[Piglit] [PATCH] GL_ARB_ubo/getintegeri_v: Respect implementation value of GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT

Ian Romanick idr at freedesktop.org
Mon Jan 28 17:14:54 PST 2013


On 01/28/2013 05:06 PM, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Cc: Vinson Lee <vlee at freedesktop.org>
> Cc: Fredrik Höglund <fredrik at kde.org>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59331

Blarg.  I didn't see Fredrik's patch for the same bug.  I believe mine 
is a bit simpler.  There shouldn't be any need to align 0... that had 
better always be valid!

> ---
>   tests/spec/arb_uniform_buffer_object/getintegeri_v.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/arb_uniform_buffer_object/getintegeri_v.c b/tests/spec/arb_uniform_buffer_object/getintegeri_v.c
> index e35e653..6850dae 100644
> --- a/tests/spec/arb_uniform_buffer_object/getintegeri_v.c
> +++ b/tests/spec/arb_uniform_buffer_object/getintegeri_v.c
> @@ -78,11 +78,14 @@ piglit_init(int argc, char **argv)
>   	int size = 1024;
>   	GLint max_bindings;
>   	GLint junk;
> +	GLint alignment;
>
>   	piglit_require_extension("GL_ARB_uniform_buffer_object");
>
>   	test_range(__LINE__, 0, 0, -1, -1);
>
> +	glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &alignment);
> +
>   	glGenBuffers(2, bo);
>   	glBindBuffer(GL_UNIFORM_BUFFER, bo[0]);
>   	glBufferData(GL_UNIFORM_BUFFER, size, NULL, GL_STATIC_READ);
> @@ -90,9 +93,9 @@ piglit_init(int argc, char **argv)
>   	glBufferData(GL_UNIFORM_BUFFER, size, NULL, GL_STATIC_READ);
>
>   	glBindBufferRange(GL_UNIFORM_BUFFER, 0, bo[0], 0, 1);
> -	glBindBufferRange(GL_UNIFORM_BUFFER, 1, bo[1], 2, 3);
> +	glBindBufferRange(GL_UNIFORM_BUFFER, 1, bo[1], 2 * alignment, 3);
>   	test_range(__LINE__, 0, bo[0], 0, 1);
> -	test_range(__LINE__, 1, bo[1], 2, 3);
> +	test_range(__LINE__, 1, bo[1], 2 * alignment, 3);
>
>   	/* There's a bit of a contradiction in the spec.  On the one
>   	 * hand, "BindBufferBase is equivalent to calling
>



More information about the Piglit mailing list