### Godot version

4.0.2.stable.official

### System information

Windows 10, NVIDIA GeForce RTX 2080 SUPER, Driver 516.94, Vulkan backend

### Issue description

When referencing a built-in matrix (MODEL_MATRIX, VIEW_MATRIX...) within the light() function of a spatial shader, these errors are thrown per renderer:

Forward+:
```
-   servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp:171 - Condition "!shader_singleton->shader.version_is_valid(version)" is true.
```
Mobile:
```
-   servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp:182 - Condition "!shader_singleton->shader.version_is_valid(version)" is true.
```
Compatibility (MODEL_MATRIX is referenced):
```
-  drivers/gles3/shader_gles3.cpp:242 - SceneShaderGLES3: Fragment shader compilation failed:
-   0(521) : error C1503: undefined variable "model_matrix"
-   drivers/gles3/shader_gles3.cpp:342 - Method/function failed.
```

The shader displays a fallback instead of what's written. This can be avoided by defining a variable that is identical to the matrix and referencing that instead:

```
shader_type spatial;

varying mat4 mdlMtx;

void vertex() {
	mdlMtx = MODEL_MATRIX;
}

void light() {
	mdlMtx; // works
//	MODEL_MATRIX; // doesn't work
}
```


### Steps to reproduce

In a spatial shader, reference any built-in matrix within the light function:

```
shader_type spatial;

void light() {
	DIFFUSE_LIGHT += ATTENUATION; // lighting that should be displayed
	MODEL_MATRIX; // breaks the shader, displays a fallback
}
```

### Minimal reproduction project

[issue_light_matrices.zip](https://github.com/godotengine/godot/files/11356572/issue_light_matrices.zip)

actions.render_mode_values["blend_sub"] = Pair<int *, int>(&blend_mode, BLEND_MODE_SUB);
	actions.render_mode_values["blend_mul"] = Pair<int *, int>(&blend_mode, BLEND_MODE_MUL);
	actions.render_mode_values["alpha_to_coverage"] = Pair<int *, int>(&alpha_antialiasing_mode, ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE);
	actions.render_mode_values["alpha_to_coverage_and_one"] = Pair<int *, int>(&alpha_antialiasing_mode, ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE);
	actions.render_mode_values["depth_draw_never"] = Pair<int *, int>(&depth_drawi, DEPTH_DRAW_DISABLED);
	actions.render_mode_values["depth_draw_opaque"] = Pair<int *, int>(&depth_drawi, DEPTH_DRAW_OPAQUE);
	actions.render_mode_values["depth_draw_always"] = Pair<int *, int>(&depth_drawi, DEPTH_DRAW_ALWAYS);
	actions.render_mode_values["depth_test_disabled"] = Pair<int *, int>(&depth_testi, DEPTH_TEST_DISABLED);
	actions.render_mode_values["cull_disabled"] = Pair<int *, int>(&cull, CULL_DISABLED);
	actions.render_mode_values["cull_front"] = Pair<int *, int>(&cull, CULL_FRONT);
	actions.render_mode_values["cull_back"] = Pair<int *, int>(&cull, CULL_BACK);
	actions.render_mode_flags["unshaded"] = &unshaded;
	actions.render_mode_flags["wireframe"] = &wireframe;
	actions.render_mode_flags["particle_trails"] = &uses_particle_trails;
	actions.usage_flag_pointers["ALPHA"] = &uses_alpha;
	actions.usage_flag_pointers["ALPHA_SCISSOR_THRESHOLD"] = &uses_alpha_clip;
	actions.usage_flag_pointers["ALPHA_HASH_SCALE"] = &uses_alpha_clip;
	actions.usage_flag_pointers["ALPHA_ANTIALIASING_EDGE"] = &uses_alpha_antialiasing;
	actions.usage_flag_pointers["ALPHA_TEXTURE_COORDINATE"] = &uses_alpha_antialiasing;
	actions.render_mode_flags["depth_prepass_alpha"] = &uses_depth_prepass_alpha;
	actions.usage_flag_pointers["SSS_STRENGTH"] = &uses_sss;
	actions.usage_flag_pointers["SSS_TRANSMITTANCE_DEPTH"] = &uses_transmittance;
	actions.usage_flag_pointers["DISCARD"] = &uses_discard;
	actions.usage_flag_pointers["TIME"] = &uses_time;
	actions.usage_flag_pointers["ROUGHNESS"] = &uses_roughness;
	actions.usage_flag_pointers["NORMAL"] = &uses_normal;
	actions.usage_flag_pointers["NORMAL_MAP"] = &uses_normal;
	actions.usage_flag_pointers["POINT_SIZE"] = &uses_point_size;
	actions.usage_flag_pointers["POINT_COORD"] = &uses_point_size;
	actions.write_flag_pointers["MODELVIEW_MATRIX"] = &writes_modelview_or_projection;