[Piglit] [PATCH 7/7] arb_shader_storage_buffer_object: set KHR_no_error compatibility

Timothy Arceri tarceri at itsqueeze.com
Thu May 18 02:00:29 UTC 2017


---
 .../array-ssbo-binding.c                           |  1 +
 .../deletebuffers.c                                |  1 +
 .../getintegeri_v.c                                | 13 +++++---
 .../layout-std140-write-shader.c                   |  1 +
 .../layout-std430-write-shader.c                   |  1 +
 .../max-ssbo-size.c                                |  1 +
 .../arb_shader_storage_buffer_object/maxblocks.c   |  1 +
 .../spec/arb_shader_storage_buffer_object/minmax.c |  1 +
 .../program-interface-query.c                      |  1 +
 .../arb_shader_storage_buffer_object/rendering.c   |  1 +
 .../ssbo-binding.c                                 | 39 ++++++++++++----------
 11 files changed, 39 insertions(+), 22 deletions(-)

diff --git a/tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c b/tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c
index f3c7d15..d98795d 100644
--- a/tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c
+++ b/tests/spec/arb_shader_storage_buffer_object/array-ssbo-binding.c
@@ -29,20 +29,21 @@
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 	config.window_width = 100;
 	config.window_height = 100;
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 #define SSBO_SIZE 4
 
 static const char vs_pass_thru_text[] =
 	"#version 330\n"
 	"#extension GL_ARB_shader_storage_buffer_object : require\n"
 	"\n"
 	"layout(std140, binding=2) buffer ssbo {\n"
diff --git a/tests/spec/arb_shader_storage_buffer_object/deletebuffers.c b/tests/spec/arb_shader_storage_buffer_object/deletebuffers.c
index 947bca9..653228d 100644
--- a/tests/spec/arb_shader_storage_buffer_object/deletebuffers.c
+++ b/tests/spec/arb_shader_storage_buffer_object/deletebuffers.c
@@ -28,20 +28,21 @@
  * usual glBindBuffer() binding.
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 void
 piglit_init(int argc, char **argv)
 {
 	bool pass = true;
 	GLuint bo[2];
 	GLint binding;
 
diff --git a/tests/spec/arb_shader_storage_buffer_object/getintegeri_v.c b/tests/spec/arb_shader_storage_buffer_object/getintegeri_v.c
index 9e7617f..e304397 100644
--- a/tests/spec/arb_shader_storage_buffer_object/getintegeri_v.c
+++ b/tests/spec/arb_shader_storage_buffer_object/getintegeri_v.c
@@ -37,20 +37,21 @@
  * Based on ARB_uniform_buffer_object's getintegeri_v.c
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 static bool pass = true;
 
 static void
 test_index(int line, GLenum e, int index, int expected)
 {
 	GLint val;
 
@@ -98,24 +99,28 @@ piglit_init(int argc, char **argv)
 	test_range(__LINE__, 0, bo[0], 0, 1);
 	test_range(__LINE__, 1, bo[1], 2 * alignment, 3);
 
 	glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, bo[1]);
 	test_range(__LINE__, 1, bo[1], 0, 0);
 
 	glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, 0);
 	test_range(__LINE__, 0, 0, 0, 0);
 
 	/* Test the error condition. */
-	glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &max_bindings);
-	glGetIntegeri_v(GL_SHADER_STORAGE_BUFFER_BINDING, max_bindings, &junk);
-	if (!piglit_check_gl_error(GL_INVALID_VALUE))
-		pass = false;
+	if (!piglit_khr_no_error) {
+		glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS,
+			      &max_bindings);
+		glGetIntegeri_v(GL_SHADER_STORAGE_BUFFER_BINDING,
+				max_bindings, &junk);
+		if (!piglit_check_gl_error(GL_INVALID_VALUE))
+			pass = false;
+	}
 
 	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
 }
 
 enum piglit_result piglit_display(void)
 {
 	/* UNREACHED */
 	return PIGLIT_FAIL;
 }
 
diff --git a/tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c b/tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c
index 1eaba37..c67248e 100644
--- a/tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c
+++ b/tests/spec/arb_shader_storage_buffer_object/layout-std140-write-shader.c
@@ -28,20 +28,21 @@
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 	config.window_width = 100;
 	config.window_height = 100;
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 #define SSBO_SIZE 44
 
 static const char vs_pass_thru_text[] =
 	"#version 130\n"
 	"#extension GL_ARB_shader_storage_buffer_object : require\n"
         "#extension GL_ARB_uniform_buffer_object : require\n"
 	"\n"
diff --git a/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c b/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
index f821f69..70c87a1 100644
--- a/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
+++ b/tests/spec/arb_shader_storage_buffer_object/layout-std430-write-shader.c
@@ -36,20 +36,21 @@
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 	config.window_width = 100;
 	config.window_height = 100;
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 #define SSBO_SIZE 64
 
 static const char vs_pass_thru_text[] =
 	"#version 130\n"
 	"#extension GL_ARB_shader_storage_buffer_object : require\n"
         "#extension GL_ARB_uniform_buffer_object : require\n"
 	"\n"
diff --git a/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c b/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c
index da5d152..4af70aa 100644
--- a/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c
+++ b/tests/spec/arb_shader_storage_buffer_object/max-ssbo-size.c
@@ -29,20 +29,21 @@
  * Based on ARB_uniform_buffer_object's maxuniformblocksize.c
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 static enum {
 	VS,
 	VS_EXCEED,
 	FS,
 	FS_EXCEED,
 } mode;
 
