mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 18:08:40 +02:00
radv/bvh: Prefer selecting quads as the first pair of a HW node
Is a single triangle is selected, it can be the case that the next iteration
can't merge any pair with the triangle. In that case, the HW node with a
single triangle will not have the highest hw_node_index, triggering an
assert.
Fixes: c18a7d0 ("radv: Emit compressed primitive nodes on GFX12")
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39655>
This commit is contained in:
parent
9e56c7bd8f
commit
db38d1a98c
1 changed files with 17 additions and 3 deletions
|
|
@ -328,9 +328,23 @@ main()
|
|||
vertex_used[i] = false;
|
||||
}
|
||||
} else {
|
||||
uint32_t chosen_invocation =
|
||||
findMSB(radv_ballot(cluster, !assigned && required_bit_size == min_required_bit_size));
|
||||
if (cluster.invocation_index != chosen_invocation && !assigned) {
|
||||
uint32_t candidate_mask = radv_ballot(cluster, !assigned && required_bit_size == min_required_bit_size);
|
||||
|
||||
/* Always choose a quad as the first node to make sure that a potential single triangle node will have the
|
||||
* highest hw_node_index.
|
||||
*/
|
||||
if (assigned_mask == 0) {
|
||||
uint32_t quad_mask = radv_ballot(cluster, !assigned && pair_index_node_index1 != RADV_BVH_INVALID_NODE);
|
||||
if (quad_mask != 0) {
|
||||
uint32_t combined_mask = candidate_mask & quad_mask;
|
||||
if (combined_mask != 0)
|
||||
candidate_mask = combined_mask;
|
||||
else
|
||||
candidate_mask = quad_mask;
|
||||
}
|
||||
}
|
||||
|
||||
if (cluster.invocation_index != findMSB(candidate_mask) && !assigned) {
|
||||
vertex_indices = UNASSIGNED_VERTEX_INDICES;
|
||||
for (uint32_t i = 0; i < 6; i++)
|
||||
vertex_used[i] = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue