Commit 7e5323f8 authored by Christoph Bumiller's avatar Christoph Bumiller Committed by Ian Romanick

glsl: add test for copy propagation bug

This is likely related to Mesa bugzilla #33197 and piglit test
glsl-vs-post-increment-01.  Christoph's original test was a
stand-alone executable, but it was converted to use shader_runner by
Ian Romanick.
Signed-off-by: default avatarIan Romanick <ian.d.romanick@intel.com>
parent 98256583
......@@ -309,6 +309,7 @@ add_shader_generic(shaders, 'glsl-constant-folding-call-1')
add_shader_generic(shaders, 'glsl-copy-propagation-if-1')
add_shader_generic(shaders, 'glsl-copy-propagation-if-2')
add_shader_generic(shaders, 'glsl-copy-propagation-if-3')
add_shader_generic(shaders, 'glsl-copy-propagation-loop-1')
add_shader_generic(shaders, 'glsl-complex-subscript')
add_shader_generic(shaders, 'glsl-deadcode-call')
add_shader_generic(shaders, 'glsl-deadcode-self-assign')
......
[require]
GLSL >= 1.10
[vertex shader]
/* Tests a bug in copy propagation that turns
* e.g. { a = v.x; v.x = v.y; v.y = a } into { v.x = v.y; v.y = v.x; }
*/
varying vec4 colour;
void main()
{
gl_Position = ftransform();
colour = vec4(0.0, 1.0, 0.0, 1.0);
}
[fragment shader]
varying vec4 colour;
void main()
{
vec4 col = colour;
while (col.b < 0.6) { /* prevent direct propagation of input */
float r = col.r;
col.r = col.g;
col.g = r;
col.b += 0.25;
}
gl_FragColor = col;
}
[test]
clear color 0.5 0.5 0.5 1.0
clear
draw rect -1 -1 2 2
probe rgb 1 1 1.0 0.0 0.75
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment