bgfx/3rdparty/spirv-cross/shaders-hlsl/frag/complex-expression-in-access-chain.frag
Бранимир Караџић ac29dccc6a Added spirv-cross.
2019-01-09 19:23:47 -08:00

30 lines
501 B
GLSL

#version 310 es
precision mediump float;
struct Foo
{
vec4 a;
vec4 b;
};
layout(binding = 0) buffer UBO
{
vec4 results[1024];
};
layout(binding = 1) uniform highp isampler2D Buf;
layout(location = 0) flat in int vIn;
layout(location = 1) flat in int vIn2;
layout(location = 0) out vec4 FragColor;
void main()
{
ivec4 coords = texelFetch(Buf, ivec2(gl_FragCoord.xy), 0);
vec4 foo = results[coords.x % 16];
int c = vIn * vIn;
int d = vIn2 * vIn2;
FragColor = foo + foo + results[c + d];
}