Make VkMaterial::GetDescriptorSet thread safe

This commit is contained in:
Magnus Norddahl 2023-05-17 19:08:57 +02:00
commit 9067d7529d
3 changed files with 35 additions and 3 deletions

View file

@ -486,7 +486,7 @@ void VkRenderState::ApplyMaterial()
if (mMaterial.mMaterial && mMaterial.mMaterial->Source()->isHardwareCanvas())
static_cast<FCanvasTexture*>(mMaterial.mMaterial->Source()->GetTexture())->NeedUpdate();
VulkanDescriptorSet* descriptorset = mMaterial.mMaterial ? static_cast<VkMaterial*>(mMaterial.mMaterial)->GetDescriptorSet(mMaterial) : descriptors->GetNullTextureDescriptorSet();
VulkanDescriptorSet* descriptorset = mMaterial.mMaterial ? static_cast<VkMaterial*>(mMaterial.mMaterial)->GetDescriptorSet(threadIndex, mMaterial) : descriptors->GetNullTextureDescriptorSet();
mCommandBuffer->bindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptors->GetFixedDescriptorSet());
mCommandBuffer->bindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 2, descriptorset);