### 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)

state.light_uniforms = memnew_arr(LightUniform, data.max_lights_per_render);
	{
		const uint32_t indices[6] = { 0, 2, 1, 3, 2, 0 };
		glGenVertexArrays(1, &data.indexed_quad_array);
		glBindVertexArray(data.indexed_quad_array);
		glBindBuffer(GL_ARRAY_BUFFER, data.canvas_quad_vertices);
		glGenBuffers(1, &data.indexed_quad_buffer);
		glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.indexed_quad_buffer);
		glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(uint32_t) * 6, indices, GL_STATIC_DRAW);
		glBindVertexArray(0);
	}
	String global_defines;
	global_defines += "#define MAX_GLOBAL_SHADER_UNIFORMS 256\n"; 
	global_defines += "#define MAX_LIGHTS " + itos(data.max_lights_per_render) + "\n";
	GLES3::MaterialStorage::get_singleton()->shaders.canvas_shader.initialize(global_defines, 1);
	data.canvas_shader_default_version = GLES3::MaterialStorage::get_singleton()->shaders.canvas_shader.version_create();
	shadow_render.shader.initialize();
	shadow_render.shader_version = shadow_render.shader.version_create();
	{
		default_canvas_group_shader = material_storage->shader_allocate();
		material_storage->shader_initialize(default_canvas_group_shader);
		material_storage->shader_set_code(default_canvas_group_shader, R"(
// Default CanvasGroup shader.
shader_type canvas_item;
render_mode unshaded;
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
void fragment() {
	vec4 c = textureLod(screen_texture, SCREEN_UV, 0.0);
	if (c.a > 0.0001) {
		c.rgb /= c.a;