diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-12-07 02:58:17 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-12-07 07:33:17 +0300 |
commit | fe20aa1edf2515d64863476641f10ce7ad65b947 (patch) | |
tree | 0b5d4ef3c1ce602fe928b30014808eb0959b4d9f /source/blender/gpu/GPU_vertex_format.h | |
parent | 88d36e6456aa66ba4e65080e4a0b969c2cf7cea8 (diff) |
GPU: Add GPU_vertformat_triple_load to load next vertices attrib
Right now does not add padding at the end of the buffer.
This seems not necessary but may cause problem on some platform. If needed
we will add this padding (only 2 more vertices).
Diffstat (limited to 'source/blender/gpu/GPU_vertex_format.h')
-rw-r--r-- | source/blender/gpu/GPU_vertex_format.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_vertex_format.h b/source/blender/gpu/GPU_vertex_format.h index 113a3e894d0..7a271caf079 100644 --- a/source/blender/gpu/GPU_vertex_format.h +++ b/source/blender/gpu/GPU_vertex_format.h @@ -92,6 +92,16 @@ uint GPU_vertformat_attr_add( void GPU_vertformat_alias_add(GPUVertFormat *, const char *alias); int GPU_vertformat_attr_id_get(const GPUVertFormat *, const char *name); +/** + * This makes the "virtual" attribs with suffixes "0", "1", "2" to access triangle data in the vertex + * shader. + * + * IMPORTANT: + * - Call this before creating the vertex buffer and after creating all attributes + * - Only first vertex out of 3 has the correct information. Use flat output with GL_FIRST_VERTEX_CONVENTION. + **/ +void GPU_vertformat_triple_load(GPUVertFormat *format); + /* format conversion */ typedef struct GPUPackedNormal { |