I like this fix much better.

Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>

On 03/12/2014 06:20 PM, Anuj Phogat wrote:
> 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.pho...@gmail.com>
> Cc: <mesa-sta...@lists.freedesktop.org>
> ---
>  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 b4b6fa9..479d872 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:
> 

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to