GPUBatch: GL backend isolation

This changes the drawing paradigm a bit. The VAO configuration is done
JIT-style and depends on context active shader.

This is to allow more flexibility for implementations to do optimization
at lower level.

The vao cache is now its own class to isolate the concept. It is this
class that is reference by the GLContext for ownership of the containing
VAO ids.
This commit is contained in:
2020-08-11 01:31:40 +02:00
parent 47bfb0f7ad
commit efc97b3919
15 changed files with 626 additions and 496 deletions

View File

@@ -188,18 +188,6 @@ void GPU_tex_free(GLuint tex_id)
* which are not shared across contexts. So we need to keep track of
* ownership. */
void gpu_context_add_batch(GPUContext *ctx, GPUBatch *batch)
{
BLI_assert(ctx);
static_cast<GLContext *>(ctx)->batch_register(batch);
}
void gpu_context_remove_batch(GPUContext *ctx, GPUBatch *batch)
{
BLI_assert(ctx);
static_cast<GLContext *>(ctx)->batch_unregister(batch);
}
void gpu_context_add_framebuffer(GPUContext *ctx, GPUFrameBuffer *fb)
{
#ifdef DEBUG