summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2014-03-12 18:16:21 -0700
committerAnuj Phogat <anuj.phogat@gmail.com>2014-04-16 18:37:06 -0700
commitfdd8bebc22f167f19d9cafbe2e7c189cb3720bcb (patch)
treea375f43515ca36f65ed820519ebc5da19dd02b39 /src/mesa
parent80b4a36fed0712fd77b8cc5dbf5b970e0425b299 (diff)
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@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Cc: <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/varray.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index b88d70018ad..66a3ef119af 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: