diff options
Diffstat (limited to 'source/blender/gpu/intern/gpu_vertex_buffer.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_vertex_buffer.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_vertex_buffer.c b/source/blender/gpu/intern/gpu_vertex_buffer.c index eecbcb9ec94..1df7e68e08b 100644 --- a/source/blender/gpu/intern/gpu_vertex_buffer.c +++ b/source/blender/gpu/intern/gpu_vertex_buffer.c @@ -196,6 +196,19 @@ void GPU_vertbuf_attr_fill(GPUVertBuf *verts, uint a_idx, const void *data) GPU_vertbuf_attr_fill_stride(verts, a_idx, stride, data); } +/** Fills a whole vertex (all attribs). Data must match packed layout. */ +void GPU_vertbuf_vert_set(GPUVertBuf *verts, uint v_idx, const void *data) +{ + const GPUVertFormat *format = &verts->format; + +#if TRUST_NO_ONE + assert(v_idx < verts->vertex_alloc); + assert(verts->data != NULL); +#endif + verts->dirty = true; + memcpy((GLubyte *)verts->data + v_idx * format->stride, data, format->stride); +} + void GPU_vertbuf_attr_fill_stride(GPUVertBuf *verts, uint a_idx, uint stride, const void *data) { const GPUVertFormat *format = &verts->format; |