/* ARB_vertex_array_bgra */
case GL_COLOR_ARRAY_SIZE:
array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR0];
- v->value_int = array->Format.Format == GL_BGRA ? GL_BGRA : array->Format.Size;
+ v->value_int = array->Format.Bgra ? GL_BGRA : array->Format.Size;
break;
case GL_SECONDARY_COLOR_ARRAY_SIZE:
array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR1];
- v->value_int = array->Format.Format == GL_BGRA ? GL_BGRA : array->Format.Size;
+ v->value_int = array->Format.Bgra ? GL_BGRA : array->Format.Size;
break;
/* ARB_copy_buffer */
struct gl_vertex_format
{
GLenum16 Type; /**< datatype: GL_FLOAT, GL_INT, etc */
- GLenum16 Format; /**< default: GL_RGBA, but may be GL_BGRA */
- enum pipe_format _PipeFormat:16; /**< pipe_format for Gallium */
+ bool Bgra; /**< true if GL_BGRA, else GL_RGBA */
GLubyte Size:5; /**< components per element (1,2,3,4) */
GLubyte Normalized:1; /**< GL_ARB_vertex_program */
GLubyte Integer:1; /**< Integer-valued? */
GLubyte Doubles:1; /**< double values are not converted to floats */
- GLubyte _ElementSize; /**< Size of each element in bytes */
+ enum pipe_format _PipeFormat:16; /**< pipe_format for Gallium */
+ GLushort _ElementSize; /**< Size of each element in bytes */
};
{
assert(size <= 4);
vertex_format->Type = type;
- vertex_format->Format = format;
+ vertex_format->Bgra = format == GL_BGRA;
vertex_format->Size = size;
vertex_format->Normalized = normalized;
vertex_format->Integer = integer;
case GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB:
return !!(vao->Enabled & VERT_BIT_GENERIC(index));
case GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB:
- return (array->Format.Format == GL_BGRA) ? GL_BGRA : array->Format.Size;
+ return array->Format.Bgra ? GL_BGRA : array->Format.Size;
case GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB:
return array->Stride;
case GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB:
return false;
if (attrib->Format.Size != size[vbo_attr])
return false;
- assert(attrib->Format.Format == GL_RGBA);
+ assert(!attrib->Format.Bgra);
assert(attrib->Format.Normalized == GL_FALSE);
assert(attrib->Format.Integer == vbo_attrtype_to_integer_flag(tp));
assert(attrib->Format.Doubles == vbo_attrtype_to_double_flag(tp));