Skip to content

Commit 03df42f

Browse files
[Renderer] Fixed crash when having no meshes in scene.
1 parent 9d5b57d commit 03df42f

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Engine/Source/JobSystemModule/Public/JobSystem/Job.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace Volt
5050
{
5151
NotifyCounterReady();
5252

53-
m_isCompleted.store(1, std::memory_order::relaxed);
53+
m_isCompleted.store(1, std::memory_order::release);
5454
m_isCompleted.notify_all();
5555
}
5656
return prevCount;
@@ -90,7 +90,7 @@ namespace Volt
9090

9191
VT_INLINE void WaitForCounterLocking()
9292
{
93-
m_isCompleted.wait(0, std::memory_order::relaxed);
93+
m_isCompleted.wait(0, std::memory_order::acquire);
9494
}
9595

9696
// Needs to be in a cpp file as it interacts with

Engine/Source/Volt-Renderer/Private/Volt-Renderer/MeshPassProcessorsBindless/MeshPassProcessorBindless.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ namespace Volt
4848
{
4949
VT_PROFILE_FUNCTION();
5050

51+
// Reset the resources tied to the lifetime of the RenderGraph.
52+
m_perDrawCommandInstancesBuffer = nullptr;
53+
m_rhiDrawCommandsCopy = nullptr;
54+
5155
if (m_meshDrawCommands.empty())
5256
{
5357
return;
@@ -144,6 +148,12 @@ namespace Volt
144148
{
145149
VT_PROFILE_FUNCTION();
146150

151+
// Processor has no commands.
152+
if (m_meshDrawCommands.empty())
153+
{
154+
return;
155+
}
156+
147157
// Use RHIDrawCommandSceneInstanceOffsets to pass in as per instance value, which contains the start offset of the scene instances.
148158
IntRef<RHI::CommandBuffer> mainCommandBuffer = renderContext.GetRHICommandBuffer();
149159
IntRef<RHI::Buffer> perDrawCommandInstancesBuffer = m_perDrawCommandInstancesBuffer->GetRHIResource()->GetRHIBuffer();

0 commit comments

Comments
 (0)