[Piglit] [PATCH] gpu_shader5: Add a test that uses an absurd number of texture arguments

Jason Ekstrand jason at jlekstrand.net
Fri Jan 9 22:27:54 PST 2015


This adds a test that uses an indirect offset into an array of 2D shadow
samplers with a textureProjGradOffset.  The primary purpse of this is to
use a lot of arguments with an indirect offset.  This hits a bug in the
current NIR code where we originally assumed a max of 4 texture arguments.
---
 .../compiler/indirect-projGradOffset-shadow.frag       | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag

diff --git a/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
new file mode 100644
index 0000000..43bbe0b
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/compiler/indirect-projGradOffset-shadow.frag
@@ -0,0 +1,18 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// [end config]
+#version 130
+#extension GL_ARB_gpu_shader5: require
+
+uniform int i;
+uniform vec4 coord;
+uniform ivec2 offset;
+uniform sampler2DShadow s[5];
+
+void main()
+{
+  float f = textureProjGradOffset(s[i], coord, coord.xy, coord.zw,
+				  ivec2(43, 7));
+  gl_FragColor = vec4(0, f, 0, 1);
+}
-- 
2.2.0



More information about the Piglit mailing list