From dd11a7b378619354c7f1f69c2257860d6b47e3e3 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 24 Dec 2023 02:14:24 +0900 Subject: [PATCH] [vulkan] Apply 2d scale to clipping bounds It was a little off-putting getting an incorrectly clipped console when using non-unitary scale (especially since I was trying to show abbator something). --- libs/video/renderer/vulkan/vulkan_draw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/video/renderer/vulkan/vulkan_draw.c b/libs/video/renderer/vulkan/vulkan_draw.c index 9cccbb00f..e1a465134 100644 --- a/libs/video/renderer/vulkan/vulkan_draw.c +++ b/libs/video/renderer/vulkan/vulkan_draw.c @@ -1803,6 +1803,10 @@ Vulkan_Draw_SetClip (int x, int y, int w, int h, vulkan_ctx_t *ctx) h += y; y = 0; } + x *= ctx->twod_scale; + y *= ctx->twod_scale; + w *= ctx->twod_scale; + h *= ctx->twod_scale; auto cr = &dframe->clip_range.a[dframe->clip_range.size - 1]; if (x != cr->clip.offset.x || y != cr->clip.offset.y || (uint32_t) w != cr->clip.extent.width