[Piglit] [PATCH 10/11] mesa_shader_integer_functions: Clone arb_gpu_shader5 textureGather compile tests
Ian Romanick
idr at freedesktop.org
Wed Jun 29 21:23:10 UTC 2016
From: Ian Romanick <ian.d.romanick at intel.com>
GL_MESA_shader_integer_functions does not enhance textureGather support,
so all of these tests should fail.
cd tests/spec/mesa_shader_integer_functions/compiler
cp -a ../../arb_gpu_shader5/compiler/builtin-functions .
cd builtin-functions
for i in *; do
sed --in-place -e 's/1[.]50/1.30/g;s/150/130/g' \
-e 's/ARB_gpu_shader5/MESA_shader_integer_functions/g' \
-e 's/expect_result: pass/expect_result: fail/' \
$i
done
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
.../fs-gather-comp-float-samplers.frag | 28 ++++++++
.../fs-gather-comp-int-samplers.frag | 28 ++++++++
.../fs-gather-comp-uint-samplers.frag | 28 ++++++++
.../fs-gather-float-samplers.frag | 28 ++++++++
.../builtin-functions/fs-gather-int-samplers.frag | 28 ++++++++
.../fs-gather-shadow-samplers.frag | 30 +++++++++
.../builtin-functions/fs-gather-uint-samplers.frag | 28 ++++++++
.../fs-gatherOffset-comp-float-samplers.frag | 25 ++++++++
.../fs-gatherOffset-comp-int-samplers.frag | 25 ++++++++
.../fs-gatherOffset-comp-uint-samplers.frag | 25 ++++++++
.../fs-gatherOffset-float-samplers.frag | 25 ++++++++
.../fs-gatherOffset-int-samplers.frag | 25 ++++++++
.../fs-gatherOffset-shadow-samplers.frag | 26 ++++++++
.../fs-gatherOffset-uint-samplers.frag | 25 ++++++++
.../fs-gatherOffset-uniform-offset.frag | 21 ++++++
.../builtin-functions/fs-gatherOffsets.frag | 75 ++++++++++++++++++++++
.../vs-gather-comp-float-samplers.vert | 28 ++++++++
.../vs-gather-comp-int-samplers.vert | 28 ++++++++
.../vs-gather-comp-must-be-constexpr.vert | 18 ++++++
.../vs-gather-comp-uint-samplers.vert | 28 ++++++++
.../vs-gather-float-samplers.vert | 28 ++++++++
.../builtin-functions/vs-gather-int-samplers.vert | 28 ++++++++
.../vs-gather-offsets-must-be-constexpr.vert | 16 +++++
.../vs-gather-shadow-samplers.vert | 30 +++++++++
.../builtin-functions/vs-gather-uint-samplers.vert | 28 ++++++++
.../vs-gatherOffset-comp-float-samplers.vert | 25 ++++++++
.../vs-gatherOffset-comp-int-samplers.vert | 25 ++++++++
.../vs-gatherOffset-comp-uint-samplers.vert | 25 ++++++++
.../vs-gatherOffset-float-samplers.vert | 25 ++++++++
.../vs-gatherOffset-int-samplers.vert | 25 ++++++++
.../vs-gatherOffset-shadow-samplers.vert | 26 ++++++++
.../vs-gatherOffset-uint-samplers.vert | 25 ++++++++
.../vs-gatherOffset-uniform-offset.vert | 21 ++++++
.../builtin-functions/vs-gatherOffsets.vert | 75 ++++++++++++++++++++++
34 files changed, 974 insertions(+)
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-float-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-int-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-uint-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-float-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-int-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-shadow-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-uint-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-float-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-int-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-uint-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-float-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-int-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-shadow-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-uint-samplers.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-uniform-offset.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffsets.frag
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-float-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-int-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-must-be-constexpr.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-uint-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-float-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-int-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-offsets-must-be-constexpr.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-shadow-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-uint-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-float-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-int-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-uint-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-float-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-int-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-shadow-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-uint-samplers.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-uniform-offset.vert
create mode 100644 tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffsets.vert
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-float-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-float-samplers.frag
new file mode 100644
index 0000000..6abaab4
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-float-samplers.frag
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform samplerCube sCube;
+uniform samplerCubeArray sCubeArray;
+uniform sampler2DRect s2DRect;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGather(s2D, vec2(0), 0);
+ res += textureGather(s2DArray, vec3(0), 1);
+ res += textureGather(sCube, vec3(0), 2);
+ res += textureGather(sCubeArray, vec4(0), 3);
+ res += textureGather(s2DRect, vec2(0), 0);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-int-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-int-samplers.frag
new file mode 100644
index 0000000..22541ad
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-int-samplers.frag
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform isampler2D s2D;
+uniform isampler2DArray s2DArray;
+uniform isamplerCube sCube;
+uniform isamplerCubeArray sCubeArray;
+uniform isampler2DRect s2DRect;
+
+void main()
+{
+ ivec4 res = ivec4(0);
+
+ res += textureGather(s2D, vec2(0), 0);
+ res += textureGather(s2DArray, vec3(0), 1);
+ res += textureGather(sCube, vec3(0), 2);
+ res += textureGather(sCubeArray, vec4(0), 3);
+ res += textureGather(s2DRect, vec2(0), 0);
+
+ gl_FragColor = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-uint-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-uint-samplers.frag
new file mode 100644
index 0000000..c579958
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-comp-uint-samplers.frag
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform usampler2D s2D;
+uniform usampler2DArray s2DArray;
+uniform usamplerCube sCube;
+uniform usamplerCubeArray sCubeArray;
+uniform usampler2DRect s2DRect;
+
+void main()
+{
+ uvec4 res = uvec4(0);
+
+ res += textureGather(s2D, vec2(0), 0);
+ res += textureGather(s2DArray, vec3(0), 1);
+ res += textureGather(sCube, vec3(0), 2);
+ res += textureGather(sCubeArray, vec4(0), 3);
+ res += textureGather(s2DRect, vec2(0), 0);
+
+ gl_FragColor = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-float-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-float-samplers.frag
new file mode 100644
index 0000000..b123212
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-float-samplers.frag
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform samplerCube sCube;
+uniform samplerCubeArray sCubeArray;
+uniform sampler2DRect s2DRect;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGather(s2D, vec2(0));
+ res += textureGather(s2DArray, vec3(0));
+ res += textureGather(sCube, vec3(0));
+ res += textureGather(sCubeArray, vec4(0));
+ res += textureGather(s2DRect, vec2(0));
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-int-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-int-samplers.frag
new file mode 100644
index 0000000..64b0c57
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-int-samplers.frag
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform isampler2D s2D;
+uniform isampler2DArray s2DArray;
+uniform isamplerCube sCube;
+uniform isamplerCubeArray sCubeArray;
+uniform isampler2DRect s2DRect;
+
+void main()
+{
+ ivec4 res = ivec4(0);
+
+ res += textureGather(s2D, vec2(0));
+ res += textureGather(s2DArray, vec3(0));
+ res += textureGather(sCube, vec3(0));
+ res += textureGather(sCubeArray, vec4(0));
+ res += textureGather(s2DRect, vec2(0));
+
+ gl_FragColor = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-shadow-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-shadow-samplers.frag
new file mode 100644
index 0000000..598e1d7
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-shadow-samplers.frag
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform sampler2DShadow s2D;
+uniform sampler2DArrayShadow s2DArray;
+uniform samplerCubeShadow sCube;
+uniform samplerCubeArrayShadow sCubeArray;
+uniform sampler2DRectShadow s2DRect;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ float refz = 0.5;
+
+ res += textureGather(s2D, vec2(0), refz);
+ res += textureGather(s2DArray, vec3(0), refz);
+ res += textureGather(sCube, vec3(0), refz);
+ res += textureGather(sCubeArray, vec4(0), refz);
+ res += textureGather(s2DRect, vec2(0), refz);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-uint-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-uint-samplers.frag
new file mode 100644
index 0000000..733470f
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gather-uint-samplers.frag
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform usampler2D s2D;
+uniform usampler2DArray s2DArray;
+uniform usamplerCube sCube;
+uniform usamplerCubeArray sCubeArray;
+uniform usampler2DRect s2DRect;
+
+void main()
+{
+ uvec4 res = uvec4(0);
+
+ res += textureGather(s2D, vec2(0));
+ res += textureGather(s2DArray, vec3(0));
+ res += textureGather(sCube, vec3(0));
+ res += textureGather(sCubeArray, vec4(0));
+ res += textureGather(s2DRect, vec2(0));
+
+ gl_FragColor = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-float-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-float-samplers.frag
new file mode 100644
index 0000000..dee531c
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-float-samplers.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform sampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset, 0);
+ res += textureGatherOffset(s2DArray, vec3(0), offset, 1);
+ res += textureGatherOffset(s2DRect, vec2(0), offset, 2);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-int-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-int-samplers.frag
new file mode 100644
index 0000000..9607224
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-int-samplers.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform isampler2D s2D;
+uniform isampler2DArray s2DArray;
+uniform isampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ ivec4 res = ivec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset, 0);
+ res += textureGatherOffset(s2DArray, vec3(0), offset, 1);
+ res += textureGatherOffset(s2DRect, vec2(0), offset, 2);
+
+ gl_FragColor = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-uint-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-uint-samplers.frag
new file mode 100644
index 0000000..874e13a
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-comp-uint-samplers.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform usampler2D s2D;
+uniform usampler2DArray s2DArray;
+uniform usampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ uvec4 res = uvec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset, 0);
+ res += textureGatherOffset(s2DArray, vec3(0), offset, 1);
+ res += textureGatherOffset(s2DRect, vec2(0), offset, 2);
+
+ gl_FragColor = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-float-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-float-samplers.frag
new file mode 100644
index 0000000..90a0afc
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-float-samplers.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform sampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset);
+ res += textureGatherOffset(s2DArray, vec3(0), offset);
+ res += textureGatherOffset(s2DRect, vec2(0), offset);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-int-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-int-samplers.frag
new file mode 100644
index 0000000..c1b9a93
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-int-samplers.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform isampler2D s2D;
+uniform isampler2DArray s2DArray;
+uniform isampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ ivec4 res = ivec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset);
+ res += textureGatherOffset(s2DArray, vec3(0), offset);
+ res += textureGatherOffset(s2DRect, vec2(0), offset);
+
+ gl_FragColor = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-shadow-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-shadow-samplers.frag
new file mode 100644
index 0000000..1cdc4d2
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-shadow-samplers.frag
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2DShadow s2D;
+uniform sampler2DArrayShadow s2DArray;
+uniform sampler2DRectShadow s2DRect;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ float refz = 0.5;
+ ivec2 offset = ivec2(-8, 7);
+
+ res += textureGatherOffset(s2D, vec2(0), refz, offset);
+ res += textureGatherOffset(s2DArray, vec3(0), refz, offset);
+ res += textureGatherOffset(s2DRect, vec2(0), refz, offset);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-uint-samplers.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-uint-samplers.frag
new file mode 100644
index 0000000..cd9c5ba
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-uint-samplers.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform usampler2D s2D;
+uniform usampler2DArray s2DArray;
+uniform usampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ uvec4 res = uvec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset);
+ res += textureGatherOffset(s2DArray, vec3(0), offset);
+ res += textureGatherOffset(s2DRect, vec2(0), offset);
+
+ gl_FragColor = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-uniform-offset.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-uniform-offset.frag
new file mode 100644
index 0000000..1522419
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffset-uniform-offset.frag
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2D s2D;
+uniform ivec2 offset; /* MESA_shader_integer_functions allows this to be uniform
+ rather than constexpr */
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffsets.frag b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffsets.frag
new file mode 100644
index 0000000..7f34748
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/fs-gatherOffsets.frag
@@ -0,0 +1,75 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform sampler2DRect s2DRect;
+
+uniform isampler2D is2D;
+uniform isampler2DArray is2DArray;
+uniform isampler2DRect is2DRect;
+
+uniform usampler2D us2D;
+uniform usampler2DArray us2DArray;
+uniform usampler2DRect us2DRect;
+
+uniform sampler2DShadow ss2D;
+uniform sampler2DArrayShadow ss2DArray;
+uniform sampler2DRectShadow ss2DRect;
+
+const ivec2[] offsets = ivec2[](
+ ivec2(-8, 7),
+ ivec2(-8, -8),
+ ivec2(7, -8),
+ ivec2(7, 7)
+);
+
+const float refz = 0.5;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ /* float samplers, no component select */
+ res += textureGatherOffsets(s2D, vec2(0), offsets);
+ res += textureGatherOffsets(s2DArray, vec3(0), offsets);
+ res += textureGatherOffsets(s2DRect, vec2(0), offsets);
+
+ /* float samplers, component select */
+ res += textureGatherOffsets(s2D, vec2(0), offsets, 0);
+ res += textureGatherOffsets(s2DArray, vec3(0), offsets, 1);
+ res += textureGatherOffsets(s2DRect, vec2(0), offsets, 2);
+
+ /* int samplers, no component select */
+ res += textureGatherOffsets(is2D, vec2(0), offsets);
+ res += textureGatherOffsets(is2DArray, vec3(0), offsets);
+ res += textureGatherOffsets(is2DRect, vec2(0), offsets);
+
+ /* int samplers, component select */
+ res += textureGatherOffsets(is2D, vec2(0), offsets, 0);
+ res += textureGatherOffsets(is2DArray, vec3(0), offsets, 1);
+ res += textureGatherOffsets(is2DRect, vec2(0), offsets, 2);
+
+ /* uint samplers, no component select */
+ res += textureGatherOffsets(us2D, vec2(0), offsets);
+ res += textureGatherOffsets(us2DArray, vec3(0), offsets);
+ res += textureGatherOffsets(us2DRect, vec2(0), offsets);
+
+ /* uint samplers, component select */
+ res += textureGatherOffsets(us2D, vec2(0), offsets, 0);
+ res += textureGatherOffsets(us2DArray, vec3(0), offsets, 1);
+ res += textureGatherOffsets(us2DRect, vec2(0), offsets, 2);
+
+ /* shadow samplers, no component select (none available) */
+ res += textureGatherOffsets(ss2D, vec2(0), refz, offsets);
+ res += textureGatherOffsets(ss2DArray, vec3(0), refz, offsets);
+ res += textureGatherOffsets(ss2DRect, vec2(0), refz, offsets);
+
+ gl_FragColor = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-float-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-float-samplers.vert
new file mode 100644
index 0000000..0889d69
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-float-samplers.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform samplerCube sCube;
+uniform samplerCubeArray sCubeArray;
+uniform sampler2DRect s2DRect;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGather(s2D, vec2(0), 0);
+ res += textureGather(s2DArray, vec3(0), 1);
+ res += textureGather(sCube, vec3(0), 2);
+ res += textureGather(sCubeArray, vec4(0), 3);
+ res += textureGather(s2DRect, vec2(0), 0);
+
+ gl_Position = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-int-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-int-samplers.vert
new file mode 100644
index 0000000..82603f9
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-int-samplers.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform isampler2D s2D;
+uniform isampler2DArray s2DArray;
+uniform isamplerCube sCube;
+uniform isamplerCubeArray sCubeArray;
+uniform isampler2DRect s2DRect;
+
+void main()
+{
+ ivec4 res = ivec4(0);
+
+ res += textureGather(s2D, vec2(0), 0);
+ res += textureGather(s2DArray, vec3(0), 1);
+ res += textureGather(sCube, vec3(0), 2);
+ res += textureGather(sCubeArray, vec4(0), 3);
+ res += textureGather(s2DRect, vec2(0), 0);
+
+ gl_Position = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-must-be-constexpr.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-must-be-constexpr.vert
new file mode 100644
index 0000000..a2c43f3
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-must-be-constexpr.vert
@@ -0,0 +1,18 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform sampler2D s2D;
+
+in int component_select; /* not a const expr! */
+
+void main()
+{
+ gl_Position = textureGather(s2D, vec2(0), component_select);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-uint-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-uint-samplers.vert
new file mode 100644
index 0000000..4769aa2
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-comp-uint-samplers.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform usampler2D s2D;
+uniform usampler2DArray s2DArray;
+uniform usamplerCube sCube;
+uniform usamplerCubeArray sCubeArray;
+uniform usampler2DRect s2DRect;
+
+void main()
+{
+ uvec4 res = uvec4(0);
+
+ res += textureGather(s2D, vec2(0), 0);
+ res += textureGather(s2DArray, vec3(0), 1);
+ res += textureGather(sCube, vec3(0), 2);
+ res += textureGather(sCubeArray, vec4(0), 3);
+ res += textureGather(s2DRect, vec2(0), 0);
+
+ gl_Position = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-float-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-float-samplers.vert
new file mode 100644
index 0000000..132c146
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-float-samplers.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform samplerCube sCube;
+uniform samplerCubeArray sCubeArray;
+uniform sampler2DRect s2DRect;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGather(s2D, vec2(0));
+ res += textureGather(s2DArray, vec3(0));
+ res += textureGather(sCube, vec3(0));
+ res += textureGather(sCubeArray, vec4(0));
+ res += textureGather(s2DRect, vec2(0));
+
+ gl_Position = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-int-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-int-samplers.vert
new file mode 100644
index 0000000..f82e089
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-int-samplers.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform isampler2D s2D;
+uniform isampler2DArray s2DArray;
+uniform isamplerCube sCube;
+uniform isamplerCubeArray sCubeArray;
+uniform isampler2DRect s2DRect;
+
+void main()
+{
+ ivec4 res = ivec4(0);
+
+ res += textureGather(s2D, vec2(0));
+ res += textureGather(s2DArray, vec3(0));
+ res += textureGather(sCube, vec3(0));
+ res += textureGather(sCubeArray, vec4(0));
+ res += textureGather(s2DRect, vec2(0));
+
+ gl_Position = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-offsets-must-be-constexpr.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-offsets-must-be-constexpr.vert
new file mode 100644
index 0000000..ac7c4dc
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-offsets-must-be-constexpr.vert
@@ -0,0 +1,16 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2D s2D;
+uniform ivec2[4] offsets;
+
+void main()
+{
+ gl_Position = textureGatherOffsets(s2D, vec2(0), offsets);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-shadow-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-shadow-samplers.vert
new file mode 100644
index 0000000..9e50c95
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-shadow-samplers.vert
@@ -0,0 +1,30 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform sampler2DShadow s2D;
+uniform sampler2DArrayShadow s2DArray;
+uniform samplerCubeShadow sCube;
+uniform samplerCubeArrayShadow sCubeArray;
+uniform sampler2DRectShadow s2DRect;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ float refz = 0.5;
+
+ res += textureGather(s2D, vec2(0), refz);
+ res += textureGather(s2DArray, vec3(0), refz);
+ res += textureGather(sCube, vec3(0), refz);
+ res += textureGather(sCubeArray, vec4(0), refz);
+ res += textureGather(s2DRect, vec2(0), refz);
+
+ gl_Position = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-uint-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-uint-samplers.vert
new file mode 100644
index 0000000..4e1687d
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gather-uint-samplers.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions GL_ARB_texture_cube_map_array
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform usampler2D s2D;
+uniform usampler2DArray s2DArray;
+uniform usamplerCube sCube;
+uniform usamplerCubeArray sCubeArray;
+uniform usampler2DRect s2DRect;
+
+void main()
+{
+ uvec4 res = uvec4(0);
+
+ res += textureGather(s2D, vec2(0));
+ res += textureGather(s2DArray, vec3(0));
+ res += textureGather(sCube, vec3(0));
+ res += textureGather(sCubeArray, vec4(0));
+ res += textureGather(s2DRect, vec2(0));
+
+ gl_Position = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-float-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-float-samplers.vert
new file mode 100644
index 0000000..c1b58fd
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-float-samplers.vert
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform sampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset, 0);
+ res += textureGatherOffset(s2DArray, vec3(0), offset, 1);
+ res += textureGatherOffset(s2DRect, vec2(0), offset, 2);
+
+ gl_Position = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-int-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-int-samplers.vert
new file mode 100644
index 0000000..cc77104
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-int-samplers.vert
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform isampler2D s2D;
+uniform isampler2DArray s2DArray;
+uniform isampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ ivec4 res = ivec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset, 0);
+ res += textureGatherOffset(s2DArray, vec3(0), offset, 1);
+ res += textureGatherOffset(s2DRect, vec2(0), offset, 2);
+
+ gl_Position = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-uint-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-uint-samplers.vert
new file mode 100644
index 0000000..251c35e
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-comp-uint-samplers.vert
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform usampler2D s2D;
+uniform usampler2DArray s2DArray;
+uniform usampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ uvec4 res = uvec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset, 0);
+ res += textureGatherOffset(s2DArray, vec3(0), offset, 1);
+ res += textureGatherOffset(s2DRect, vec2(0), offset, 2);
+
+ gl_Position = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-float-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-float-samplers.vert
new file mode 100644
index 0000000..5fda0ce
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-float-samplers.vert
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform sampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset);
+ res += textureGatherOffset(s2DArray, vec3(0), offset);
+ res += textureGatherOffset(s2DRect, vec2(0), offset);
+
+ gl_Position = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-int-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-int-samplers.vert
new file mode 100644
index 0000000..1860544
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-int-samplers.vert
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform isampler2D s2D;
+uniform isampler2DArray s2DArray;
+uniform isampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ ivec4 res = ivec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset);
+ res += textureGatherOffset(s2DArray, vec3(0), offset);
+ res += textureGatherOffset(s2DRect, vec2(0), offset);
+
+ gl_Position = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-shadow-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-shadow-samplers.vert
new file mode 100644
index 0000000..b05073e
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-shadow-samplers.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2DShadow s2D;
+uniform sampler2DArrayShadow s2DArray;
+uniform sampler2DRectShadow s2DRect;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ float refz = 0.5;
+ ivec2 offset = ivec2(-8, 7);
+
+ res += textureGatherOffset(s2D, vec2(0), refz, offset);
+ res += textureGatherOffset(s2DArray, vec3(0), refz, offset);
+ res += textureGatherOffset(s2DRect, vec2(0), refz, offset);
+
+ gl_Position = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-uint-samplers.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-uint-samplers.vert
new file mode 100644
index 0000000..af79247
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-uint-samplers.vert
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform usampler2D s2D;
+uniform usampler2DArray s2DArray;
+uniform usampler2DRect s2DRect;
+
+const ivec2 offset = ivec2(-8, 7);
+
+void main()
+{
+ uvec4 res = uvec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset);
+ res += textureGatherOffset(s2DArray, vec3(0), offset);
+ res += textureGatherOffset(s2DRect, vec2(0), offset);
+
+ gl_Position = vec4(res);
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-uniform-offset.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-uniform-offset.vert
new file mode 100644
index 0000000..57d6dff
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffset-uniform-offset.vert
@@ -0,0 +1,21 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2D s2D;
+uniform ivec2 offset; /* MESA_shader_integer_functions allows this to be uniform
+ rather than constexpr */
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ res += textureGatherOffset(s2D, vec2(0), offset);
+
+ gl_Position = res;
+}
diff --git a/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffsets.vert b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffsets.vert
new file mode 100644
index 0000000..288986c
--- /dev/null
+++ b/tests/spec/mesa_shader_integer_functions/compiler/builtin-functions/vs-gatherOffsets.vert
@@ -0,0 +1,75 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.30
+// require_extensions: GL_MESA_shader_integer_functions
+// [end config]
+
+#version 130
+#extension GL_MESA_shader_integer_functions: require
+
+uniform sampler2D s2D;
+uniform sampler2DArray s2DArray;
+uniform sampler2DRect s2DRect;
+
+uniform isampler2D is2D;
+uniform isampler2DArray is2DArray;
+uniform isampler2DRect is2DRect;
+
+uniform usampler2D us2D;
+uniform usampler2DArray us2DArray;
+uniform usampler2DRect us2DRect;
+
+uniform sampler2DShadow ss2D;
+uniform sampler2DArrayShadow ss2DArray;
+uniform sampler2DRectShadow ss2DRect;
+
+const ivec2[] offsets = ivec2[](
+ ivec2(-8, 7),
+ ivec2(-8, -8),
+ ivec2(7, -8),
+ ivec2(7, 7)
+);
+
+const float refz = 0.5;
+
+void main()
+{
+ vec4 res = vec4(0);
+
+ /* float samplers, no component select */
+ res += textureGatherOffsets(s2D, vec2(0), offsets);
+ res += textureGatherOffsets(s2DArray, vec3(0), offsets);
+ res += textureGatherOffsets(s2DRect, vec2(0), offsets);
+
+ /* float samplers, component select */
+ res += textureGatherOffsets(s2D, vec2(0), offsets, 0);
+ res += textureGatherOffsets(s2DArray, vec3(0), offsets, 1);
+ res += textureGatherOffsets(s2DRect, vec2(0), offsets, 2);
+
+ /* int samplers, no component select */
+ res += textureGatherOffsets(is2D, vec2(0), offsets);
+ res += textureGatherOffsets(is2DArray, vec3(0), offsets);
+ res += textureGatherOffsets(is2DRect, vec2(0), offsets);
+
+ /* int samplers, component select */
+ res += textureGatherOffsets(is2D, vec2(0), offsets, 0);
+ res += textureGatherOffsets(is2DArray, vec3(0), offsets, 1);
+ res += textureGatherOffsets(is2DRect, vec2(0), offsets, 2);
+
+ /* uint samplers, no component select */
+ res += textureGatherOffsets(us2D, vec2(0), offsets);
+ res += textureGatherOffsets(us2DArray, vec3(0), offsets);
+ res += textureGatherOffsets(us2DRect, vec2(0), offsets);
+
+ /* uint samplers, component select */
+ res += textureGatherOffsets(us2D, vec2(0), offsets, 0);
+ res += textureGatherOffsets(us2DArray, vec3(0), offsets, 1);
+ res += textureGatherOffsets(us2DRect, vec2(0), offsets, 2);
+
+ /* shadow samplers, no component select (none available) */
+ res += textureGatherOffsets(ss2D, vec2(0), refz, offsets);
+ res += textureGatherOffsets(ss2DArray, vec3(0), refz, offsets);
+ res += textureGatherOffsets(ss2DRect, vec2(0), refz, offsets);
+
+ gl_Position = res;
+}
--
2.5.5
More information about the Piglit
mailing list