radv/bvh: Fix updating empty bvhs

valid_child_count_minus_one is 15 for box nodes without child so every
child was considered valid which made the code read invalid data and use
that for addressing.

Fixes: 2d48b2c ("radv: Use subgroup OPs for BVH updates on GFX12")
Closes: #13217
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35119>
This commit is contained in:
Konstantin Seurer
2025-05-22 21:32:02 +02:00
committed by Marge Bot
parent df2c774a83
commit 36c9b66ee2

View File

@@ -79,7 +79,7 @@ main()
uint32_t child_type = (child.dword2 >> 24) & 0xf;
bool is_leaf_or_invalid = child_type == radv_bvh_node_triangle;
bool is_valid = cluster.invocation_index <= valid_child_count_minus_one;
bool is_valid = cluster.invocation_index <= valid_child_count_minus_one && valid_child_count_minus_one != 0xf;
bool is_leaf = is_leaf_or_invalid && is_valid;
uint32_t child_offset;