mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 11:38:05 +02:00
radv/bvh: Make sure internal nodes are collapsed when possible
Avoiding NaNs should have the same effect but it's good practice to not
rely on float OPs for correctness.
Fixes: 95a89f7 ("radv: Report smaller bvh sizes when possible")
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39640>
This commit is contained in:
parent
60c1e4e3e6
commit
24a1e3d8c2
1 changed files with 1 additions and 1 deletions
|
|
@ -145,7 +145,7 @@ main()
|
|||
ir_id_to_offset(children[i]))).aabb;
|
||||
|
||||
float surface_area = aabb_surface_area(bounds);
|
||||
if (surface_area > largest_surface_area) {
|
||||
if (surface_area > largest_surface_area || collapsed_child_index == -1) {
|
||||
largest_surface_area = surface_area;
|
||||
collapsed_child_index = i;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue