Merge branch 'dev' into Atom/antonmic/SrgDebugImprovements

This commit is contained in:
antonmic
2021-08-09 23:47:40 -07:00
1701 changed files with 24775 additions and 33101 deletions
@@ -91,7 +91,7 @@ namespace AZ
if (auto* serialize = azrtti_cast<SerializeContext*>(context))
{
serialize->Class<MaterialAssetBuilderComponent, SceneAPI::SceneCore::ExportingComponent>()
->Version(14); // [ATOM-13410]
->Version(16); // Optional material conversion
}
}
@@ -109,7 +109,7 @@ namespace AZ
if (auto* serialize = azrtti_cast<SerializeContext*>(context))
{
serialize->Class<ModelAssetBuilderComponent, SceneAPI::SceneCore::ExportingComponent>()
->Version(27); // [ATOM-15658]
->Version(30); // (updated to separate material slot ID from default material asset)
}
}
@@ -367,6 +367,9 @@ namespace AZ
MorphTargetMetaAssetCreator morphTargetMetaCreator;
morphTargetMetaCreator.Begin(MorphTargetMetaAsset::ConstructAssetId(modelAssetId, modelAssetName));
ModelAssetCreator modelAssetCreator;
modelAssetCreator.Begin(modelAssetId);
uint32_t lodIndex = 0;
for (const SourceMeshContentList& sourceMeshContentList : sourceMeshContentListsByLod)
@@ -429,7 +432,7 @@ namespace AZ
for (const ProductMeshView& meshView : lodMeshViews)
{
if (!CreateMesh(meshView, indexBuffer, streamBuffers, lodAssetCreator, context.m_materialsByUid))
if (!CreateMesh(meshView, indexBuffer, streamBuffers, modelAssetCreator, lodAssetCreator, context.m_materialsByUid))
{
return AZ::SceneAPI::Events::ProcessingResult::Failure;
}
@@ -469,10 +472,6 @@ namespace AZ
}
sourceMeshContentListsByLod.clear();
// Build the final asset structure
ModelAssetCreator modelAssetCreator;
modelAssetCreator.Begin(modelAssetId);
// Finalize all LOD assets
for (auto& lodAsset : lodAssets)
{
@@ -883,7 +882,7 @@ namespace AZ
processedMorphTargets = true;
}
totalVertexCount += vertexCount;
totalVertexCount += static_cast<uint32_t>(vertexCount);
productMeshList.emplace_back(productMesh);
}
}
@@ -961,7 +960,7 @@ namespace AZ
for (const auto& skinData : sourceMesh.m_skinData)
{
const size_t numJoints = skinData->GetBoneCount();
const AZ::u32 controlPointIndex = sourceMeshData->GetControlPointIndex(vertexIndex);
const AZ::u32 controlPointIndex = sourceMeshData->GetControlPointIndex(static_cast<int>(vertexIndex));
const size_t numSkinInfluences = skinData->GetLinkCount(controlPointIndex);
size_t numInfluencesExcess = 0;
@@ -1196,15 +1195,15 @@ namespace AZ
mesh.m_skinWeights.size(), m_numSkinJointInfluencesPerVertex, m_numSkinJointInfluencesPerVertex);
const size_t numSkinInfluences = mesh.m_skinWeights.size();
uint32_t jointIndicesSizeInBytes = numSkinInfluences * sizeof(uint16_t);
uint32_t jointIndicesSizeInBytes = static_cast<uint32_t>(numSkinInfluences * sizeof(uint16_t));
meshView.m_skinJointIndicesView = RHI::BufferViewDescriptor::CreateRaw(0, jointIndicesSizeInBytes);
meshView.m_skinWeightsView = RHI::BufferViewDescriptor::CreateTyped(0, numSkinInfluences, SkinWeightFormat);
meshView.m_skinWeightsView = RHI::BufferViewDescriptor::CreateTyped(0, static_cast<uint32_t>(numSkinInfluences), SkinWeightFormat);
}
if (!mesh.m_morphTargetVertexData.empty())
{
const size_t numTotalVertices = mesh.m_morphTargetVertexData.size();
meshView.m_morphTargetVertexDataView = RHI::BufferViewDescriptor::CreateStructured(0, numTotalVertices, sizeof(PackedCompressedMorphTargetDelta));
meshView.m_morphTargetVertexDataView = RHI::BufferViewDescriptor::CreateStructured(0, static_cast<uint32_t>(numTotalVertices), sizeof(PackedCompressedMorphTargetDelta));
}
if (!mesh.m_clothData.empty())
@@ -1359,8 +1358,8 @@ namespace AZ
const size_t numPrevSkinInfluences = lodBufferInfo.m_skinInfluencesCount;
const size_t numNewSkinInfluences = mesh.m_skinWeights.size();
meshView.m_skinJointIndicesView = RHI::BufferViewDescriptor::CreateRaw(/*byteOffset=*/numPrevSkinInfluences * sizeof(uint16_t), numNewSkinInfluences * sizeof(uint16_t));
meshView.m_skinWeightsView = RHI::BufferViewDescriptor::CreateTyped(/*elementOffset=*/numPrevSkinInfluences, numNewSkinInfluences, SkinWeightFormat);
meshView.m_skinJointIndicesView = RHI::BufferViewDescriptor::CreateRaw(/*byteOffset=*/ static_cast<uint32_t>(numPrevSkinInfluences * sizeof(uint16_t)), static_cast<uint32_t>(numNewSkinInfluences * sizeof(uint16_t)));
meshView.m_skinWeightsView = RHI::BufferViewDescriptor::CreateTyped(/*elementOffset=*/ static_cast<uint32_t>(numPrevSkinInfluences), static_cast<uint32_t>(numNewSkinInfluences), SkinWeightFormat);
lodBufferInfo.m_skinInfluencesCount += numNewSkinInfluences;
}
@@ -1370,7 +1369,7 @@ namespace AZ
const size_t numPrevVertexDeltas = lodBufferInfo.m_morphTargetVertexDeltaCount;
const size_t numNewVertexDeltas = mesh.m_morphTargetVertexData.size();
meshView.m_morphTargetVertexDataView = RHI::BufferViewDescriptor::CreateStructured(/*elementOffset=*/numPrevVertexDeltas, numNewVertexDeltas, sizeof(PackedCompressedMorphTargetDelta));
meshView.m_morphTargetVertexDataView = RHI::BufferViewDescriptor::CreateStructured(/*elementOffset=*/ static_cast<uint32_t>(numPrevVertexDeltas), static_cast<uint32_t>(numNewVertexDeltas), sizeof(PackedCompressedMorphTargetDelta));
lodBufferInfo.m_morphTargetVertexDeltaCount += numNewVertexDeltas;
}
@@ -1796,6 +1795,7 @@ namespace AZ
const ProductMeshView& meshView,
const BufferAssetView& lodIndexBuffer,
const AZStd::vector<ModelLodAsset::Mesh::StreamBufferInfo>& lodStreamBuffers,
ModelAssetCreator& modelAssetCreator,
ModelLodAssetCreator& lodAssetCreator,
const MaterialAssetsByUid& materialAssetsByUid)
{
@@ -1806,8 +1806,13 @@ namespace AZ
auto iter = materialAssetsByUid.find(meshView.m_materialUid);
if (iter != materialAssetsByUid.end())
{
const Data::Asset<MaterialAsset>& materialAsset = iter->second.m_asset;
lodAssetCreator.SetMeshMaterialAsset(materialAsset);
ModelMaterialSlot materialSlot;
materialSlot.m_stableId = meshView.m_materialUid;
materialSlot.m_displayName = iter->second.m_name;
materialSlot.m_defaultMaterialAsset = iter->second.m_asset;
modelAssetCreator.AddMaterialSlot(materialSlot);
lodAssetCreator.SetMeshMaterialSlot(materialSlot.m_stableId);
}
}
@@ -42,6 +42,7 @@ namespace AZ
using SkinData = AZ::SceneAPI::DataTypes::ISkinWeightData;
class Stream;
class ModelAssetCreator;
class ModelLodAssetCreator;
class BufferAssetCreator;
struct PackedCompressedMorphTargetDelta;
@@ -294,6 +295,7 @@ namespace AZ
const ProductMeshView& meshView,
const BufferAssetView& lodIndexBuffer,
const AZStd::vector<ModelLodAsset::Mesh::StreamBufferInfo>& lodStreamBuffers,
ModelAssetCreator& modelAssetCreator,
ModelLodAssetCreator& lodAssetCreator,
const MaterialAssetsByUid& materialAssetsByUid);
@@ -110,8 +110,8 @@ namespace AZ::RPI
{
AZ::Aabb meshAabb = AZ::Aabb::CreateNull();
const size_t numVertices = mesh.m_meshData->GetVertexCount();
for (size_t i = 0; i < numVertices; ++i)
const unsigned int numVertices = static_cast<unsigned int>(mesh.m_meshData->GetVertexCount());
for (unsigned int i = 0; i < numVertices; ++i)
{
meshAabb.AddPoint(mesh.m_meshData->GetPosition(i));
}
@@ -164,7 +164,7 @@ namespace AZ::RPI
blendShapeName.c_str(), numVertices, sourceMesh.m_meshData->GetVertexCount());
// The start index is after any previously added deltas
metaData.m_startIndex = aznumeric_caster<uint32_t>(packedCompressedMorphTargetVertexData.size());
metaData.m_startIndex = aznumeric_cast<uint32_t>(packedCompressedMorphTargetVertexData.size());
// Multiply normal by inverse transpose to avoid incorrect values produced by non-uniformly scaled transforms.
@@ -720,6 +720,7 @@ namespace AZ
void CullingScene::BeginCulling(const AZStd::vector<ViewPtr>& views)
{
AZ_ATOM_PROFILE_FUNCTION("RPI", "CullingScene: BeginCulling");
m_cullDataConcurrencyCheck.soft_lock();
m_debugCtx.ResetCullStats();
@@ -40,7 +40,7 @@ namespace AZ
return m_lods;
}
Data::Instance<Model> Model::CreateInternal(ModelAsset& modelAsset)
Data::Instance<Model> Model::CreateInternal(const Data::Asset<ModelAsset>& modelAsset)
{
AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender);
Data::Instance<Model> model = aznew Model();
@@ -54,15 +54,15 @@ namespace AZ
return nullptr;
}
RHI::ResultCode Model::Init(ModelAsset& modelAsset)
RHI::ResultCode Model::Init(const Data::Asset<ModelAsset>& modelAsset)
{
AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender);
m_lods.resize(modelAsset.GetLodAssets().size());
m_lods.resize(modelAsset->GetLodAssets().size());
for (size_t lodIndex = 0; lodIndex < m_lods.size(); ++lodIndex)
{
const Data::Asset<ModelLodAsset>& lodAsset = modelAsset.GetLodAssets()[lodIndex];
const Data::Asset<ModelLodAsset>& lodAsset = modelAsset->GetLodAssets()[lodIndex];
if (!lodAsset)
{
@@ -70,7 +70,7 @@ namespace AZ
return RHI::ResultCode::Fail;
}
Data::Instance<ModelLod> lodInstance = ModelLod::FindOrCreate(lodAsset);
Data::Instance<ModelLod> lodInstance = ModelLod::FindOrCreate(lodAsset, modelAsset);
if (lodInstance == nullptr)
{
return RHI::ResultCode::Fail;
@@ -98,7 +98,7 @@ namespace AZ
m_lods[lodIndex] = AZStd::move(lodInstance);
}
m_modelAsset = { &modelAsset, AZ::Data::AssetLoadBehavior::PreLoad };
m_modelAsset = modelAsset;
m_isUploadPending = true;
return RHI::ResultCode::Success;
}
@@ -19,11 +19,14 @@ namespace AZ
{
namespace RPI
{
Data::Instance<ModelLod> ModelLod::FindOrCreate(const Data::Asset<ModelLodAsset>& lodAsset)
Data::Instance<ModelLod> ModelLod::FindOrCreate(const Data::Asset<ModelLodAsset>& lodAsset, const Data::Asset<ModelAsset>& modelAsset)
{
AZStd::any modelAssetAny{&modelAsset};
return Data::InstanceDatabase<ModelLod>::Instance().FindOrCreate(
Data::InstanceId::CreateFromAssetId(lodAsset.GetId()),
lodAsset);
lodAsset,
&modelAssetAny);
}
AZStd::array_view<ModelLod::Mesh> ModelLod::GetMeshes() const
@@ -31,10 +34,13 @@ namespace AZ
return m_meshes;
}
Data::Instance<ModelLod> ModelLod::CreateInternal(ModelLodAsset& lodAsset)
Data::Instance<ModelLod> ModelLod::CreateInternal(const Data::Asset<ModelLodAsset>& lodAsset, const AZStd::any* modelAssetAny)
{
AZ_Assert(modelAssetAny != nullptr, "Invalid model asset param");
auto modelAsset = AZStd::any_cast<Data::Asset<ModelAsset>*>(*modelAssetAny);
Data::Instance<ModelLod> lod = aznew ModelLod();
const RHI::ResultCode resultCode = lod->Init(lodAsset);
const RHI::ResultCode resultCode = lod->Init(lodAsset, *modelAsset);
if (resultCode == RHI::ResultCode::Success)
{
@@ -44,11 +50,11 @@ namespace AZ
return nullptr;
}
RHI::ResultCode ModelLod::Init(ModelLodAsset& lodAsset)
RHI::ResultCode ModelLod::Init(const Data::Asset<ModelLodAsset>& lodAsset, const Data::Asset<ModelAsset>& modelAsset)
{
AZ_TRACE_METHOD();
for (const ModelLodAsset::Mesh& mesh : lodAsset.GetMeshes())
for (const ModelLodAsset::Mesh& mesh : lodAsset->GetMeshes())
{
Mesh meshInstance;
@@ -100,10 +106,13 @@ namespace AZ
}
}
auto& materialAsset = mesh.GetMaterialAsset();
if (materialAsset.IsReady())
const ModelMaterialSlot& materialSlot = modelAsset->FindMaterialSlot(mesh.GetMaterialSlotId());
meshInstance.m_materialSlotStableId = materialSlot.m_stableId;
if (materialSlot.m_defaultMaterialAsset.IsReady())
{
meshInstance.m_material = Material::FindOrCreate(materialAsset);
meshInstance.m_material = Material::FindOrCreate(materialSlot.m_defaultMaterialAsset);
}
m_meshes.emplace_back(AZStd::move(meshInstance));
@@ -24,6 +24,7 @@ namespace AZ
{
ModelLodAsset::Reflect(context);
ModelAsset::Reflect(context);
ModelMaterialSlot::Reflect(context);
MorphTargetMetaAsset::Reflect(context);
SkinMetaAsset::Reflect(context);
}
@@ -40,9 +41,9 @@ namespace AZ
{
//Create Lod Database
AZ::Data::InstanceHandler<ModelLod> lodInstanceHandler;
lodInstanceHandler.m_createFunction = [](Data::AssetData* modelLodAsset)
lodInstanceHandler.m_createFunctionWithParam = [](Data::AssetData* modelLodAsset, const AZStd::any* modelAsset)
{
return ModelLod::CreateInternal(*(azrtti_cast<ModelLodAsset*>(modelLodAsset)));
return ModelLod::CreateInternal(Data::Asset<ModelLodAsset>{modelLodAsset, AZ::Data::AssetLoadBehavior::PreLoad}, modelAsset);
};
Data::InstanceDatabase<ModelLod>::Create(azrtti_typeid<ModelLodAsset>(), lodInstanceHandler);
@@ -50,7 +51,7 @@ namespace AZ
AZ::Data::InstanceHandler<Model> modelInstanceHandler;
modelInstanceHandler.m_createFunction = [](Data::AssetData* modelAsset)
{
return Model::CreateInternal(*(azrtti_cast<ModelAsset*>(modelAsset)));
return Model::CreateInternal(Data::Asset<ModelAsset>{modelAsset, AZ::Data::AssetLoadBehavior::PreLoad});
};
Data::InstanceDatabase<Model>::Create(azrtti_typeid<ModelAsset>(), modelInstanceHandler);
}
@@ -298,6 +298,7 @@ namespace AZ
void PassSystem::ProcessQueuedChanges()
{
AZ_ATOM_PROFILE_FUNCTION("RPI", "PassSystem: ProcessQueuedChanges");
RemovePasses();
BuildPasses();
InitializePasses();
@@ -314,7 +315,11 @@ namespace AZ
m_state = PassSystemState::Rendering;
Pass::FramePrepareParams params{ &frameGraphBuilder };
m_rootPass->FrameBegin(params);
{
AZ_ATOM_PROFILE_TIME_GROUP_REGION("RPI", "Pass: FrameBegin");
m_rootPass->FrameBegin(params);
}
}
void PassSystem::FrameEnd()
@@ -172,7 +172,7 @@ namespace AZ
}
m_pipelineState = m_shader->AcquirePipelineState(descriptor);
}
}
m_dirty = false;
}
return m_pipelineState;
@@ -408,6 +408,7 @@ namespace AZ
{
AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "m_srgCallback");
AZ_ATOM_PROFILE_TIME_GROUP_REGION("RPI", "ShaderResourceGroupCallback: SrgCallback");
// Set values for scene srg
if (m_srg && m_srgCallback)
{
@@ -418,7 +419,7 @@ namespace AZ
// Get active pipelines which need to be rendered and notify them frame started
AZStd::vector<RenderPipelinePtr> activePipelines;
{
AZ_ATOM_PROFILE_TIME_GROUP_REGION("RPI", "OnStartFrame");
AZ_ATOM_PROFILE_TIME_GROUP_REGION("RPI", "Scene: OnStartFrame");
for (auto& pipeline : m_pipelines)
{
if (pipeline->NeedsRender())
@@ -483,6 +484,7 @@ namespace AZ
{
AZ_PROFILE_SCOPE(Debug::ProfileCategory::AzRender, "CollectDrawPackets");
AZ_ATOM_PROFILE_TIME_GROUP_REGION("RPI", "CollectDrawPackets");
AZ::JobCompletion* collectDrawPacketsCompletion = aznew AZ::JobCompletion();
// Launch FeatureProcessor::Render() jobs
@@ -780,7 +782,7 @@ namespace AZ
pipelineStateList.push_back();
pipelineStateList[size].m_multisampleState = rasterPass->GetMultisampleState();
pipelineStateList[size].m_renderAttachmentConfiguration = rasterPass->GetRenderAttachmentConfiguration();
rasterPass->SetPipelineStateDataIndex(size);
rasterPass->SetPipelineStateDataIndex(static_cast<AZ::u32>(size));
}
}
}
@@ -29,9 +29,10 @@ namespace AZ
if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
{
serializeContext->Class<ModelAsset, Data::AssetData>()
->Version(0)
->Version(1)
->Field("Name", &ModelAsset::m_name)
->Field("Aabb", &ModelAsset::m_aabb)
->Field("MaterialSlots", &ModelAsset::m_materialSlots)
->Field("LodAssets", &ModelAsset::m_lodAssets)
;
}
@@ -56,6 +57,25 @@ namespace AZ
{
return m_aabb;
}
const ModelMaterialSlotMap& ModelAsset::GetMaterialSlots() const
{
return m_materialSlots;
}
const ModelMaterialSlot& ModelAsset::FindMaterialSlot(uint32_t stableId) const
{
auto iter = m_materialSlots.find(stableId);
if (iter == m_materialSlots.end())
{
return m_fallbackSlot;
}
else
{
return iter->second;
}
}
size_t ModelAsset::GetLodCount() const
{
@@ -29,6 +29,33 @@ namespace AZ
m_asset->m_name = name;
}
}
void ModelAssetCreator::AddMaterialSlot(const ModelMaterialSlot& materialSlot)
{
if (ValidateIsReady())
{
auto iter = m_asset->m_materialSlots.find(materialSlot.m_stableId);
if (iter == m_asset->m_materialSlots.end())
{
m_asset->m_materialSlots[materialSlot.m_stableId] = materialSlot;
}
else
{
if (materialSlot.m_displayName != iter->second.m_displayName)
{
ReportWarning("Material slot %u was already added with a different name.", materialSlot.m_stableId);
}
if (materialSlot.m_defaultMaterialAsset != iter->second.m_defaultMaterialAsset)
{
ReportWarning("Material slot %u was already added with a different default MaterialAsset.", materialSlot.m_stableId);
}
iter->second = materialSlot;
}
}
}
void ModelAssetCreator::AddLodAsset(Data::Asset<ModelLodAsset>&& lodAsset)
{
@@ -31,16 +31,16 @@ namespace AZ
Mesh::Reflect(context);
}
void ModelLodAsset::Mesh::Reflect(AZ::ReflectContext* context)
{
if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<ModelLodAsset::Mesh>()
->Version(0)
->Field("Material", &ModelLodAsset::Mesh::m_materialAsset)
->Version(1)
->Field("Name", &ModelLodAsset::Mesh::m_name)
->Field("AABB", &ModelLodAsset::Mesh::m_aabb)
->Field("MaterialSlotId", &ModelLodAsset::Mesh::m_materialSlotId)
->Field("IndexBufferAssetView", &ModelLodAsset::Mesh::m_indexBufferAssetView)
->Field("StreamBufferInfo", &ModelLodAsset::Mesh::m_streamBufferInfo)
;
@@ -75,9 +75,9 @@ namespace AZ
return m_indexBufferAssetView.GetBufferViewDescriptor().m_elementCount;
}
const Data::Asset <MaterialAsset>& ModelLodAsset::Mesh::GetMaterialAsset() const
ModelMaterialSlot::StableId ModelLodAsset::Mesh::GetMaterialSlotId() const
{
return m_materialAsset;
return m_materialSlotId;
}
const AZ::Name& ModelLodAsset::Mesh::GetName() const
@@ -118,7 +118,7 @@ namespace AZ
{
return m_aabb;
}
const BufferAssetView* ModelLodAsset::Mesh::GetSemanticBufferAssetView(const AZ::Name& semantic) const
{
const AZStd::array_view<ModelLodAsset::Mesh::StreamBufferInfo>& streamBufferList = GetStreamBufferInfoList();
@@ -60,13 +60,15 @@ namespace AZ
m_currentMesh.m_aabb = AZStd::move(aabb);
}
}
void ModelLodAssetCreator::SetMeshMaterialAsset(const Data::Asset<MaterialAsset>& materialAsset)
void ModelLodAssetCreator::SetMeshMaterialSlot(ModelMaterialSlot::StableId id)
{
if (ValidateIsMeshReady())
if (!ValidateIsMeshReady())
{
m_currentMesh.m_materialAsset = materialAsset;
return;
}
m_currentMesh.m_materialSlotId = id;
}
void ModelLodAssetCreator::SetMeshIndexBuffer(const BufferAssetView& bufferAssetView)
@@ -288,7 +290,8 @@ namespace AZ
creator.SetMeshName(sourceMesh.GetName());
AZ::Aabb aabb = sourceMesh.GetAabb();
creator.SetMeshAabb(AZStd::move(aabb));
creator.SetMeshMaterialAsset(sourceMesh.GetMaterialAsset());
creator.SetMeshMaterialSlot(sourceMesh.GetMaterialSlotId());
// Mesh index buffer view
const BufferAssetView& sourceIndexBufferView = sourceMesh.GetIndexBufferAssetView();
@@ -0,0 +1,34 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <Atom/RPI.Reflect/Model/ModelMaterialSlot.h>
#include <AzCore/RTTI/ReflectContext.h>
#include <AzCore/Serialization/SerializeContext.h>
namespace AZ
{
namespace RPI
{
// Normally this would be defined in the header file and substituted by the compiler, but for
// some reason clang doesn't accept it.
const ModelMaterialSlot::StableId ModelMaterialSlot::InvalidStableId = -1;
void ModelMaterialSlot::Reflect(AZ::ReflectContext* context)
{
if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<ModelMaterialSlot>()
->Version(0)
->Field("StableId", &ModelMaterialSlot::m_stableId)
->Field("DisplayName", &ModelMaterialSlot::m_displayName)
->Field("DefaultMaterialAsset", &ModelMaterialSlot::m_defaultMaterialAsset)
;
}
}
} // namespace RPI
} // namespace AZ
@@ -516,7 +516,7 @@ namespace AZ
SupervariantIndex ShaderAsset::GetSupervariantIndexInternal(AZ::Name supervariantName) const
{
const auto& supervariants = GetCurrentShaderApiData().m_supervariants;
const uint32_t supervariantCount = supervariants.size();
const uint32_t supervariantCount = static_cast<uint32_t>(supervariants.size());
for (uint32_t index = 0; index < supervariantCount; ++index)
{
if (supervariants[index].m_name == supervariantName)