From 51496cf5ef21aa5683aeea7d74d0bb30e136b7cc Mon Sep 17 00:00:00 2001 From: Benau Date: Wed, 28 Sep 2022 08:56:15 +0800 Subject: [PATCH] Fix moltenvk without binding all mesh textures --- data/shaders/ge_shaders/utils/sample_mesh_texture.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/shaders/ge_shaders/utils/sample_mesh_texture.h b/data/shaders/ge_shaders/utils/sample_mesh_texture.h index afb6dbf2c..606550d54 100644 --- a/data/shaders/ge_shaders/utils/sample_mesh_texture.h +++ b/data/shaders/ge_shaders/utils/sample_mesh_texture.h @@ -51,12 +51,14 @@ vec4 sampleMeshTexture7(int material_id, vec2 uv) #else layout(binding = 0) uniform sampler2D f_mesh_texture_0; layout(binding = 1) uniform sampler2D f_mesh_texture_1; +#ifdef PBR_ENABLED layout(binding = 2) uniform sampler2D f_mesh_texture_2; layout(binding = 3) uniform sampler2D f_mesh_texture_3; layout(binding = 4) uniform sampler2D f_mesh_texture_4; layout(binding = 5) uniform sampler2D f_mesh_texture_5; layout(binding = 6) uniform sampler2D f_mesh_texture_6; layout(binding = 7) uniform sampler2D f_mesh_texture_7; +#endif vec4 sampleMeshTexture0(int material_id, vec2 uv) { @@ -68,6 +70,7 @@ vec4 sampleMeshTexture1(int material_id, vec2 uv) return texture(f_mesh_texture_1, uv); } +#ifdef PBR_ENABLED vec4 sampleMeshTexture2(int material_id, vec2 uv) { return texture(f_mesh_texture_2, uv); @@ -98,3 +101,4 @@ vec4 sampleMeshTexture7(int material_id, vec2 uv) return texture(f_mesh_texture_7, uv); } #endif +#endif