From 48690d967a7731367cda01ab8dca64e7f4c3f6b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 8 Sep 2020 04:12:12 +0200 Subject: 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() --- source/blender/gpu/intern/gpu_texture.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/gpu/intern/gpu_texture.cc') diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc index 05b97129f00..b22fd53f0f6 100644 --- a/source/blender/gpu/intern/gpu_texture.cc +++ b/source/blender/gpu/intern/gpu_texture.cc @@ -386,7 +386,7 @@ void GPU_texture_update(GPUTexture *tex, eGPUDataFormat data_format, const void * Skipping pixels correctly when changing rows when doing partial update.*/ void GPU_unpack_row_length_set(uint len) { - GPU_context_active_get()->state_manager->texture_unpack_row_length_set(len); + Context::get()->state_manager->texture_unpack_row_length_set(len); } /* ------ Binding ------ */ @@ -398,24 +398,24 @@ void GPU_texture_bind_ex(GPUTexture *tex_, { Texture *tex = reinterpret_cast(tex_); state = (state >= GPU_SAMPLER_MAX) ? tex->sampler_state : state; - GPU_context_active_get()->state_manager->texture_bind(tex, state, unit); + Context::get()->state_manager->texture_bind(tex, state, unit); } void GPU_texture_bind(GPUTexture *tex_, int unit) { Texture *tex = reinterpret_cast(tex_); - GPU_context_active_get()->state_manager->texture_bind(tex, tex->sampler_state, unit); + Context::get()->state_manager->texture_bind(tex, tex->sampler_state, unit); } void GPU_texture_unbind(GPUTexture *tex_) { Texture *tex = reinterpret_cast(tex_); - GPU_context_active_get()->state_manager->texture_unbind(tex); + Context::get()->state_manager->texture_unbind(tex); } void GPU_texture_unbind_all(void) { - GPU_context_active_get()->state_manager->texture_unbind_all(); + Context::get()->state_manager->texture_unbind_all(); } void GPU_texture_generate_mipmap(GPUTexture *tex) -- cgit v1.2.3