[Piglit] [PATCH] spec/arb_copy_buffer: Add a new test for copy_buffer.

Eric Anholt eric at anholt.net
Tue Aug 9 16:44:37 PDT 2011


On Sun,  7 Aug 2011 23:49:18 -0700, Ben Widawsky <ben at bwidawsk.net> wrote:
> This is failing on Intel pre-GEN6, but will be fixed shortly.
> 
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>

> +static enum piglit_result
> +do_copy()
> +{
> +	GLuint buffer_handles[2];
> +
> +	glGenBuffersARB(2, buffer_handles);
> +	CATCH_ERROR;

I'd drop these CATCH_ERRORs.  They're not what the test is about.

We have talked about having the framework check that no errors are in
place at piglit_report_result() time, which I think would cover what you
were going for here (no unexpected errors).

> +	glBindBufferARB(GL_COPY_READ_BUFFER, buffer_handles[0]);
> +	CATCH_ERROR;
> +	glBindBufferARB(GL_COPY_WRITE_BUFFER, buffer_handles[1]);
> +	CATCH_ERROR;
> +	glBufferData(GL_COPY_READ_BUFFER, COPY_BUFFER_SIZE, NULL,
> +		     GL_STREAM_COPY);
> +	CATCH_ERROR;
> +	glBufferData(GL_COPY_WRITE_BUFFER, COPY_BUFFER_SIZE, NULL,
> +		     GL_STREAM_READ);
> +	CATCH_ERROR;
> +
> +	glBufferSubDataARB(GL_COPY_READ_BUFFER, 0, COPY_BUFFER_SIZE, src_data);
> +	CATCH_ERROR;

Seems like this would just fold into the glBufferData() call for that buffer.

> +	glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0,
> +			    COPY_BUFFER_SIZE);
> +	CATCH_ERROR;
> +
> +	glGetBufferSubDataARB(GL_COPY_WRITE_BUFFER, 0, COPY_BUFFER_SIZE,
> +			      dest_data);
> +	CATCH_ERROR;
> +
> +	if (memcmp(src_data, dest_data, COPY_BUFFER_SIZE) != 0)
> +		return PIGLIT_FAIL;
> +
> +	return PIGLIT_PASS;
> +}

Other than that, looks good.  Thanks for fixing this!
-------------- 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/20110809/72ac90c6/attachment.pgp>


More information about the Piglit mailing list