v3dv: simplify too small Z viewport scale workaround
authorIago Toral Quiroga <itoral@igalia.com>
Wed, 20 Oct 2021 09:25:23 +0000 (11:25 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 23 May 2023 09:22:56 +0000 (09:22 +0000)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23167>

src/broadcom/vulkan/v3dv_cmd_buffer.c

index 2cf2fdf..4bd05e1 100644 (file)
@@ -2161,7 +2161,7 @@ v3dv_viewport_compute_xform(const VkViewport *viewport,
     */
    const float min_abs_scale = 0.000009f;
    if (fabs(scale[2]) < min_abs_scale)
-      scale[2] = min_abs_scale * (scale[2] < 0 ? -1.0f : 1.0f);
+      scale[2] = scale[2] < 0 ? -min_abs_scale : min_abs_scale;
 }
 
 /* Considers the pipeline's negative_one_to_one state and applies it to the