fixed a couple of raytracing-related crashes

This commit is contained in:
myT 2024-02-18 16:22:24 +01:00
parent e69dc0c57b
commit c592ef22d6
2 changed files with 6 additions and 6 deletions

View File

@ -171,11 +171,6 @@ void Raytracing::Init()
desc.shortLifeTime = true;
desc.structureByteCount = structByteCount;
tlasInstanceBuffer = CreateBuffer(desc);
}
void Raytracing::ProcessWorld(world_t& world)
{
TagMapSurfacesRecursively(world.nodes);
// make sure we're not trying to use deleted buffers after a video restart
for(uint32_t i = 0; i < BLASBucket::Count; i++)
@ -185,6 +180,11 @@ void Raytracing::ProcessWorld(world_t& world)
dynamicBLASBuffers[i] = {};
}
tlasBuffer = RHI_MAKE_NULL_HANDLE();
}
void Raytracing::ProcessWorld(world_t& world)
{
TagMapSurfacesRecursively(world.nodes);
BLASBuilder staticBLASes[BLASBucket::Count];
WorldSurfaceList surfaceList;

View File

@ -1338,7 +1338,7 @@ void R_AddRTSurf( const surfaceType_t* surface, const shader_t* shader )
return;
if (*surface == SF_ENTITY) {
const refEntity_t* const ent = &backEnd.refdef.entities[tr.currentEntityNum].e;
const refEntity_t* const ent = &tr.refdef.entities[tr.currentEntityNum].e;
if (ent->reType == RT_SPRITE ||
ent->reType == RT_LIGHTNING ||
ent->reType == RT_POLY ||