[ATOM-15472] Shader Build Pipeline: Remove Deprecated Files And Funct… (#1079)
* [ATOM-15472] Shader Build Pipeline: Remove Deprecated Files And Functions That Predate The Shader Supervariants These are the essential impactful changes as a result of deprecating the ShaderResourceGroupAsset. * Addressed feedback by @moudgils. Better comments in header files. * More updates related with deprecation of ShaderResourceGroupAsset * Deleted the temporary version 2 classes. * Updated version of the shader asset builders. * Updated version of all the shader related classes impacted by the Supervariant concept and deprecation of ShaderResourceGroupAsset * Changes to *.pass and DGI, Reflections and RayTracing. * changes to material related assets * changes to core lights * Changes to auxgeom/dynamic draw. * changes to decals, lyshine, imguipass * changes to RPI Pass classes * Shader for SceneSrg, ViewSrg and ForwardPass Srgs. * changes to mesh, skinned mesh, Morphtarget. * Fixes to RayTracingPass.cpp & now allow empty srg in shaders. * Updated Atom_RPI.Tests * Simplified InstanceDatabase by removing AddHandler ------------------------------------------------------------------------------------ * Updated DiffuseGI precompiled shaders. Added RayTracingSceneSrg and RayTracingMaterialSrg shader asset. Updated ShaderAssetCreator::Clone to handle the supervariant when processing root variants. Co-authored-by: Doug McDiarmid <dmcdiar@amazon.com> ------------------------------------------------------------------------------------ * Changed semantics for some PassSrg to SRG_PerPass_WithFallback. AuxGeom/FixedShapeProcessor.cpp requires SRG_PerDraw on ObjectSrg. Removed names of SceneSrg and ViewSrg from RPISystemDescriptor.cpp * Moved ShaderLib/Atom/Features/DummyEntryFunctions.azsli To Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/DummyEntryFunctions.azsli Removed redundant checking for finalization in ShaderResourceGroupLayout.cpp * Fixed race condition bug for Shader::FindOrCreate. InstanceDatabase<>::CreateInstance() needs to be atomic for instance creation and initialization. Added optional InstanceHandler::CreateFunctionWithParams to accomodate to the needs of Instances that need more than an asset reference to be able to be created an initialzed. Removed ShaderResourceGroup::FindOrCreate() only ::Create is available now. * Renamed scene_and_view_srgs.* as SceneAndViewSrgs.* Changed GetAzslFileOfOrigin for GetUniqueId * Fixed unit tests. * Reverted the serialization name of m_uniqueId back to "m_azslFileOfOrigin" so precompiled shaders don't fail in layout comparison. * Fixed AtomCore.Tests Removed non-applicable test. InstanceDatabase.AddHandler() is not available anymore. * The Null rhi is re-enabled for shader compilation. Signed-off-by: garrieta <garrieta@amazon.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <Atom/RPI.Reflect/Image/StreamingImageAssetCreator.h>
|
||||
#include <Atom/RPI.Reflect/Image/StreamingImagePoolAsset.h>
|
||||
#include <Atom/RPI.Reflect/Image/StreamingImagePoolAssetCreator.h>
|
||||
#include <Atom/RPI.Reflect/Image/DefaultStreamingImageControllerAsset.h>
|
||||
#include <Atom/RPI.Reflect/Asset/BuiltInAssetHandler.h>
|
||||
|
||||
#include <Atom/RPI.Public/Image/ImageSystemInterface.h>
|
||||
@@ -148,32 +149,11 @@ namespace UnitTest
|
||||
size_t m_expectedTimestamp = 0;
|
||||
};
|
||||
|
||||
class TestStreamingImageControllerAsset
|
||||
: public AZ::RPI::StreamingImageControllerAsset
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(TestStreamingImageControllerAsset, AZ::SystemAllocator, 0);
|
||||
AZ_RTTI(TestStreamingImageControllerAsset, "{A90B4AC0-979A-4F01-AD41-B1D32DD9DAEC}", AZ::RPI::StreamingImageControllerAsset);
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
|
||||
{
|
||||
serializeContext->Class<TestStreamingImageControllerAsset, AZ::RPI::StreamingImageControllerAsset>();
|
||||
}
|
||||
}
|
||||
|
||||
TestStreamingImageControllerAsset()
|
||||
{
|
||||
m_status = AssetStatus::Ready;
|
||||
}
|
||||
};
|
||||
|
||||
class StreamingImageTests
|
||||
: public RPITestFixture
|
||||
{
|
||||
private:
|
||||
AZ::Data::Asset<TestStreamingImageControllerAsset> m_testControllerAsset;
|
||||
AZ::Data::Asset<AZ::RPI::DefaultStreamingImageControllerAsset> m_testControllerAsset;
|
||||
|
||||
protected:
|
||||
AZ::RPI::BuiltInAssetHandler* m_testControllerAssetHandler;
|
||||
@@ -184,7 +164,7 @@ namespace UnitTest
|
||||
AZ::Data::Instance<AZ::RPI::StreamingImagePool> m_defaultPool = nullptr;
|
||||
|
||||
StreamingImageTests()
|
||||
: m_testControllerAssetId("{9202CEC4-4E31-443C-ABE8-512B3E896448}")
|
||||
: m_testControllerAssetId(AZ::RPI::DefaultStreamingImageControllerAsset::BuiltInAssetId)
|
||||
{}
|
||||
|
||||
void SetUp() override
|
||||
@@ -194,23 +174,12 @@ namespace UnitTest
|
||||
RPITestFixture::SetUp();
|
||||
|
||||
auto* serializeContext = GetSerializeContext();
|
||||
TestStreamingImageControllerAsset::Reflect(serializeContext);
|
||||
TestStreamingImagePoolDescriptor::Reflect(serializeContext);
|
||||
|
||||
m_testControllerAssetHandler = aznew RPI::BuiltInAssetHandler(
|
||||
azrtti_typeid<TestStreamingImageControllerAsset>(),
|
||||
[]() { return aznew TestStreamingImageControllerAsset(); });
|
||||
m_testControllerAssetHandler->Register();
|
||||
m_testControllerAsset = Data::AssetManager::Instance().CreateAsset<TestStreamingImageControllerAsset>(m_testControllerAssetId);
|
||||
|
||||
Data::InstanceDatabase<RPI::StreamingImageController>::Instance().AddHandler(
|
||||
azrtti_typeid<TestStreamingImageControllerAsset>(),
|
||||
[](Data::AssetData*) { return aznew TestStreamingImageController(); });
|
||||
|
||||
m_imageHandler = Data::AssetManager::Instance().GetHandler(RPI::StreamingImageAsset::RTTI_Type());
|
||||
m_mipChainHandler = Data::AssetManager::Instance().GetHandler(RPI::ImageMipChainAsset::RTTI_Type());
|
||||
|
||||
AZ::Data::Asset < AZ::RPI::StreamingImagePoolAsset > poolAsset = BuildImagePoolAsset(16 * 1024 * 1024);
|
||||
AZ::Data::Asset<AZ::RPI::StreamingImagePoolAsset> poolAsset = BuildImagePoolAsset(16 * 1024 * 1024);
|
||||
m_defaultPool = AZ::RPI::StreamingImagePool::FindOrCreate(poolAsset);
|
||||
}
|
||||
|
||||
@@ -221,10 +190,6 @@ namespace UnitTest
|
||||
|
||||
m_defaultPool = nullptr;
|
||||
|
||||
m_testControllerAsset.Release();
|
||||
delete m_testControllerAssetHandler;
|
||||
Data::InstanceDatabase<RPI::StreamingImageController>::Instance().RemoveHandler(azrtti_typeid<TestStreamingImageControllerAsset>());
|
||||
|
||||
RPITestFixture::TearDown();
|
||||
}
|
||||
|
||||
@@ -341,7 +306,7 @@ namespace UnitTest
|
||||
|
||||
{
|
||||
Data::Asset<RPI::StreamingImageControllerAsset> asset = poolAsset->GetControllerAsset();
|
||||
EXPECT_TRUE(azrtti_typeid<TestStreamingImageControllerAsset>() == asset.GetType());
|
||||
EXPECT_TRUE(azrtti_typeid<RPI::DefaultStreamingImageControllerAsset>() == asset.GetType());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,7 +424,7 @@ namespace UnitTest
|
||||
assetCreator.SetPoolDescriptor(AZStd::make_unique<TestStreamingImagePoolDescriptor>(budgetInBytes));
|
||||
|
||||
assetCreator.SetControllerAsset(
|
||||
Data::AssetManager::Instance().GetAsset<TestStreamingImageControllerAsset>(
|
||||
Data::AssetManager::Instance().GetAsset<RPI::DefaultStreamingImageControllerAsset>(
|
||||
m_testControllerAssetId,
|
||||
Data::AssetLoadBehavior::PreLoad)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user