### Godot version

v4.0.rc.custom_build [b12bf7ff0]

### System information

Ubuntu 23.04 (Lunar Lobster)

### Issue description

In a spatial shader: calling textureSize with a texture with hint_screen_texture or hint_depth_texture causes a long list of errors in the terminal, hangs the editor for a minute and fails to run the shader. Shaders using textureSize built fine two weeks ago.



### Steps to reproduce

Open sample project. Errors should be printed to console right away.

[terminal_output.txt](https://github.com/godotengine/godot/files/10700615/terminal_output.txt)




### Minimal reproduction project

[textureSize.zip](https://github.com/godotengine/godot/files/10700628/textureSize.zip)

Shader for MeshInstance3D with a plane mesh:

```
shader_type spatial;

uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;

void fragment() {
    textureSize(SCREEN_TEXTURE, 0);  // <- culprit
    ALBEDO = vec3(1, 0, 0);
}
```
}
												if (function->arguments[j].tex_argument_check) {
													sampler_name = _get_sampler_name(function->arguments[j].tex_argument_filter, function->arguments[j].tex_argument_repeat);
													found = true;
													break;
												}
											}
										}
										if (!found) {
											
											sampler_name = _get_sampler_name(ShaderLanguage::FILTER_DEFAULT, ShaderLanguage::REPEAT_DEFAULT);
										}
									}
								}
								String data_type_name = "";
								if (actions.check_multiview_samplers && (is_screen_texture || is_depth_texture || is_normal_roughness_texture)) {
									data_type_name = "multiviewSampler";
									multiview_uv_needed = true;
								} else {
									data_type_name = ShaderLanguage::get_datatype_name(onode->arguments[i]->get_datatype());
								}
								code += data_type_name + "(" + node_code + ", " + sampler_name + ")";
							} else if (actions.check_multiview_samplers && correct_texture_uniform && RS::get_singleton()->is_low_end()) {
								
								
								if (shader->uniforms.has(texture_uniform)) {
									const ShaderLanguage::ShaderNode::Uniform &u = shader->uniforms[texture_uniform];
									if (u.hint == ShaderLanguage::ShaderNode::Uniform::HINT_SCREEN_TEXTURE) {
										multiview_uv_needed = true;
									} else if (u.hint == ShaderLanguage::ShaderNode::Uniform::HINT_DEPTH_TEXTURE) {