### Godot version

4.1 beta 3

### System information

Windows 11

### Issue description

Project builds and displays fine in all releases of Godot 4.x up until and including 4.1 beta 2.
When opening the project in 4.1 beta 3, it builds to a black screen, without crashing.

Switching from the Compatibility Renderer to Forward+ solves the issue.
Switching back to Compatibility breaks the build again

Reverting back to beta 2 also solves the issue, regardless of the renderer used.

### Steps to reproduce

- create a project in a version of Godot 4.x prior to beta 3, using the Compatibility renderer
- open and build the project in Godot 4.1 beta 3
- switch between different renderers to get the build to display 


### Minimal reproduction project

N/A
CanvasTexture *ct = canvas_texture_owner.get_or_null(p_canvas_texture);
	ERR_FAIL_NULL(ct);
	ct->specular_color.r = p_specular_color.r;
	ct->specular_color.g = p_specular_color.g;
	ct->specular_color.b = p_specular_color.b;
	ct->specular_color.a = p_shininess;
}
void TextureStorage::canvas_texture_set_texture_filter(RID p_canvas_texture, RS::CanvasItemTextureFilter p_filter) {
	CanvasTexture *ct = canvas_texture_owner.get_or_null(p_canvas_texture);
	ERR_FAIL_NULL(ct);
	ct->texture_filter = p_filter;
}
void TextureStorage::canvas_texture_set_texture_repeat(RID p_canvas_texture, RS::CanvasItemTextureRepeat p_repeat) {
	CanvasTexture *ct = canvas_texture_owner.get_or_null(p_canvas_texture);
	ERR_FAIL_NULL(ct);
	ct->texture_repeat = p_repeat;
}
Ref<Image> TextureStorage::_get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool p_force_decompress) const {
	Config *config = Config::get_singleton();
	r_gl_format = 0;
	Ref<Image> image = p_image;
	r_compressed = false;
	r_real_format = p_format;
	bool need_decompress = false;
	bool decompress_ra_to_rg = false;
	switch (p_format) {
		case Image::FORMAT_L8: {
#ifdef GLES_OVER_GL
			r_gl_internal_format = GL_R8;
			r_gl_format = GL_RED;