ac/nir/cull: fix line position w culling
authorQiang Yu <yuq825@gmail.com>
Fri, 5 May 2023 03:04:35 +0000 (11:04 +0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 9 May 2023 02:30:41 +0000 (02:30 +0000)
Fixes: db0e9d3caba ("ac/nir/ngg: support line culling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8950
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22867>

src/amd/common/ac_nir_cull.c

index eb8a76d..ffb8c2d 100644 (file)
@@ -314,7 +314,7 @@ ac_nir_cull_line(nir_builder *b,
                  void *state)
 {
    nir_ssa_def *accepted = initially_accepted;
-   accepted = nir_iand(b, accepted, nir_inot(b, w_info->any_w_negative));
+   accepted = nir_iand(b, accepted, nir_inot(b, w_info->all_w_negative));
 
    nir_ssa_def *bbox_accepted = NULL;
 
@@ -328,7 +328,7 @@ ac_nir_cull_line(nir_builder *b,
       nir_ssa_def *prim_invisible =
          cull_small_primitive_line(b, pos, bbox_min, bbox_max, prim_outside_view);
 
-      bbox_accepted = nir_inot(b, prim_invisible);
+      bbox_accepted = nir_ior(b, nir_inot(b, prim_invisible), w_info->any_w_negative);
 
       /* for caller which need to react when primitive is accepted */
       if (accept_func) {