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

GLenum internal_format;
	bool compressed = false;
	Image::Format real_format;
	Ref<Image> img = _get_gl_image_and_format(p_image, p_image->get_format(), real_format, format, internal_format, type, compressed, texture->resize_to_po2);
	ERR_FAIL_COND(img.is_null());
	if (texture->resize_to_po2) {
		if (p_image->is_compressed()) {
			ERR_PRINT("Texture '" + texture->path + "' is required to be a power of 2 because it uses either mipmaps or repeat, so it was decompressed. This will hurt performance and memory usage.");
		}
		if (img == p_image) {
			img = img->duplicate();
		}
		img->resize_to_po2(false);
	}
	GLenum blit_target = (texture->target == GL_TEXTURE_CUBE_MAP) ? _cube_side_enum[p_layer] : texture->target;
	Vector<uint8_t> read = img->get_data();
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(texture->target, texture->tex_id);
	
	texture->gl_set_filter(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST);
	texture->gl_set_repeat(RS::CANVAS_ITEM_TEXTURE_REPEAT_ENABLED);
#ifndef WEB_ENABLED
	switch (texture->format) {
#ifdef GLES_OVER_GL
		case Image::FORMAT_L8: {
			glTexParameteri(texture->target, GL_TEXTURE_SWIZZLE_R, GL_RED);
			glTexParameteri(texture->target, GL_TEXTURE_SWIZZLE_G, GL_RED);
			glTexParameteri(texture->target, GL_TEXTURE_SWIZZLE_B, GL_RED);
			glTexParameteri(texture->target, GL_TEXTURE_SWIZZLE_A, GL_ONE);
		} break;