Skip to content

Commit

Permalink
Potential fix for #207
Browse files Browse the repository at this point in the history
  • Loading branch information
Moddingear committed Jan 30, 2023
1 parent 9dcb44b commit 409e65c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FRuntimeMeshComponentSceneProxy : public FPrimitiveSceneProxy
// Reference all the in-use buffers so that as long as this proxy is around these buffers will be too.
// This is meant only for statically drawn sections. Dynamically drawn sections can update safely in place.
// Static sections get new buffers on each update.
TArray<TSharedPtr<FRuntimeMeshSectionProxyBuffers>> InUseBuffers;
TArray<TSharedPtr<FRuntimeMeshSectionProxyBuffers, ESPMode::ThreadSafe>> InUseBuffers;

// Reference to the body setup for rendering.
UBodySetup* BodySetup;
Expand Down
2 changes: 1 addition & 1 deletion Source/RuntimeMeshComponent/Private/RuntimeMeshProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ void FRuntimeMeshProxy::ApplyMeshToSection(int32 LODIndex, int32 SectionId, FRun

if (bShouldRecreateBuffers)
{
Section.Buffers = MakeShared<FRuntimeMeshSectionProxyBuffers>(false, false);
Section.Buffers = MakeShared<FRuntimeMeshSectionProxyBuffers, ESPMode::ThreadSafe>(false, false);
Section.Buffers->InitFromRHIReferences(MeshData, Batcher);
}
else
Expand Down
4 changes: 2 additions & 2 deletions Source/RuntimeMeshComponent/Private/RuntimeMeshSectionProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct FRuntimeMeshSectionNullBufferElement
};


struct FRuntimeMeshSectionProxyBuffers : public TSharedFromThis<FRuntimeMeshSectionProxyBuffers>
struct FRuntimeMeshSectionProxyBuffers : public TSharedFromThis<FRuntimeMeshSectionProxyBuffers, ESPMode::ThreadSafe>
{
/** Vertex factory for this section */
FRuntimeMeshVertexFactory VertexFactory;
Expand Down Expand Up @@ -112,7 +112,7 @@ struct FRuntimeMeshSectionProxyBuffers : public TSharedFromThis<FRuntimeMeshSect

struct FRuntimeMeshSectionProxy
{
TSharedPtr<FRuntimeMeshSectionProxyBuffers> Buffers;
TSharedPtr<FRuntimeMeshSectionProxyBuffers, ESPMode::ThreadSafe> Buffers;

uint32 FirstIndex;
uint32 NumTriangles;
Expand Down

0 comments on commit 409e65c

Please sign in to comment.