[ATOM-15276] Shader Build Pipeline: Add Shader Supervariant System (#749)

* [ATOM-15276] Shader Build Pipeline: Add Shader Supervariant System.

Added ShaderAssetBuilder2 & ShaderVariantAssetBuilder2.

Added ShaderAsset2, ShaderVariantAsset2.

Eventually they will be the only builders. AzslBuilder &
SrgLayoutBuilder will be removed.
ShaderResourceGroupAsset will be removed. ShaderAssetBuilder &
ShaderVariantAssetBuilder will be replaced.

Signed-off-by: garrieta <garrieta@amazon.com>
This commit is contained in:
galibzon
2021-05-20 04:53:16 -05:00
committed by GitHub
parent af22a0f44e
commit 256df54575
63 changed files with 6191 additions and 603 deletions
@@ -111,7 +111,7 @@ namespace AZ
ShaderMetricsSystem::Get()->RequestShaderVariant(pairItor->m_shaderAsset.Get(), pairItor->m_shaderVariantId, searchResult);
uint32_t shaderVariantProductSubId =
ShaderVariantAsset::GetAssetSubId(RHI::Factory::Get().GetAPIUniqueIndex(), searchResult.GetStableId());
ShaderVariantAsset::MakeAssetProductSubId(RHI::Factory::Get().GetAPIUniqueIndex(), searchResult.GetStableId());
Data::AssetId shaderVariantAssetId(shaderVariantTreeAsset.GetId().m_guid, shaderVariantProductSubId);
shaderVariantPendingRequests.insert(shaderVariantAssetId);
pairItor = newShaderVariantPendingRequests.erase(pairItor);
@@ -211,7 +211,7 @@ namespace AZ
AZ_Assert(variantStableId != RootShaderVariantStableId, "Root Variants Are Found inside ShaderAssets");
uint32_t shaderVariantProductSubId =
ShaderVariantAsset::GetAssetSubId(RHI::Factory::Get().GetAPIUniqueIndex(), variantStableId);
ShaderVariantAsset::MakeAssetProductSubId(RHI::Factory::Get().GetAPIUniqueIndex(), variantStableId);
Data::AssetId shaderVariantAssetId(shaderVariantTreeAssetId.m_guid, shaderVariantProductSubId);
{
AZStd::unique_lock<decltype(m_mutex)> lock(m_mutex);
@@ -299,7 +299,7 @@ namespace AZ
{
AZ_Assert(variantStableId != RootShaderVariantStableId, "Root Variants Are Found inside ShaderAssets");
uint32_t shaderVariantProductSubId = ShaderVariantAsset::GetAssetSubId(RHI::Factory::Get().GetAPIUniqueIndex(), variantStableId);
uint32_t shaderVariantProductSubId = ShaderVariantAsset::MakeAssetProductSubId(RHI::Factory::Get().GetAPIUniqueIndex(), variantStableId);
Data::AssetId shaderVariantAssetId(shaderVariantTreeAssetId.m_guid, shaderVariantProductSubId);
AZStd::unique_lock<decltype(m_mutex)> lock(m_mutex);