diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-08 05:12:12 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-08 05:15:50 +0300 |
commit | 48690d967a7731367cda01ab8dca64e7f4c3f6b5 (patch) | |
tree | 9295cc0ef083fd50eaab2c62785d54545eb004c6 /source/blender/gpu/opengl/gl_uniform_buffer.cc | |
parent | d2e9de93b8d1d6cd45abce8164d0f92af8f636d0 (diff) |
GPUContext: Move GPUContext to gpu::Context for more consistency
This makes the GPUContext follow the same naming convention as the rest
of the module.
Also add a static getter for extra bonus style (no need for casts):
- Context::get()
- GLContext::get()
Diffstat (limited to 'source/blender/gpu/opengl/gl_uniform_buffer.cc')
-rw-r--r-- | source/blender/gpu/opengl/gl_uniform_buffer.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpu/opengl/gl_uniform_buffer.cc b/source/blender/gpu/opengl/gl_uniform_buffer.cc index a06fadf4785..62c590d289f 100644 --- a/source/blender/gpu/opengl/gl_uniform_buffer.cc +++ b/source/blender/gpu/opengl/gl_uniform_buffer.cc @@ -56,7 +56,7 @@ GLUniformBuf::~GLUniformBuf() void GLUniformBuf::init(void) { - BLI_assert(GPU_context_active_get()); + BLI_assert(GLContext::get()); glGenBuffers(1, &ubo_id_); glBindBuffer(GL_UNIFORM_BUFFER, ubo_id_); @@ -112,7 +112,7 @@ void GLUniformBuf::bind(int slot) #ifdef DEBUG BLI_assert(slot < 16); - static_cast<GLContext *>(GPU_context_active_get())->bound_ubo_slots |= 1 << slot; + GLContext::get()->bound_ubo_slots |= 1 << slot; #endif } @@ -122,7 +122,7 @@ void GLUniformBuf::unbind(void) /* NOTE: This only unbinds the last bound slot. */ glBindBufferBase(GL_UNIFORM_BUFFER, slot_, 0); /* Hope that the context did not change. */ - static_cast<GLContext *>(GPU_context_active_get())->bound_ubo_slots &= ~(1 << slot_); + GLContext::get()->bound_ubo_slots &= ~(1 << slot_); #endif slot_ = 0; } |