Mesa (10.1): mesa: Fix glGetVertexAttribi(GL_VERTEX_ATTRIB_ARRAY_SIZE)

Carl Worth cworth at kemper.freedesktop.org
Wed Apr 23 09:27:24 UTC 2014


Module: Mesa
Branch: 10.1
Commit: b026b6bbfe3f15c8a7296ac107dc3d31f74e401e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b026b6bbfe3f15c8a7296ac107dc3d31f74e401e

Author: Anuj Phogat <anuj.phogat at gmail.com>
Date:   Wed Mar 12 18:16:21 2014 -0700

mesa: Fix glGetVertexAttribi(GL_VERTEX_ATTRIB_ARRAY_SIZE)

mesa currently returns 4 when GL_VERTEX_ATTRIB_ARRAY_SIZE is queried
for a vertex array initially set up with size=GL_BGRA. This patch
makes changes to return size=GL_BGRA as required by the spec.

Fixes Khronos OpenGL CTS test: vertex_array_bgra_basic.test

V2: Use array->Format instead of adding a new variable

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: <mesa-stable at lists.freedesktop.org>
(cherry picked from commit fdd8bebc22f167f19d9cafbe2e7c189cb3720bcb)

---

 src/mesa/main/varray.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 6bd2482..e250c23 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -738,7 +738,7 @@ get_vertex_array_attrib(struct gl_context *ctx, GLuint index, GLenum pname,
    case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB:
       return array->Enabled;
    case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB:
-      return array->Size;
+      return (array->Format == GL_BGRA) ? GL_BGRA : array->Size;
    case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB:
       return array->Stride;
    case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB:




More information about the mesa-commit mailing list