diff --git a/data/shaders/texturemipmapgen/texture.frag b/data/shaders/texturemipmapgen/texture.frag index 0d24666a..32f214b4 100644 --- a/data/shaders/texturemipmapgen/texture.frag +++ b/data/shaders/texturemipmapgen/texture.frag @@ -8,12 +8,11 @@ layout (set = 0, binding = 2) uniform sampler samplers[3]; layout (location = 0) in vec2 inUV; layout (location = 1) in float inLodBias; -layout (location = 2) in float inSamplerIndex; +layout (location = 2) flat in int inSamplerIndex; layout (location = 0) out vec4 outFragColor; void main() { - highp int samplerIndex = int(inSamplerIndex); - outFragColor = texture(sampler2D(textureColor, samplers[samplerIndex]), inUV, inLodBias); + outFragColor = texture(sampler2D(textureColor, samplers[inSamplerIndex]), inUV, inLodBias); } \ No newline at end of file diff --git a/data/shaders/texturemipmapgen/texture.frag.spv b/data/shaders/texturemipmapgen/texture.frag.spv index b6238f31..5374f4bb 100644 Binary files a/data/shaders/texturemipmapgen/texture.frag.spv and b/data/shaders/texturemipmapgen/texture.frag.spv differ diff --git a/data/shaders/texturemipmapgen/texture.vert b/data/shaders/texturemipmapgen/texture.vert index 277dec0a..955ee136 100644 --- a/data/shaders/texturemipmapgen/texture.vert +++ b/data/shaders/texturemipmapgen/texture.vert @@ -13,12 +13,12 @@ layout (binding = 0) uniform UBO mat4 view; mat4 model; float lodBias; - float samplerIndex; + int samplerIndex; } ubo; layout (location = 0) out vec2 outUV; layout (location = 1) out float outLodBias; -layout (location = 2) out float outSamplerIndex; +layout (location = 2) flat out int outSamplerIndex; out gl_PerVertex { diff --git a/data/shaders/texturemipmapgen/texture.vert.spv b/data/shaders/texturemipmapgen/texture.vert.spv index eb85901a..74cbb774 100644 Binary files a/data/shaders/texturemipmapgen/texture.vert.spv and b/data/shaders/texturemipmapgen/texture.vert.spv differ diff --git a/texturemipmapgen/texturemipmapgen.cpp b/texturemipmapgen/texturemipmapgen.cpp index 01388703..adefc2c6 100644 --- a/texturemipmapgen/texturemipmapgen.cpp +++ b/texturemipmapgen/texturemipmapgen.cpp @@ -67,7 +67,7 @@ public: glm::mat4 view; glm::mat4 model; float lodBias = 0.0f; - float samplerIndex = 2.0f; + uint32_t samplerIndex = 2; } uboVS; struct {