### Godot version

4.0rc1 gl_compatibility only.

### System information

Windows 10, Nvidia 527.56 RTX3090, gl_compatibility
OpenGL API 3.3.0 NVIDIA 527.56 - Compatibility

### Issue description

Assigning a `CanvasItemMatrial` with `blend_mode = BLEND_MODE_SUB` in opengl causes the entire editor to turn black and break, even if later unassigned.

In case it matters, I'm using Single Window Mode in the editor.

### Steps to reproduce

1. Open the attached Project. Make sure it is using **Compatibility** on the top right.
2. On the root "Level" node, click the `Use Standard` checkbox which runs the tool script (it actually sets a CanvasItemMaterial, not standard. the checkbox was badly named). The editor turns black.
3. Without moving the mouse, click again to toggle this material off and return to a ShaderMaterial. The editor is still black / broken.
4. Press Ctrl-S to save the scene so you aren't bombarded with an invisible save dialog.
5. Close the editor.

If you edit the script and try other blend_mode values, this issue does not happen.

### Minimal reproduction project

[black_screen_test.zip](https://github.com/godotengine/godot/files/10689627/black_screen_test.zip)

GLES3::Config *config = GLES3::Config::get_singleton();
	if (state.shadow_fb == 0) {
		glActiveTexture(GL_TEXTURE0);
		glGenFramebuffers(1, &state.shadow_fb);
		glBindFramebuffer(GL_FRAMEBUFFER, state.shadow_fb);
		glGenRenderbuffers(1, &state.shadow_depth_buffer);
		glBindRenderbuffer(GL_RENDERBUFFER, state.shadow_depth_buffer);
		glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, state.shadow_texture_size, data.max_lights_per_render * 2);
		glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, state.shadow_depth_buffer);
		glGenTextures(1, &state.shadow_texture);
		glBindTexture(GL_TEXTURE_2D, state.shadow_texture);
		if (config->float_texture_supported) {
			glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, state.shadow_texture_size, data.max_lights_per_render * 2, 0, GL_RED, GL_FLOAT, nullptr);
		} else {
			glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, state.shadow_texture_size, data.max_lights_per_render * 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
		}
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, state.shadow_texture, 0);
		GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
		if (status != GL_FRAMEBUFFER_COMPLETE) {