Merge pull request #102 from aws-lumberyard-dev/Atom/qingtao/ATOM-15252

ATOM-15252 [Atom 0.8.5] Track View capture crashes when scene contains certain postfx
This commit is contained in:
Vicky
2021-04-16 15:50:37 -07:00
committed by GitHub
4 changed files with 21 additions and 4 deletions
@@ -131,8 +131,13 @@ namespace AZ
AZ_Assert(m_blendedLut.m_lutImage != nullptr, "BlendColorGradingLutsPass unable to acquire LUT image");
AZ::RHI::AttachmentId imageAttachmentId = AZ::RHI::AttachmentId("BlendColorGradingLutImageAttachmentId");
[[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportImage(imageAttachmentId, m_blendedLut.m_lutImage);
AZ_Error("BlendColorGradingLutsPass", result == RHI::ResultCode::Success, "Failed to import compute buffer with error %d", result);
// import this attachment if it wasn't imported
if (!frameGraph.GetAttachmentDatabase().IsAttachmentValid(imageAttachmentId))
{
[[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportImage(imageAttachmentId, m_blendedLut.m_lutImage);
AZ_Error("BlendColorGradingLutsPass", result == RHI::ResultCode::Success, "Failed to import BlendColorGradingLutImageAttachmentId with error %d", result);
}
RHI::ImageScopeAttachmentDescriptor desc;
desc.m_attachmentId = imageAttachmentId;
@@ -16,6 +16,6 @@ namespace AZ
{
namespace RHI
{
bool Validation::s_isEnabled = BuildOptions::IsDebugBuild;
bool Validation::s_isEnabled = BuildOptions::IsDebugBuild || BuildOptions::IsProfileBuild;
}
}
@@ -404,6 +404,12 @@ namespace AZ
Buffer& buffer = static_cast<Buffer&>(*bufferFrameAttachment.GetBuffer());
RHI::BufferScopeAttachment* scopeAttachment = bufferFrameAttachment.GetFirstScopeAttachment();
if (scopeAttachment == nullptr)
{
AZ_WarningOnce("RHI", false, "Imported BufferFrameAttachment isn't used in any Scope");
return;
}
D3D12_RESOURCE_TRANSITION_BARRIER transition;
transition.pResource = buffer.GetMemoryView().GetMemory();
transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;
@@ -471,6 +477,12 @@ namespace AZ
Image& image = static_cast<Image&>(*imageFrameAttachment.GetImage());
RHI::ImageScopeAttachment* scopeAttachment = imageFrameAttachment.GetFirstScopeAttachment();
if (scopeAttachment == nullptr)
{
AZ_WarningOnce("RHI", false, "Imported ImageFrameAttachment isn't used in any Scope");
return;
}
D3D12_RESOURCE_TRANSITION_BARRIER transition;
transition.pResource = image.GetMemoryView().GetMemory();
@@ -16,6 +16,6 @@ namespace AZ
{
namespace RPI
{
bool Validation::s_isEnabled = RHI::BuildOptions::IsDebugBuild;
bool Validation::s_isEnabled = RHI::BuildOptions::IsDebugBuild || RHI::BuildOptions::IsProfileBuild;
}
}