소스 검색

Merge pull request #101 from aws-lumberyard-dev/AtomSampleViewer/antonmic/PassChanges

[ATOM-15590] Pass System Improvements ASV
Anton Michels 4 년 전
부모
커밋
5dbdc2942f

+ 2 - 2
Gem/Code/Source/Passes/RayTracingAmbientOcclusionPass.cpp

@@ -117,13 +117,13 @@ namespace AZ
 
         void RayTracingAmbientOcclusionPass::FrameBeginInternal(FramePrepareParams params)
         {
-            if (!m_flags.m_initialized)
+            if (m_createRayTracingPipelineState)
             {
                 RPI::Scene* scene = m_pipeline->GetScene();
                 m_rayTracingFeatureProcessor = scene->GetFeatureProcessor<RayTracingFeatureProcessor>();
 
                 CreateRayTracingPipelineState();
-                m_flags.m_initialized = true;
+                m_createRayTracingPipelineState = false;
             }
 
             if (!m_rayTracingShaderTable)

+ 2 - 0
Gem/Code/Source/Passes/RayTracingAmbientOcclusionPass.h

@@ -83,6 +83,8 @@ namespace AZ
             float m_rayMaxT = 0.4f;          // The ray's far distance
             float m_rayMinT = 0.01f;        // The ray's near distance
             uint32_t m_rayNumber = 8;      // Ray casted per pixel
+
+            bool m_createRayTracingPipelineState = true;
         };
     }   // namespace RPI
 }   // namespace AZ

+ 2 - 2
Gem/Code/Source/RHI/BasicRHIComponent.cpp

@@ -54,9 +54,9 @@ namespace AtomSampleViewer
         }
     }
 
-    void RHISamplePass::BuildAttachmentsInternal()
+    void RHISamplePass::BuildInternal()
     {
-        Base::BuildAttachmentsInternal();
+        Base::BuildInternal();
 
         // The RHISamplePass template should have one owned image attachment which is the render target
         m_outputAttachment = m_ownedAttachments[0];

+ 1 - 1
Gem/Code/Source/RHI/BasicRHIComponent.h

@@ -74,7 +74,7 @@ namespace AtomSampleViewer
         explicit RHISamplePass(const AZ::RPI::PassDescriptor& descriptor);
 
         // --- Pass Behaviour Overrides ---
-        void BuildAttachmentsInternal() override; // build attachment
+        void BuildInternal() override; // build attachment
         void FrameBeginInternal(FramePrepareParams params) override; // import scopes
 
         BasicRHIComponent* m_rhiSample = nullptr;