SPIRV-Cross/reference/opt/shaders/vulkan/frag/nonuniform-qualifier.vk.nocompat.frag.vk

32 lines
893 B
Plaintext
Raw Normal View History

#version 450
#extension GL_EXT_nonuniform_qualifier : require
layout(set = 0, binding = 2, std140) uniform UBO
{
vec4 v[64];
} ubos[];
layout(set = 0, binding = 3, std430) readonly buffer SSBO
{
vec4 v[];
} ssbos[];
layout(set = 0, binding = 0) uniform texture2D uSamplers[];
layout(set = 0, binding = 1) uniform sampler uSamps[];
layout(set = 0, binding = 4) uniform sampler2D uCombinedSamplers[];
layout(location = 0) flat in int vIndex;
layout(location = 0) out vec4 FragColor;
layout(location = 1) in vec2 vUV;
void main()
{
int _22 = vIndex + 10;
int _32 = vIndex + 40;
FragColor = texture(sampler2D(uSamplers[nonuniformEXT(_22)], uSamps[nonuniformEXT(_32)]), vUV);
FragColor = texture(uCombinedSamplers[nonuniformEXT(_22)], vUV);
FragColor += ubos[nonuniformEXT(vIndex + 20)].v[_32];
FragColor += ssbos[nonuniformEXT(vIndex + 50)].v[vIndex + 60];
}