diff --git a/tests/spec/arb_shader_storage_buffer_object/maxblocks.c b/tests/spec/arb_shader_storage_buffer_object/maxblocks.c
index 50f2f7c..d95e057 100644
--- a/tests/spec/arb_shader_storage_buffer_object/maxblocks.c
+++ b/tests/spec/arb_shader_storage_buffer_object/maxblocks.c
@@ -44,20 +44,21 @@
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.window_width = 800;
 	config.window_height = 200;
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 static char *
 get_shader(GLenum target, const char *block_prefix, int blocks)
 {
 	char *shader = NULL;
 	const char *vs_source =
 		"#version 130\n"
 		"#extension GL_ARB_shader_storage_buffer_object : enable\n"
diff --git a/tests/spec/arb_shader_storage_buffer_object/minmax.c b/tests/spec/arb_shader_storage_buffer_object/minmax.c
index 71d86fe..bb0385e 100644
--- a/tests/spec/arb_shader_storage_buffer_object/minmax.c
+++ b/tests/spec/arb_shader_storage_buffer_object/minmax.c
@@ -26,20 +26,21 @@
  * Test for the minimum and maximum values specified in the
  * ARB_shader_storage_buffer_object spec.
  */
 #include "piglit-util-gl.h"
 #include "minmax-test.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 40;
 	config.supports_gl_core_version = 40;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 enum piglit_result
 piglit_display(void)
 {
 	/* UNREACHED */
 	return PIGLIT_FAIL;
 }
 
diff --git a/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c b/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
index 68cbbff..131cd40 100644
--- a/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
+++ b/tests/spec/arb_shader_storage_buffer_object/program-interface-query.c
@@ -28,20 +28,21 @@
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 	config.window_width = 100;
 	config.window_height = 100;
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 #define SSBO_SIZE 4
 #define NUM_QUERIES 11
 
 static const char vs_pass_thru_text[] =
 	"#version 330\n"
 	"#extension GL_ARB_shader_storage_buffer_object : require\n"
 	"\n"
diff --git a/tests/spec/arb_shader_storage_buffer_object/rendering.c b/tests/spec/arb_shader_storage_buffer_object/rendering.c
index 52d5882..9a87ffe 100644
--- a/tests/spec/arb_shader_storage_buffer_object/rendering.c
+++ b/tests/spec/arb_shader_storage_buffer_object/rendering.c
@@ -29,20 +29,21 @@
  * Based on GL_ARB_uniform_buffer_object's rendering.c
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 static const char vert_shader_text[] =
 	"#version 130\n"
 	"#extension GL_ARB_shader_storage_buffer_object : require\n"
 	"\n"
 	"buffer ssbo_pos_size { vec2 pos; float size; };\n"
 	"buffer ssbo_rot {float rotation; };\n"
 	"in vec4 piglit_vertex;\n"
diff --git a/tests/spec/arb_shader_storage_buffer_object/ssbo-binding.c b/tests/spec/arb_shader_storage_buffer_object/ssbo-binding.c
index 062f71e..e4701d7 100644
--- a/tests/spec/arb_shader_storage_buffer_object/ssbo-binding.c
+++ b/tests/spec/arb_shader_storage_buffer_object/ssbo-binding.c
@@ -40,20 +40,21 @@
  *   variables in the shader storage block identified by <storageBlockIndex>."
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 32;
 	config.supports_gl_core_version = 32;
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 static GLuint prog;
 
 static const char frag_shader_text[] =
 	"#version 130\n"
 	"#extension GL_ARB_shader_storage_buffer_object : require\n"
 	"\n"
 	"buffer ssbo_a { vec4 a; };\n"
@@ -89,38 +90,40 @@ piglit_init(int argc, char **argv)
 	glShaderStorageBlockBinding(prog, index, 0);
 	if (!piglit_check_gl_error(0)) {
 		pass = false;
 	}
 	printf("Test binding value: %d\n", max_binding - 1);
 	glShaderStorageBlockBinding(prog, index, max_binding - 1);
 	if (!piglit_check_gl_error(0)) {
 		pass = false;
 	}
 
-	/* The error INVALID_VALUE is generated if <storageBlockIndex> is not
-	 * an active shader storage block index in <program>, or if
-	 * <storageBlockBinding> is greater than or equal to the value of
-	 * MAX_SHADER_STORAGE_BUFFER_BINDINGS.
-	 */
-	printf("Test binding value: %d\n", max_binding);
-	glShaderStorageBlockBinding(prog, index, max_binding);
-	if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
-		pass = false;
-	}
-
-	/* The error INVALID_VALUE is generated if <storageBlockIndex> is not
-	 * an active shader storage block index in <program>
-	 */
-	printf("Test invalid index: %d\n", index + 1);
-	glShaderStorageBlockBinding(prog, index + 1, 0);
-	if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
-		pass = false;
+	if (!piglit_khr_no_error) {
+		/* The error INVALID_VALUE is generated if <storageBlockIndex>
+		 * is not an active shader storage block index in <program>,
+		 * or if <storageBlockBinding> is greater than or equal to the
+		 * value of MAX_SHADER_STORAGE_BUFFER_BINDINGS.
+		 */
+		printf("Test binding value: %d\n", max_binding);
+		glShaderStorageBlockBinding(prog, index, max_binding);
+		if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
+			pass = false;
+		}
+
+		/* The error INVALID_VALUE is generated if <storageBlockIndex>
+		 * is not an active shader storage block index in <program>
+		 */
+		printf("Test invalid index: %d\n", index + 1);
+		glShaderStorageBlockBinding(prog, index + 1, 0);
+		if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
+			pass = false;
+		}
 	}
 
 	piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
 }
 
 enum piglit_result piglit_display(void)
 {
 	/* UNREACHED */
 	return PIGLIT_FAIL;
 }
-- 
2.9.4



More information about the Piglit mailing list