From e6d996f8ff2e365b96de3e521275764ada317249 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Mon, 16 Aug 2021 13:13:43 +0200 Subject: [PATCH] radeonsi: improve rounding of zmin MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_clear.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c index 7f236fe..48283c0 100644 --- a/src/gallium/drivers/radeonsi/si_clear.c +++ b/src/gallium/drivers/radeonsi/si_clear.c @@ -476,7 +476,7 @@ static uint32_t si_get_htile_clear_value(struct si_texture *tex, float depth) const uint32_t smem = 0; /* Convert depthValue to 14-bit zmin/zmax uint values. */ - const uint32_t zmin = (depth * max_z_value) + 0.5f; + const uint32_t zmin = lroundf(depth * max_z_value); const uint32_t zmax = zmin; if (tex->htile_stencil_disabled) { -- 2.7.4