[Piglit] [PATCH] arb_copy_image-api_errors: fix one error check (INVALID_ENUM instead of INVALID_OPERATION)

Nicolai Hähnle nhaehnle at gmail.com
Mon Jul 4 19:25:11 UTC 2016


Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

On 01.07.2016 19:05, Alejandro Piñeiro wrote:
> This patch adapts the test to the last change on mesa. Copying
> the rationale on that patch here:
>
> For the case (both src or dst) where we had a texobject, but the
> texobject target was not the same that the method target, this spec
> paragraph was appplied:
>
>   /* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core
>    * Profile spec says:
>    *
>    *     "An INVALID_VALUE error is generated if either name does not
>    *     correspond to a valid renderbuffer or texture object according
>    *     to the corresponding target parameter."
>    */
>
> But for that case, the correct spec paragraph should be:
>   /* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core
>    * Profile spec says:
>    *
>    *     "An INVALID_ENUM error is generated if either target is
>    *      not RENDERBUFFER or a valid non-proxy texture target;
>    *      is TEXTURE_BUFFER or one of the cubemap face selectors
>    *      described in table 8.18; or if the target does not
>    *      match the type of the object."
>    */
>
> specifically the last sentence: "or if the target does not match the
> type of the object".
>
> This patch fixes the error checked (s/INVALID/ENUM) for that case,
> and moves down the INVALID_VALUE spec paragraph, as that case (invalid
> texture object) was already checked on the test, but without spec
> paragraph.
> ---
>
> You can find the mesa patch Im talking about here:
> https://patchwork.freedesktop.org/patch/96229/
>
>
>   tests/spec/arb_copy_image/api_errors.c | 27 +++++++++++++++++++--------
>   1 file changed, 19 insertions(+), 8 deletions(-)
>
> diff --git a/tests/spec/arb_copy_image/api_errors.c b/tests/spec/arb_copy_image/api_errors.c
> index a1abcf6..a348104 100644
> --- a/tests/spec/arb_copy_image/api_errors.c
> +++ b/tests/spec/arb_copy_image/api_errors.c
> @@ -129,9 +129,11 @@ test_simple_errors(GLenum src_target, GLenum dst_target)
>   	/* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core
>   	 * Profile spec says:
>   	 *
> -	 *     "An INVALID_VALUE error is generated if either name does not
> -	 *     correspond to a valid renderbuffer or texture object according
> -	 *     to the corresponding target parameter."
> +	 *     "An INVALID_ENUM error is generated if either target is
> +	 *      not RENDERBUFFER or a valid non-proxy texture target;
> +	 *      is TEXTURE_BUFFER or one of the cubemap face selectors
> +	 *      described in table 8.18; or if the target does not
> +	 *      match the type of the object."
>   	 */
>   	if (src_target != GL_RENDERBUFFER_EXT) {
>   		for (i = 0; i < ARRAY_LENGTH(targets); ++i) {
> @@ -142,7 +144,7 @@ test_simple_errors(GLenum src_target, GLenum dst_target)
>   			glCopyImageSubData(src, targets[i], 0, 0, 0, 0,
>   					   dst, dst_target, 0, 0, 0, 0,
>   					   0, 0, 0);
> -			pass &= piglit_check_gl_error(GL_INVALID_VALUE);
> +			pass &= piglit_check_gl_error(GL_INVALID_ENUM);
>   			if (!pass)
>   				return false;
>   		}
> @@ -151,9 +153,11 @@ test_simple_errors(GLenum src_target, GLenum dst_target)
>   	/* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core
>   	 * Profile spec says:
>   	 *
> -	 *     "An INVALID_VALUE error is generated if either name does not
> -	 *     correspond to a valid renderbuffer or texture object according
> -	 *     to the corresponding target parameter."
> +	 *     "An INVALID_ENUM error is generated if either target is
> +	 *      not RENDERBUFFER or a valid non-proxy texture target;
> +	 *      is TEXTURE_BUFFER or one of the cubemap face selectors
> +	 *      described in table 8.18; or if the target does not
> +	 *      match the type of the object."
>   	 */
>   	if (dst_target != GL_RENDERBUFFER_EXT) {
>   		for (i = 0; i < ARRAY_LENGTH(targets); ++i) {
> @@ -164,12 +168,19 @@ test_simple_errors(GLenum src_target, GLenum dst_target)
>   			glCopyImageSubData(src, src_target, 0, 0, 0, 0,
>   					   dst, targets[i], 0, 0, 0, 0,
>   					   0, 0, 0);
> -			pass &= piglit_check_gl_error(GL_INVALID_VALUE);
> +			pass &= piglit_check_gl_error(GL_INVALID_ENUM);
>   			if (!pass)
>   				return false;
>   		}
>   	}
>
> +	/* Section 18.3.2 (Copying Between Images) of the OpenGL 4.5 Core
> +	 * Profile spec says:
> +	 *
> +	 *     "An INVALID_VALUE error is generated if either name does not
> +	 *     correspond to a valid renderbuffer or texture object according
> +	 *     to the corresponding target parameter."
> +	 */
>   	/* 4523 should be a bogus renderbuffer/texture */
>   	glCopyImageSubData(4523, src_target, 0, 0, 0, 0,
>   			   dst, dst_target, 0, 0, 0, 0, 0, 0, 0);
>


More information about the Piglit mailing list