[Piglit] [PATCH] glsl-fs-lots-of-tex: New test for extended TEX instructions on r400
Tom Stellard
tstellar at gmail.com
Sat Jan 22 22:50:34 PST 2011
---
tests/all.tests | 1 +
tests/shaders/glsl-fs-lots-of-tex.shader_test | 45 +++++++++++++++++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)
create mode 100644 tests/shaders/glsl-fs-lots-of-tex.shader_test
diff --git a/tests/all.tests b/tests/all.tests
index 0ce6d34..4f2f83b 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -403,6 +403,7 @@ add_shader_generic(shaders, 'glsl-fs-loop-two-counter-03')
add_shader_generic(shaders, 'glsl-fs-loop-two-counter-04')
add_shader_generic(shaders, 'glsl-fs-loop-zero-iter')
add_shader_generic(shaders, 'glsl-fs-loop-diagonal-break')
+add_shader_generic(shaders, 'glsl-fs-lots-of-tex')
add_shader_generic(shaders, 'glsl-fs-max')
add_shader_generic(shaders, 'glsl-fs-min')
add_plain_test(shaders, 'glsl-fs-mix')
diff --git a/tests/shaders/glsl-fs-lots-of-tex.shader_test b/tests/shaders/glsl-fs-lots-of-tex.shader_test
new file mode 100644
index 0000000..a31778f
--- /dev/null
+++ b/tests/shaders/glsl-fs-lots-of-tex.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.10
+
+[vertex shader]
+
+void main()
+{
+ gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+uniform sampler2D tex;
+uniform vec4 cst;
+void main()
+{
+ /* This test is for the extended shader limits on r400 cards.
+ * It should generate 34 TEX instructions.
+ */
+ vec4 a = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 b = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 c = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 d = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 e = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 f = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 g = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 h = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 i = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 j = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 k = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 l = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 m = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 n = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 o = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 p = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+ vec4 q = texture2D(tex, cst.xy) + texture2D(tex, cst.xy);
+
+ gl_FragColor = a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q;
+}
+
+[test]
+uniform int tex 0
+uniform vec4 cst 0.0 0.0 0.0 0.0
+texture checkerboard 0 0 (8, 8) (0.01, 0.0, 0.0, 0.0) (0.01, 0.0, 0.0, 0.0)
+draw rect -1 -1 2 2
+relative probe rgb (0.75, 0.75) (0.4, 0.0, 0.0)
--
1.7.2.5
More information about the Piglit
mailing list