### Godot version

v4.1.1.stable.flathub [bd6af8e0e]

### System information

Linux pop-os 6.4.6-76060406-generic, RTX3060

### Issue description

Setting a texture as a global shader parameter using RenderingServer.global_shader_parameter_set() does not seem to update the shader properly. However, setting the same texture directly on the shader material using material.set("shader_parameter/mask_texture", texture) works as expected.


BTW. I am also seeing error
```
E 0:00:19:0820   sd.gd:22 @ _draw_texture(): Condition "!global_shader_uniforms.variables.has(p_name)" is true.
  <C++ Source>   servers/rendering/renderer_rd/storage_rd/material_storage.cpp:1684 @ global_shader_parameter_set()
```

### Steps to reproduce

0. Add global shader parameter of type sampler2d
1. Create a basic shader with a uniform sampler2D to accept a texture.
2. Generate a texture in GDScript (for example, a simple black/white mask).
3. Attempt to set this texture as a global shader parameter using:
```
RenderingServer.global_shader_parameter_set("uniform_name", texture)
```
4. Observe that the shader does not update with the new texture.
5. Now, set the texture directly on a material instance using:
```
material.set("shader_parameter/uniform_name", texture)
```
6. Observe that the shader updates correctly with the new texture.

Expected behavior:

Setting a global shader parameter using RenderingServer.global_shader_parameter_set() should update all shaders that utilize this global uniform, just as setting it directly on a material instance does.


### Minimal reproduction project

not included
glBindBuffer(GL_UNIFORM_BUFFER, uniform_buffer);
		glBufferData(GL_UNIFORM_BUFFER, ubo_data.size(), ubo_data.ptrw(), GL_DYNAMIC_DRAW);
		glBindBuffer(GL_UNIFORM_BUFFER, 0);
	}
	uint32_t tex_uniform_count = 0U;
	for (int i = 0; i < p_texture_uniforms.size(); i++) {
		tex_uniform_count += uint32_t(p_texture_uniforms[i].array_size > 0 ? p_texture_uniforms[i].array_size : 1);
	}
	if ((uint32_t)texture_cache.size() != tex_uniform_count || p_textures_dirty) {
		texture_cache.resize(tex_uniform_count);
		p_textures_dirty = true;
	}
	if (p_textures_dirty && tex_uniform_count) {
		update_textures(p_parameters, p_default_texture_params, p_texture_uniforms, texture_cache.ptrw(), p_is_3d_shader_type);
	}
}
MaterialStorage *MaterialStorage::singleton = nullptr;
MaterialStorage *MaterialStorage::get_singleton() {
	return singleton;
}
MaterialStorage::MaterialStorage() {
	singleton = this;
	shader_data_request_func[RS::SHADER_SPATIAL] = _create_scene_shader_func;
	shader_data_request_func[RS::SHADER_CANVAS_ITEM] = _create_canvas_shader_func;
	shader_data_request_func[RS::SHADER_PARTICLES] = _create_particles_shader_func;
	shader_data_request_func[RS::SHADER_SKY] = _create_sky_shader_func;
	shader_data_request_func[RS::SHADER_FOG] = nullptr;
	material_data_request_func[RS::SHADER_SPATIAL] = _create_scene_material_func;
	material_data_request_func[RS::SHADER_CANVAS_ITEM] = _create_canvas_material_func;
	material_data_request_func[RS::SHADER_PARTICLES] = _create_particles_material_func;