mesa: shrink gl_vertex_array
Inspired by Marek's earlier patch, but goes a little further. Sort fields from largest to smallest. Use bitfields. Reduced from 48 bytes to 32. Also reduces size of gl_vertex_array_object from 4144 to 3632 Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
f96a69f916
commit
79cafa0df3
|
@ -1497,18 +1497,19 @@ struct gl_pixelstore_attrib
|
||||||
*/
|
*/
|
||||||
struct gl_vertex_array
|
struct gl_vertex_array
|
||||||
{
|
{
|
||||||
GLint Size; /**< components per element (1,2,3,4) */
|
/** if NULL, vertex data are in user memory */
|
||||||
|
struct gl_buffer_object *BufferObj;
|
||||||
|
/** Pointer into user memory, or offset into the BufferObj */
|
||||||
|
const GLubyte *Ptr;
|
||||||
|
GLsizei StrideB; /**< actual stride in bytes */
|
||||||
|
GLuint InstanceDivisor; /**< GL_ARB_instanced_arrays */
|
||||||
GLenum16 Type; /**< datatype: GL_FLOAT, GL_INT, etc */
|
GLenum16 Type; /**< datatype: GL_FLOAT, GL_INT, etc */
|
||||||
GLenum16 Format; /**< default: GL_RGBA, but may be GL_BGRA */
|
GLenum16 Format; /**< default: GL_RGBA, but may be GL_BGRA */
|
||||||
GLsizei StrideB; /**< actual stride in bytes */
|
unsigned Size:4; /**< components per element (1,2,3,4) */
|
||||||
GLuint _ElementSize; /**< size of each element in bytes */
|
unsigned _ElementSize:8; /**< in bytes, up to 4*sizeof(GLdouble) */
|
||||||
const GLubyte *Ptr; /**< Points to array data */
|
unsigned Normalized:1; /**< GL_ARB_vertex_program */
|
||||||
GLboolean Normalized; /**< GL_ARB_vertex_program */
|
unsigned Integer:1; /**< Integer-valued? */
|
||||||
GLboolean Integer; /**< Integer-valued? */
|
unsigned Doubles:1; /**< doubles not converted to floats */
|
||||||
GLboolean Doubles; /**< double precision values are not converted to floats */
|
|
||||||
GLuint InstanceDivisor; /**< GL_ARB_instanced_arrays */
|
|
||||||
|
|
||||||
struct gl_buffer_object *BufferObj;/**< GL_ARB_vertex_buffer_object */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue