Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-08 05:12:12 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-08 05:15:50 +0300
commit48690d967a7731367cda01ab8dca64e7f4c3f6b5 (patch)
tree9295cc0ef083fd50eaab2c62785d54545eb004c6 /source/blender/gpu/opengl/gl_batch.cc
parentd2e9de93b8d1d6cd45abce8164d0f92af8f636d0 (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_batch.cc')
-rw-r--r--source/blender/gpu/opengl/gl_batch.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc
index c28d3e33e65..b25bafad6a3 100644
--- a/source/blender/gpu/opengl/gl_batch.cc
+++ b/source/blender/gpu/opengl/gl_batch.cc
@@ -151,7 +151,7 @@ void GLVaoCache::remove(const GLShaderInterface *interface)
void GLVaoCache::clear(void)
{
- GLContext *ctx = static_cast<GLContext *>(GPU_context_active_get());
+ GLContext *ctx = GLContext::get();
const int count = (is_dynamic_vao_count) ? dynamic_vaos.count : GPU_VAO_STATIC_LEN;
GLuint *vaos = (is_dynamic_vao_count) ? dynamic_vaos.vao_ids : static_vaos.vao_ids;
const GLShaderInterface **interfaces = (is_dynamic_vao_count) ? dynamic_vaos.interfaces :
@@ -209,7 +209,7 @@ GLuint GLVaoCache::lookup(const GLShaderInterface *interface)
* Reset the cache if trying to draw in another context; */
void GLVaoCache::context_check(void)
{
- GLContext *ctx = static_cast<GLContext *>(GPU_context_active_get());
+ GLContext *ctx = GLContext::get();
BLI_assert(ctx);
if (context_ != ctx) {
@@ -228,7 +228,7 @@ GLuint GLVaoCache::base_instance_vao_get(GPUBatch *batch, int i_first)
{
this->context_check();
/* Make sure the interface is up to date. */
- Shader *shader = GPU_context_active_get()->shader;
+ Shader *shader = GLContext::get()->shader;
GLShaderInterface *interface = static_cast<GLShaderInterface *>(shader->interface);
if (interface_ != interface) {
vao_get(batch);
@@ -260,7 +260,7 @@ GLuint GLVaoCache::vao_get(GPUBatch *batch)
{
this->context_check();
- Shader *shader = GPU_context_active_get()->shader;
+ Shader *shader = GLContext::get()->shader;
GLShaderInterface *interface = static_cast<GLShaderInterface *>(shader->interface);
if (interface_ != interface) {
interface_ = interface;
@@ -298,7 +298,7 @@ GLBatch::~GLBatch()
void GLBatch::bind(int i_first)
{
- GPU_context_active_get()->state_manager->apply_state();
+ GLContext::get()->state_manager->apply_state();
if (flag & GPU_BATCH_DIRTY) {
flag &= ~GPU_BATCH_DIRTY;