From e6c12499f73799bd96e3869418d7b3e51c7fdb87 Mon Sep 17 00:00:00 2001 From: alexpete Date: Tue, 13 Apr 2021 14:05:48 -0700 Subject: [PATCH] Added raytracingscenesrg.srgi to the default project template and AutomatedTesting project. Added assert to check for successful load of the raytracingscenesrg asset. --- .../ShaderLib/raytracingscenesrg.srgi | 28 +++++++++++++++++++ .../RayTracing/RayTracingFeatureProcessor.cpp | 1 + .../ShaderLib/raytracingscenesrg.srgi | 28 +++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 AutomatedTesting/ShaderLib/raytracingscenesrg.srgi create mode 100644 Templates/DefaultProject/Template/ShaderLib/raytracingscenesrg.srgi diff --git a/AutomatedTesting/ShaderLib/raytracingscenesrg.srgi b/AutomatedTesting/ShaderLib/raytracingscenesrg.srgi new file mode 100644 index 0000000000..ac1d663bb8 --- /dev/null +++ b/AutomatedTesting/ShaderLib/raytracingscenesrg.srgi @@ -0,0 +1,28 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +// Please read README.md for an explanation on why scenesrg.srgi and viewsrg.srgi are +// located in this folder (And how you can optionally customize your own scenesrg.srgi +// and viewsrg.srgi in your game project). + +#include + +partial ShaderResourceGroup RayTracingSceneSrg : SRG_RayTracingScene +{ +/* Intentionally Empty. Helps define the SrgSemantic for RayTracingSceneSrg once.*/ +}; + +#define AZ_COLLECTING_PARTIAL_SRGS +#include +#undef AZ_COLLECTING_PARTIAL_SRGS diff --git a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp index 68de2b87bb..d4d71b5741 100644 --- a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp @@ -67,6 +67,7 @@ namespace AZ // load the RayTracingSceneSrg asset Data::Asset rayTracingSceneSrgAsset = RPI::AssetUtils::LoadAssetByProductPath("shaderlib/raytracingscenesrg_raytracingscenesrg.azsrg", RPI::AssetUtils::TraceLevel::Error); + AZ_Assert(rayTracingSceneSrgAsset.IsReady(), "Failed to load RayTracingSceneSrg asset"); m_rayTracingSceneSrg = RPI::ShaderResourceGroup::Create(rayTracingSceneSrgAsset); } diff --git a/Templates/DefaultProject/Template/ShaderLib/raytracingscenesrg.srgi b/Templates/DefaultProject/Template/ShaderLib/raytracingscenesrg.srgi new file mode 100644 index 0000000000..ac1d663bb8 --- /dev/null +++ b/Templates/DefaultProject/Template/ShaderLib/raytracingscenesrg.srgi @@ -0,0 +1,28 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +// Please read README.md for an explanation on why scenesrg.srgi and viewsrg.srgi are +// located in this folder (And how you can optionally customize your own scenesrg.srgi +// and viewsrg.srgi in your game project). + +#include + +partial ShaderResourceGroup RayTracingSceneSrg : SRG_RayTracingScene +{ +/* Intentionally Empty. Helps define the SrgSemantic for RayTracingSceneSrg once.*/ +}; + +#define AZ_COLLECTING_PARTIAL_SRGS +#include +#undef AZ_COLLECTING_PARTIAL_SRGS