| 1 |
#version 310 es |
| 2 |
precision mediump float; |
| 3 |
|
| 4 |
struct Foo |
| 5 |
{ |
| 6 |
vec4 a; |
| 7 |
vec4 b; |
| 8 |
}; |
| 9 |
|
| 10 |
layout(binding = 0) buffer UBO |
| 11 |
{ |
| 12 |
vec4 results[1024]; |
| 13 |
}; |
| 14 |
|
| 15 |
layout(binding = 1) uniform highp isampler2D Buf; |
| 16 |
layout(location = 0) flat in int vIn; |
| 17 |
layout(location = 1) flat in int vIn2; |
| 18 |
|
| 19 |
layout(location = 0) out vec4 FragColor; |
| 20 |
|
| 21 |
void main() |
| 22 |
{ |
| 23 |
ivec4 coords = texelFetch(Buf, ivec2(gl_FragCoord.xy), 0); |
| 24 |
vec4 foo = results[coords.x % 16]; |
| 25 |
|
| 26 |
int c = vIn * vIn; |
| 27 |
int d = vIn2 * vIn2; |
| 28 |
FragColor = foo + foo + results[c + d]; |
| 29 |
} |