Bad things happen when these aren't initialized.
Fixes GPU hangs when loading Avatar: Frontiers of Pandora savegames.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26712>
(cherry picked from commit
f9a394b753b55ccfc869568413b6fc6795dc1636)
"description": "radv/rt: Initialize unused children in PLOC early-exit",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null
total_bounds.min = vec3(INFINITY);
total_bounds.max = vec3(-INFINITY);
- for (uint32_t i = 0; i < DEREF(args.header).active_leaf_count; i++) {
+ uint32_t i = 0;
+ for (; i < DEREF(args.header).active_leaf_count; i++) {
uint32_t child_id = DEREF(INDEX(key_id_pair, src_ids, i)).id;
if (child_id != RADV_BVH_INVALID_NODE) {
DEREF(dst_node).children[i] = child_id;
}
+ for (; i < 2; i++)
+ DEREF(dst_node).children[i] = RADV_BVH_INVALID_NODE;
DEREF(dst_node).base.aabb = total_bounds;
DEREF(dst_node).bvh_offset = RADV_UNKNOWN_BVH_OFFSET;