diff options
Diffstat (limited to 'source/blender/gpu/intern/gpu_context.cpp')
-rw-r--r-- | source/blender/gpu/intern/gpu_context.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_context.cpp b/source/blender/gpu/intern/gpu_context.cpp index 8d8f4d12b04..ce3eb64fa37 100644 --- a/source/blender/gpu/intern/gpu_context.cpp +++ b/source/blender/gpu/intern/gpu_context.cpp @@ -69,6 +69,7 @@ static std::mutex orphans_mutex; struct GPUContext { GLuint default_vao; + GPUFrameBuffer *current_fbo; std::unordered_set<GPUBatch *> batches; /* Batches that have VAOs from this context */ #ifdef DEBUG std::unordered_set<GPUFrameBuffer *> framebuffers; /* Framebuffers that have FBO from this context */ @@ -82,6 +83,7 @@ struct GPUContext { GPUContext() { thread_is_used = false; + current_fbo = 0; } #endif }; @@ -315,3 +317,13 @@ void gpu_context_remove_framebuffer(GPUContext *ctx, GPUFrameBuffer *fb) UNUSED_VARS(ctx, fb); #endif } + +void gpu_context_active_framebuffer_set(GPUContext *ctx, GPUFrameBuffer *fb) +{ + ctx->current_fbo = fb; +} + +GPUFrameBuffer *gpu_context_active_framebuffer_get(GPUContext *ctx) +{ + return ctx->current_fbo; +} |