diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-11 02:31:40 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-13 15:20:24 +0300 |
commit | efc97b3919ea4fd46b9d2e931ca3fea27e7ea31c (patch) | |
tree | 125e4239c90902a967487f44d5aca1696d49be68 /source/blender/gpu/opengl/gl_context.hh | |
parent | 47bfb0f7ad2f70017585fe55a68e49ae09f1150c (diff) |
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.
Diffstat (limited to 'source/blender/gpu/opengl/gl_context.hh')
-rw-r--r-- | source/blender/gpu/opengl/gl_context.hh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/gpu/opengl/gl_context.hh b/source/blender/gpu/opengl/gl_context.hh index 3b55965b9d1..f3ff5cb47f4 100644 --- a/source/blender/gpu/opengl/gl_context.hh +++ b/source/blender/gpu/opengl/gl_context.hh @@ -25,15 +25,16 @@ #include "gpu_context_private.hh" +#include "GPU_framebuffer.h" + #include "BLI_set.hh" #include "BLI_vector.hh" #include "glew-mx.h" -#include <iostream> +#include "gl_batch.hh" + #include <mutex> -#include <unordered_set> -#include <vector> namespace blender { namespace gpu { @@ -63,7 +64,7 @@ class GLContext : public GPUContext { * GPUBatch & GPUFramebuffer have references to the context they are from, in the case the * context is destroyed, we need to remove any reference to it. */ - Set<GPUBatch *> batches_; + Set<GLVaoCache *> vao_caches_; Set<GPUFrameBuffer *> framebuffers_; /** Mutex for the bellow structures. */ std::mutex lists_mutex_; @@ -87,8 +88,8 @@ class GLContext : public GPUContext { void vao_free(GLuint vao_id); void fbo_free(GLuint fbo_id); - void batch_register(struct GPUBatch *batch); - void batch_unregister(struct GPUBatch *batch); + void vao_cache_register(GLVaoCache *cache); + void vao_cache_unregister(GLVaoCache *cache); void framebuffer_register(struct GPUFrameBuffer *fb); void framebuffer_unregister(struct GPUFrameBuffer *fb); }; |