From 893e19efb74edd6133a607e09338bf5d449632f1 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 17 Apr 2018 22:07:26 +0200 Subject: [PATCH] radv: fix scissor computation when using half-pixel viewport offset 'scale[i]' can be non-integer. Original patch by Philip Rebohle. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106074 Fixes: 0f3de89a56a ("radv: Use the guard band.") Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Niuwenhuizen --- src/amd/vulkan/si_cmd_buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c index aed291be35d..15edaa4b2b5 100644 --- a/src/amd/vulkan/si_cmd_buffer.c +++ b/src/amd/vulkan/si_cmd_buffer.c @@ -663,10 +663,10 @@ static VkRect2D si_scissor_from_viewport(const VkViewport *viewport) get_viewport_xform(viewport, scale, translate); - rect.offset.x = translate[0] - abs(scale[0]); - rect.offset.y = translate[1] - abs(scale[1]); - rect.extent.width = ceilf(translate[0] + abs(scale[0])) - rect.offset.x; - rect.extent.height = ceilf(translate[1] + abs(scale[1])) - rect.offset.y; + rect.offset.x = translate[0] - fabs(scale[0]); + rect.offset.y = translate[1] - fabs(scale[1]); + rect.extent.width = ceilf(translate[0] + fabs(scale[0])) - rect.offset.x; + rect.extent.height = ceilf(translate[1] + fabs(scale[1])) - rect.offset.y; return rect; } -- 2.30.2