[Piglit] [PATCH 2/6] gs: Sanity test interactions between geometry shaders and extensions.
Paul Berry
stereotype441 at gmail.com
Sat Jul 27 06:10:03 PDT 2013
These tests are parallel to the equivalently-named tests in
tests/spec/arb_geometry_shader4, except that they verify that the
extensions can be used in GLSL 1.50 geometry shaders rather than
ARB_geometry_shader4 geometry shaders.
---
.../glsl-1.50/compiler/arb_shader_texture_lod.geom | 36 ++++++++++++++++++++++
.../compiler/arb_shading_language_packing.geom | 28 +++++++++++++++++
.../compiler/arb_texture_cube_map_array.geom | 35 +++++++++++++++++++++
.../compiler/arb_texture_multisample.geom | 29 +++++++++++++++++
.../glsl-1.50/compiler/arb_texture_rectangle.geom | 24 +++++++++++++++
.../compiler/arb_uniform_buffer_object.geom | 20 ++++++++++++
.../spec/glsl-1.50/compiler/ext_texture_array.geom | 28 +++++++++++++++++
7 files changed, 200 insertions(+)
create mode 100644 tests/spec/glsl-1.50/compiler/arb_shader_texture_lod.geom
create mode 100644 tests/spec/glsl-1.50/compiler/arb_shading_language_packing.geom
create mode 100644 tests/spec/glsl-1.50/compiler/arb_texture_cube_map_array.geom
create mode 100644 tests/spec/glsl-1.50/compiler/arb_texture_multisample.geom
create mode 100644 tests/spec/glsl-1.50/compiler/arb_texture_rectangle.geom
create mode 100644 tests/spec/glsl-1.50/compiler/arb_uniform_buffer_object.geom
create mode 100644 tests/spec/glsl-1.50/compiler/ext_texture_array.geom
diff --git a/tests/spec/glsl-1.50/compiler/arb_shader_texture_lod.geom b/tests/spec/glsl-1.50/compiler/arb_shader_texture_lod.geom
new file mode 100644
index 0000000..57083ed
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/arb_shader_texture_lod.geom
@@ -0,0 +1,36 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_shader_texture_lod
+ * [end config]
+ *
+ * Verify that GL_ARB_shader_texture_lod can be used in geometry shaders
+ */
+#version 150
+#extension GL_ARB_shader_texture_lod: require
+
+uniform sampler1D s1;
+uniform sampler2D s2;
+uniform sampler3D s3;
+uniform samplerCube sc;
+uniform sampler1DShadow s1s;
+uniform sampler2DShadow s2s;
+
+void main()
+{
+ vec4 foo = texture1DGradARB(s1, 0.0, 0.0, 0.0);
+ foo += texture1DProjGradARB(s1, vec2(0.0), 0.0, 0.0);
+ foo += texture1DProjGradARB(s1, vec4(0.0), 0.0, 0.0);
+ foo += texture2DGradARB(s2, vec2(0.0), vec2(0.0), vec2(0.0));
+ foo += texture2DProjGradARB(s2, vec3(0.0), vec2(0.0), vec2(0.0));
+ foo += texture2DProjGradARB(s2, vec4(0.0), vec2(0.0), vec2(0.0));
+ foo += texture3DGradARB(s3, vec3(0.0), vec3(0.0), vec3(0.0));
+ foo += texture3DProjGradARB(s3, vec4(0.0), vec3(0.0), vec3(0.0));
+ foo += textureCubeGradARB(sc, vec3(0.0), vec3(0.0), vec3(0.0));
+ foo += shadow1DGradARB(s1s, vec3(0.0), 0.0, 0.0);
+ foo += shadow1DProjGradARB(s1s, vec4(0.0), 0.0, 0.0);
+ foo += shadow2DGradARB(s2s, vec3(0.0), vec2(0.0), vec2(0.0));
+ foo += shadow2DProjGradARB(s2s, vec4(0.0), vec2(0.0), vec2(0.0));
+ gl_Position = foo;
+ EmitVertex();
+}
diff --git a/tests/spec/glsl-1.50/compiler/arb_shading_language_packing.geom b/tests/spec/glsl-1.50/compiler/arb_shading_language_packing.geom
new file mode 100644
index 0000000..b07b130
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/arb_shading_language_packing.geom
@@ -0,0 +1,28 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_shading_language_packing
+ * [end config]
+ *
+ * Verify that GL_ARB_shading_language_packing can be used in geometry shaders
+ */
+#version 150
+#extension GL_ARB_shading_language_packing: require
+
+uniform vec2 v2;
+uniform vec4 v4;
+uniform uint u;
+
+void main()
+{
+ vec4 foo = vec4(packUnorm2x16(v2));
+ foo += vec4(packSnorm2x16(v2));
+ foo += vec4(packUnorm4x8(v4));
+ foo += vec4(packSnorm4x8(v4));
+ foo += vec4(unpackUnorm2x16(u), 0.0, 0.0);
+ foo += vec4(unpackSnorm2x16(u), 0.0, 0.0);
+ foo += unpackUnorm4x8(u);
+ foo += unpackSnorm4x8(u);
+ gl_Position = foo;
+ EmitVertex();
+}
diff --git a/tests/spec/glsl-1.50/compiler/arb_texture_cube_map_array.geom b/tests/spec/glsl-1.50/compiler/arb_texture_cube_map_array.geom
new file mode 100644
index 0000000..c618a58
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/arb_texture_cube_map_array.geom
@@ -0,0 +1,35 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_texture_cube_map_array
+ * [end config]
+ *
+ * Verify that GL_ARB_texture_cube_map_array can be used in geometry shaders
+ */
+#version 150
+#extension GL_ARB_texture_cube_map_array: require
+
+uniform samplerCubeArray sca;
+uniform samplerCubeArrayShadow scas;
+uniform isamplerCubeArray isca;
+uniform usamplerCubeArray usca;
+
+void main()
+{
+ vec4 foo = vec4(textureSize(sca, 0), 0.0);
+ foo += vec4(textureSize(isca, 0), 0.0);
+ foo += vec4(textureSize(usca, 0), 0.0);
+ foo += texture(sca, vec4(0.0));
+ foo += vec4(texture(isca, vec4(0.0)));
+ foo += vec4(texture(usca, vec4(0.0)));
+ foo += textureLod(sca, vec4(0.0), 0.0);
+ foo += vec4(textureLod(isca, vec4(0.0), 0.0));
+ foo += vec4(textureLod(usca, vec4(0.0), 0.0));
+ foo += vec4(textureSize(scas, 0), 0.0);
+ foo += vec4(texture(scas, vec4(0.0), 0.0));
+ foo += textureGrad(sca, vec4(0.0), vec3(0.0), vec3(0.0));
+ foo += vec4(textureGrad(isca, vec4(0.0), vec3(0.0), vec3(0.0)));
+ foo += vec4(textureGrad(usca, vec4(0.0), vec3(0.0), vec3(0.0)));
+ gl_Position = foo;
+ EmitVertex();
+}
diff --git a/tests/spec/glsl-1.50/compiler/arb_texture_multisample.geom b/tests/spec/glsl-1.50/compiler/arb_texture_multisample.geom
new file mode 100644
index 0000000..8f8cea2
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/arb_texture_multisample.geom
@@ -0,0 +1,29 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_texture_multisample
+ * [end config]
+ *
+ * Verify that GL_ARB_texture_multisample can be used in geometry shaders
+ */
+#version 150
+#extension GL_ARB_texture_multisample: require
+
+uniform sampler2DMS s;
+uniform isampler2DMS is;
+uniform usampler2DMS us;
+uniform sampler2DMSArray sa;
+uniform isampler2DMSArray isa;
+uniform usampler2DMSArray usa;
+
+void main()
+{
+ vec4 foo = texelFetch(s, ivec2(0, 0), 0);
+ foo += vec4(texelFetch(is, ivec2(0, 0), 0));
+ foo += vec4(texelFetch(us, ivec2(0, 0), 0));
+ foo += texelFetch(sa, ivec3(0, 0, 0), 0);
+ foo += vec4(texelFetch(isa, ivec3(0, 0, 0), 0));
+ foo += vec4(texelFetch(usa, ivec3(0, 0, 0), 0));
+ gl_Position = foo;
+ EmitVertex();
+}
diff --git a/tests/spec/glsl-1.50/compiler/arb_texture_rectangle.geom b/tests/spec/glsl-1.50/compiler/arb_texture_rectangle.geom
new file mode 100644
index 0000000..081c0c3
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/arb_texture_rectangle.geom
@@ -0,0 +1,24 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_texture_rectangle
+ * [end config]
+ *
+ * Verify that GL_ARB_texture_rectangle can be used in geometry shaders
+ */
+#version 150
+#extension GL_ARB_texture_rectangle: require
+
+uniform sampler2DRect s;
+uniform sampler2DRectShadow s_shadow;
+
+void main()
+{
+ vec4 foo = texture2DRect(s, vec2(0.0));
+ foo += texture2DRectProj(s, vec3(0.0));
+ foo += texture2DRectProj(s, vec4(0.0));
+ foo += shadow2DRect(s_shadow, vec3(0.0));
+ foo += shadow2DRectProj(s_shadow, vec4(0.0));
+ gl_Position = foo;
+ EmitVertex();
+}
diff --git a/tests/spec/glsl-1.50/compiler/arb_uniform_buffer_object.geom b/tests/spec/glsl-1.50/compiler/arb_uniform_buffer_object.geom
new file mode 100644
index 0000000..21717ff
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/arb_uniform_buffer_object.geom
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_uniform_buffer_object
+ * [end config]
+ *
+ * Verify that GL_ARB_uniform_buffer_object can be used in geometry shaders
+ */
+#version 150
+#extension GL_ARB_uniform_buffer_object: require
+
+uniform a {
+ vec4 b;
+};
+
+void main()
+{
+ gl_Position = b;
+ EmitVertex();
+}
diff --git a/tests/spec/glsl-1.50/compiler/ext_texture_array.geom b/tests/spec/glsl-1.50/compiler/ext_texture_array.geom
new file mode 100644
index 0000000..1e1b92d
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/ext_texture_array.geom
@@ -0,0 +1,28 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * require_extensions: GL_EXT_texture_array
+ * [end config]
+ *
+ * Verify that GL_EXT_texture_array can be used in geometry shaders
+ */
+#version 150
+#extension GL_EXT_texture_array: require
+
+uniform sampler1DArray s1;
+uniform sampler2DArray s2;
+uniform sampler1DArrayShadow s1s;
+uniform sampler2DArrayShadow s2s;
+
+void main()
+{
+ vec4 foo = texture1DArray(s1, vec2(0.0));
+ foo += texture1DArrayLod(s1, vec2(0.0), 0.0);
+ foo += texture2DArray(s2, vec3(0.0));
+ foo += texture2DArrayLod(s2, vec3(0.0), 0.0);
+ foo += shadow1DArray(s1s, vec3(0.0));
+ foo += shadow1DArrayLod(s1s, vec3(0.0), 0.0);
+ foo += shadow2DArray(s2s, vec4(0.0));
+ gl_Position = foo;
+ EmitVertex();
+}
--
1.8.3.4
More information about the Piglit
mailing list