Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-12-07 02:58:17 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-12-07 07:33:17 +0300
commitfe20aa1edf2515d64863476641f10ce7ad65b947 (patch)
tree0b5d4ef3c1ce602fe928b30014808eb0959b4d9f /source/blender/gpu/GPU_vertex_format.h
parent88d36e6456aa66ba4e65080e4a0b969c2cf7cea8 (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.h10
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 {