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:
authorMike Erwin <significant.bit@gmail.com>2017-03-14 08:38:42 +0300
committerMike Erwin <significant.bit@gmail.com>2017-03-14 08:38:42 +0300
commit225e3a6857b33ac0af8de89cc1b63734caa3e058 (patch)
tree74b1cb44af5e4d4a8e8996ad6e6c9eb054352e7c /source/blender/gpu/gawain/batch.h
parent9bf0b246ac495b901362f1cc4e74d9b3772d9195 (diff)
Gawain: multiple VertexBuffers per Batch
So we can store (for example) vertex positions in one buffer and normals + colors in another buffer. Not super exciting right now, but very useful once we start changing some attribute values. Supports future work by Clément et al. Only tested with one VBO per Batch since that's all our current code uses.
Diffstat (limited to 'source/blender/gpu/gawain/batch.h')
-rw-r--r--source/blender/gpu/gawain/batch.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/gpu/gawain/batch.h b/source/blender/gpu/gawain/batch.h
index 85d9227ff08..189a586f964 100644
--- a/source/blender/gpu/gawain/batch.h
+++ b/source/blender/gpu/gawain/batch.h
@@ -21,9 +21,11 @@ typedef enum {
READY_TO_DRAW
} BatchPhase;
-typedef struct Batch{
+#define BATCH_MAX_VBO_CT 3
+
+typedef struct Batch {
// geometry
- VertexBuffer* verts;
+ VertexBuffer* verts[BATCH_MAX_VBO_CT]; // verts[0] is required, others can be NULL
ElementList* elem; // NULL if element list not needed
PrimitiveType prim_type;
@@ -43,6 +45,8 @@ void Batch_init(Batch*, PrimitiveType, VertexBuffer*, ElementList*);
void Batch_discard(Batch*); // verts & elem are not discarded
void Batch_discard_all(Batch*); // including verts & elem
+int Batch_add_VertexBuffer(Batch*, VertexBuffer*);
+
void Batch_set_program(Batch*, GLuint program);
// Entire batch draws with one shader program, but can be redrawn later with another program.
// Vertex shader's inputs must be compatible with the batch's vertex format.