Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-08-24 13:28:54 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-24 13:28:54 +0300
commitcb8da6efce80932797aaf3e10aa7eb8f3474c1ae (patch)
treec7653024e9579b378a208b8c53b13f90490c9034 /source/blender/gpu/intern
parent4883cc572888e281ee27f02b307d6fc827477686 (diff)
GPUState: Fix scissor state being overwritten when changing scissor bounds
Fix T79899 viewport artifacts when sculpting
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_state.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc
index f8d753f9ee7..fcbaa500e2d 100644
--- a/source/blender/gpu/intern/gpu_state.cc
+++ b/source/blender/gpu/intern/gpu_state.cc
@@ -201,7 +201,8 @@ void GPU_scissor(int x, int y, int width, int height)
{
GPUStateManager *stack = GPU_context_active_get()->state_manager;
auto &state = stack->mutable_state;
- int scissor_rect[4] = {x, y, width, height};
+ bool enabled = state.scissor_rect[2] > 0;
+ int scissor_rect[4] = {x, y, enabled ? width : -width, height};
copy_v4_v4_int(state.scissor_rect, scissor_rect);
}