Added barrier for shadow maps
This commit is contained in:
parent
ef8867a7a5
commit
b771cdbfc6
|
@ -560,6 +560,7 @@ namespace SHADE
|
||||||
// Prepare to write to descriptor
|
// Prepare to write to descriptor
|
||||||
shadowMapImageSamplers.emplace_back(NEW_IMAGE_VIEW, shadowMapSampler, vk::ImageLayout::eShaderReadOnlyOptimal);
|
shadowMapImageSamplers.emplace_back(NEW_IMAGE_VIEW, shadowMapSampler, vk::ImageLayout::eShaderReadOnlyOptimal);
|
||||||
|
|
||||||
|
// Update descriptor set
|
||||||
static constexpr uint32_t SHADOW_MAP_DESC_SET_INDEX = 0;
|
static constexpr uint32_t SHADOW_MAP_DESC_SET_INDEX = 0;
|
||||||
uint32_t const SHADOW_MAP_DESC_ARRAY_INDEX = shadowMapImageSamplers.size() - 1;
|
uint32_t const SHADOW_MAP_DESC_ARRAY_INDEX = shadowMapImageSamplers.size() - 1;
|
||||||
shadowMapDescriptorSet->ModifyWriteDescImage
|
shadowMapDescriptorSet->ModifyWriteDescImage
|
||||||
|
@ -577,6 +578,23 @@ namespace SHADE
|
||||||
SHGraphicsConstants::DescriptorSetBindings::SHADOW_MAP_IMAGE_SAMPLER_DATA
|
SHGraphicsConstants::DescriptorSetBindings::SHADOW_MAP_IMAGE_SAMPLER_DATA
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// add to barriers
|
||||||
|
shadowMapMemoryBarriers.push_back (vk::ImageMemoryBarrier
|
||||||
|
{
|
||||||
|
.oldLayout = vk::ImageLayout::eDepthAttachmentOptimal,
|
||||||
|
.newLayout = vk::ImageLayout::eShaderReadOnlyOptimal,
|
||||||
|
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||||
|
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||||
|
.image = newShadowMap->GetImage()->GetVkImage(),
|
||||||
|
.subresourceRange = vk::ImageSubresourceRange
|
||||||
|
{
|
||||||
|
.aspectMask = vk::ImageAspectFlagBits::eDepth,
|
||||||
|
.baseMipLevel = 0,
|
||||||
|
.levelCount = 1,
|
||||||
|
.baseArrayLayer = 0,
|
||||||
|
.layerCount = 1,
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle<SHVkDescriptorSetGroup> SHLightingSubSystem::GetLightDataDescriptorSet(void) const noexcept
|
Handle<SHVkDescriptorSetGroup> SHLightingSubSystem::GetLightDataDescriptorSet(void) const noexcept
|
||||||
|
|
Loading…
Reference in New Issue