### Godot version

v4.0.3.stable.arch_linux

### System information

Arch linux  - OpenGL API 4.2 (Core Profile) Mesa 21.3.9 Amber - Compatibility - Using Device: Intel Open Source Technology Center - Mesa DRI Intel(R) HD Graphics 2500 (IVB GT1)

### Issue description

I wrote a simple colorize shader:
```
uniform sampler2D color_map;
void fragment()
{
	vec2 uv = COLOR.rg;
	COLOR.rgb = texture(color_map, uv).rgb;
}
```
![20230614_21h26m15s_grim](https://github.com/godotengine/godot/assets/68549456/636c00f8-09e3-4be4-9784-787a3c35ae63)

But when I change the uniform parameter in the editor, it turned into this
![20230614_21h07m45s_grim](https://github.com/godotengine/godot/assets/68549456/0ac2430d-33f5-4c4a-8cd0-bd2f76b575cf)

However, this issue does not appear on Vulkan renderer (Foward+ and Mobile) 

### Steps to reproduce

Change value in the gradient in the shader parameter.

### Minimal reproduction project

[shader-bug.zip](https://github.com/godotengine/godot/files/11746761/shader-bug.zip)

} else {
				ERR_FAIL_COND(p_layers[i]->get_width() != valid_width);
				ERR_FAIL_COND(p_layers[i]->get_height() != valid_height);
				ERR_FAIL_COND(p_layers[i]->get_format() != valid_format);
				ERR_FAIL_COND(p_layers[i]->has_mipmaps() != valid_mipmaps);
			}
		}
	}
	Texture texture;
	texture.width = image->get_width();
	texture.height = image->get_height();
	texture.alloc_width = texture.width;
	texture.alloc_height = texture.height;
	texture.mipmaps = image->get_mipmap_count() + 1;
	texture.format = image->get_format();
	texture.type = Texture::TYPE_LAYERED;
	texture.layered_type = p_layered_type;
	texture.target = p_layered_type == RS::TEXTURE_LAYERED_CUBEMAP ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D_ARRAY;
	texture.layers = p_layers.size();
	_get_gl_image_and_format(Ref<Image>(), texture.format, texture.real_format, texture.gl_format_cache, texture.gl_internal_format_cache, texture.gl_type_cache, texture.compressed, false);
	texture.total_data_size = p_layers[0]->get_image_data_size(texture.width, texture.height, texture.format, texture.mipmaps) * texture.layers;
	texture.active = true;
	glGenTextures(1, &texture.tex_id);
	GLES3::Utilities::get_singleton()->texture_allocated_data(texture.tex_id, texture.total_data_size, "Texture Layered");
	texture_owner.initialize_rid(p_texture, texture);
	for (int i = 0; i < p_layers.size(); i++) {
		_texture_set_data(p_texture, p_layers[i], i, i == 0);
	}
}
void TextureStorage::texture_3d_initialize(RID p_texture, Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector<Ref<Image>> &p_data) {