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
perf/pixel-rate: new pixel throughput microbenchmark
[piglit.git]
/
tests
/
spec
/
glsl-1.10
/
execution
/
void-ternary.shader_test
blob
1b0f0821b335996f6f60d99cfdd8f95bd1a8193c
1
[require]
2
GLSL >= 1.10
3
4
[vertex shader]
5
6
varying vec4 c;
7
uniform bool b;
8
9
void good(void)
10
{
11
c = vec4(0, 1, 0, 1);
12
}
13
14
void bad(void)
15
{
16
c = vec4(1, 0, 0, 1);
17
}
18
19
void main()
20
{
21
gl_Position = gl_Vertex;
22
b ? good() : bad();
23
}
24
25
[fragment shader]
26
27
varying vec4 c;
28
uniform bool b;
29
30
void good(void)
31
{
32
gl_FragColor = c;
33
}
34
35
void bad(void)
36
{
37
gl_FragColor = c + vec4(0, 0, 1, 0);
38
}
39
40
void main()
41
{
42
b ? good() : bad();
43
}
44
45
[test]
46
uniform int b 1
47
48
draw rect -1 -1 2 2
49
probe all rgba 0.0 1.0 0.0 1.0