ac/nir/cull: Fix typo in bounding box culling.
Bounding box culling is only viable when the W of all
vertices are positive. Always accept triangles whose any
W is negative.
Fixes: 0d527bb1aa
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7018
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17929>
This commit is contained in:
@@ -157,7 +157,7 @@ ac_nir_cull_triangle(nir_builder *b,
|
||||
nir_ssa_def *prim_outside_view = cull_frustrum(b, bbox_min, bbox_max);
|
||||
nir_ssa_def *prim_invisible = cull_small_primitive(b, bbox_min, bbox_max, prim_outside_view);
|
||||
|
||||
accepted = nir_iand(b, nir_inot(b, prim_invisible), nir_inot(b, w_info.any_w_negative));
|
||||
accepted = nir_ior(b, nir_inot(b, prim_invisible), w_info.any_w_negative);
|
||||
nir_if *if_still_accepted = nir_push_if(b, accepted);
|
||||
{
|
||||
accept_func(b, state);
|
||||
|
||||
Reference in New Issue
Block a user