diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-07-17 20:21:33 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-07-18 04:43:52 +0300 |
commit | 1f2edba1fbf39a40b07bdf37276d2650655a4edd (patch) | |
tree | 8a4421f5b3eeede0cc37cd1dde19d3c9983dfb45 /source/blender/gpu/intern | |
parent | d19b3019d9aee026b7aab738624795da162f6a8b (diff) |
Cleanup: GPU: Encapsulate scissor test
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.c | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_state.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index 40c1e6f59b2..c079864126e 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -979,10 +979,10 @@ void GPU_offscreen_bind(GPUOffScreen *ofs, bool save) GPUFrameBuffer *fb = GPU_framebuffer_active_get(); gpuPushFrameBuffer(fb); } - glDisable(GL_SCISSOR_TEST); 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); } diff --git a/source/blender/gpu/intern/gpu_state.c b/source/blender/gpu/intern/gpu_state.c index 1e79212fc4e..a339cfb8b5a 100644 --- a/source/blender/gpu/intern/gpu_state.c +++ b/source/blender/gpu/intern/gpu_state.c @@ -146,6 +146,16 @@ void GPU_program_point_size(bool enable) } } +void GPU_scissor_test(bool enable) +{ + if (enable) { + glEnable(GL_SCISSOR_TEST); + } + else { + glDisable(GL_SCISSOR_TEST); + } +} + void GPU_scissor(int x, int y, int width, int height) { glScissor(x, y, width, height); |