[Piglit] [PATCH 2/2] arb_direct_state_access: set KHR_no_error compatibility

Timothy Arceri tarceri at itsqueeze.com
Sat May 13 13:02:46 UTC 2017


We also use the piglit_khr_no_error global to add compatibility
to some tests that generate errors.
---
 .../arb_direct_state_access/bind-texture-unit.c    |  5 +++
 .../compressedtextureimage.c                       |  1 +
 .../arb_direct_state_access/copytexturesubimage.c  |  1 +
 .../create-programpipelines.c                      | 10 +++--
 .../spec/arb_direct_state_access/create-queries.c  | 18 +++++----
 .../arb_direct_state_access/create-renderbuffers.c | 10 +++--
 .../spec/arb_direct_state_access/create-samplers.c | 10 +++--
 .../spec/arb_direct_state_access/create-textures.c | 34 ++++++++--------
 .../create-transformfeedbacks.c                    | 10 +++--
 tests/spec/arb_direct_state_access/dsa-textures.c  |  1 +
 .../generatetexturemipmap.c                        |  1 +
 tests/spec/arb_direct_state_access/get-textures.c  |  5 +++
 .../getcompressedtextureimage.c                    | 20 ++++++----
 .../gettextureimage-formats.c                      |  1 +
 .../gettextureimage-luminance.c                    |  1 +
 .../gettextureimage-targets.c                      | 14 ++++---
 .../arb_direct_state_access/gettransformfeedback.c |  4 ++
 .../arb_direct_state_access/namedrenderbuffer.c    |  5 +++
 .../spec/arb_direct_state_access/texture-buffer.c  |  1 +
 .../spec/arb_direct_state_access/texture-errors.c  |  1 +
 .../spec/arb_direct_state_access/texture-params.c  |  1 +
 .../texture-storage-multisample.c                  | 12 ++++--
 .../spec/arb_direct_state_access/texture-storage.c | 45 +++++++++++++---------
 .../spec/arb_direct_state_access/texturesubimage.c |  1 +
 tests/spec/arb_direct_state_access/texunits.c      |  9 +++--
 .../transformfeedback-bufferbase.c                 |  5 +++
 .../transformfeedback-bufferrange.c                |  4 ++
 27 files changed, 152 insertions(+), 78 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/bind-texture-unit.c b/tests/spec/arb_direct_state_access/bind-texture-unit.c
index 1ccbd36..6081529 100644
--- a/tests/spec/arb_direct_state_access/bind-texture-unit.c
+++ b/tests/spec/arb_direct_state_access/bind-texture-unit.c
@@ -30,36 +30,40 @@
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 	config.supports_gl_compat_version = 20;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 }
 
 enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 	GLuint name = 3;
 	GLint nunits;
 
+	if (piglit_khr_no_error)
+		goto valid_call;
+
 	/* Throw some invalid inputs at BindTextureUnit. */
 
 
 	/* Section 8.1. of the OpenGL 4.5 Core Profile spec says:
 	 *
 	 *     "An INVALID_OPERATION error is generated by BindTextureUnit if
 	 *     texture is not zero or the name of an existing texture object."
 	 */
 
 	/* Texture name doesn't exist */
@@ -83,17 +87,18 @@ piglit_display(void)
 	 * not INVALID_OPERATION.
 	 */
 
 	/* Texture unit doesn't exist */
 	glDeleteTextures(1, &name);
 	glCreateTextures(GL_TEXTURE_2D, 1, &name);
 	glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &nunits);
 	glBindTextureUnit(nunits, name); /* Too High */
 	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
 
+valid_call:
 	/* Trivial, but should work. */
 	glBindTextureUnit(1, name);
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
 
diff --git a/tests/spec/arb_direct_state_access/compressedtextureimage.c b/tests/spec/arb_direct_state_access/compressedtextureimage.c
index 22a6a8f..2202ca6 100644
--- a/tests/spec/arb_direct_state_access/compressedtextureimage.c
+++ b/tests/spec/arb_direct_state_access/compressedtextureimage.c
@@ -39,20 +39,21 @@
 
 #define SIZE 128
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 10;
 
 	config.window_width = (SIZE*2)+60;
 	config.window_height = SIZE+20;
 	config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 struct format {
 	const char *name;
 	GLenum token;
 	const char **extension;
 };
 
 static struct format *format;
diff --git a/tests/spec/arb_direct_state_access/copytexturesubimage.c b/tests/spec/arb_direct_state_access/copytexturesubimage.c
index f168a34..2450a5b 100644
--- a/tests/spec/arb_direct_state_access/copytexturesubimage.c
+++ b/tests/spec/arb_direct_state_access/copytexturesubimage.c
@@ -25,20 +25,21 @@
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 	config.supports_gl_compat_version = 20;
 
 	config.window_width = 200;
 	config.window_height = 200;
 	config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 static const char vs_template[] =
 	"#version %s\n"
 	"#if __VERSION__ < 130\n"
 	"attribute vec4 piglit_vertex;\n"
 	"#else\n"
 	"in vec4 piglit_vertex;\n"
 	"#endif\n"
diff --git a/tests/spec/arb_direct_state_access/create-programpipelines.c b/tests/spec/arb_direct_state_access/create-programpipelines.c
index 2745af4..90e1588 100644
--- a/tests/spec/arb_direct_state_access/create-programpipelines.c
+++ b/tests/spec/arb_direct_state_access/create-programpipelines.c
@@ -41,44 +41,46 @@
 
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 	piglit_require_extension("GL_ARB_separate_shader_objects");
 }
 
 enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 	GLchar label[11];
 	GLsizei length;
 	GLuint ids[10];
 	GLint param;
 
 	/* Throw some invalid inputs at glCreateProgramPipelines */
-
-	/* n is negative */
-	glCreateProgramPipelines(-1, ids);
-	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
+	if (!piglit_khr_no_error) {
+		/* n is negative */
+		glCreateProgramPipelines(-1, ids);
+		PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
+	}
 
 	/* Throw some valid inputs at glCreateProgramPipelines. */
 
 	/* n is zero */
 	glCreateProgramPipelines(0, NULL);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n == 0");
 
 	/* n is more than 1 */
 	glCreateProgramPipelines(10, ids);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n > 1");
diff --git a/tests/spec/arb_direct_state_access/create-queries.c b/tests/spec/arb_direct_state_access/create-queries.c
index f66bd80..42448fe 100644
--- a/tests/spec/arb_direct_state_access/create-queries.c
+++ b/tests/spec/arb_direct_state_access/create-queries.c
@@ -48,46 +48,48 @@
 
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 	piglit_require_extension("GL_ARB_timer_query");
 }
 
 enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 	GLuint ids[10];
 	GLint param;
 
 	/* Throw some invalid inputs at glCreateQueries */
-
-	/* n is negative */
-	glCreateQueries(GL_SAMPLES_PASSED, -1, ids);
-	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
-
-	/* invalid target */
-	glCreateQueries(GL_RGBA, 0, ids);
-	PIGLIT_SUBTEST_ERROR(GL_INVALID_ENUM, pass, "invalid target");
+	if (!piglit_khr_no_error) {
+		/* n is negative */
+		glCreateQueries(GL_SAMPLES_PASSED, -1, ids);
+		PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
+
+		/* invalid target */
+		glCreateQueries(GL_RGBA, 0, ids);
+		PIGLIT_SUBTEST_ERROR(GL_INVALID_ENUM, pass, "invalid target");
+	}
 
 	/* Throw some valid inputs at glCreateQueries. */
 
 	/* n is zero */
 	glCreateQueries(GL_SAMPLES_PASSED, 0, NULL);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n == 0");
 
 	/* n is more than 1 */
 	glCreateQueries(GL_SAMPLES_PASSED, 10, ids);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n > 1");
diff --git a/tests/spec/arb_direct_state_access/create-renderbuffers.c b/tests/spec/arb_direct_state_access/create-renderbuffers.c
index 8a90c6b..5d92088 100644
--- a/tests/spec/arb_direct_state_access/create-renderbuffers.c
+++ b/tests/spec/arb_direct_state_access/create-renderbuffers.c
@@ -43,44 +43,46 @@
 
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 	piglit_require_extension("GL_ARB_framebuffer_object");
 }
 
 enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 	GLchar label[11];
 	GLsizei length;
 	GLuint ids[10];
 	GLint param;
 
 	/* Throw some invalid inputs at glCreateRenderbuffers */
-
-	/* n is negative */
-	glCreateRenderbuffers(-1, ids);
-	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
+	if (!piglit_khr_no_error) {
+		/* n is negative */
+		glCreateRenderbuffers(-1, ids);
+		PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
+	}
 
 	/* Throw some valid inputs at glCreateRenderbuffers. */
 
 	/* n is zero */
 	glCreateRenderbuffers(0, NULL);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n == 0");
 
 	/* n is more than 1 */
 	glCreateRenderbuffers(10, ids);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n > 1");
diff --git a/tests/spec/arb_direct_state_access/create-samplers.c b/tests/spec/arb_direct_state_access/create-samplers.c
index b4febe7..3b9242a 100644
--- a/tests/spec/arb_direct_state_access/create-samplers.c
+++ b/tests/spec/arb_direct_state_access/create-samplers.c
@@ -40,20 +40,21 @@
 
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 	piglit_require_extension("GL_ARB_sampler_objects");
 }
 
@@ -61,24 +62,25 @@ enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 	GLfloat bc[4], paramf;
 	GLchar label[11];
 	GLsizei length;
 	GLuint ids[10];
 	GLint param;
 
 	/* Throw some invalid inputs at glCreateSamplers */
-
-	/* n is negative */
-	glCreateSamplers(-1, ids);
-	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
+	if (!piglit_khr_no_error) {
+		/* n is negative */
+		glCreateSamplers(-1, ids);
+		PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
+	}
 
 	/* Throw some valid inputs at glCreateSamplers. */
 
 	/* n is zero */
 	glCreateSamplers(0, NULL);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n == 0");
 
 	/* n is more than 1 */
 	glCreateSamplers(10, ids);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n > 1");
diff --git a/tests/spec/arb_direct_state_access/create-textures.c b/tests/spec/arb_direct_state_access/create-textures.c
index 5479844..f9e1bd3 100644
--- a/tests/spec/arb_direct_state_access/create-textures.c
+++ b/tests/spec/arb_direct_state_access/create-textures.c
@@ -30,50 +30,52 @@
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 	config.supports_gl_compat_version = 20;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 }
 
 enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 	GLuint name;
 
 	/* Throw some invalid inputs at glCreateTextures. */
-
-	/* Invalid (not a target) */
-	glCreateTextures(GL_INVALID_ENUM, 1, &name);
-	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
-
-	/* Invalid (not supported) target */
-	glCreateTextures(GL_PROXY_TEXTURE_2D, 1, &name);
-	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
-
-	/* Invalid zero target */
-	glCreateTextures(0, 1, &name);
-	pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
-
-	/* n is negative */
-	glCreateTextures(GL_TEXTURE_2D, -1, &name);
-	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
+	if (!piglit_khr_no_error) {
+		/* Invalid (not a target) */
+		glCreateTextures(GL_INVALID_ENUM, 1, &name);
+		pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
+
+		/* Invalid (not supported) target */
+		glCreateTextures(GL_PROXY_TEXTURE_2D, 1, &name);
+		pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
+
+		/* Invalid zero target */
+		glCreateTextures(0, 1, &name);
+		pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
+
+		/* n is negative */
+		glCreateTextures(GL_TEXTURE_2D, -1, &name);
+		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
+	}
 
 	/* Trivial, but should work. */
 	glCreateTextures(GL_TEXTURE_2D, 1, &name);
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
 
diff --git a/tests/spec/arb_direct_state_access/create-transformfeedbacks.c b/tests/spec/arb_direct_state_access/create-transformfeedbacks.c
index bf8fcd8..3594964 100644
--- a/tests/spec/arb_direct_state_access/create-transformfeedbacks.c
+++ b/tests/spec/arb_direct_state_access/create-transformfeedbacks.c
@@ -37,41 +37,43 @@
 
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 	piglit_require_extension("GL_ARB_transform_feedback3");
 }
 
 enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 	GLuint ids[10];
 
 	/* Throw some invalid inputs at glCreateTransformFeedbacks. */
-
-	/* n is negative */
-	glCreateTransformFeedbacks(-1, ids);
-	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
+	if (!piglit_khr_no_error) {
+		/* n is negative */
+		glCreateTransformFeedbacks(-1, ids);
+		PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "n < 0");
+	}
 
 	/* Throw some valid inputs at glCreateTransformFeedbacks. */
 
 	/* n is zero */
 	glCreateTransformFeedbacks(0, NULL);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n == 0");
 
 	/* n is more than 1 */
 	glCreateTransformFeedbacks(10, ids);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "n > 1");
diff --git a/tests/spec/arb_direct_state_access/dsa-textures.c b/tests/spec/arb_direct_state_access/dsa-textures.c
index 401c29f..7de1b14 100644
--- a/tests/spec/arb_direct_state_access/dsa-textures.c
+++ b/tests/spec/arb_direct_state_access/dsa-textures.c
@@ -31,20 +31,21 @@
 
 #include <stdlib.h>
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 	config.supports_gl_compat_version = 20;
 
 	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 GLuint prog;
 
 GLfloat*
 random_image_data(void)
 {
 	int i;
 	GLfloat *img = malloc(4*piglit_width*piglit_height*sizeof(GLfloat));
diff --git a/tests/spec/arb_direct_state_access/generatetexturemipmap.c b/tests/spec/arb_direct_state_access/generatetexturemipmap.c
index d54d8fa..9a73911 100644
--- a/tests/spec/arb_direct_state_access/generatetexturemipmap.c
+++ b/tests/spec/arb_direct_state_access/generatetexturemipmap.c
@@ -39,20 +39,21 @@
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 	config.supports_gl_compat_version = 20;
 
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
 		PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 /* 2x2 block of red pixels. */
 static const float red[2 * 2 * 4] = {
 	1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0,
 	1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0
 };
 
 /* 4x4 block of green pixels. */
diff --git a/tests/spec/arb_direct_state_access/get-textures.c b/tests/spec/arb_direct_state_access/get-textures.c
index 98d26fc..8b33720 100644
--- a/tests/spec/arb_direct_state_access/get-textures.c
+++ b/tests/spec/arb_direct_state_access/get-textures.c
@@ -29,38 +29,42 @@
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 20;
 	config.supports_gl_core_version = 31;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 	piglit_require_extension("GL_ARB_texture_storage");
 }
 
 enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 	GLuint name;
 	GLubyte *data = malloc(50 * 50 * 6 * 4 * sizeof(GLubyte));
 	GLubyte *image = malloc(50 * 50 * 4 * sizeof(GLubyte));
 
+	if (piglit_khr_no_error)
+		goto valid_call;
+
 	/* Throw some invalid inputs at glGetTextureImage. */
 
 	/* Non-gen-ed name */
 	glGetTextureImage(3, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, data);
 	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
 
 	/* Unsupported target. */
 	glGenTextures(1, &name);
 	glBindTexture(GL_TEXTURE_CUBE_MAP_POSITIVE_X, name);
 	glGetTextureImage(name, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, data);
@@ -97,20 +101,21 @@ piglit_display(void)
 		     GL_RGBA8, 50, 50, 0, GL_RGBA, GL_UNSIGNED_BYTE, image);
 	/* Note: GL_TEXTURE_CUBE_MAP_NEGATIVE_Y not set */
 	glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0,
 		     GL_RGBA8, 50, 50, 0, GL_RGBA, GL_UNSIGNED_BYTE, image);
 	glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0,
 		     GL_RGBA8, 50, 50, 0, GL_RGBA, GL_UNSIGNED_BYTE, image);
 	glGetTextureImage(name, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, data);
 	pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
 	glDeleteTextures(1, &name);
 
+valid_call:
 	/* Trivial, but should work. */
 	glCreateTextures(GL_TEXTURE_CUBE_MAP, 1, &name);
 	glTextureStorage2D(name, 1, GL_RGBA8, 50, 50);
 	glGetTextureImage(name, 0, GL_RGBA, GL_UNSIGNED_BYTE,
 			  50 * 50 * 6 * 4, data);
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
 
diff --git a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
index 28e4027..978b78c 100644
--- a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
+++ b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
@@ -29,20 +29,21 @@
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.window_width = 216;
 	config.supports_gl_compat_version = 20;
 	config.supports_gl_core_version = 31;
 
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA |
 			       PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 #define IMAGE_WIDTH 32
 #define IMAGE_HEIGHT 32
 #define IMAGE_SIZE (IMAGE_WIDTH * IMAGE_HEIGHT * 4)
 #define DISPLAY_GAP 4
 
 static void
 show_image(GLubyte *data, int num_layers, const char *title)
@@ -413,23 +414,26 @@ piglit_display(void)
 			result = PIGLIT_FAIL;
 	}
 
 	/* 1D targets can't be compressed in Mesa right now, but here is a
 	 * trivial test for the entry point.
 	 */
 	glCompressedTextureSubImage1D(250, 0, 0, 60,
 				      internalformat, 60*4*8,
 				      NULL);
 
-	if (!piglit_check_gl_error(GL_INVALID_OPERATION)) /* Bad texture */
-		subtest = PIGLIT_FAIL;
-	else
-		subtest = PIGLIT_PASS;
-	piglit_report_subtest_result(subtest, "Compressed Texture"
-				     " Sub Image 1D");
-	if (subtest == PIGLIT_FAIL)
-		result = PIGLIT_FAIL;
+	if (!piglit_khr_no_error) {
+		 /* Bad texture */
+		if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+			subtest = PIGLIT_FAIL;
+		else
+			subtest = PIGLIT_PASS;
+		piglit_report_subtest_result(subtest, "Compressed Texture"
+					     " Sub Image 1D");
+		if (subtest == PIGLIT_FAIL)
+			result = PIGLIT_FAIL;
+	}
 
 	free(data);
 
 	return result;
 }
diff --git a/tests/spec/arb_direct_state_access/gettextureimage-formats.c b/tests/spec/arb_direct_state_access/gettextureimage-formats.c
index 84febe9..dfc8ff4 100644
--- a/tests/spec/arb_direct_state_access/gettextureimage-formats.c
+++ b/tests/spec/arb_direct_state_access/gettextureimage-formats.c
@@ -34,20 +34,21 @@
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 20;
 	config.supports_gl_core_version = 31;
 
 	config.window_width = 600;
 	config.window_height = 200;
 	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 const char *TestName = "gettextureimage-formats";
 
 static const GLfloat clearColor[4] = { 0.4, 0.4, 0.4, 0.0 };
 static GLuint texture_id;
 static GLuint prog;
 static bool init_by_rendering;
 
diff --git a/tests/spec/arb_direct_state_access/gettextureimage-luminance.c b/tests/spec/arb_direct_state_access/gettextureimage-luminance.c
index fa6813f..0b7f649 100644
--- a/tests/spec/arb_direct_state_access/gettextureimage-luminance.c
+++ b/tests/spec/arb_direct_state_access/gettextureimage-luminance.c
@@ -27,20 +27,21 @@
  * Test glGetTexImage for luminance formats.
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 10;
 
 	config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 static const char *TestName = "gettextureimage-luminance";
 static float tolerance = 3.0 / 255.0;
 
 
 static bool
 rgba_equal(const float *c1, const float *c2)
 {
diff --git a/tests/spec/arb_direct_state_access/gettextureimage-targets.c b/tests/spec/arb_direct_state_access/gettextureimage-targets.c
index 9fbe3c8..a2f12a5 100644
--- a/tests/spec/arb_direct_state_access/gettextureimage-targets.c
+++ b/tests/spec/arb_direct_state_access/gettextureimage-targets.c
@@ -28,20 +28,21 @@
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 20;
 	config.supports_gl_core_version = 31;
 
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA |
 			       PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 #define IMAGE_WIDTH 32
 #define IMAGE_HEIGHT 32
 #define IMAGE_SIZE (IMAGE_WIDTH * IMAGE_HEIGHT * 4)
 
 static void
 init_layer_data(GLubyte *layer_data, int num_layers)
 {
@@ -123,25 +124,28 @@ getTexImage(bool doPBO, GLenum target, GLubyte data[][IMAGE_SIZE],
 				   IMAGE_HEIGHT);
 		glTextureSubImage2D(name, 0, 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT,
 				    GL_RGBA, GL_UNSIGNED_BYTE, data);
 		layer_size = IMAGE_SIZE;
 		break;
 
 	case GL_TEXTURE_CUBE_MAP:
 		num_faces = 6;
 		glCreateTextures(target, 1, &name);
 		/* This is invalid. You must use 2D storage call for cube. */
-		glTextureStorage3D(name, 1, internalformat,
-				   IMAGE_WIDTH, IMAGE_HEIGHT, num_faces);
-		pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
-		glTextureStorage2D(name, 1, internalformat,
-				   IMAGE_WIDTH, IMAGE_HEIGHT);
+		if (!piglit_khr_no_error) {
+			glTextureStorage3D(name, 1, internalformat,
+					   IMAGE_WIDTH, IMAGE_HEIGHT,
+					   num_faces);
+			pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
+			glTextureStorage2D(name, 1, internalformat,
+					   IMAGE_WIDTH, IMAGE_HEIGHT);
+		}
 		/* This is legal. */
 		glTextureSubImage3D(name, 0, 0, 0, 0, IMAGE_WIDTH,
 				    IMAGE_HEIGHT, num_faces, GL_RGBA,
 				    GL_UNSIGNED_BYTE, data);
 		layer_size = IMAGE_SIZE;
 		break;
 
 	case GL_TEXTURE_1D_ARRAY:
 		num_layers = 7;
 		glCreateTextures(target, 1, &name);
diff --git a/tests/spec/arb_direct_state_access/gettransformfeedback.c b/tests/spec/arb_direct_state_access/gettransformfeedback.c
index f250a5a..879a65c 100644
--- a/tests/spec/arb_direct_state_access/gettransformfeedback.c
+++ b/tests/spec/arb_direct_state_access/gettransformfeedback.c
@@ -54,20 +54,21 @@
  *  GetTransformFeedbacki64 v if index is greater than or equal to the number
  *  of binding points for transform feedback, as described in section 6.7.1."
  */
 
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 	config.supports_gl_core_version = 31;
 	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 GLuint xfb_buf[3], input_buf, vao;
 static bool pass = true;
 
 static const char *vstext = {
 	"#version 140\n"
 	"in float valIn;"
@@ -140,20 +141,23 @@ check_binding_state(const char *test_name)
 				 i);
 	}
 }
 
 void
 check_invalid_queries()
 {
 	GLint64 param64;
 	GLint param;
 
+	if (piglit_khr_no_error)
+		return;
+
 	glGetTransformFeedbackiv(0, GL_TRANSFORM_FEEDBACK_BINDING, &param);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_ENUM, pass,
 		"glGetTransformFeedbackiv: fetch invalid attribute");
 
 	glGetTransformFeedbacki_v(0, GL_TRANSFORM_FEEDBACK_ACTIVE, 0, &param);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_ENUM, pass,
 		"glGetTransformFeedbacki_v: fetch invalid attribute");
 
 	glGetTransformFeedbacki64_v(0, GL_TRANSFORM_FEEDBACK_BUFFER_BINDING,
 				    0, &param64);
diff --git a/tests/spec/arb_direct_state_access/namedrenderbuffer.c b/tests/spec/arb_direct_state_access/namedrenderbuffer.c
index 7a3f4c8..56438db 100644
--- a/tests/spec/arb_direct_state_access/namedrenderbuffer.c
+++ b/tests/spec/arb_direct_state_access/namedrenderbuffer.c
@@ -78,20 +78,21 @@
 
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 	piglit_require_extension("GL_ARB_framebuffer_object");
 }
 
@@ -99,20 +100,23 @@ enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 	GLuint ids[10], genID;
 	GLint size, width;
 
 	/* Test retrieving information about an unexisting buffer */
 	glCreateRenderbuffers(10, ids);
 	piglit_check_gl_error(GL_NO_ERROR);
 
+	if (piglit_khr_no_error)
+		goto valid_calls;
+
 	/* Check some various cases of errors */
 	glNamedRenderbufferStorageMultisample(1337, 0, GL_RGBA, 1024, 768);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_OPERATION, pass, "set unexisting "
 			     "renderbuffer");
 
 	glGetNamedRenderbufferParameteriv(1337, GL_RENDERBUFFER_WIDTH, &width);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_OPERATION, pass, "get unexisting "
 			     "renderbuffer");
 
 	glGetNamedRenderbufferParameteriv(ids[0], GL_TRUE, &width);
@@ -153,20 +157,21 @@ piglit_display(void)
 
 	glNamedRenderbufferStorageMultisample(ids[0], size + 1, GL_RGBA, 1024,
 					      768);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_OPERATION, pass,
 			     "samples == MAX_SAMPLES(%d) + 1", size);
 
 	/* Misc tests */
 	glNamedRenderbufferStorageMultisample(ids[0], 0, GL_TRUE, 1024, 768);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_ENUM, pass, "invalid internalformat");
 
+valid_calls:
 	/* bind one buffer so as we can check we never change its state */
 	glBindRenderbuffer(GL_RENDERBUFFER, ids[1]);
 	piglit_check_gl_error(GL_NO_ERROR);
 
 	/* Test to change the parameters of an unbound renderbuffer */
 	glNamedRenderbufferStorageMultisample(ids[0], 0, GL_RGBA, 1024,
 					      768);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "update unbound buffer");
 
 	glGetNamedRenderbufferParameteriv(ids[0], GL_RENDERBUFFER_WIDTH,
diff --git a/tests/spec/arb_direct_state_access/texture-buffer.c b/tests/spec/arb_direct_state_access/texture-buffer.c
index 1caed8e..39cafc8 100644
--- a/tests/spec/arb_direct_state_access/texture-buffer.c
+++ b/tests/spec/arb_direct_state_access/texture-buffer.c
@@ -30,20 +30,21 @@
  * Adapted to test glTextureBuffer by Laura Ekstrand (December 2014).
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 	config.supports_gl_core_version = 31;
 
 	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 vs_source[] =
 	"#version 140\n"
 	"in vec4 piglit_vertex;\n"
 	"void main()\n"
 	"{\n"
 	"	gl_Position = piglit_vertex;\n"
 	"}\n"
 	;
diff --git a/tests/spec/arb_direct_state_access/texture-errors.c b/tests/spec/arb_direct_state_access/texture-errors.c
index fa91d23..7eca6f6 100644
--- a/tests/spec/arb_direct_state_access/texture-errors.c
+++ b/tests/spec/arb_direct_state_access/texture-errors.c
@@ -30,20 +30,21 @@
  * Tests gl*Texture* functions for error reporting.
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_compat_version = 20;
 	config.supports_gl_core_version = 31;
 	config.window_visual = PIGLIT_GL_VISUAL_RGB;
+	config.khr_no_error_support = PIGLIT_HAS_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 /** Test texture size errors and subtexture position errors */
 static bool
 test_pos_and_sizes(void)
 {
 	bool pass = true;
 	GLuint name;
 
diff --git a/tests/spec/arb_direct_state_access/texture-params.c b/tests/spec/arb_direct_state_access/texture-params.c
index c7eeb85..22f33dd 100644
--- a/tests/spec/arb_direct_state_access/texture-params.c
+++ b/tests/spec/arb_direct_state_access/texture-params.c
@@ -34,20 +34,21 @@
 /* a close approximation: */
 #define FLOAT_TO_INT(X)     ( (GLint) (2147483647.0 * (X)) )
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 	config.supports_gl_compat_version = 20;
 
 	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)
 {
 	piglit_require_extension("GL_ARB_direct_state_access");
 }
 
 enum piglit_result
diff --git a/tests/spec/arb_direct_state_access/texture-storage-multisample.c b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
index 3486a21..b6fff44 100644
--- a/tests/spec/arb_direct_state_access/texture-storage-multisample.c
+++ b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
@@ -31,20 +31,21 @@
  */
 
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA |
 			       PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 /* This has the modelview matrix built in. */
 static const char multisample_texture_vs_source[] =
 	"#version 140\n"
 	"in vec2 piglit_vertex;\n"
 	"out vec2 tex_coords;\n"
 	"void main()\n"
 	"{\n"
@@ -441,19 +442,22 @@ piglit_init(int argc, char **argv)
 	piglit_require_extension("GL_ARB_texture_storage_multisample");
 	glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
 	printf("Max samples = %d\n", max_samples);
 }
 
 enum piglit_result
 piglit_display(void)
 {
 	bool pass = true;
 
-	pass = check_non_generated_texture() && pass;
-	pass = check_immutable() && pass;
-	pass = check_unsized_format() && pass;
-	pass = check_improper_effective_target() && pass;
+	if (!piglit_khr_no_error) {
+		pass = check_non_generated_texture() && pass;
+		pass = check_immutable() && pass;
+		pass = check_unsized_format() && pass;
+		pass = check_improper_effective_target() && pass;
+	}
+
 	pass = trivial_but_should_work() && pass;
 	pass = draw_multisampled() && pass;
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
diff --git a/tests/spec/arb_direct_state_access/texture-storage.c b/tests/spec/arb_direct_state_access/texture-storage.c
index 42fec48..ee1342e 100644
--- a/tests/spec/arb_direct_state_access/texture-storage.c
+++ b/tests/spec/arb_direct_state_access/texture-storage.c
@@ -30,20 +30,21 @@
 
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 	config.supports_gl_compat_version = 20;
 
 	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 const char *TestName = "texture-storage";
 
 static GLubyte Colors[][4] = {
 	{255,	0,	0, 255},
 	{  0, 255,	0, 255},
 	{  0,	0, 255, 255},
 	{  0, 255, 255, 255},
@@ -111,21 +112,21 @@ test_one_level_errors(GLenum target)
 	 *
 	 *     "Using any of the following commands with the same texture will
 	 *     result in the error INVALID_OPERATION being generated, even if
 	 *     it does not affect the dimensions or format:
 	 *
 	 *         - TexImage*
 	 *         - CompressedTexImage*
 	 *         - CopyTexImage*
 	 *         - TexStorage*"
 	 */
-	if (target == GL_TEXTURE_2D) {
+	if (!piglit_khr_no_error && target == GL_TEXTURE_2D) {
 		glTexImage2D(target, 0, GL_RGBA, width, height, 0,
 			     GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 		if (glGetError() != GL_INVALID_OPERATION) {
 			printf("%s: glTexImage2D failed to generate error\n",
 			       TestName);
 			return false;
 		}
 
 		glTextureStorage2D(tex, 1, GL_RGBA8, width, height);
 		if (glGetError() != GL_INVALID_OPERATION) {
@@ -241,58 +242,62 @@ test_cube_texture(void)
 	bool pass = true;
 
 	/* Test valid cube dimensions */
 	glCreateTextures(target, 1, &tex);
 	glBindTextureUnit(0, tex);
 	glTextureStorage2D(tex, 1, GL_RGBA8, width, height);
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 	glDeleteTextures(1, &tex);
 
 	/* Test invalid cube dimensions */
-	glCreateTextures(target, 1, &tex);
-	glBindTextureUnit(0, tex);
-	glTextureStorage2D(tex, 1, GL_RGBA8, width, height+2);
-	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
-	glDeleteTextures(1, &tex);
+	if (!piglit_khr_no_error) {
+		glCreateTextures(target, 1, &tex);
+		glBindTextureUnit(0, tex);
+		glTextureStorage2D(tex, 1, GL_RGBA8, width, height+2);
+		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
+		glDeleteTextures(1, &tex);
+	}
 
 	return pass;
 }
 
 
 static bool
 test_cube_array_texture(void)
 {
 	const GLint width = 16, height = 16;
 	const GLenum target = GL_TEXTURE_CUBE_MAP_ARRAY;
 	GLuint tex;
 	bool pass = true;
 
 	/* Test valid cube array dimensions */
 	glCreateTextures(target, 1, &tex);
 	glBindTextureUnit(0, tex);
 	glTextureStorage3D(tex, 1, GL_RGBA8, width, height, 12);
 	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 	glDeleteTextures(1, &tex);
 
-	/* Test invalid cube array width, height dimensions */
-	glCreateTextures(target, 1, &tex);
-	glBindTextureUnit(0, tex);
-	glTextureStorage3D(tex, 1, GL_RGBA8, width, height+3, 12);
-	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
-	glDeleteTextures(1, &tex);
+	if (!piglit_khr_no_error) {
+		/* Test invalid cube array width, height dimensions */
+		glCreateTextures(target, 1, &tex);
+		glBindTextureUnit(0, tex);
+		glTextureStorage3D(tex, 1, GL_RGBA8, width, height+3, 12);
+		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
+		glDeleteTextures(1, &tex);
 
-	/* Test invalid cube array depth */
-	glCreateTextures(target, 1, &tex);
-	glBindTextureUnit(0, tex);
-	glTextureStorage3D(tex, 1, GL_RGBA8, width, height, 12+2);
-	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
-	glDeleteTextures(1, &tex);
+		/* Test invalid cube array depth */
+		glCreateTextures(target, 1, &tex);
+		glBindTextureUnit(0, tex);
+		glTextureStorage3D(tex, 1, GL_RGBA8, width, height, 12+2);
+		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
+		glDeleteTextures(1, &tex);
+	}
 
 	return pass;
 }
 
 
 /**
  * Create a single-color image.
  */
 static GLubyte *
 create_image(GLint w, GLint h, const GLubyte color[4])
@@ -501,20 +506,24 @@ test_internal_formats(void)
 			printf("%s: internal format %s should be legal"
 			       " but raised an error.",
 			       TestName,
 			       piglit_get_gl_enum_name(legal_formats[i]));
 			pass = false;
 		}
 
 		glDeleteTextures(1, &tex);
 	}
 
+	/* Return early if KHR_no_error is enabled */
+	if (piglit_khr_no_error)
+		return pass;
+
 	for (i = 0; i < ARRAY_SIZE(illegal_formats); i++) {
 		glCreateTextures(target, 1, &tex);
 		glBindTextureUnit(0, tex);
 
 		glTextureStorage2D(tex, 1, illegal_formats[i], 32, 32);
 
 		if (!piglit_check_gl_error(GL_INVALID_ENUM)) {
 			printf("%s: internal format %s should be illegal"
 			       " but didn't raised an error.",
 			       TestName,
diff --git a/tests/spec/arb_direct_state_access/texturesubimage.c b/tests/spec/arb_direct_state_access/texturesubimage.c
index f21d9e4..4db246a 100644
--- a/tests/spec/arb_direct_state_access/texturesubimage.c
+++ b/tests/spec/arb_direct_state_access/texturesubimage.c
@@ -35,20 +35,21 @@
 #include <string.h>
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 	config.supports_gl_compat_version = 20;
 
 	config.window_visual = PIGLIT_GL_VISUAL_RGBA |
 			       PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 GLubyte*
 random_image_data(int width, int height, int depth)
 {
 	int i;
 	GLubyte *img = malloc(4 * width * height * depth * sizeof(GLubyte));
 	for (i = 0; i < 4 * width * height * depth; ++i) {
 		img[i] = rand() % 256;
diff --git a/tests/spec/arb_direct_state_access/texunits.c b/tests/spec/arb_direct_state_access/texunits.c
index 0d77efa..9913cbf 100644
--- a/tests/spec/arb_direct_state_access/texunits.c
+++ b/tests/spec/arb_direct_state_access/texunits.c
@@ -27,20 +27,21 @@
  * texture coord units, image units, combined units, etc.
  */
 #include "piglit-util-gl.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
 	config.supports_gl_core_version = 31;
 	config.supports_gl_compat_version = 20;
 
 	config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+	config.khr_no_error_support = PIGLIT_NO_ERRORS;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 #define MAX_UNITS 256
 
 /** random number for checking state */
 static GLfloat Random[MAX_UNITS][4];
 
 static GLint MaxTextureCoordUnits;
 static GLint MaxTextureVertexUnits;
@@ -115,23 +116,25 @@ test_texture_params(void)
       return false;
    }
 
    maxUnit = MAX2(MaxTextureCombinedUnits, MaxTextureCoordUnits);
 
    /* This should generate an error.  The GL_ARB_direct_state_access extension
     * isn't explicit about which error should be generated, but the typical
     * error for a out-of-range int/uint is GL_INVALID_VALUE.  That's what
     * NVIDIA's driver does.
     */
-   glBindTextureUnit(maxUnit, tex[0]);
-   if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
-      return false;
+   if (!piglit_khr_no_error) {
+      glBindTextureUnit(maxUnit, tex[0]);
+      if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
+         return false;
+      }
    }
 
    return true;
 }
 
 
 static void
 report_info(void)
 {
    printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
diff --git a/tests/spec/arb_direct_state_access/transformfeedback-bufferbase.c b/tests/spec/arb_direct_state_access/transformfeedback-bufferbase.c
index f270501..97c0d1d 100644
--- a/tests/spec/arb_direct_state_access/transformfeedback-bufferbase.c
+++ b/tests/spec/arb_direct_state_access/transformfeedback-bufferbase.c
@@ -58,20 +58,21 @@
  * parameters for transform feedback array bindings, as described in
  *  section 6.7.1."
  */
 
 #include "piglit-util-gl.h"
 #include "dsa-utils.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 	config.supports_gl_core_version = 31;
 	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 GLuint xfb_buf[3], input_buf, vao;
 static const int xfb_buf_size = 500;
 
 static const char *vstext = {
 	"#version 140\n"
 	"in float valIn;"
@@ -142,39 +143,43 @@ piglit_display(void)
 	/* init the transform feedback buffers */
 	glGenBuffers(3, xfb_buf);
 	glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, xfb_buf[2]);
 	piglit_check_gl_error(GL_NO_ERROR);
 
 	/* Fetch the number of bind points */
 	glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, &max_bind_points);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass, "fetch maximum number of bind "
 			     "points");
 
+	if (piglit_khr_no_error)
+		goto valid_calls;
+
 	/* bind a non-existing transform feedback BO */
 	glTransformFeedbackBufferBase(1337, 0, 0);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_OPERATION, pass,
 			"bind non-existing transform feedback BO");
 
 	/* bind a non-existing output BO */
 	glTransformFeedbackBufferBase(0, 0, 1337);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "bind a non-existing "
 			     "output BO");
 
 	/* bind to a negative index */
 	glTransformFeedbackBufferBase(0, -1, xfb_buf[2]);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "bind negative index");
 
 	/* bind to an index == max */
 	glTransformFeedbackBufferBase(0, max_bind_points, xfb_buf[2]);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass, "bind to index == "
 			     "max_bind_points (%i)", max_bind_points);
 
+valid_calls:
 	/* Set up the transform feedback buffer */
 	for (i = 0; i < 2; i++) {
 		glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, xfb_buf[i]);
 		glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER,
 				 xfb_buf_size, NULL, GL_STREAM_READ);
 		glTransformFeedbackBufferBase(0, i, xfb_buf[i]);
 		piglit_check_gl_error(GL_NO_ERROR);
 	}
 
 	/* Set up the query that checks the # of primitives handled */
diff --git a/tests/spec/arb_direct_state_access/transformfeedback-bufferrange.c b/tests/spec/arb_direct_state_access/transformfeedback-bufferrange.c
index b2c9613..9ec3fb5 100644
--- a/tests/spec/arb_direct_state_access/transformfeedback-bufferrange.c
+++ b/tests/spec/arb_direct_state_access/transformfeedback-bufferrange.c
@@ -144,20 +144,23 @@ piglit_display(void)
 	/* init the transform feedback buffers */
 	glGenBuffers(3, xfb_buf);
 	glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, xfb_buf[2]);
 	piglit_check_gl_error(GL_NO_ERROR);
 
 	/* Fetch the number of bind points */
 	glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, &max_bind_points);
 	PIGLIT_SUBTEST_ERROR(GL_NO_ERROR, pass,
 			     "fetch maximum number of bind points");
 
+	if (piglit_khr_no_error)
+		goto valid_calls;
+
 	/* bind a non-existing transform feedback BO */
 	glTransformFeedbackBufferRange(1337, 0, 0, 0, 4096);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_OPERATION, pass,
 			     "bind non-existing transform feedback BO");
 
 	/* bind a non-existing output BO */
 	glTransformFeedbackBufferRange(0, 0, 1337, 0, 4096);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass,
 			     "bind a non-existing output BO");
 
@@ -174,20 +177,21 @@ piglit_display(void)
 	/* bind at a non-aligned offset */
 	glTransformFeedbackBufferRange(0, 0, xfb_buf[2], 3, 4096);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass,
 			     "bind at a non-aligned offset");
 
 	/* bind with a non-aligned size */
 	glTransformFeedbackBufferRange(0, 0, xfb_buf[2], 0, 4095);
 	PIGLIT_SUBTEST_ERROR(GL_INVALID_VALUE, pass,
 			     "bind with a non-aligned size");
 
+valid_calls:
 	/* Set up the transform feedback buffer */
 	for (i = 0; i < 2; i++) {
 		glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, xfb_buf[i]);
 		glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER,
 				 xfb_buf_size, NULL, GL_STREAM_READ);
 		glTransformFeedbackBufferRange(0, i, xfb_buf[i], offset,
 					       xfb_buf_size);
 		piglit_check_gl_error(GL_NO_ERROR);
 	}
 
-- 
2.9.3



More information about the Piglit mailing list