summaryrefslogtreecommitdiff
path: root/tests/spec/ext_shader_framebuffer_fetch/execution/redeclared-lowp-gles2.shader_test
blob: c9ecf26058c9ec9a712df166da853cd3bc516fc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[require]
GL ES >= 2.0
GLSL ES >= 1.00
GL_EXT_shader_framebuffer_fetch

[vertex shader]
#version 100

attribute highp vec4 vertex;
varying highp vec4 vcolor;

void main()
{
	gl_Position = vertex;
        vcolor = vec4((1.0 + vertex.x) / 2.0, (1.0 + vertex.y) / 2.0, 0.0, 1.0);
}

[fragment shader]
#version 100
#extension GL_EXT_shader_framebuffer_fetch : enable

lowp vec4 gl_LastFragData[gl_MaxDrawBuffers];
varying highp vec4 vcolor;

void main()
{
     if (gl_LastFragData[0].x <= 0.5 && gl_LastFragData[0].y <= 0.5)
       gl_FragData[0] = gl_LastFragData[0] + vcolor;
     else
       gl_FragData[0] = gl_LastFragData[0] +
                        vec4((vcolor.x >= 0.5 ? 1.0 : 0.0) - vcolor.x,
                             (vcolor.y >= 0.5 ? 1.0 : 0.0) - vcolor.y, 0, 0);
}

[test]
texture rgbw 0 (250, 250) GL_RGBA8
fb tex 2d 0

clear color 0.0 0.0 1.0 0.0
clear
draw rect -1 -1 2 2
draw rect -1 -1 2 2

relative probe rect rgb (0.55, 0.0, 0.45, 0.45) (1.0, 0.0, 1.0)
relative probe rect rgb (0.0, 0.55, 0.45, 0.45) (0.0, 1.0, 1.0)
relative probe rect rgb (0.55, 0.55, 0.45, 0.45) (1.0, 1.0, 1.0)