Minor change to comments

Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com>
This commit is contained in:
dmcdiarmid-ly
2021-12-13 12:03:40 -07:00
parent 4d187b0980
commit da8967d570
2 changed files with 4 additions and 4 deletions
@@ -1155,8 +1155,7 @@ namespace AZ
case RHI::ScopeAttachmentUsage::Shader:
case RHI::ScopeAttachmentUsage::SubpassInput:
{
// If we are reading from a depth/stencil texture, then we use the depth/stencil read optimal layout instead of the generic shader read one.
// Note that if the Image is ShaderWrite we always set VK_IMAGE_LAYOUT_GENERAL, even in a read scope.
// always set VK_IMAGE_LAYOUT_GENERAL if the Image is ShaderWrite, even in a read scope
if (RHI::CheckBitsAny(usagesAndAccesses.front().m_access, RHI::ScopeAttachmentAccess::Write) ||
RHI::CheckBitsAny(imageView->GetImage().GetDescriptor().m_bindFlags, RHI::ImageBindFlags::ShaderWrite))
{
@@ -1164,6 +1163,7 @@ namespace AZ
}
else
{
// if we are reading from a depth/stencil texture, then we use the depth/stencil read optimal layout instead of the generic shader read one
return RHI::CheckBitsAny(imageAspects, RHI::ImageAspectFlags::DepthStencil) ?
VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
}
@@ -149,8 +149,7 @@ namespace AZ
{
imageInfo.imageView = imageView->GetNativeImageView();
// If we are reading from a depth/stencil texture, then we use the depth/stencil read optimal layout instead of the generic shader read one.
// Note that if the Image is ShaderWrite we always set VK_IMAGE_LAYOUT_GENERAL, even if the descriptor layout wants a read-only input.
// always set VK_IMAGE_LAYOUT_GENERAL if the Image is ShaderWrite, even if the descriptor layout wants a read-only input
if (layout.GetDescriptorType(layoutIndex) == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE ||
RHI::CheckBitsAny(imageView->GetImage().GetDescriptor().m_bindFlags, RHI::ImageBindFlags::ShaderWrite))
{
@@ -158,6 +157,7 @@ namespace AZ
}
else
{
// if we are reading from a depth/stencil texture, then we use the depth/stencil read optimal layout instead of the generic shader read one
imageInfo.imageLayout = RHI::CheckBitsAny(imageView->GetImage().GetAspectFlags(), RHI::ImageAspectFlags::DepthStencil) ?
VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
}