Atom/galibzon/atom 4608/inline to root constant (#4897)
* Changed references to "InlineConstant" to "RootConstant". Updated AZSLC to version 1.7.34 for mac, linux & windows Signed-off-by: garrieta <garrieta@amazon.com>
This commit is contained in:
@@ -404,18 +404,18 @@ namespace AZ
|
||||
|
||||
bool AzslCompiler::ParseSrgPopulateRootConstantData(const rapidjson::Document& input, RootConstantData& rootConstantData) const
|
||||
{
|
||||
if (input.HasMember("InlineConstantBuffer"))
|
||||
if (input.HasMember("RootConstantBuffer"))
|
||||
{
|
||||
const rapidjson::Value& rootConstantBufferValue = input["InlineConstantBuffer"];
|
||||
AZ_Assert(rootConstantBufferValue.IsObject(), "InlineConstantBuffer is not an object");
|
||||
const rapidjson::Value& rootConstantBufferValue = input["RootConstantBuffer"];
|
||||
AZ_Assert(rootConstantBufferValue.IsObject(), "RootConstantBuffer is not an object");
|
||||
for (rapidjson::Value::ConstMemberIterator itr = rootConstantBufferValue.MemberBegin(); itr != rootConstantBufferValue.MemberEnd(); ++itr)
|
||||
{
|
||||
AZStd::string_view rootConstantBufferMemberName = itr->name.GetString();
|
||||
const rapidjson::Value& rootConstantBufferMemberValue = itr->value;
|
||||
|
||||
if (rootConstantBufferMemberName == "bufferForInlineConstants")
|
||||
if (rootConstantBufferMemberName == "bufferForRootConstants")
|
||||
{
|
||||
AZ_Assert(rootConstantBufferMemberValue.IsObject(), "bufferForInlineConstants is not an object");
|
||||
AZ_Assert(rootConstantBufferMemberValue.IsObject(), "bufferForRootConstants is not an object");
|
||||
|
||||
for (rapidjson::Value::ConstMemberIterator itr2 = rootConstantBufferMemberValue.MemberBegin(); itr2 != rootConstantBufferMemberValue.MemberEnd(); ++itr2)
|
||||
{
|
||||
@@ -442,14 +442,14 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (rootConstantBufferMemberName == "inputsForInlineConstants")
|
||||
else if (rootConstantBufferMemberName == "inputsForRootConstants")
|
||||
{
|
||||
AZ_Assert(rootConstantBufferMemberValue.IsArray(), "inputsForInlineConstants is not an array");
|
||||
AZ_Assert(rootConstantBufferMemberValue.IsArray(), "inputsForRootConstants is not an array");
|
||||
|
||||
for (rapidjson::Value::ConstValueIterator itr2 = rootConstantBufferMemberValue.Begin(); itr2 != rootConstantBufferMemberValue.End(); ++itr2)
|
||||
{
|
||||
const rapidjson::Value& rootConstantBufferValue2 = *itr2;
|
||||
AZ_Assert(rootConstantBufferValue2.IsObject(), "Entry in inputsForInlineConstants is not an object");
|
||||
AZ_Assert(rootConstantBufferValue2.IsObject(), "Entry in inputsForRootConstants is not an object");
|
||||
|
||||
SrgConstantData rootConstantInputs;
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace AZ
|
||||
// Register Shader Asset Builder
|
||||
AssetBuilderSDK::AssetBuilderDesc shaderAssetBuilderDescriptor;
|
||||
shaderAssetBuilderDescriptor.m_name = "Shader Asset Builder";
|
||||
shaderAssetBuilderDescriptor.m_version = 104; // ATOM-15871
|
||||
shaderAssetBuilderDescriptor.m_version = 105; // [AZSL] Changing inlineConstant to rootConstant keyword work.
|
||||
// .shader file changes trigger rebuilds
|
||||
shaderAssetBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern( AZStd::string::format("*.%s", RPI::ShaderSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
|
||||
shaderAssetBuilderDescriptor.m_busId = azrtti_typeid<ShaderAssetBuilder>();
|
||||
@@ -96,7 +96,7 @@ namespace AZ
|
||||
shaderVariantAssetBuilderDescriptor.m_name = "Shader Variant Asset Builder";
|
||||
// Both "Shader Variant Asset Builder" and "Shader Asset Builder" produce ShaderVariantAsset products. If you update
|
||||
// ShaderVariantAsset you will need to update BOTH version numbers, not just "Shader Variant Asset Builder".
|
||||
shaderVariantAssetBuilderDescriptor.m_version = 25; // ATOM-15871
|
||||
shaderVariantAssetBuilderDescriptor.m_version = 26; // [AZSL] Changing inlineConstant to rootConstant keyword work.
|
||||
shaderVariantAssetBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern(AZStd::string::format("*.%s", RPI::ShaderVariantListSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
|
||||
shaderVariantAssetBuilderDescriptor.m_busId = azrtti_typeid<ShaderVariantAssetBuilder>();
|
||||
shaderVariantAssetBuilderDescriptor.m_createJobFunction = AZStd::bind(&ShaderVariantAssetBuilder::CreateJobs, &m_shaderVariantAssetBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2);
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace AZ
|
||||
// access the root constants reflection
|
||||
if (!azslc.ParseSrgPopulateRootConstantData(
|
||||
outcomes[AzslSubProducts::srg].GetValue(),
|
||||
rootConstantData)) // consuming data from --srg ("InlineConstantBuffer" subjson section)
|
||||
rootConstantData)) // consuming data from --srg ("RootConstantBuffer" subjson section)
|
||||
{
|
||||
AZ_Error(builderName, false, "Failed to obtain root constant data reflection");
|
||||
return AssetBuilderSDK::ProcessJobResult_Failed;
|
||||
|
||||
@@ -561,7 +561,7 @@ namespace AZ
|
||||
// Access the root constants reflection
|
||||
if (!azslCompiler.ParseSrgPopulateRootConstantData(
|
||||
jsonOutcome.GetValue(),
|
||||
rootConstantData)) // consuming data from --srg ("InlineConstantBuffer" subjson section)
|
||||
rootConstantData)) // consuming data from --srg ("RootConstantBuffer" subjson section)
|
||||
{
|
||||
AZ_Error(ShaderVariantAssetBuilderName, false, "Failed to obtain root constant data reflection");
|
||||
return false;
|
||||
|
||||
+8
@@ -48,6 +48,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"Supervariants":
|
||||
[
|
||||
{
|
||||
"Name": "",
|
||||
"PlusArguments": "--no-alignment-validation"
|
||||
}
|
||||
],
|
||||
|
||||
"DrawList" : "forward"
|
||||
}
|
||||
|
||||
+8
@@ -49,5 +49,13 @@
|
||||
]
|
||||
},
|
||||
|
||||
"Supervariants":
|
||||
[
|
||||
{
|
||||
"Name": "",
|
||||
"PlusArguments": "--no-alignment-validation"
|
||||
}
|
||||
],
|
||||
|
||||
"DrawList" : "forward"
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@
|
||||
[
|
||||
{
|
||||
"Name": "",
|
||||
"PlusArguments": "",
|
||||
"PlusArguments": "--no-alignment-validation",
|
||||
"MinusArguments": "--strip-unused-srgs"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user