summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-06-22 13:16:16 +1000
committerDave Airlie <airlied@redhat.com>2015-07-09 09:42:35 +1000
commitf7ea49f0b887f920c6b0392d8de0708e6311d17f (patch)
tree43a6a45cd5e89164937737d75451ccab3dd8624b
parentce84598b6cd8fd6365bae3db4ad382a551abf113 (diff)
arb_gpu_shader5: add textureSize sampler indexing tests
softpipe takes a different path for textureSize, so test it as well just in case other drivers do similiar. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test68
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test
new file mode 100644
index 000000000..dca749f09
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/sampler_array_indexing/fs-simple-texture-size.shader_test
@@ -0,0 +1,68 @@
+# This test verifies that dynamically uniform indexing of sampler arrays
+# in the fragment shader behaves correctly using textureSize
+
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader5: require
+
+uniform sampler2D s[4];
+
+uniform int n;
+
+out vec4 color;
+
+void main()
+{
+ color = vec4(textureSize(s[n], 0)/100.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+uniform int s[0] 0
+uniform int s[1] 1
+uniform int s[2] 2
+uniform int s[3] 3
+
+texture checkerboard 0 0 (128, 128) (1.0, 0.0, 0.0, 0.0) (1.0, 0.0, 0.0, 0.0)
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+texture checkerboard 1 0 (64, 64) (0.0, 1.0, 0.0, 0.0) (0.0, 1.0, 0.0, 0.0)
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+texture checkerboard 2 0 (32, 32) (0.0, 0.0, 1.0, 0.0) (0.0, 0.0, 1.0, 0.0)
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+texture checkerboard 3 0 (16, 16) (1.0, 1.0, 1.0, 1.0) (1.0, 1.0, 1.0, 1.0)
+texparameter 2D min nearest
+texparameter 2D mag nearest
+
+uniform int n 0
+draw rect -1 -1 1 1
+
+relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 1.0, 0.0)
+
+uniform int n 1
+draw rect 0 -1 1 1
+
+relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.64, 0.64, 0.0)
+
+uniform int n 2
+draw rect -1 0 1 1
+
+relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.32, 0.32, 0.0)
+
+uniform int n 3
+draw rect 0 0 1 1
+
+relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (0.16, 0.16, 0.0)