Jelajahi Sumber

Fix a validation warning due to overlapping attachments in DiffuseProbeGrid and an AZ_Assert for the AABB BLAS descriptor (#18155)

Signed-off-by: Markus Prettner <[email protected]>
Markus Prettner 1 tahun lalu
induk
melakukan
c9f5bebd3d

+ 1 - 1
Gems/Atom/Feature/Common/Code/Source/Debug/RayTracingDebugFeatureProcessor.cpp

@@ -57,7 +57,7 @@ namespace AZ::Render
 
     void RayTracingDebugFeatureProcessor::Deactivate()
     {
-        EnableSceneNotification();
+        DisableSceneNotification();
         FeatureProcessor::Deactivate();
 
         m_sceneSrg = nullptr;

+ 1 - 1
Gems/Atom/RHI/Code/Source/RHI/DeviceRayTracingAccelerationStructure.cpp

@@ -53,7 +53,7 @@ namespace AZ::RHI
 
     DeviceRayTracingBlasDescriptor* DeviceRayTracingBlasDescriptor::BuildFlags(const RHI::RayTracingAccelerationStructureBuildFlags &buildFlags)
     {
-        AZ_Assert(m_buildContext, "BuildFlags property can only be added to a Geometry entry");
+        AZ_Assert(m_buildContext || m_aabb, "BuildFlags property can only be added to a Geometry or AABB entry");
         m_buildFlags = buildFlags;
         return this;
     }

+ 3 - 3
Gems/Atom/RHI/Code/Source/RHI/RayTracingAccelerationStructure.cpp

@@ -26,13 +26,13 @@ namespace AZ::RHI
                 ->IndexBuffer(geometry.m_indexBuffer.GetDeviceIndexBufferView(deviceIndex));
         }
 
-        descriptor.BuildFlags(m_buildFlags);
-
         if(m_aabb.has_value())
         {
             descriptor.AABB(m_aabb.value());
         }
 
+        descriptor.BuildFlags(m_buildFlags);
+
         return descriptor;
     }
 
@@ -79,7 +79,7 @@ namespace AZ::RHI
 
     RayTracingBlasDescriptor* RayTracingBlasDescriptor::BuildFlags(const RHI::RayTracingAccelerationStructureBuildFlags &buildFlags)
     {
-        AZ_Assert(m_buildContext, "BuildFlags property can only be added to a Geometry entry");
+        AZ_Assert(m_buildContext || m_aabb, "BuildFlags property can only be added to a Geometry or AABB entry");
         m_buildFlags = buildFlags;
         return this;
     }

+ 4 - 4
Gems/DiffuseProbeGrid/Assets/Passes/DiffuseProbeGridQueryFullscreenWithAlbedo.pass

@@ -10,25 +10,25 @@
             "Slots": [
                 {
                     "Name": "AlbedoInput",
-                    "SlotType": "InputOutput",
+                    "SlotType": "Input",
                     "ShaderInputName": "m_albedo",
                     "ScopeAttachmentUsage": "Shader"
                 },
                 {
                     "Name": "NormalInput",
-                    "SlotType": "InputOutput",
+                    "SlotType": "Input",
                     "ShaderInputName": "m_normal",
                     "ScopeAttachmentUsage": "Shader"
                 },
                 {
                     "Name": "PositionInput",
-                    "SlotType": "InputOutput",
+                    "SlotType": "Input",
                     "ShaderInputName": "m_queryPositions",
                     "ScopeAttachmentUsage": "Shader"
                 },
                 {
                     "Name": "DirectionInput",
-                    "SlotType": "InputOutput",
+                    "SlotType": "Input",
                     "ShaderInputName": "m_queryDirections",
                     "ScopeAttachmentUsage": "Shader"
                 },