(flat) int for samplerindex

This commit is contained in:
saschawillems 2016-08-30 20:45:23 +02:00
parent 1461731a0e
commit 5dd928b7f4
5 changed files with 5 additions and 6 deletions

View file

@ -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);
}

View file

@ -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
{