Reviewed-by: Charmaine Lee <charmai...@vmware.com>
________________________________________
From: Piglit <piglit-boun...@lists.freedesktop.org> on behalf of Brian Paul 
<bri...@vmware.com>
Sent: Wednesday, June 25, 2014 12:27 PM
To: piglit@lists.freedesktop.org
Subject: [Piglit] [PATCH] arb_uniform_buffer_object-minmax: divide block        
size by 4 to get components

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.

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);
--
1.7.10.4

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/piglit&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=iVNYIcCaC9TDvyNBQU%2F5q5NVsC01tSgJb3oX27T14ck%3D%0A&m=lEYZ9459wIc6IgbAQD3%2FFYDbod4P7xug8QlynP41A9c%3D%0A&s=f939d37c249b2670247980424bb327077d489f7e46890c3b38e0fc00f4d35076
_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to