From 2c04373c45ea80eda6f86e0a9d0eb97a7522ab86 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 28 Feb 2022 14:18:09 -0600 Subject: [PATCH] anv: Calculate the real guardband based on render area Reviewed-by: Ivan Briano Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/gfx8_cmd_buffer.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/gfx8_cmd_buffer.c b/src/intel/vulkan/gfx8_cmd_buffer.c index 993ed1e6f6b..ae01562f5e2 100644 --- a/src/intel/vulkan/gfx8_cmd_buffer.c +++ b/src/intel/vulkan/gfx8_cmd_buffer.c @@ -77,10 +77,15 @@ gfx8_cmd_buffer_emit_viewport(struct anv_cmd_buffer *cmd_buffer) * framebuffer at the time we emit the packet. Otherwise, we have * fall back to a worst-case guardband of [-1, 1]. */ - intel_calculate_guardband_size(0, gfx->render_area.offset.x + - gfx->render_area.extent.width, - 0, gfx->render_area.offset.y + - gfx->render_area.extent.height, + const uint32_t x_min = gfx->render_area.offset.x; + const uint32_t x_max = gfx->render_area.offset.x + + gfx->render_area.extent.width; + + const uint32_t y_min = gfx->render_area.offset.y; + const uint32_t y_max = gfx->render_area.offset.y + + gfx->render_area.extent.height; + + intel_calculate_guardband_size(x_min, x_max, y_min, y_max, sfv.ViewportMatrixElementm00, sfv.ViewportMatrixElementm11, sfv.ViewportMatrixElementm30,