[Piglit] [PATCH 1/7] intel_shader_atomic_float_minmax: Simple negative compile tests

Ian Romanick idr at freedesktop.org
Sat Jun 23 05:04:24 UTC 2018


From: Ian Romanick <ian.d.romanick at intel.com>

If the extension isn't enabled in the shader, the functions should not
be availale.  Yes, I botched this in the initial implementation.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 .../compiler/shared-atomicExchange-float-fail.comp | 20 ++++++++++++++++++++
 .../compiler/shared-atomicMax-float-fail.comp      | 20 ++++++++++++++++++++
 .../compiler/shared-atomicMin-float-fail.comp      | 20 ++++++++++++++++++++
 .../ssbo-atomicCompareExchnage-float-fail.frag     | 22 ++++++++++++++++++++++
 .../compiler/ssbo-atomicExchange-float-fail.frag   | 22 ++++++++++++++++++++++
 .../compiler/ssbo-atomicMax-float-fail.frag        | 22 ++++++++++++++++++++++
 .../compiler/ssbo-atomicMin-float-fail.frag        | 22 ++++++++++++++++++++++
 7 files changed, 148 insertions(+)
 create mode 100644 tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicExchange-float-fail.comp
 create mode 100644 tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicMax-float-fail.comp
 create mode 100644 tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicMin-float-fail.comp
 create mode 100644 tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicCompareExchnage-float-fail.frag
 create mode 100644 tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicExchange-float-fail.frag
 create mode 100644 tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicMax-float-fail.frag
 create mode 100644 tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicMin-float-fail.frag

diff --git a/tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicExchange-float-fail.comp b/tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicExchange-float-fail.comp
new file mode 100644
index 000000000..099a8ddf6
--- /dev/null
+++ b/tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicExchange-float-fail.comp
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_compute_shader GL_INTEL_shader_atomic_float_minmax
+// [end config]
+//
+// The extension is supported by the implementation, but it is not enabled in
+// the shader.  This should fail to compile.
+
+#version 150
+#extension GL_ARB_compute_shader: require
+
+layout(local_size_x = 32) in;
+
+shared float a;
+
+void main()
+{
+	atomicExchange(a, 1.7);
+}
diff --git a/tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicMax-float-fail.comp b/tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicMax-float-fail.comp
new file mode 100644
index 000000000..1b3ef577a
--- /dev/null
+++ b/tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicMax-float-fail.comp
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_compute_shader GL_INTEL_shader_atomic_float_minmax
+// [end config]
+//
+// The extension is supported by the implementation, but it is not enabled in
+// the shader.  This should fail to compile.
+
+#version 150
+#extension GL_ARB_compute_shader: require
+
+layout(local_size_x = 32) in;
+
+shared float a;
+
+void main()
+{
+	atomicCompSwap(a, 3.14159, 2.71828);
+}
diff --git a/tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicMin-float-fail.comp b/tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicMin-float-fail.comp
new file mode 100644
index 000000000..8f58bb520
--- /dev/null
+++ b/tests/spec/intel_shader_atomic_float_minmax/compiler/shared-atomicMin-float-fail.comp
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_compute_shader GL_INTEL_shader_atomic_float_minmax
+// [end config]
+//
+// The extension is supported by the implementation, but it is not enabled in
+// the shader.  This should fail to compile.
+
+#version 150
+#extension GL_ARB_compute_shader: require
+
+layout(local_size_x = 32) in;
+
+shared float a;
+
+void main()
+{
+	atomicMin(a, 1.7);
+}
diff --git a/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicCompareExchnage-float-fail.frag b/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicCompareExchnage-float-fail.frag
new file mode 100644
index 000000000..f6daad903
--- /dev/null
+++ b/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicCompareExchnage-float-fail.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_shader_storage_buffer_object GL_INTEL_shader_atomic_float_minmax
+// [end config]
+//
+// The extension is supported by the implementation, but it is not enabled in
+// the shader.  This should fail to compile.
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer bufblock {
+       float a;
+};
+
+out vec4 color;
+
+void main()
+{
+	color = vec4(atomicCompSwap(a, 3.14159, 2.71828));
+}
diff --git a/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicExchange-float-fail.frag b/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicExchange-float-fail.frag
new file mode 100644
index 000000000..a49a15961
--- /dev/null
+++ b/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicExchange-float-fail.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_shader_storage_buffer_object GL_NV_shader_atomic_float
+// [end config]
+//
+// The extension is supported by the implementation, but it is not enabled in
+// the shader.  This should fail to compile.
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer bufblock {
+       float a;
+};
+
+out vec4 color;
+
+void main()
+{
+	color = vec4(atomicExchange(a, 1.7));
+}
diff --git a/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicMax-float-fail.frag b/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicMax-float-fail.frag
new file mode 100644
index 000000000..0ca02a051
--- /dev/null
+++ b/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicMax-float-fail.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_shader_storage_buffer_object GL_INTEL_shader_atomic_float_minmax
+// [end config]
+//
+// The extension is supported by the implementation, but it is not enabled in
+// the shader.  This should fail to compile.
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer bufblock {
+       float a;
+};
+
+out vec4 color;
+
+void main()
+{
+	color = vec4(atomicMax(a, 3.14159));
+}
diff --git a/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicMin-float-fail.frag b/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicMin-float-fail.frag
new file mode 100644
index 000000000..3dac1f344
--- /dev/null
+++ b/tests/spec/intel_shader_atomic_float_minmax/compiler/ssbo-atomicMin-float-fail.frag
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_shader_storage_buffer_object GL_INTEL_shader_atomic_float_minmax
+// [end config]
+//
+// The extension is supported by the implementation, but it is not enabled in
+// the shader.  This should fail to compile.
+
+#version 150
+#extension GL_ARB_shader_storage_buffer_object: require
+
+buffer bufblock {
+       float a;
+};
+
+out vec4 color;
+
+void main()
+{
+	color = vec4(atomicMin(a, 3.14159));
+}
-- 
2.14.4



More information about the Piglit mailing list