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

glBindBuffer(GL_UNIFORM_BUFFER, 0);
	}
	glActiveTexture(GL_TEXTURE0 + GLES3::Config::get_singleton()->max_texture_image_units - 5);
	glBindTexture(GL_TEXTURE_2D, texture_storage->render_target_get_sdf_texture(p_to_render_target));
	{
		state.default_filter = p_default_filter;
		state.default_repeat = p_default_repeat;
	}
	Size2 render_target_size = texture_storage->render_target_get_size(p_to_render_target);
	glViewport(0, 0, render_target_size.x, render_target_size.y);
	r_sdf_used = false;
	int item_count = 0;
	bool backbuffer_cleared = false;
	bool time_used = false;
	bool material_screen_texture_cached = false;
	bool material_screen_texture_mipmaps_cached = false;
	Rect2 back_buffer_rect;
	bool backbuffer_copy = false;
	bool backbuffer_gen_mipmaps = false;
	bool update_skeletons = false;
	Item *ci = p_item_list;
	Item *canvas_group_owner = nullptr;
	state.last_item_index = 0;
	while (ci) {
		if (ci->copy_back_buffer && canvas_group_owner == nullptr) {
			backbuffer_copy = true;
			if (ci->copy_back_buffer->full) {
				back_buffer_rect = Rect2();
			} else {
				back_buffer_rect = ci->copy_back_buffer->rect;