[Piglit] [PATCH v2 2/2] framebuffer-blit-levels: Test stencil buffers.

Eric Anholt eric at anholt.net
Mon Oct 1 14:49:28 PDT 2012


Now I remember, I was waiting to send review to go look at the original
file to see if my review note made sense.  I think there's a little
cleanup available:

Paul Berry <stereotype441 at gmail.com> writes:
>  static void
>  create_test_data(GLfloat *data, GLenum texture_format,
>  		 unsigned level, unsigned width, unsigned height)
>  {
> -	if (texture_format == GL_RGBA)
> +	switch (texture_format) {
> +	case GL_RGBA:
>  		create_test_data_rgba(data, level, width, height);
> -	else if (texture_format == GL_DEPTH_COMPONENT)
> +		break;
> +	case GL_DEPTH_COMPONENT:
>  		create_test_data_depth(data, level, width, height);
> -	else
> +		break;
> +	case GL_DEPTH_STENCIL:
> +		create_test_data_stencil((GLbyte *) data, level,
> +					 width, height);
> +		break;
> +	default:
>  		assert(0);
> +		break;
> +	}
>  }

GL_DEPTH_COMPONENT mode is introduced here...

> @@ -180,6 +243,12 @@ piglit_init(int argc, char **argv)
>  		texture_type = GL_FLOAT;
>  		framebuffer_attachment = GL_DEPTH_ATTACHMENT;
>  		blit_mask = GL_DEPTH_BUFFER_BIT;
> +	} else if (strcmp(argv[2], "stencil") == 0) {
> +		texture_internal_format = GL_DEPTH_STENCIL;
> +		texture_format = GL_DEPTH_STENCIL;
> +		texture_type = GL_UNSIGNED_INT_24_8;
> +		framebuffer_attachment = GL_DEPTH_STENCIL_ATTACHMENT;
> +		blit_mask = GL_STENCIL_BUFFER_BIT;

And this is the new internalformat == GL_DEPTH_STENCIL

> @@ -239,7 +308,13 @@ upload_test_data(GLuint texture, unsigned data_level,
>  
>  	glBindTexture(GL_TEXTURE_2D, texture);
>  
> -	create_test_data(data, texture_format, data_level, width, height);
> +	if (texture_format == GL_DEPTH_STENCIL) {
> +		create_test_data_depthstencil((GLbyte *) data, data_level,
> +					      width, height);
> +	} else {
> +		create_test_data(data, texture_format, data_level,
> +				 width, height);
> +	}

But here you avoid calling create_test_data for GL_DEPTH_STENCIL.  I
think you could just adjust the GL_DEPTH_STENCIL case above.

Other than that, Reviewed-by: Eric Anholt <eric at anholt.net>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20121001/8a99762b/attachment.pgp>


More information about the Piglit mailing list