diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-09 01:52:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-13 15:20:23 +0300 |
commit | 854c999d827cfb78938c3b4605707b891092d001 (patch) | |
tree | 6d066bbaa52689ddb6c5b4bcd692ab3e4da03dcb /source/blender/gpu/GPU_batch.h | |
parent | 186abf7d3bab9ed8b905c6914de02427bb2547cf (diff) |
GPUShader: Change shader state tracking to be part of the GPUContext
This remove the use of batch->program and replace it with batch->shader.
This will allow GL abstraction latter.
Diffstat (limited to 'source/blender/gpu/GPU_batch.h')
-rw-r--r-- | source/blender/gpu/GPU_batch.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/gpu/GPU_batch.h b/source/blender/gpu/GPU_batch.h index fb273847a9c..d37fc923a67 100644 --- a/source/blender/gpu/GPU_batch.h +++ b/source/blender/gpu/GPU_batch.h @@ -57,11 +57,13 @@ typedef struct GPUBatch { GPUVertBuf *inst[GPU_BATCH_INST_VBO_MAX_LEN]; /** NULL if element list not needed */ GPUIndexBuf *elem; + + GPUShader *shader; + GPUPrimType prim_type; /* cached values (avoid dereferencing later) */ uint32_t vao_id; - uint32_t program; const struct GPUShaderInterface *interface; /* book-keeping */ @@ -69,7 +71,6 @@ typedef struct GPUBatch { /** used to free all vaos. this implies all vaos were created under the same context. */ struct GPUContext *context; GPUBatchPhase phase; - bool program_in_use; /* Vao management: remembers all geometry state (vertex attribute bindings & element buffer) * for each shader interface. Start with a static number of vaos and fallback to dynamic count @@ -128,17 +129,11 @@ 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) void GPU_batch_set_shader(GPUBatch *batch, GPUShader *shader); -void GPU_batch_set_shader_no_bind(GPUBatch *batch, GPUShader *shader); void GPU_batch_program_set_imm_shader(GPUBatch *batch); void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id); void GPU_batch_program_set_builtin_with_config(GPUBatch *batch, eGPUBuiltinShader shader_id, eGPUShaderConfig sh_cfg); -/* 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. */ - -void GPU_batch_program_use_begin(GPUBatch *); /* call before Batch_Uniform (temp hack?) */ -void GPU_batch_program_use_end(GPUBatch *); void GPU_batch_uniform_1ui(GPUBatch *, const char *name, uint value); void GPU_batch_uniform_1i(GPUBatch *, const char *name, int value); |