### Tested versions

Reproducible on custom build from main (4.3.dev aa5b6ed)
Unreproducible if set renderer to "Compatibility"
Unreproducible if undo ee1bf15 locally

### System information

M1 Mac 14.2 , Vulkan SDK 1.3.268.1, Vulkan Forward+ renderer

### Issue description

Vulkan validation  error keeps popping up, notably

`program_source:514:427: error: 'sampler' attribute parameter is out of bounds: must be between 0 and 15` and 

`VK_ERROR_INVALID_SHADER_NV: Fragment shader function could not be compiled into pipeline. See previous logged error.`

```
--- Debug adapter server started ---
--- GDScript language server started on port 6005 ---
[LSP] Connection Taken
  drivers/vulkan/vulkan_context.cpp:267 - VALIDATION - Message Id Number: 0 | Message Id Name: 
  	VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (Error code 3):
  program_source:456:12: warning: unused variable 'vertex0' [-Wunused-variable]
      float3 vertex0 = vertex_interp;
             ^
  program_source:457:12: warning: unused variable 'eye_offset' [-Wunused-variable]
      float3 eye_offset = float3(0.0);
             ^
  program_source:458:12: warning: unused variable 'view' [-Wunused-variable]
      float3 view = -fast::normalize(vertex_interp);
             ^
  program_source:460:12: warning: unused variable 'backlight' [-Wunused-variable]
      float3 backlight = float3(0.0);
             ^
  program_source:461:12: warning: unused variable 'transmittance_color' [-Wunused-variable]
      float4 transmittance_color = float4(0.0, 0.0, 0.0, 1.0);
             ^
  program_source:462:11: warning: unused variable 'transmittance_depth' [-Wunused-variable]
      float transmittance_depth = 0.0;
            ^
  program_source:463:11: warning: unused variable 'transmittance_boost' [-Wunused-variable]
      float transmittance_boost = 0.0;
            ^
  program_source:466:12: warning: unused variable 'emission' [-Wunused-variable]
      float3 emission = float3(0.0);
             ^
  program_source:468:11: warning: unused variable 'rim' [-Wunused-variable]
      float rim = 0.0;
            ^
  program_source:469:11: warning: unused variable 'rim_tint' [-Wunused-variable]
      float rim_tint = 0.0;
            ^
  program_source:470:11: warning: unused variable 'clearcoat' [-Wunused-variable]
      float clearcoat = 0.0;
            ^
  program_source:471:11: warning: unused variable 'clearcoat_roughness' [-Wunused-variable]
      float clearcoat_roughness = 0.0;
            ^
  program_source:472:11: warning: unused variable 'anisotropy' [-Wunused-variable]
      float anisotropy = 0.0;
            ^
  program_source:473:12: warning: unused variable 'anisotropy_flow' [-Wunused-variable]
      float2 anisotropy_flow = float2(1.0, 0.0);
             ^
  program_source:474:11: warning: unused variable 'ao' [-Wunused-variable]
      float ao = 1.0;
            ^
  program_source:475:11: warning: unused variable 'ao_light_affect' [-Wunused-variable]
      float ao_light_affect = 0.0;
            ^
  program_source:477:12: warning: unused variable 'binormal' [-Wunused-variable]
      float3 binormal = float3(0.0);
             ^
  program_source:478:12: warning: unused variable 'tangent' [-Wunused-variable]
      float3 tangent = float3(0.0);
             ^
  program_source:479:12: warning: unused variable 'uv' [-Wunused-variable]
      float2 uv = uv_interp;
             ^
  program_source:480:12: warning: unused variable 'color' [-Wunused-variable]
      float4 color = color_interp;
             ^
  program_source:481:11: warning: unused variable 'normal_map_depth' [-Wunused-variable]
      float normal_map_depth = 1.0;
            ^
  program_source:482:12: warning: unused variable 'screen_uv' [-Wunused-variable]
      float2 screen_uv = gl_FragCoord.xy * scene_data.screen_pixel_size;
             ^
  program_source:483:11: warning: unused variable 'sss_strength' [-Wunused-variable]
      float sss_strength = 0.0;
            ^
  program_source:492:14: warning: unused variable 'read_view_matrix' [-Wunused-variable]
      float4x4 read_view_matrix = scene_data.view_matrix;
               ^
  program_source:493:12: warning: unused variable 'read_viewport_size' [-Wunused-variable]
      float2 read_viewport_size = scene_data.viewport_size;
             ^
  program_source:509:12: warning: unused variable 'specular_light' [-Wunused-variable]
      float3 specular_light = float3(0.0);
             ^
  program_source:510:12: warning: unused variable 'diffuse_light' [-Wunused-variable]
      float3 diffuse_light = float3(0.0);
             ^
  program_source:511:12: warning: unused variable 'ambient_light' [-Wunused-variable]
      float3 ambient_light = float3(0.0);
             ^
  program_source:514:427: error: 'sampler' attribute parameter is out of bounds: must be between 0 and 15
  fragment void main0(main0_in in [[stage_in]], constant SceneDataBlock& scene_data_block [[buffer(10)]], const device InstanceDataBuffer& instances [[buffer(12)]], constant MaterialUniforms& material [[buffer(16)]], texture2d<float> m_texture_albedo [[texture(32)]], texture2d<float> m_texture_metallic [[texture(33)]], texture2d<float> m_texture_roughness [[texture(34)]], sampler SAMPLER_LINEAR_WITH_MIPMAPS_REPEAT [[sampler(24)]], float4 gl_FragCoord [[position]])
                                                                                                                                                                                                                                                                                                                                                                                                                                            ^
  .
  	Objects - 1
  		Object[0] - VK_OBJECT_TYPE_PIPELINE_CACHE, Handle 4741973040
  drivers/vulkan/vulkan_context.cpp:267 - VALIDATION - Message Id Number: 0 | Message Id Name: 
  	VK_ERROR_INVALID_SHADER_NV: Fragment shader function could not be compiled into pipeline. See previous logged error.
  	Objects - 1
  		Object[0] - VK_OBJECT_TYPE_PIPELINE, Handle 11339407872
  vkCreateGraphicsPipelines failed with error -1000012000 for shader 'SceneForwardClusteredShaderRD:0'.
  servers/rendering/renderer_rd/pipeline_cache_rd.cpp:61 - Condition "pipeline.is_null()" is true. Returning: RID()
  This render pipeline requires (0) bytes of push constant data, supplied: (16)
  No render pipeline was set before attempting to draw.
  drivers/vulkan/vulkan_context.cpp:267 - VALIDATION - Message Id Number: 0 | Message Id Name: 
  	VK_ERROR_INITIALIZATION_FAILED: Shader library compile failed (Error code 3):
  program_source:498:12: warning: unused variable 'eye_offset' [-Wunused-variable]
      float3 eye_offset = float3(0.0);
             ^
  program_source:499:12: warning: unused variable 'view' [-Wunused-variable]
      float3 view = -fast::normalize(vertex_interp);
             ^
  program_source:501:12: warning: unused variable 'backlight' [-Wunused-variable]
      float3 backlight = float3(0.0);
             ^
  program_source:502:12: warning: unused variable 'transmittance_color' [-Wunused-variable]
      float4 transmittance_color = float4(0.0, 0.0, 0.0, 1.0);
             ^
  program_source:503:11: warning: unused variable 'transmittance_depth' [-Wunused-variable]
      float transmittance_depth = 0.0;
            ^
  program_source:504:11: warning: unused variable 'transmittance_boost' [-Wunused-variable]
      float transmittance_boost = 0.0;
            ^
  program_source:509:11: warning: unused variable 'rim' [-Wunused-variable]
      float rim = 0.0;
            ^
  program_source:510:11: warning: unused variable 'rim_tint' [-Wunused-variable]
      float rim_tint = 0.0;
            ^
  program_source:511:11: warning: unused variable 'clearcoat' [-Wunused-variable]
      float clearcoat = 0.0;
            ^
  program_source:512:11: warning: unused variable 'clearcoat_roughness' [-Wunused-variable]
      float clearcoat_roughness = 0.0;
            ^
  program_source:513:11: warning: unused variable 'anisotropy' [-Wunused-variable]
      float anisotropy = 0.0;
            ^
  program_source:514:12: warning: unused variable 'anisotropy_flow' [-Wunused-variable]
      float2 anisotropy_flow = float2(1.0, 0.0);
             ^
  program_source:516:11: warning: unused variable 'ao_light_affect' [-Wunused-variable]
      float ao_light_affect = 0.0;
            ^
  program_source:518:12: warning: unused variable 'binormal' [-Wunused-variable]
      float3 binormal = float3(0.0);
             ^
  program_source:519:12: warning: unused variable 'tangent' [-Wunused-variable]
      float3 tangent = float3(0.0);
             ^
  program_source:521:12: warning: unused variable 'uv' [-Wunused-variable]
      float2 uv = uv_interp;
             ^
  program_source:522:12: warning: unused variable 'color' [-Wunused-variable]
      float4 color = color_interp;
             ^
  program_source:523:11: warning: unused variable 'normal_map_depth' [-Wunused-variable]
      float normal_map_depth = 1.0;
            ^
  program_source:524:12: warning: unused variable 'screen_uv' [-Wunused-variable]
      float2 screen_uv = gl_FragCoord.xy * scene_data.screen_pixel_size;
             ^
  program_source:525:11: warning: unused variable 'sss_strength' [-Wunused-variable]
      float sss_strength = 0.0;
            ^
  program_source:534:14: warning: unused variable 'read_view_matrix' [-Wunused-variable]
      float4x4 read_view_matrix = scene_data.view_matrix;
               ^
  program_source:535:12: warning: unused variable 'read_viewport_size' [-Wunused-variable]
      float2 read_viewport_size = scene_data.viewport_size;
             ^
  program_source:707:744: error: 'sampler' attribute parameter is out of bounds: must be between 0 and 15
  fragment main0_out main0(main0_in in [[stage_in]], const device Decals& decals [[buffer(7)]], constant SceneDataBlock& scene_data_block [[buffer(10)]], constant ImplementationDataBlock& implementation_data_block [[buffer(11)]], const device InstanceDataBuffer& instances [[buffer(12)]], const device ClusterBuffer& cluster_buffer [[buffer(13)]], constant MaterialUniforms& material [[buffer(16)]], texture2d<float> decal_atlas [[texture(0)]], texture2d<float> decal_atlas_srgb [[texture(1)]], texture2d<float> m_texture_albedo [[texture(32)]], texture2d<float> m_texture_metallic [[texture(33)]], texture2d<float> m_texture_roughness [[texture(34)]], sampler decal_sampler [[sampler(13)]], sampler SAMPLER_LINEAR_WITH_MIPMAPS_REPEAT [[sampler(24)]], float4 gl_FragCoord [[position]])
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^
  .
  	Objects - 1
  		Object[0] - VK_OBJECT_TYPE_PIPELINE_CACHE, Handle 4741973040
  drivers/vulkan/vulkan_context.cpp:267 - VALIDATION - Message Id Number: 0 | Message Id Name: 
  	VK_ERROR_INVALID_SHADER_NV: Fragment shader function could not be compiled into pipeline. See previous logged error.
  	Objects - 1
  		Object[0] - VK_OBJECT_TYPE_PIPELINE, Handle 11380276224
  vkCreateGraphicsPipelines failed with error -1000012000 for shader 'SceneForwardClusteredShaderRD:9'.
  servers/rendering/renderer_rd/pipeline_cache_rd.cpp:61 - Condition "pipeline.is_null()" is true. Returning: RID()
  This render pipeline requires (0) bytes of push constant data, supplied: (16)
  No render pipeline was set before attempting to draw.
  drivers/vulkan/vulkan_context.cpp:267 - VALIDATION - Message Id Number: 0 | Message Id Name: 
  	VK_ERROR_INVALID_SHADER_NV: Fragment shader function could not be compiled into pipeline. See previous logged error.
  	Objects - 1
  		Object[0] - VK_OBJECT_TYPE_PIPELINE, Handle 4790395904
  vkCreateGraphicsPipelines failed with error -1000012000 for shader 'SceneForwardClusteredShaderRD:0'.
  servers/rendering/renderer_rd/pipeline_cache_rd.cpp:61 - Condition "pipeline.is_null()" is true. Returning: RID()
  This render pipeline requires (0) bytes of push constant data, supplied: (16)
  No render pipeline was set before attempting to draw.
...
```

<img width="1106" alt="image" src="https://github.com/godotengine/godot/assets/5029519/dd3e7743-e551-4490-954d-41044e038ec4">


### Steps to reproduce

1. Build Godot with `platform=osx arch=arm64 dev_build=true` and open launcher
2. Create a blank project with Forward+ and open
3. observe errors pop up

### Minimal reproduction project (MRP)

[godot_test.zip](https://github.com/godotengine/godot/files/13673668/godot_test.zip)
(it's a blank project)
ERR_FAIL_NULL_V(render_buffers, RID());
	bool use_msaa = render_buffers->get_msaa_3d() != RS::VIEWPORT_MSAA_DISABLED;
	int v_count = (p_color_pass_flags & COLOR_PASS_FLAG_MULTIVIEW) ? render_buffers->get_view_count() : 1;
	RID color = use_msaa ? render_buffers->get_texture(RB_SCOPE_BUFFERS, RB_TEX_COLOR_MSAA) : render_buffers->get_internal_texture();
	RID specular;
	if (p_color_pass_flags & COLOR_PASS_FLAG_SEPARATE_SPECULAR) {
		ensure_specular();
		specular = render_buffers->get_texture(RB_SCOPE_FORWARD_CLUSTERED, use_msaa ? RB_TEX_SPECULAR_MSAA : RB_TEX_SPECULAR);
	}
	RID velocity_buffer;
	if (p_color_pass_flags & COLOR_PASS_FLAG_MOTION_VECTORS) {
		render_buffers->ensure_velocity();
		velocity_buffer = render_buffers->get_velocity_buffer(use_msaa);
	}
	RID depth = use_msaa ? render_buffers->get_texture(RB_SCOPE_BUFFERS, RB_TEX_DEPTH_MSAA) : render_buffers->get_depth_texture();
	if (render_buffers->has_texture(RB_SCOPE_VRS, RB_TEXTURE)) {
		RID vrs_texture = render_buffers->get_texture(RB_SCOPE_VRS, RB_TEXTURE);
		return FramebufferCacheRD::get_singleton()->get_cache_multiview(v_count, color, specular, velocity_buffer, depth, vrs_texture);
	} else {
		return FramebufferCacheRD::get_singleton()->get_cache_multiview(v_count, color, specular, velocity_buffer, depth);
	}
}
RID RenderForwardClustered::RenderBufferDataForwardClustered::get_depth_fb(DepthFrameBufferType p_type) {