From 461d9b40529a5e8979965ab998e49e49704e842b Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 29 Aug 2023 18:04:28 +0200 Subject: [PATCH] gpu: Set scissor rect before clearing The render area that restricts clearing on Vulkan needs to be respected by the GL renderer, too. --- gsk/gpu/gskgpurenderpassop.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gsk/gpu/gskgpurenderpassop.c b/gsk/gpu/gskgpurenderpassop.c index 899b7c03b7..403e7b661b 100644 --- a/gsk/gpu/gskgpurenderpassop.c +++ b/gsk/gpu/gskgpurenderpassop.c @@ -172,6 +172,10 @@ gsk_gpu_render_pass_op_gl_command (GskGpuOp *op, gsk_gpu_image_get_width (self->target), gsk_gpu_image_get_height (self->target)); + if (target_flip_y) + glScissor (self->area.x, target_flip_y - self->area.y - self->area.height, self->area.width, self->area.height); + else + glScissor (self->area.x, self->area.y, self->area.width, self->area.height); glClearColor (0, 0, 0, 0); glClear (GL_COLOR_BUFFER_BIT);