From ccc512cc619dc9f0e6fd79270a7a96ece34d23b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 8 Sep 2020 03:18:49 +0200 Subject: GPUImmediate: Make activation / deactivation implicit This avoids unecessary complexity. Also makes the GPUImmediate threadsafe by using a threadlocal imm variable. --- source/blender/gpu/intern/gpu_immediate.cc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'source/blender/gpu/intern/gpu_immediate.cc') diff --git a/source/blender/gpu/intern/gpu_immediate.cc b/source/blender/gpu/intern/gpu_immediate.cc index dd3e5bea604..9fc5e03a796 100644 --- a/source/blender/gpu/intern/gpu_immediate.cc +++ b/source/blender/gpu/intern/gpu_immediate.cc @@ -39,12 +39,7 @@ using namespace blender::gpu; -static Immediate *imm = NULL; - -void immInit(void) -{ - /* TODO Remove */ -} +static thread_local Immediate *imm = NULL; void immActivate(void) { @@ -56,11 +51,6 @@ void immDeactivate(void) imm = NULL; } -void immDestroy(void) -{ - /* TODO Remove */ -} - GPUVertFormat *immVertexFormat(void) { GPU_vertformat_clear(&imm->vertex_format); -- cgit v1.2.3