[Piglit] [PATCH] Sanity test interactions between ARB_geometry_shader4 and other extensions.
Paul Berry
stereotype441 at gmail.com
Mon Jul 1 09:07:41 PDT 2013
This patch verifies that the following extensions are available in
geometry shaders, and that all of the functions provided by each
extension can be called from geometry shaders:
- ARB_shader_texture_lod
- ARB_shading_language_packing
- ARB_texture_cube_map_array
- ARB_texture_multisample
- ARB_texture_rectangle
- ARB_uniform_buffer_object
- EXT_texture_array
---
.../compiler/arb_shader_texture_lod.geom | 36 ++++++++++++++++++++++
.../compiler/arb_shading_language_packing.geom | 29 +++++++++++++++++
.../compiler/arb_texture_cube_map_array.geom | 36 ++++++++++++++++++++++
.../compiler/arb_texture_multisample.geom | 30 ++++++++++++++++++
.../compiler/arb_texture_rectangle.geom | 24 +++++++++++++++
.../compiler/arb_uniform_buffer_object.geom | 20 ++++++++++++
.../compiler/ext_texture_array.geom | 28 +++++++++++++++++
7 files changed, 203 insertions(+)
create mode 100644 tests/spec/arb_geometry_shader4/compiler/arb_shader_texture_lod.geom
create mode 100644 tests/spec/arb_geometry_shader4/compiler/arb_shading_language_packing.geom
create mode 100644 tests/spec/arb_geometry_shader4/compiler/arb_texture_cube_map_array.geom
create mode 100644 tests/spec/arb_geometry_shader4/compiler/arb_texture_multisample.geom
create mode 100644 tests/spec/arb_geometry_shader4/compiler/arb_texture_rectangle.geom
create mode 100644 tests/spec/arb_geometry_shader4/compiler/arb_uniform_buffer_object.geom
create mode 100644 tests/spec/arb_geometry_shader4/compiler/ext_texture_array.geom
diff --git a/tests/spec/arb_geometry_shader4/compiler/arb_shader_texture_lod.geom b/tests/spec/arb_geometry_shader4/compiler/arb_shader_texture_lod.geom
new file mode 100644
index 0000000..d5376e1
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/compiler/arb_shader_texture_lod.geom
@@ -0,0 +1,36 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * require_extensions: GL_ARB_geometry_shader4 GL_ARB_shader_texture_lod
+ * [end config]
+ *
+ * Verify that GL_ARB_shader_texture_lod can be used in geometry shaders
+ */
+#extension GL_ARB_geometry_shader4: require
+#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/arb_geometry_shader4/compiler/arb_shading_language_packing.geom b/tests/spec/arb_geometry_shader4/compiler/arb_shading_language_packing.geom
new file mode 100644
index 0000000..d09b677
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/compiler/arb_shading_language_packing.geom
@@ -0,0 +1,29 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.30
+ * require_extensions: GL_ARB_geometry_shader4 GL_ARB_shading_language_packing
+ * [end config]
+ *
+ * Verify that GL_ARB_shading_language_packing can be used in geometry shaders
+ */
+#version 130
+#extension GL_ARB_geometry_shader4: require
+#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/arb_geometry_shader4/compiler/arb_texture_cube_map_array.geom b/tests/spec/arb_geometry_shader4/compiler/arb_texture_cube_map_array.geom
new file mode 100644
index 0000000..945d92b
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/compiler/arb_texture_cube_map_array.geom
@@ -0,0 +1,36 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.30
+ * require_extensions: GL_ARB_geometry_shader4 GL_ARB_texture_cube_map_array
+ * [end config]
+ *
+ * Verify that GL_ARB_texture_cube_map_array can be used in geometry shaders
+ */
+#version 130
+#extension GL_ARB_geometry_shader4: require
+#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/arb_geometry_shader4/compiler/arb_texture_multisample.geom b/tests/spec/arb_geometry_shader4/compiler/arb_texture_multisample.geom
new file mode 100644
index 0000000..f36590e
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/compiler/arb_texture_multisample.geom
@@ -0,0 +1,30 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.30
+ * require_extensions: GL_ARB_geometry_shader4 GL_ARB_texture_multisample
+ * [end config]
+ *
+ * Verify that GL_ARB_texture_multisample can be used in geometry shaders
+ */
+#version 130
+#extension GL_ARB_geometry_shader4: require
+#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/arb_geometry_shader4/compiler/arb_texture_rectangle.geom b/tests/spec/arb_geometry_shader4/compiler/arb_texture_rectangle.geom
new file mode 100644
index 0000000..9e14875
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/compiler/arb_texture_rectangle.geom
@@ -0,0 +1,24 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * require_extensions: GL_ARB_geometry_shader4 GL_ARB_texture_rectangle
+ * [end config]
+ *
+ * Verify that GL_ARB_texture_rectangle can be used in geometry shaders
+ */
+#extension GL_ARB_geometry_shader4: require
+#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/arb_geometry_shader4/compiler/arb_uniform_buffer_object.geom b/tests/spec/arb_geometry_shader4/compiler/arb_uniform_buffer_object.geom
new file mode 100644
index 0000000..fd75db1
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/compiler/arb_uniform_buffer_object.geom
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * require_extensions: GL_ARB_geometry_shader4 GL_ARB_uniform_buffer_object
+ * [end config]
+ *
+ * Verify that GL_ARB_uniform_buffer_object can be used in geometry shaders
+ */
+#extension GL_ARB_geometry_shader4: require
+#extension GL_ARB_uniform_buffer_object: require
+
+uniform a {
+ vec4 b;
+};
+
+void main()
+{
+ gl_Position = b;
+ EmitVertex();
+}
diff --git a/tests/spec/arb_geometry_shader4/compiler/ext_texture_array.geom b/tests/spec/arb_geometry_shader4/compiler/ext_texture_array.geom
new file mode 100644
index 0000000..344db88
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/compiler/ext_texture_array.geom
@@ -0,0 +1,28 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * require_extensions: GL_ARB_geometry_shader4 GL_EXT_texture_array
+ * [end config]
+ *
+ * Verify that GL_EXT_texture_array can be used in geometry shaders
+ */
+#extension GL_ARB_geometry_shader4: require
+#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.2
More information about the Piglit
mailing list