summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2018-01-26 14:49:41 -0700
committerBrian Paul <[email protected]>2018-01-29 21:15:52 -0700
commit79cafa0df342f9fdc142ad2ed7d910044f5f4c4f (patch)
tree9c97483197027ef9b49d2d721c2399d651d5de00 /src/mesa/main
parentf96a69f916aed40519e755d0460a83940a58780e (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/mtypes.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b0eeeafbcda..78132de4254 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1497,18 +1497,19 @@ struct gl_pixelstore_attrib
*/
struct gl_vertex_array
{
- GLint Size; /**< components per element (1,2,3,4) */
- GLenum16 Type; /**< datatype: GL_FLOAT, GL_INT, etc */
- GLenum16 Format; /**< default: GL_RGBA, but may be GL_BGRA */
+ /** 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 _ElementSize; /**< size of each element in bytes */
- const GLubyte *Ptr; /**< Points to array data */
- GLboolean Normalized; /**< GL_ARB_vertex_program */
- GLboolean Integer; /**< Integer-valued? */
- 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 */
+ GLenum16 Type; /**< datatype: GL_FLOAT, GL_INT, etc */
+ GLenum16 Format; /**< default: GL_RGBA, but may be GL_BGRA */
+ unsigned Size:4; /**< components per element (1,2,3,4) */
+ unsigned _ElementSize:8; /**< in bytes, up to 4*sizeof(GLdouble) */
+ unsigned Normalized:1; /**< GL_ARB_vertex_program */
+ unsigned Integer:1; /**< Integer-valued? */
+ unsigned Doubles:1; /**< doubles not converted to floats */
};