turnip: fix znear clipping
authorJonathan Marek <jonathan@marek.ca>
Tue, 24 Mar 2020 01:33:36 +0000 (21:33 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 24 Mar 2020 13:01:44 +0000 (13:01 +0000)
Vulkan clips znear at 0 instead of -1.

Fixes dEQP-VK.draw.inverted_depth_ranges.nodepthclamp_*

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4293>

src/freedreno/vulkan/tu_pipeline.c

index 3d25428fe82fcf67df2c8d9c8dcf7c8059a4a0ab..1604bec0e1bab3332943357b29e27c64803e51fa 100644 (file)
@@ -1343,7 +1343,8 @@ static void
 tu6_emit_gras_unknowns(struct tu_cs *cs)
 {
    tu_cs_emit_pkt4(cs, REG_A6XX_GRAS_CL_CNTL, 1);
-   tu_cs_emit(cs, A6XX_GRAS_CL_CNTL_VP_CLIP_CODE_IGNORE);
+   tu_cs_emit(cs, A6XX_GRAS_CL_CNTL_ZERO_GB_SCALE_Z |
+                  A6XX_GRAS_CL_CNTL_VP_CLIP_CODE_IGNORE);
    tu_cs_emit_pkt4(cs, REG_A6XX_GRAS_UNKNOWN_8001, 1);
    tu_cs_emit(cs, 0x0);
    tu_cs_emit_pkt4(cs, REG_A6XX_GRAS_LAYER_CNTL, 1);