From 53cf7b462bf58385d39cf4714642e1c4e33b6761 Mon Sep 17 00:00:00 2001 From: antonmic <56370189+antonmic@users.noreply.github.com> Date: Thu, 16 Dec 2021 11:03:20 -0800 Subject: [PATCH] Changing all ClearPass to SlowClearPass Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com> --- .../Feature/Common/Assets/Passes/SlowClear.pass | 2 +- .../Pass/{ClearPass.h => SlowClearPass.h} | 16 ++++++++-------- .../{ClearPassData.h => SlowClearPassData.h} | 16 ++++++++-------- .../Code/Source/RPI.Public/Pass/ParentPass.cpp | 8 ++++---- .../Code/Source/RPI.Public/Pass/PassFactory.cpp | 4 ++-- .../Code/Source/RPI.Public/Pass/PassSystem.cpp | 4 ++-- .../Pass/{ClearPass.cpp => SlowClearPass.cpp} | 16 ++++++++-------- Gems/Atom/RPI/Code/atom_rpi_public_files.cmake | 4 ++-- Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake | 2 +- 9 files changed, 36 insertions(+), 36 deletions(-) rename Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/{ClearPass.h => SlowClearPass.h} (65%) rename Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/{ClearPassData.h => SlowClearPassData.h} (58%) rename Gems/Atom/RPI/Code/Source/RPI.Public/Pass/{ClearPass.cpp => SlowClearPass.cpp} (59%) diff --git a/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass b/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass index 417cf94eac..97b486191a 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/SlowClear.pass @@ -9,7 +9,7 @@ // If you want to clear an attachment you should // use the LoadStoreAction on your pass slot. "Name": "SlowClearPassTemplate", - "PassClass": "ClearPass", + "PassClass": "SlowClearPass", "Slots": [ { "Name": "ClearInputOutput", diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/SlowClearPass.h similarity index 65% rename from Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h rename to Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/SlowClearPass.h index 96252ca82c..6fcb7abd17 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/ClearPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/SlowClearPass.h @@ -17,21 +17,21 @@ namespace AZ //! Only use this for debug purposes and edge cases //! The correct and efficient way to clear a pass is through the LoadStoreAction on the pass slot //! This will clear a given image attachment to the specified clear value. - class ClearPass + class SlowClearPass : public RenderPass { - AZ_RPI_PASS(ClearPass); + AZ_RPI_PASS(SlowClearPass); public: - AZ_RTTI(ClearPass, "{31CBAD6C-108F-4F3F-B498-ED968DFCFCE2}", RenderPass); - AZ_CLASS_ALLOCATOR(ClearPass, SystemAllocator, 0); - virtual ~ClearPass() = default; + AZ_RTTI(SlowClearPass, "{31CBAD6C-108F-4F3F-B498-ED968DFCFCE2}", RenderPass); + AZ_CLASS_ALLOCATOR(SlowClearPass, SystemAllocator, 0); + virtual ~SlowClearPass() = default; - //! Creates a ClearPass - static Ptr Create(const PassDescriptor& descriptor); + //! Creates a SlowClearPass + static Ptr Create(const PassDescriptor& descriptor); protected: - ClearPass(const PassDescriptor& descriptor); + SlowClearPass(const PassDescriptor& descriptor); void InitializeInternal() override; private: diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/SlowClearPassData.h similarity index 58% rename from Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h rename to Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/SlowClearPassData.h index 9c03f5ccd6..7607bca285 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/ClearPassData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Pass/SlowClearPassData.h @@ -14,23 +14,23 @@ namespace AZ { namespace RPI { - //! Custom data for the ClearPass. Should be specified in the PassRequest. - struct ClearPassData + //! Custom data for the SlowClearPass. Should be specified in the PassRequest. + struct SlowClearPassData : public RenderPassData { - AZ_RTTI(ClearPassData, "{5F2C24A4-62D0-4E60-91EC-C207C10D15C6}", RenderPassData); - AZ_CLASS_ALLOCATOR(ClearPassData, SystemAllocator, 0); + AZ_RTTI(SlowClearPassData, "{5F2C24A4-62D0-4E60-91EC-C207C10D15C6}", RenderPassData); + AZ_CLASS_ALLOCATOR(SlowClearPassData, SystemAllocator, 0); - ClearPassData() = default; - virtual ~ClearPassData() = default; + SlowClearPassData() = default; + virtual ~SlowClearPassData() = default; static void Reflect(ReflectContext* context) { if (auto* serializeContext = azrtti_cast(context)) { - serializeContext->Class() + serializeContext->Class() ->Version(0) - ->Field("ClearValue", &ClearPassData::m_clearValue) + ->Field("ClearValue", &SlowClearPassData::m_clearValue) ; } } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp index fff6fae0a3..55f3e44173 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ParentPass.cpp @@ -9,14 +9,14 @@ #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include @@ -231,7 +231,7 @@ namespace AZ clearRequest.m_connections[0].m_attachmentRef.m_attachment = binding.m_name; // Set the pass clear value to the clear value of the attachment binding - ClearPassData* clearData = static_cast(clearRequest.m_passData.get()); + SlowClearPassData* clearData = static_cast(clearRequest.m_passData.get()); clearData->m_clearValue = binding.m_unifiedScopeDesc.m_loadStoreAction.m_clearValue; // Create and add the pass @@ -248,7 +248,7 @@ namespace AZ { PassRequest clearRequest; clearRequest.m_templateName = Name("SlowClearPassTemplate"); - clearRequest.m_passData = AZStd::make_shared(); + clearRequest.m_passData = AZStd::make_shared(); clearRequest.m_connections.push_back(); clearRequest.m_connections[0].m_localSlot = Name("ClearInputOutput"); clearRequest.m_connections[0].m_attachmentRef.m_pass = Name("Parent"); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp index 7443c51bff..cc79df144d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassFactory.cpp @@ -8,7 +8,6 @@ #include -#include #include #include #include @@ -20,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -61,7 +61,7 @@ namespace AZ { AddPassCreator(Name("ParentPass"), &ParentPass::Create); AddPassCreator(Name("RasterPass"), &RasterPass::Create); - AddPassCreator(Name("ClearPass"), &ClearPass::Create); + AddPassCreator(Name("SlowClearPass"), &SlowClearPass::Create); AddPassCreator(Name("CopyPass"), &CopyPass::Create); AddPassCreator(Name("FullScreenTriangle"), &FullscreenTrianglePass::Create); AddPassCreator(Name("ComputePass"), &ComputePass::Create); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp index f45d28518f..9e1333b7ab 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/PassSystem.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -40,6 +39,7 @@ #include #include #include +#include namespace AZ { @@ -68,7 +68,7 @@ namespace AZ PassSlot::Reflect(context); PassData::Reflect(context); - ClearPassData::Reflect(context); + SlowClearPassData::Reflect(context); CopyPassData::Reflect(context); RenderPassData::Reflect(context); ComputePassData::Reflect(context); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/SlowClearPass.cpp similarity index 59% rename from Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp rename to Gems/Atom/RPI/Code/Source/RPI.Public/Pass/SlowClearPass.cpp index 0e3ea76728..62a8241242 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/ClearPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/SlowClearPass.cpp @@ -6,37 +6,37 @@ * */ -#include +#include #include -#include +#include namespace AZ { namespace RPI { - Ptr ClearPass::Create(const PassDescriptor& descriptor) + Ptr SlowClearPass::Create(const PassDescriptor& descriptor) { - Ptr pass = aznew ClearPass(descriptor); + Ptr pass = aznew SlowClearPass(descriptor); return pass; } - ClearPass::ClearPass(const PassDescriptor& descriptor) + SlowClearPass::SlowClearPass(const PassDescriptor& descriptor) : RenderPass(descriptor) { - const ClearPassData* passData = PassUtils::GetPassData(descriptor); + const SlowClearPassData* passData = PassUtils::GetPassData(descriptor); if (passData != nullptr) { m_clearValue = passData->m_clearValue; } } - void ClearPass::InitializeInternal() + void SlowClearPass::InitializeInternal() { RenderPass::InitializeInternal(); // Set clear value - AZ_Assert(GetInputOutputCount() > 0, "ClearPass: Missing InputOutput binding!"); + AZ_Assert(GetInputOutputCount() > 0, "SlowClearPass: Missing InputOutput binding!"); RPI::PassAttachmentBinding& binding = GetInputOutputBinding(0); binding.m_unifiedScopeDesc.m_loadStoreAction.m_clearValue = m_clearValue; } diff --git a/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake index 91dcf479e9..36df56cdab 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake @@ -57,7 +57,6 @@ set(FILES Include/Atom/RPI.Public/Model/ModelSystem.h Include/Atom/RPI.Public/Model/UvStreamTangentBitmask.h Include/Atom/RPI.Public/Pass/AttachmentReadback.h - Include/Atom/RPI.Public/Pass/ClearPass.h Include/Atom/RPI.Public/Pass/ComputePass.h Include/Atom/RPI.Public/Pass/CopyPass.h Include/Atom/RPI.Public/Pass/FullscreenTrianglePass.h @@ -74,6 +73,7 @@ set(FILES Include/Atom/RPI.Public/Pass/RasterPass.h Include/Atom/RPI.Public/Pass/RenderPass.h Include/Atom/RPI.Public/Pass/MSAAResolvePass.h + Include/Atom/RPI.Public/Pass/SlowClearPass.h Include/Atom/RPI.Public/Pass/Specific/DownsampleMipChainPass.h Include/Atom/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.h Include/Atom/RPI.Public/Pass/Specific/EnvironmentCubeMapPass.h @@ -136,7 +136,6 @@ set(FILES Source/RPI.Public/Model/ModelSystem.cpp Source/RPI.Public/Model/UvStreamTangentBitmask.cpp Source/RPI.Public/Pass/AttachmentReadback.cpp - Source/RPI.Public/Pass/ClearPass.cpp Source/RPI.Public/Pass/ComputePass.cpp Source/RPI.Public/Pass/CopyPass.cpp Source/RPI.Public/Pass/FullscreenTrianglePass.cpp @@ -151,6 +150,7 @@ set(FILES Source/RPI.Public/Pass/RasterPass.cpp Source/RPI.Public/Pass/RenderPass.cpp Source/RPI.Public/Pass/MSAAResolvePass.cpp + Source/RPI.Public/Pass/SlowClearPass.cpp Source/RPI.Public/Pass/Specific/DownsampleMipChainPass.cpp Source/RPI.Public/Pass/Specific/ImageAttachmentPreviewPass.cpp Source/RPI.Public/Pass/Specific/EnvironmentCubeMapPass.cpp diff --git a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake index 921d5a8e46..df8f389c37 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake @@ -62,7 +62,6 @@ set(FILES Include/Atom/RPI.Reflect/Material/ShaderCollection.h Include/Atom/RPI.Reflect/Material/MaterialFunctor.h Include/Atom/RPI.Reflect/Material/MaterialVersionUpdate.h - Include/Atom/RPI.Reflect/Pass/ClearPassData.h Include/Atom/RPI.Reflect/Pass/ComputePassData.h Include/Atom/RPI.Reflect/Pass/CopyPassData.h Include/Atom/RPI.Reflect/Pass/DownsampleMipChainPassData.h @@ -76,6 +75,7 @@ set(FILES Include/Atom/RPI.Reflect/Pass/PassTemplate.h Include/Atom/RPI.Reflect/Pass/RasterPassData.h Include/Atom/RPI.Reflect/Pass/RenderPassData.h + Include/Atom/RPI.Reflect/Pass/SlowClearPassData.h Include/Atom/RPI.Reflect/Shader/ShaderCommonTypes.h Include/Atom/RPI.Reflect/Shader/ShaderAsset.h Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator.h