diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-14 00:31:43 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-14 11:57:04 +0300 |
commit | 016fc7f0c238fae9904dd6f0e48bec3a06b691e6 (patch) | |
tree | d9d0e6a3c0216b0ce9feba8b9c693dc1770c03ef /source/blender/gpu/GPU_vertex_buffer.h | |
parent | 72a5e3f61a1478616a494d90bdcc565e20ee0858 (diff) |
GPUVertexFormat: Reduce size of structs
With this patch, the size of GPUVertFormat goes from 1240 to 388.
Diffstat (limited to 'source/blender/gpu/GPU_vertex_buffer.h')
-rw-r--r-- | source/blender/gpu/GPU_vertex_buffer.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/gpu/GPU_vertex_buffer.h b/source/blender/gpu/GPU_vertex_buffer.h index a5a5e3d4296..3e178e193dc 100644 --- a/source/blender/gpu/GPU_vertex_buffer.h +++ b/source/blender/gpu/GPU_vertex_buffer.h @@ -48,12 +48,17 @@ typedef enum { typedef struct GPUVertBuf { GPUVertFormat format; - uint vertex_len; /* number of verts we want to draw */ - uint vertex_alloc; /* number of verts data */ - bool dirty; + /** Number of verts we want to draw. */ + uint vertex_len; + /** Number of verts data. */ + uint vertex_alloc; + /** 0 indicates not yet allocated. */ + uint32_t vbo_id; + /** Usage hint for GL optimisation. */ + uint usage : 2; + /** Data has been touched and need to be reuploaded to GPU. */ + uint dirty : 1; unsigned char *data; /* NULL indicates data in VRAM (unmapped) */ - uint32_t vbo_id; /* 0 indicates not yet allocated */ - GPUUsageType usage; /* usage hint for GL optimisation */ } GPUVertBuf; GPUVertBuf *GPU_vertbuf_create(GPUUsageType); |