[2/3] arb_get_texture_sub_image: fix depth parameter when performing zero-sized texture queries

Submitted by Anthony Pesch on March 28, 2018, 3:15 p.m.

Details

Message ID 20180328151523.17491-2-inolen@gmail.com
State New
Headers show
Series "Series without cover letter" ( rev: 3 2 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Anthony Pesch March 28, 2018, 3:15 p.m.
From: Anthony Pesch <apesch@nvidia.com>

Change zero-sized texture queries to pass a valid depth parameter, otherwise
they should error as per the OpenGL 4.6 Core spec:

"An INVALID_VALUE error is generated if the effective target is TEXTURE_1D,
TEXTURE_1D_ARRAY, TEXTURE_2D or TEXTURE_RECTANGLE, and either zoffset is not
zero, or depth is not one."
---
 tests/spec/arb_get_texture_sub_image/errors.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_get_texture_sub_image/errors.c b/tests/spec/arb_get_texture_sub_image/errors.c
index 57875fa6a..1e7b17115 100644
--- a/tests/spec/arb_get_texture_sub_image/errors.c
+++ b/tests/spec/arb_get_texture_sub_image/errors.c
@@ -293,7 +293,7 @@  test_zero_size_image(void)
 	/* getting 0x0 image from 8x8 source should work */
 	glGetTextureSubImage(tex, 0,
 			     0, 0, 0,
-			     0, 0, 0,
+			     0, 0, 1,
 			     GL_RGBA, GL_UNSIGNED_BYTE,
 			     sizeof(image), image);
 	if (!piglit_check_gl_error(GL_NO_ERROR))
@@ -306,7 +306,7 @@  test_zero_size_image(void)
 	/* getting 0x0 image from 0x0 source should work */
 	glGetTextureSubImage(tex, 0,
 			     0, 0, 0,
-			     0, 0, 0,
+			     0, 0, 1,
 			     GL_RGBA, GL_UNSIGNED_BYTE,
 			     sizeof(image), image);
 	if (!piglit_check_gl_error(GL_NO_ERROR))
@@ -315,7 +315,7 @@  test_zero_size_image(void)
 	/* getting 0x0 image at an offset from 0x0 source should error */
 	glGetTextureSubImage(tex, 0,
 			     1, 2, 0,  /* offset */
-			     0, 0, 0,
+			     0, 0, 1,
 			     GL_RGBA, GL_UNSIGNED_BYTE,
 			     sizeof(image), image);
 	if (!piglit_check_gl_error(GL_INVALID_VALUE))

Comments

Reviewed-by: Arthur Huillet <ahuillet@nvidia.com>

Thanks
On Wed, 2018-03-28 at 11:15 -0400, Anthony Pesch wrote:
> From: Anthony Pesch <apesch@nvidia.com>
> 
> Change zero-sized texture queries to pass a valid depth parameter, otherwise
> they should error as per the OpenGL 4.6 Core spec:
> 
> "An INVALID_VALUE error is generated if the effective target is TEXTURE_1D,
> TEXTURE_1D_ARRAY, TEXTURE_2D or TEXTURE_RECTANGLE, and either zoffset is not
> zero, or depth is not one."

For this patch:

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>


	J.A.

> ---
>  tests/spec/arb_get_texture_sub_image/errors.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/spec/arb_get_texture_sub_image/errors.c b/tests/spec/arb_get_texture_sub_image/errors.c
> index 57875fa6a..1e7b17115 100644
> --- a/tests/spec/arb_get_texture_sub_image/errors.c
> +++ b/tests/spec/arb_get_texture_sub_image/errors.c
> @@ -293,7 +293,7 @@ test_zero_size_image(void)
>  	/* getting 0x0 image from 8x8 source should work */
>  	glGetTextureSubImage(tex, 0,
>  			     0, 0, 0,
> -			     0, 0, 0,
> +			     0, 0, 1,
>  			     GL_RGBA, GL_UNSIGNED_BYTE,
>  			     sizeof(image), image);
>  	if (!piglit_check_gl_error(GL_NO_ERROR))
> @@ -306,7 +306,7 @@ test_zero_size_image(void)
>  	/* getting 0x0 image from 0x0 source should work */
>  	glGetTextureSubImage(tex, 0,
>  			     0, 0, 0,
> -			     0, 0, 0,
> +			     0, 0, 1,
>  			     GL_RGBA, GL_UNSIGNED_BYTE,
>  			     sizeof(image), image);
>  	if (!piglit_check_gl_error(GL_NO_ERROR))
> @@ -315,7 +315,7 @@ test_zero_size_image(void)
>  	/* getting 0x0 image at an offset from 0x0 source should error */
>  	glGetTextureSubImage(tex, 0,
>  			     1, 2, 0,  /* offset */
> -			     0, 0, 0,
> +			     0, 0, 1,
>  			     GL_RGBA, GL_UNSIGNED_BYTE,
>  			     sizeof(image), image);
>  	if (!piglit_check_gl_error(GL_INVALID_VALUE))