[Piglit] [PATCH] arb_uniform_buffer_object-minmax: divide block size by 4 to get components
Ian Romanick
idr at freedesktop.org
Wed Jun 25 13:08:56 PDT 2014
On 06/25/2014 12:27 PM, Brian Paul wrote:
> GL_MAX_UNIFORM_BLOCK_SIZE is in bytes. A "component" is regarded as being
> four bytes in size. So to compute the number of components, divide the
> block size by 4.
>
> With this change, nvidia's driver passes the test.
I might be tempted to s/4/sizeof(float)/g, but either way
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
> Found by Kai Ninomiya of VMware.
> ---
> tests/spec/arb_uniform_buffer_object/minmax.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/spec/arb_uniform_buffer_object/minmax.c b/tests/spec/arb_uniform_buffer_object/minmax.c
> index 03b254c..e5cd81a 100644
> --- a/tests/spec/arb_uniform_buffer_object/minmax.c
> +++ b/tests/spec/arb_uniform_buffer_object/minmax.c
> @@ -81,9 +81,9 @@ piglit_init(int argc, char **argv)
> glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &funiforms);
> glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &blocksize);
> piglit_test_min_int(GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,
> - vblocks * blocksize + vuniforms);
> + vblocks * blocksize / 4 + vuniforms);
> piglit_test_min_int(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,
> - fblocks * blocksize + funiforms);
> + fblocks * blocksize / 4 + funiforms);
> if (gs) {
> if (piglit_get_gl_version() >= 31) {
> glGetIntegerv(GL_MAX_GEOMETRY_UNIFORM_BLOCKS, &gblocks);
> @@ -91,7 +91,7 @@ piglit_init(int argc, char **argv)
> glGetIntegerv(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, &guniforms);
>
> piglit_test_min_int(GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS,
> - gblocks * blocksize + guniforms);
> + gblocks * blocksize / 4 + guniforms);
> }
>
> piglit_test_min_int(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, 1);
>
More information about the Piglit
mailing list