diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-07 21:08:25 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-07 21:17:45 +0300 |
commit | 19f56cfe6c59e3a54aaf7499fd9072a8790171b7 (patch) | |
tree | 3db73ef6ceb2586175249344bf4564457ad2fbc5 /source/blender/gpu/intern | |
parent | 58353834f441b8b4ca91dcd4ec94ac49bbbf5ab0 (diff) |
Cleanup: GLBackend: Move buf_free and tex_free to GLContext
This makes it easier to follow.
Also removes the GL related functions inside gpu_context.cc.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_context.cc | 52 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_context_private.hh | 13 |
2 files changed, 0 insertions, 65 deletions
diff --git a/source/blender/gpu/intern/gpu_context.cc b/source/blender/gpu/intern/gpu_context.cc index 85e7dffe3e7..8ebd49a658e 100644 --- a/source/blender/gpu/intern/gpu_context.cc +++ b/source/blender/gpu/intern/gpu_context.cc @@ -126,58 +126,6 @@ GPUContext *GPU_context_active_get(void) return active_ctx; } -GLuint GPU_vao_alloc(void) -{ - GLuint new_vao_id = 0; - glGenVertexArrays(1, &new_vao_id); - return new_vao_id; -} - -GLuint GPU_fbo_alloc(void) -{ - GLuint new_fbo_id = 0; - glGenFramebuffers(1, &new_fbo_id); - return new_fbo_id; -} - -GLuint GPU_buf_alloc(void) -{ - GLuint new_buffer_id = 0; - glGenBuffers(1, &new_buffer_id); - return new_buffer_id; -} - -GLuint GPU_tex_alloc(void) -{ - GLuint new_texture_id = 0; - glGenTextures(1, &new_texture_id); - return new_texture_id; -} - -void GPU_vao_free(GLuint vao_id, GPUContext *ctx) -{ - static_cast<GLContext *>(ctx)->vao_free(vao_id); -} - -void GPU_fbo_free(GLuint fbo_id, GPUContext *ctx) -{ - static_cast<GLContext *>(ctx)->fbo_free(fbo_id); -} - -void GPU_buf_free(GLuint buf_id) -{ - /* TODO avoid using backend */ - GPUBackend *backend = GPUBackend::get(); - static_cast<GLBackend *>(backend)->buf_free(buf_id); -} - -void GPU_tex_free(GLuint tex_id) -{ - /* TODO avoid using backend */ - GPUBackend *backend = GPUBackend::get(); - static_cast<GLBackend *>(backend)->tex_free(tex_id); -} - struct GPUMatrixState *gpu_context_active_matrix_state_get() { BLI_assert(active_ctx); diff --git a/source/blender/gpu/intern/gpu_context_private.hh b/source/blender/gpu/intern/gpu_context_private.hh index 5643eec1aa6..3d92b4eb587 100644 --- a/source/blender/gpu/intern/gpu_context_private.hh +++ b/source/blender/gpu/intern/gpu_context_private.hh @@ -83,19 +83,6 @@ struct GPUContext { MEM_CXX_CLASS_ALLOC_FUNCS("GPUContext") }; -/* These require a OpenGL ctx bound. */ -GLuint GPU_buf_alloc(void); -GLuint GPU_tex_alloc(void); -GLuint GPU_vao_alloc(void); -GLuint GPU_fbo_alloc(void); - -/* These can be called any threads even without OpenGL ctx. */ -void GPU_buf_free(GLuint buf_id); -void GPU_tex_free(GLuint tex_id); -/* These two need the ctx the id was created with. */ -void GPU_vao_free(GLuint vao_id, GPUContext *ctx); -void GPU_fbo_free(GLuint fbo_id, GPUContext *ctx); - void gpu_context_active_framebuffer_set(GPUContext *ctx, struct GPUFrameBuffer *fb); struct GPUFrameBuffer *gpu_context_active_framebuffer_get(GPUContext *ctx); |