- store the Vulkan descriptor sets in the material - where they belong!

Having them in the base texture object was a major maintenance issue.
This commit is contained in:
Christoph Oelckers 2020-04-18 23:56:22 +02:00
commit 5a2a72fc95
18 changed files with 160 additions and 116 deletions

View file

@ -434,8 +434,7 @@ void VkRenderState::ApplyMaterial()
auto fb = GetVulkanFrameBuffer();
auto passManager = fb->GetRenderPassManager();
VkHardwareTexture* base = mMaterial.mMaterial ? static_cast<VkHardwareTexture*>(mMaterial.mMaterial->GetLayer(0, mMaterial.mTranslation)) : nullptr;
VulkanDescriptorSet* descriptorset = base ? base->GetDescriptorSet(mMaterial) : passManager->GetNullTextureDescriptorSet();
VulkanDescriptorSet* descriptorset = mMaterial.mMaterial ? static_cast<VkMaterial*>(mMaterial.mMaterial)->GetDescriptorSet(mMaterial) : passManager->GetNullTextureDescriptorSet();
mCommandBuffer->bindDescriptorSet(VK_PIPELINE_BIND_POINT_GRAPHICS, passManager->GetPipelineLayout(mPipelineKey.NumTextureLayers), 1, descriptorset);
mMaterial.mChanged = false;