Merge pull request #3972 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-16381
Add RayTracingPass support for the Scene Srg
This commit is contained in:
@@ -115,10 +115,13 @@ namespace AZ
|
||||
AZ_Assert(m_shaderResourceGroup, "RayTracingPass [%s]: Failed to create RayTracingGlobalSrg", GetPathName().GetCStr());
|
||||
RPI::PassUtils::BindDataMappingsToSrg(m_passDescriptor, m_shaderResourceGroup.get());
|
||||
|
||||
// check to see if the shader requires the View and RayTracingMaterial Srgs
|
||||
// check to see if the shader requires the View, Scene, or RayTracingMaterial Srgs
|
||||
const auto& viewSrgLayout = m_rayGenerationShader->FindShaderResourceGroupLayout(RPI::SrgBindingSlot::View);
|
||||
m_requiresViewSrg = (viewSrgLayout != nullptr);
|
||||
|
||||
const auto& sceneSrgLayout = m_rayGenerationShader->FindShaderResourceGroupLayout(RPI::SrgBindingSlot::Scene);
|
||||
m_requiresSceneSrg = (sceneSrgLayout != nullptr);
|
||||
|
||||
const auto& rayTracingMaterialSrgLayout = m_rayGenerationShader->FindShaderResourceGroupLayout(RayTracingMaterialSrgBindingSlot);
|
||||
m_requiresRayTracingMaterialSrg = (rayTracingMaterialSrgLayout != nullptr);
|
||||
|
||||
@@ -324,6 +327,11 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
if (m_requiresSceneSrg)
|
||||
{
|
||||
shaderResourceGroups.push_back(scene->GetShaderResourceGroup()->GetRHIShaderResourceGroup());
|
||||
}
|
||||
|
||||
if (m_requiresRayTracingMaterialSrg)
|
||||
{
|
||||
shaderResourceGroups.push_back(rayTracingFeatureProcessor->GetRayTracingMaterialSrg()->GetRHIShaderResourceGroup());
|
||||
|
||||
@@ -72,6 +72,7 @@ namespace AZ
|
||||
RHI::ConstPtr<RHI::PipelineState> m_globalPipelineState;
|
||||
RHI::Ptr<RHI::RayTracingShaderTable> m_rayTracingShaderTable;
|
||||
bool m_requiresViewSrg = false;
|
||||
bool m_requiresSceneSrg = false;
|
||||
bool m_requiresRayTracingMaterialSrg = false;
|
||||
};
|
||||
} // namespace RPI
|
||||
|
||||
Reference in New Issue
Block a user