Mesa (main): dzn: Use fabs on floating point input

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jul 9 14:39:11 UTC 2022


Module: Mesa
Branch: main
Commit: 5a59211acd128c4ced0f7e33ab2e2eb088bc9342
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a59211acd128c4ced0f7e33ab2e2eb088bc9342

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Fri Jul  8 08:02:24 2022 -0700

dzn: Use fabs on floating point input

Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17423>

---

 src/microsoft/vulkan/dzn_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/microsoft/vulkan/dzn_util.c b/src/microsoft/vulkan/dzn_util.c
index 7f9dac363ce..5c7750d9ac9 100644
--- a/src/microsoft/vulkan/dzn_util.c
+++ b/src/microsoft/vulkan/dzn_util.c
@@ -281,7 +281,7 @@ dzn_translate_viewport(D3D12_VIEWPORT *out,
    out->TopLeftX = in->x;
    out->TopLeftY = in->height < 0 ? in->height + in->y : in->y;
    out->Width = in->width;
-   out->Height = abs(in->height);
+   out->Height = fabs(in->height);
    out->MinDepth = MIN2(in->minDepth, in->maxDepth);
    out->MaxDepth = MAX2(in->maxDepth, in->minDepth);
 }



More information about the mesa-commit mailing list