### Godot version

v4.0.beta16.official [518b9e580]

### System information

Pop!_OS 22.04 (Ubuntu), Compatibility, HAWAII (, LLVM 14.0.0, DRM 2.50, 6.0.12-76060006-generic)

### Issue description

A 3D object with a material with `blend_mode` set to `subtract` and `transparency` set to `alpha` causes the entire editor to render completely black when the renderer is set to `compatibility`.

The editor remains completely black while the object with the material is selected. Selecting a different object fixes it, but moving the editor camera can sometimes cause the editor to return to black again.

- The `forward+` and `mobile` rendering modes work properly.
- The editor seems remains to remain fully functional apart from the rendering.
- This issue does not occur in the running game.
- I was also able to reproduce the error in 2D once, but when I tried it a second time it worked properly without the rendering error.

### Steps to reproduce

In the provided minimal project is a cube with a material added to its `material_override` property. Setting `blend_mode` to `alpha` in the material causes the entire editor to render black.

### Minimal reproduction project

[MinimalProject.zip](https://github.com/godotengine/godot/files/10552568/MinimalProject.zip)

GLuint vertex_array_gl = 0;
				GLuint index_array_gl = 0;
				uint32_t input_mask = 0; 
				if (mesh_instance.is_valid()) {
					mesh_storage->mesh_instance_surface_get_vertex_arrays_and_format(mesh_instance, j, input_mask, vertex_array_gl);
				} else {
					mesh_storage->mesh_surface_get_vertex_arrays_and_format(surface, input_mask, vertex_array_gl);
				}
				index_array_gl = mesh_storage->mesh_surface_get_index_buffer(surface, 0);
				bool use_index_buffer = false;
				glBindVertexArray(vertex_array_gl);
				glBindBuffer(GL_ARRAY_BUFFER, state.canvas_instance_data_buffers[state.current_data_buffer_index].instance_buffers[state.canvas_instance_batches[p_index].instance_buffer_index]);
				uint32_t range_start = state.canvas_instance_batches[p_index].start * sizeof(InstanceData);
				_enable_attributes(range_start, false, instance_count);
				if (index_array_gl != 0) {
					glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_array_gl);
					use_index_buffer = true;
				}
				if (instance_count > 1) {
					if (instance_buffer == 0) {
						break;
					}
					
					glBindBuffer(GL_ARRAY_BUFFER, instance_buffer);
					glEnableVertexAttribArray(1);
					glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, instance_stride * sizeof(float), CAST_INT_TO_UCHAR_PTR(0));
					glVertexAttribDivisor(1, 1);
					glEnableVertexAttribArray(2);
					glVertexAttribPointer(2, 4, GL_FLOAT, GL_FALSE, instance_stride * sizeof(float), CAST_INT_TO_UCHAR_PTR(4 * 4));
					glVertexAttribDivisor(2, 1);