Fix race condition
This commit is contained in:
parent
f87bcfd3a2
commit
883e3ce907
2 changed files with 3 additions and 0 deletions
|
|
@ -276,6 +276,7 @@ VkVertexFormat *VkRenderPassManager::GetVertexFormat(int index)
|
|||
|
||||
VulkanPipelineLayout* VkRenderPassManager::GetPipelineLayout(bool levelmesh, int UserUniformSize)
|
||||
{
|
||||
std::unique_lock lock(PipelineLayoutsMutex);
|
||||
auto &layout = PipelineLayouts[levelmesh][UserUniformSize];
|
||||
if (layout)
|
||||
return layout.get();
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <map>
|
||||
#include <thread>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
|
||||
class VulkanRenderDevice;
|
||||
class ColorBlendAttachmentBuilder;
|
||||
|
|
@ -183,6 +184,7 @@ private:
|
|||
VulkanRenderDevice* fb = nullptr;
|
||||
|
||||
std::map<VkRenderPassKey, std::unique_ptr<VkRenderPassSetup>> RenderPassSetup;
|
||||
std::mutex PipelineLayoutsMutex;
|
||||
std::map<int, std::unique_ptr<VulkanPipelineLayout>> PipelineLayouts[2];
|
||||
std::vector<VkVertexFormat> VertexFormats;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue