# Tests non-uniform control flow in the vertex shader # with fp64 functionality. # # The Intel vec4 backend used in gen7 for VS programs # has peculiarities related to non-uniform control-flow # with fp64 code. This test should verify that these # situations are handled correctly. # # Expected result: red to green horizontal gradient [require] GLSL >= 1.50 GL_ARB_gpu_shader_fp64 [vertex shader] #extension GL_ARB_gpu_shader_fp64 : require #extension GL_ARB_explicit_attrib_location : require layout(location=0) in vec4 pos; layout(location=1) in float col; uniform dvec2 u0; uniform dvec2 u1; out vec4 color; void main() { dvec2 res; gl_Position = pos; if (col == 0.0f) { res = 2.0lf * (u0 + u1); // res = (1, 1) : yellow res.y -= 1.0; // res = (1, 0) : red } else { res = u1 - u0 - dvec2(0.3lf, 0.1lf); // res = (0, 0) : black res.y += 1.0lf; // res = (0, 1) : green } color = vec4(res.x, res.y, 0, 1); } [fragment shader] varying vec4 color; void main() { gl_FragColor = color; } [vertex data] pos/float/2 col/float/1 -1.0 -1.0 1.0 1.0 -1.0 0.0 -1.0 1.0 0.0 1.0 1.0 0.0 [test] clear color 0.0 0.0 1.0 1.0 clear uniform dvec2 u0 0.1 0.2 uniform dvec2 u1 0.4 0.3 draw arrays GL_TRIANGLE_STRIP 0 4