diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-01 18:04:08 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-01 18:22:57 +0300 |
commit | f1b10477c28c91f8b29a0ab4a25a149e7f0147db (patch) | |
tree | 1c9d2c076fceb46cbc5abcd74cf2704bd7d8df71 | |
parent | 907a718ebe3e242d923929af9dd7bd73130c6940 (diff) |
GPUOffscreen: Remove scissor and viewport state tracking
This was a workaround that is not needed anymore.
Fix FT80321 Cropped output with Viewport Render Animation
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.cc | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index ead72bbd0c5..1b6fea56028 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -541,13 +541,6 @@ struct GPUOffScreen { GPUTexture *color; GPUTexture *depth; - - /** Saved state of the previously bound framebuffer. */ - /* TODO(fclem) This is quite hacky and a proper fix would be to - * put these states directly inside the GPUFrambuffer. - * But we don't have a GPUFramebuffer for the default framebuffer yet. */ - int saved_viewport[4]; - int saved_scissor[4]; }; /* Returns the correct framebuffer for the current context. */ @@ -642,26 +635,16 @@ void GPU_offscreen_free(GPUOffScreen *ofs) void GPU_offscreen_bind(GPUOffScreen *ofs, bool save) { if (save) { - GPU_scissor_get(ofs->saved_scissor); - GPU_viewport_size_get_i(ofs->saved_viewport); - GPUFrameBuffer *fb = GPU_framebuffer_active_get(); gpuPushFrameBuffer(reinterpret_cast<GPUFrameBuffer *>(fb)); } - GPUFrameBuffer *ofs_fb = gpu_offscreen_fb_get(ofs); - GPU_framebuffer_bind(ofs_fb); - glDisable(GL_FRAMEBUFFER_SRGB); - GPU_scissor_test(false); - GPU_shader_set_framebuffer_srgb_target(false); + reinterpret_cast<FrameBuffer *>(gpu_offscreen_fb_get(ofs))->bind(false); } -void GPU_offscreen_unbind(GPUOffScreen *ofs, bool restore) +void GPU_offscreen_unbind(GPUOffScreen *UNUSED(ofs), bool restore) { GPUFrameBuffer *fb = NULL; - if (restore) { - GPU_scissor(UNPACK4(ofs->saved_scissor)); - GPU_viewport(UNPACK4(ofs->saved_viewport)); fb = gpuPopFrameBuffer(); } |