Fix upload bug and skip upload when RT cores are available
This commit is contained in:
parent
e7c2716191
commit
c866937262
3 changed files with 8 additions and 5 deletions
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "hw_collision.h"
|
||||
#include "hw_levelmesh.h"
|
||||
#include "v_video.h"
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <cfloat>
|
||||
|
|
@ -128,7 +129,8 @@ static FVector3 SwapYZ(const FVector3& v)
|
|||
|
||||
void CPUAccelStruct::Upload()
|
||||
{
|
||||
// To do: don't bother with this if rayquery is available as it won't be used
|
||||
if (screen->IsRayQueryEnabled())
|
||||
return;
|
||||
|
||||
unsigned int count = (unsigned int)TLAS.Nodes.size();
|
||||
for (auto& blas : DynamicBLAS)
|
||||
|
|
@ -165,9 +167,9 @@ void CPUAccelStruct::Upload()
|
|||
CollisionNode& info = destnodes[offset];
|
||||
info.center = SwapYZ(node.aabb.Center);
|
||||
info.extents = SwapYZ(node.aabb.Extents);
|
||||
info.left = blasStart + node.left;
|
||||
info.right = blasStart + node.right;
|
||||
info.element_index = indexStart + node.element_index;
|
||||
info.left = node.left != -1 ? blasStart + node.left : -1;
|
||||
info.right = node.right != -1 ? blasStart + node.right : -1;
|
||||
info.element_index = node.element_index != -1 ? indexStart + node.element_index : -1;
|
||||
offset++;
|
||||
}
|
||||
instance++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue