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

RBMap<uint32_t, RenderTarget::RTOverridden::FBOCacheEntry>::Element *cache;
	if ((cache = rt->overridden.fbo_cache.find(hash_key)) != nullptr) {
		rt->fbo = cache->get().fbo;
		rt->color = cache->get().color;
		rt->depth = cache->get().depth;
		rt->size = cache->get().size;
		rt->texture = p_color_texture;
		return;
	}
	_update_render_target(rt);
	RenderTarget::RTOverridden::FBOCacheEntry new_entry;
	new_entry.fbo = rt->fbo;
	new_entry.color = rt->color;
	new_entry.depth = rt->depth;
	new_entry.size = rt->size;
	
	if (p_color_texture.is_null()) {
		new_entry.allocated_textures.push_back(rt->color);
	}
	if (p_depth_texture.is_null()) {
		new_entry.allocated_textures.push_back(rt->depth);
	}
	rt->overridden.fbo_cache.insert(hash_key, new_entry);
}
RID TextureStorage::render_target_get_override_color(RID p_render_target) const {
	RenderTarget *rt = render_target_owner.get_or_null(p_render_target);
	ERR_FAIL_COND_V(!rt, RID());
	return rt->overridden.color;
}
RID TextureStorage::render_target_get_override_depth(RID p_render_target) const {