Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/GPU_batch.h
| Show All 35 Lines | typedef enum { | ||||
| GPU_BATCH_UNUSED, | GPU_BATCH_UNUSED, | ||||
| GPU_BATCH_READY_TO_FORMAT, | GPU_BATCH_READY_TO_FORMAT, | ||||
| GPU_BATCH_READY_TO_BUILD, | GPU_BATCH_READY_TO_BUILD, | ||||
| GPU_BATCH_BUILDING, | GPU_BATCH_BUILDING, | ||||
| GPU_BATCH_READY_TO_DRAW, | GPU_BATCH_READY_TO_DRAW, | ||||
| } GPUBatchPhase; | } GPUBatchPhase; | ||||
| #define GPU_BATCH_VBO_MAX_LEN 6 | #define GPU_BATCH_VBO_MAX_LEN 6 | ||||
| #define GPU_BATCH_INST_VBO_MAX_LEN 2 | |||||
| #define GPU_BATCH_VAO_STATIC_LEN 3 | #define GPU_BATCH_VAO_STATIC_LEN 3 | ||||
| #define GPU_BATCH_VAO_DYN_ALLOC_COUNT 16 | #define GPU_BATCH_VAO_DYN_ALLOC_COUNT 16 | ||||
| typedef struct GPUBatch { | typedef struct GPUBatch { | ||||
| /* geometry */ | /* geometry */ | ||||
| /** verts[0] is required, others can be NULL */ | /** verts[0] is required, others can be NULL */ | ||||
| GPUVertBuf *verts[GPU_BATCH_VBO_MAX_LEN]; | GPUVertBuf *verts[GPU_BATCH_VBO_MAX_LEN]; | ||||
| /** Instance attributes. */ | /** Instance attributes. */ | ||||
| GPUVertBuf *inst; | GPUVertBuf *inst[GPU_BATCH_INST_VBO_MAX_LEN]; | ||||
| /** NULL if element list not needed */ | /** NULL if element list not needed */ | ||||
| GPUIndexBuf *elem; | GPUIndexBuf *elem; | ||||
| uint32_t gl_prim_type; | uint32_t gl_prim_type; | ||||
| /* cached values (avoid dereferencing later) */ | /* cached values (avoid dereferencing later) */ | ||||
| uint32_t vao_id; | uint32_t vao_id; | ||||
| uint32_t program; | uint32_t program; | ||||
| const struct GPUShaderInterface *interface; | const struct GPUShaderInterface *interface; | ||||
| ▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
| void GPU_batch_vao_cache_clear(GPUBatch *); | void GPU_batch_vao_cache_clear(GPUBatch *); | ||||
| void GPU_batch_callback_free_set(GPUBatch *, void (*callback)(GPUBatch *, void *), void *); | void GPU_batch_callback_free_set(GPUBatch *, void (*callback)(GPUBatch *, void *), void *); | ||||
| void GPU_batch_instbuf_set(GPUBatch *, GPUVertBuf *, bool own_vbo); /* Instancing */ | void GPU_batch_instbuf_set(GPUBatch *, GPUVertBuf *, bool own_vbo); /* Instancing */ | ||||
| void GPU_batch_elembuf_set(GPUBatch *batch, GPUIndexBuf *elem, bool own_ibo); | void GPU_batch_elembuf_set(GPUBatch *batch, GPUIndexBuf *elem, bool own_ibo); | ||||
| int GPU_batch_instbuf_add_ex(GPUBatch *, GPUVertBuf *, bool own_vbo); | |||||
| int GPU_batch_vertbuf_add_ex(GPUBatch *, GPUVertBuf *, bool own_vbo); | int GPU_batch_vertbuf_add_ex(GPUBatch *, GPUVertBuf *, bool own_vbo); | ||||
| #define GPU_batch_vertbuf_add(batch, verts) GPU_batch_vertbuf_add_ex(batch, verts, false) | #define GPU_batch_vertbuf_add(batch, verts) GPU_batch_vertbuf_add_ex(batch, verts, false) | ||||
| void GPU_batch_program_set_no_use(GPUBatch *, uint32_t program, const GPUShaderInterface *); | void GPU_batch_program_set_no_use(GPUBatch *, uint32_t program, const GPUShaderInterface *); | ||||
| void GPU_batch_program_set(GPUBatch *, uint32_t program, const GPUShaderInterface *); | void GPU_batch_program_set(GPUBatch *, uint32_t program, const GPUShaderInterface *); | ||||
| void GPU_batch_program_set_shader(GPUBatch *, GPUShader *shader); | void GPU_batch_program_set_shader(GPUBatch *, GPUShader *shader); | ||||
| void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id); | void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id); | ||||
| ▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines | |||||