Added a mutex to protect the mesh and BLAS lists in the RayTracingFeatureProcessor
Signed-off-by: dmcdiar <dmcdiar@amazon.com>
This commit is contained in:
@@ -89,6 +89,9 @@ namespace AZ
|
||||
RHI::Ptr<RHI::Device> device = RHI::RHISystemInterface::Get()->GetDevice();
|
||||
uint32_t objectIndex = objectId.GetIndex();
|
||||
|
||||
// lock the mutex to protect the mesh and BLAS lists
|
||||
AZStd::unique_lock<AZStd::mutex> lock(m_mutex);
|
||||
|
||||
MeshMap::iterator itMesh = m_meshes.find(objectIndex);
|
||||
if (itMesh == m_meshes.end())
|
||||
{
|
||||
@@ -169,6 +172,9 @@ namespace AZ
|
||||
return;
|
||||
}
|
||||
|
||||
// lock the mutex to protect the mesh and BLAS lists
|
||||
AZStd::unique_lock<AZStd::mutex> lock(m_mutex);
|
||||
|
||||
MeshMap::iterator itMesh = m_meshes.find(objectId.GetIndex());
|
||||
if (itMesh != m_meshes.end())
|
||||
{
|
||||
|
||||
@@ -223,6 +223,9 @@ namespace AZ
|
||||
// cached TransformServiceFeatureProcessor
|
||||
TransformServiceFeatureProcessor* m_transformServiceFeatureProcessor = nullptr;
|
||||
|
||||
// mutex for the mesh and BLAS lists
|
||||
AZStd::mutex m_mutex;
|
||||
|
||||
// structure for data in the m_meshInfoBuffer, shaders that use the buffer must match this type
|
||||
struct MeshInfo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user