diff options
Diffstat (limited to 'source/blender/gpu/opengl/gl_backend.hh')
-rw-r--r-- | source/blender/gpu/opengl/gl_backend.hh | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/source/blender/gpu/opengl/gl_backend.hh b/source/blender/gpu/opengl/gl_backend.hh index c178aa537a0..231e5811b45 100644 --- a/source/blender/gpu/opengl/gl_backend.hh +++ b/source/blender/gpu/opengl/gl_backend.hh @@ -32,6 +32,7 @@ #include "gl_drawlist.hh" #include "gl_framebuffer.hh" #include "gl_index_buffer.hh" +#include "gl_query.hh" #include "gl_shader.hh" #include "gl_texture.hh" #include "gl_uniform_buffer.hh" @@ -47,11 +48,17 @@ class GLBackend : public GPUBackend { public: GLBackend() { + /* platform_init needs to go first. */ + GLBackend::platform_init(); + + GLBackend::capabilities_init(); GLTexture::samplers_init(); } ~GLBackend() { GLTexture::samplers_free(); + + GLBackend::platform_exit(); } static GLBackend *get(void) @@ -64,7 +71,7 @@ class GLBackend : public GPUBackend { GLTexture::samplers_update(); }; - GPUContext *context_alloc(void *ghost_window) override + Context *context_alloc(void *ghost_window) override { return new GLContext(ghost_window, shared_orphan_list_); }; @@ -89,6 +96,11 @@ class GLBackend : public GPUBackend { return new GLIndexBuf(); }; + QueryPool *querypool_alloc(void) override + { + return new GLQueryPool(); + }; + Shader *shader_alloc(const char *name) override { return new GLShader(name); @@ -109,15 +121,16 @@ class GLBackend : public GPUBackend { return new GLVertBuf(); }; - /* TODO remove */ - void buf_free(GLuint buf_id); - void tex_free(GLuint tex_id); - void orphans_add(Vector<GLuint> &orphan_list, std::mutex &list_mutex, unsigned int id) + GLSharedOrphanLists &shared_orphan_list_get(void) { - list_mutex.lock(); - orphan_list.append(id); - list_mutex.unlock(); - } + return shared_orphan_list_; + }; + + private: + static void platform_init(void); + static void platform_exit(void); + + static void capabilities_init(void); }; } // namespace gpu |