- Added two more tests to stress the new optimizations in prog_optimize.c in the mesa code base --- tests/all.tests | 2 + tests/shaders/glsl-vs-masked-cos.shader_test | 33 ++++++++++++++++++++++++++ tests/shaders/glsl-vs-masked-dot.shader_test | 32 +++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 0 deletions(-) create mode 100644 tests/shaders/glsl-vs-masked-cos.shader_test create mode 100644 tests/shaders/glsl-vs-masked-dot.shader_test
diff --git a/tests/all.tests b/tests/all.tests index 1851c3e..312f990 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -269,6 +269,8 @@ add_shader_generic(shaders, 'glsl-octal') add_plain_test(shaders, 'glsl-orangebook-ch06-bump') add_plain_test(shaders, 'glsl-routing') add_plain_test(shaders, 'glsl-vs-arrays') +add_shader_generic(shaders, 'glsl-vs-masked-dot') +add_shader_generic(shaders, 'glsl-vs-masked-cos') add_shader_generic(shaders, 'glsl-vs-arrays-2') add_shader_generic(shaders, 'glsl-vs-arrays-3') add_shader_generic(shaders, 'glsl-vs-cross') diff --git a/tests/shaders/glsl-vs-masked-cos.shader_test b/tests/shaders/glsl-vs-masked-cos.shader_test new file mode 100644 index 0000000..6f13bbc --- /dev/null +++ b/tests/shaders/glsl-vs-masked-cos.shader_test @@ -0,0 +1,33 @@ +[require] +GL >= 2.0 +GLSL >= 1.10 + +[vertex shader] +uniform vec2 arg0; +uniform vec3 arg1; +varying vec3 color; + +void main() +{ + gl_Position = gl_Vertex; + + /* try to trigger masked mov for cos */ + vec3 val = arg1; + val.z = cos(arg0.x); + color.x = val.z; + color.yz = val.xy; +} + +[fragment shader] +varying vec3 color; +void main() +{ + gl_FragColor = vec4(color, 0.0); +} + +[test] +uniform vec2 arg0 0.0 0.0 +uniform vec3 arg1 1.0 0.5 1.0 +draw rect -1 -1 2 2 +probe rgba 1 1 1.0 1.0 0.5 0.0 + diff --git a/tests/shaders/glsl-vs-masked-dot.shader_test b/tests/shaders/glsl-vs-masked-dot.shader_test new file mode 100644 index 0000000..70eb55a --- /dev/null +++ b/tests/shaders/glsl-vs-masked-dot.shader_test @@ -0,0 +1,32 @@ +[require] +GL >= 2.0 +GLSL >= 1.10 + +[vertex shader] +uniform vec3 arg0; +uniform vec3 arg1; +varying vec3 color; + +void main() +{ + gl_Position = gl_Vertex; + + /* try to trigger masked mov for dp */ + vec3 val = arg0; + val.y = dot(arg0, arg1); + color = val.yxz * 0.25f; +} + +[fragment shader] +varying vec3 color; +void main() +{ + gl_FragColor = vec4(color, 0.0); +} + +[test] +uniform vec3 arg0 2.0 1.0 1.0 +uniform vec3 arg1 1.0 1.0 1.0 +draw rect -1 -1 2 2 +probe rgba 1 1 1.0 0.50 0.25 0.0 + -- 1.7.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev