[Piglit] [PATCH 3/3] arb_viewport_array: set KHR_no_error compatibility

Timothy Arceri tarceri at itsqueeze.com
Sun Jun 25 02:23:23 UTC 2017


Thanks! Series:

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

On 24/06/17 00:23, Samuel Pitoiset wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
>   tests/spec/arb_viewport_array/bounds.c             | 53 ++++++++++++----------
>   tests/spec/arb_viewport_array/clear.c              |  1 +
>   .../spec/arb_viewport_array/depth_range_indices.c  | 45 +++++++++---------
>   tests/spec/arb_viewport_array/minmax.c             |  1 +
>   tests/spec/arb_viewport_array/queries.c            | 31 +++++++------
>   tests/spec/arb_viewport_array/render_depthrange.c  |  1 +
>   tests/spec/arb_viewport_array/render_scissor.c     |  1 +
>   tests/spec/arb_viewport_array/render_viewport.c    |  1 +
>   tests/spec/arb_viewport_array/render_viewport_2.c  |  1 +
>   tests/spec/arb_viewport_array/scissor_check.c      |  1 +
>   tests/spec/arb_viewport_array/scissor_indices.c    | 28 +++++++-----
>   tests/spec/arb_viewport_array/viewport_indices.c   | 52 +++++++++++----------
>   12 files changed, 122 insertions(+), 94 deletions(-)
> 
> diff --git a/tests/spec/arb_viewport_array/bounds.c b/tests/spec/arb_viewport_array/bounds.c
> index 9a8e8697d..8d43e9f97 100644
> --- a/tests/spec/arb_viewport_array/bounds.c
> +++ b/tests/spec/arb_viewport_array/bounds.c
> @@ -37,6 +37,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> @@ -116,18 +117,20 @@ viewport_bounds(GLint maxVP)
>   
>   	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
>   
> -	/* negative width, height gives gl error */
> -	vp[2] = -10.3;
> -	vp[3] = 0.0;
> -	for (i = 0; i < 2; i++) {
> -		glViewportArrayv(0, 1, vp);
> -		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -		glViewportIndexedf(1, vp[0], vp[1], vp[2], vp[3]);
> -		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -		glViewportIndexedfv(2, vp);
> -		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -		vp[2] = 5.0;
> -		vp[3] = -12345.7;
> +	if (!piglit_khr_no_error) {
> +		/* negative width, height gives gl error */
> +		vp[2] = -10.3;
> +		vp[3] = 0.0;
> +		for (i = 0; i < 2; i++) {
> +			glViewportArrayv(0, 1, vp);
> +			pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> +			glViewportIndexedf(1, vp[0], vp[1], vp[2], vp[3]);
> +			pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> +			glViewportIndexedfv(2, vp);
> +			pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> +			vp[2] = 5.0;
> +			vp[3] = -12345.7;
> +		}
>   	}
>   
>   	return pass;
> @@ -232,18 +235,20 @@ scissor_bounds(GLint maxVP)
>   	glScissorIndexed(0, 0x8000, 0x80000000, 0x7ffff, 0x7fffffff);
>   	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
>   
> -	/* negative width, height gives gl error */
> -	sc[2] = -10;
> -	sc[3] = 0;
> -	for (i = 0; i < 2; i++) {
> -		glScissorArrayv(0, 1, sc);
> -		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -		glScissorIndexed(1, sc[0], sc[1], sc[2], sc[3]);
> -		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -		glScissorIndexedv(2, sc);
> -		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -		sc[2] = 5;
> -		sc[3] = -12345;
> +	if (!piglit_khr_no_error) {
> +		/* negative width, height gives gl error */
> +		sc[2] = -10;
> +		sc[3] = 0;
> +		for (i = 0; i < 2; i++) {
> +			glScissorArrayv(0, 1, sc);
> +			pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> +			glScissorIndexed(1, sc[0], sc[1], sc[2], sc[3]);
> +			pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> +			glScissorIndexedv(2, sc);
> +			pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> +			sc[2] = 5;
> +			sc[3] = -12345;
> +		}
>   	}
>   
>   	return pass;
> diff --git a/tests/spec/arb_viewport_array/clear.c b/tests/spec/arb_viewport_array/clear.c
> index aee9bcab9..3d6200cc6 100644
> --- a/tests/spec/arb_viewport_array/clear.c
> +++ b/tests/spec/arb_viewport_array/clear.c
> @@ -35,6 +35,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_version = 31;
>   
>   	config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
> +	config.khr_no_error_support = PIGLIT_NO_ERRORS;
>   
>   PIGLIT_GL_TEST_CONFIG_END
>   
> diff --git a/tests/spec/arb_viewport_array/depth_range_indices.c b/tests/spec/arb_viewport_array/depth_range_indices.c
> index 806b24cad..a0f58f456 100644
> --- a/tests/spec/arb_viewport_array/depth_range_indices.c
> +++ b/tests/spec/arb_viewport_array/depth_range_indices.c
> @@ -41,6 +41,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> @@ -118,30 +119,32 @@ test_dr_indices(GLint maxVP)
>   		pass = false;
>   	}
>   
> -	/**
> -	 * invalid count + first index for DepthRange
> -	 * OpenGL Spec Core 4.3 Spec, section 13.6.1 ref:
> -	 *     "An INVALID_VALUE error is generated if first + count
> -	 *     is greater than the valuue of MAX_VIEWPORTS."
> -	 */
> -	if (!check_dr_index(maxVP - 2, 3, GL_INVALID_VALUE)) {
> -		printf("Wrong error for invalid DepthRange index range\n");
> -		pass = false;
> -	}
> -
> -	/**
> -	 * invalid count for DepthRange
> -	 * OpenGL Spec Core 4.3 Spec, section 13.6.1 ref:
> -	 *    "An INVALID_VALUE error is generated if count is negative."
> -	 */
> +	if (!piglit_khr_no_error) {
> +		/**
> +		 * invalid count + first index for DepthRange
> +		 * OpenGL Spec Core 4.3 Spec, section 13.6.1 ref:
> +		 *     "An INVALID_VALUE error is generated if first + count
> +		 *     is greater than the valuue of MAX_VIEWPORTS."
> +		 */
> +		if (!check_dr_index(maxVP - 2, 3, GL_INVALID_VALUE)) {
> +			printf("Wrong error for invalid DepthRange index range\n");
> +			pass = false;
> +		}
> +
> +		/**
> +		 * invalid count for DepthRange
> +		 * OpenGL Spec Core 4.3 Spec, section 13.6.1 ref:
> +		 *    "An INVALID_VALUE error is generated if count is negative."
> +		 */
>   #ifdef PIGLIT_USE_OPENGL
> -	glDepthRangeArrayv(0, -1, NULL);
> +		glDepthRangeArrayv(0, -1, NULL);
>   #else
> -	glDepthRangeArrayfvOES(0, -1, NULL);
> +		glDepthRangeArrayfvOES(0, -1, NULL);
>   #endif
> -	if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
> -		printf("Wrong error for invalid DepthRange count\n");
> -		pass = false;
> +		if (!piglit_check_gl_error(GL_INVALID_VALUE)) {
> +			printf("Wrong error for invalid DepthRange count\n");
> +			pass = false;
> +		}
>   	}
>   
>   	return pass;
> diff --git a/tests/spec/arb_viewport_array/minmax.c b/tests/spec/arb_viewport_array/minmax.c
> index 8bb0c9df9..3a1ee3957 100644
> --- a/tests/spec/arb_viewport_array/minmax.c
> +++ b/tests/spec/arb_viewport_array/minmax.c
> @@ -42,6 +42,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> diff --git a/tests/spec/arb_viewport_array/queries.c b/tests/spec/arb_viewport_array/queries.c
> index 49739315f..efd280b30 100644
> --- a/tests/spec/arb_viewport_array/queries.c
> +++ b/tests/spec/arb_viewport_array/queries.c
> @@ -40,6 +40,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> @@ -74,23 +75,25 @@ piglit_init(int argc, char **argv)
>   #endif
>   
>   	glGetIntegerv(GL_MAX_VIEWPORTS, &maxVP);
> -	/**
> -	 * Test for invalid (non-indexed "pname") parameters with GetFloati_v
> -	 * and GetDoublei_v
> -	 * NOTE: "index" parameter validity is tested in the depthrange-indices
> -	 * and viewport-indices tests.
> -	 * OpenGL 4.3 Core section 22.1 ref:
> -	 *     "An INVALID_ENUM error is generated if target is not indexed
> -	 *     state queriable with these commands."
> -	 */
>   
> -	for (i = 0; i < ARRAY_SIZE(tokens); i++) {
> -		glGetFloati_v(tokens[i], 1, valf);
> -		pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
> +	if (!piglit_khr_no_error) {
> +		/**
> +		 * Test for invalid (non-indexed "pname") parameters with
> +		 * GetFloati_v and GetDoublei_v
> +		 * NOTE: "index" parameter validity is tested in the
> +		 * depthrange-indices and viewport-indices tests.
> +		 * OpenGL 4.3 Core section 22.1 ref:
> +		 *     "An INVALID_ENUM error is generated if target is not
> +		 *     indexed state queriable with these commands."
> +		 */
> +		for (i = 0; i < ARRAY_SIZE(tokens); i++) {
> +			glGetFloati_v(tokens[i], 1, valf);
> +			pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
>   #ifdef PIGLIT_USE_OPENGL
> -		glGetDoublei_v(tokens[i], 1, vald);
> -		pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
> +			glGetDoublei_v(tokens[i], 1, vald);
> +			pass = piglit_check_gl_error(GL_INVALID_ENUM) && pass;
>   #endif
> +		}
>   	}
>   
>   	/**
> diff --git a/tests/spec/arb_viewport_array/render_depthrange.c b/tests/spec/arb_viewport_array/render_depthrange.c
> index c7e016f0a..1295917c9 100644
> --- a/tests/spec/arb_viewport_array/render_depthrange.c
> +++ b/tests/spec/arb_viewport_array/render_depthrange.c
> @@ -48,6 +48,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> diff --git a/tests/spec/arb_viewport_array/render_scissor.c b/tests/spec/arb_viewport_array/render_scissor.c
> index 95d345099..93f07754a 100644
> --- a/tests/spec/arb_viewport_array/render_scissor.c
> +++ b/tests/spec/arb_viewport_array/render_scissor.c
> @@ -48,6 +48,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> diff --git a/tests/spec/arb_viewport_array/render_viewport.c b/tests/spec/arb_viewport_array/render_viewport.c
> index 50630de91..bdc8b6f00 100644
> --- a/tests/spec/arb_viewport_array/render_viewport.c
> +++ b/tests/spec/arb_viewport_array/render_viewport.c
> @@ -45,6 +45,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> diff --git a/tests/spec/arb_viewport_array/render_viewport_2.c b/tests/spec/arb_viewport_array/render_viewport_2.c
> index 28c54fad3..3164ff2ee 100644
> --- a/tests/spec/arb_viewport_array/render_viewport_2.c
> +++ b/tests/spec/arb_viewport_array/render_viewport_2.c
> @@ -38,6 +38,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> diff --git a/tests/spec/arb_viewport_array/scissor_check.c b/tests/spec/arb_viewport_array/scissor_check.c
> index 65262214b..0b106c6d0 100644
> --- a/tests/spec/arb_viewport_array/scissor_check.c
> +++ b/tests/spec/arb_viewport_array/scissor_check.c
> @@ -39,6 +39,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> diff --git a/tests/spec/arb_viewport_array/scissor_indices.c b/tests/spec/arb_viewport_array/scissor_indices.c
> index e4e73558b..40171ff59 100644
> --- a/tests/spec/arb_viewport_array/scissor_indices.c
> +++ b/tests/spec/arb_viewport_array/scissor_indices.c
> @@ -42,6 +42,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> @@ -116,18 +117,21 @@ test_scissor_indices(GLint maxVP)
>   		printf("Got error for valid scissor range, max=%u\n", maxVP);
>   		pass = false;
>   	}
> -	/**
> -	 * invalid count + first index for Scissor index
> -	 * OpenGL Core 4.3 Spec, section 17.3.2 ref:
> -	 *     "An INVALID_VALUE error is generated by ScissorArrayv if
> -	 *     first +count is greater than the value of MAX_VIEWPORTS."
> -	 *     "If the viewport index specified to Enablei, Disablei or
> -	 *     IsEnabledi is greater or equal to the value of
> -	 *     MAX_VIEWPORTS, then an INVALID_VALUE error is generated."
> -	 */
> -	if (!check_sc_index(maxVP - 4, 5, GL_INVALID_VALUE)) {
> -		printf("Wrong error for invalid Scissor first index\n");
> -		pass = false;
> +
> +	if (!piglit_khr_no_error) {
> +		/**
> +		 * invalid count + first index for Scissor index
> +		 * OpenGL Core 4.3 Spec, section 17.3.2 ref:
> +		 *     "An INVALID_VALUE error is generated by ScissorArrayv if
> +		 *     first +count is greater than the value of MAX_VIEWPORTS."
> +		 *     "If the viewport index specified to Enablei, Disablei or
> +		 *     IsEnabledi is greater or equal to the value of
> +		 *     MAX_VIEWPORTS, then an INVALID_VALUE error is generated."
> +		 */
> +		if (!check_sc_index(maxVP - 4, 5, GL_INVALID_VALUE)) {
> +			printf("Wrong error for invalid Scissor first index\n");
> +			pass = false;
> +		}
>   	}
>   
>   	return pass;
> diff --git a/tests/spec/arb_viewport_array/viewport_indices.c b/tests/spec/arb_viewport_array/viewport_indices.c
> index 2f7b6d5c3..0088828c3 100644
> --- a/tests/spec/arb_viewport_array/viewport_indices.c
> +++ b/tests/spec/arb_viewport_array/viewport_indices.c
> @@ -45,6 +45,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>   	config.supports_gl_es_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
>   
> @@ -111,23 +112,26 @@ test_vp_indices(GLint maxVP)
>   		       maxVP);
>   		pass = false;
>   	}
> -	/**
> -	 *  invalid count + first index for viewport
> -	 * OpenGL Spec Core 4.3 Spec, section 13.6.1 ref:
> -	 *     "An INVALID_VALUE error is generated if first + count
> -	 *     is greater than the value of MAX_VIEWPORTS."
> -	 */
> -	if (!check_vp_index(maxVP - 1, 2, GL_INVALID_VALUE)) {
> -		printf("Wrong error for invalid viewport range\n");
> -		pass = false;
> +
> +	if (!piglit_khr_no_error) {
> +		/**
> +		 *  invalid count + first index for viewport
> +		 * OpenGL Spec Core 4.3 Spec, section 13.6.1 ref:
> +		 *     "An INVALID_VALUE error is generated if first + count
> +		 *     is greater than the value of MAX_VIEWPORTS."
> +		 */
> +		if (!check_vp_index(maxVP - 1, 2, GL_INVALID_VALUE)) {
> +			printf("Wrong error for invalid viewport range\n");
> +			pass = false;
> +		}
> +		/**
> +		 * invalid count for viewport
> +		 * OpenGL Spec Core 4.3 Spec, section 13.6.1 ref:
> +		 *    "An INVALID_VALUE error is generated if count is negative."
> +		 */
> +		glViewportArrayv(0, -1, NULL);
> +		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
>   	}
> -	/**
> -	 * invalid count for viewport
> -	 * OpenGL Spec Core 4.3 Spec, section 13.6.1 ref:
> -	 *    "An INVALID_VALUE error is generated if count is negative."
> -	 */
> -	glViewportArrayv(0, -1, NULL);
> -	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
>   
>   	return pass;
>   }
> @@ -170,17 +174,19 @@ test_preserve_invalid_index(GLint maxVP)
>   	}
>   	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
>   
> -	/* set an illegal index and then test that no indices changed*/
> -	glViewportIndexedf(maxVP, 0.0, 0.0, 1.0, 1.0);
> -	glScissorIndexed(maxVP, 0, 0, 1, 1);
> +	if (!piglit_khr_no_error) {
> +		/* set an illegal index and then test that no indices changed*/
> +		glViewportIndexedf(maxVP, 0.0, 0.0, 1.0, 1.0);
> +		glScissorIndexed(maxVP, 0, 0, 1, 1);
>   #ifdef PIGLIT_USE_OPENGL
> -	glDepthRangeIndexed(maxVP, 0.0, 0.0);
> +		glDepthRangeIndexed(maxVP, 0.0, 0.0);
>   #else
> -	glDepthRangeIndexedfOES(maxVP, 0.0, 0.0);
> +		glDepthRangeIndexedfOES(maxVP, 0.0, 0.0);
>   #endif
> -	glDisablei(GL_SCISSOR_TEST, maxVP);
> +		glDisablei(GL_SCISSOR_TEST, maxVP);
>   
> -	pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> +		pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> +	}
>   
>   	for (i = 0; i < maxVP; i++) {
>   		glGetFloati_v(GL_VIEWPORT, i, vpGet);
> 


More information about the Piglit mailing list