diff options
Diffstat (limited to 'source/blender/gpu/intern/gpu_framebuffer.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.cc | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index 910bdc531fe..d5d7994a154 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -476,8 +476,10 @@ void GPU_framebuffer_recursive_downsample(GPUFrameBuffer *gpu_fb, /** \} */ /* -------------------------------------------------------------------- */ -/** \name Framebuffer Push/Pop +/** \name GPUOffScreen * + * Container that holds a frame-buffer and its textures. + * Might be bound to multiple contexts. * \{ */ #define FRAMEBUFFER_STACK_DEPTH 16 @@ -487,36 +489,22 @@ static struct { uint top; } FrameBufferStack = {{nullptr}}; -void GPU_framebuffer_push(GPUFrameBuffer *fb) +static void gpuPushFrameBuffer(GPUFrameBuffer *fb) { BLI_assert(FrameBufferStack.top < FRAMEBUFFER_STACK_DEPTH); FrameBufferStack.framebuffers[FrameBufferStack.top] = fb; FrameBufferStack.top++; } -GPUFrameBuffer *GPU_framebuffer_pop(void) +static GPUFrameBuffer *gpuPopFrameBuffer() { BLI_assert(FrameBufferStack.top > 0); FrameBufferStack.top--; return FrameBufferStack.framebuffers[FrameBufferStack.top]; } -uint GPU_framebuffer_stack_level_get(void) -{ - return FrameBufferStack.top; -} - #undef FRAMEBUFFER_STACK_DEPTH -/** \} */ - -/* -------------------------------------------------------------------- */ -/** \name GPUOffScreen - * - * Container that holds a frame-buffer and its textures. - * Might be bound to multiple contexts. - * \{ */ - #define MAX_CTX_FB_LEN 3 struct GPUOffScreen { @@ -626,7 +614,7 @@ void GPU_offscreen_bind(GPUOffScreen *ofs, bool save) { if (save) { GPUFrameBuffer *fb = GPU_framebuffer_active_get(); - GPU_framebuffer_push(fb); + gpuPushFrameBuffer(fb); } unwrap(gpu_offscreen_fb_get(ofs))->bind(false); } @@ -635,7 +623,7 @@ void GPU_offscreen_unbind(GPUOffScreen *UNUSED(ofs), bool restore) { GPUFrameBuffer *fb = nullptr; if (restore) { - fb = GPU_framebuffer_pop(); + fb = gpuPopFrameBuffer(); } if (fb) { |