repo.or.cz
/
piglit.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
glsl-array-bounds: set out-of-bounds array index inside shader
[piglit.git]
/
tests
/
shaders
/
glsl-fs-vec4-indexing-8.shader_test
blob
3ff99785dab1afd7c143b24c1725fd0ed175f3db
1
[require]
2
GLSL >= 1.10
3
4
[vertex shader passthrough]
5
6
[fragment shader]
7
uniform float id;
8
void main()
9
{
10
ivec4 test = ivec4(0, 1, 0, 0);
11
vec4 test2 = vec4(0.0, 1.0, 0.0, 0.0);
12
int index = int(id);
13
float col = test2[test[index]];
14
gl_FragColor = vec4(col);
15
}
16
17
[test]
18
uniform float id 1
19
draw rect -1 -1 2 2
20
probe rgb 1 1 1.0 1.0 1.0