From 46d0126deb82b46c2d7bdadb228e1721b4f485f7 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Mon, 16 Aug 2021 13:02:50 +0200 Subject: [PATCH] radv: improve rounding of zmin Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_meta_clear.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c index 82bb12b..e41ac7b 100644 --- a/src/amd/vulkan/radv_meta_clear.c +++ b/src/amd/vulkan/radv_meta_clear.c @@ -888,7 +888,7 @@ radv_get_htile_fast_clear_value(const struct radv_device *device, const struct r uint32_t zmin, zmax; /* Convert the depth value to 14-bit zmin/zmax values. */ - zmin = ((value.depth * max_zval) + 0.5f); + zmin = lroundf(value.depth * max_zval); zmax = zmin; if (radv_image_tile_stencil_disabled(device, image)) { -- 2.7.4