Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Info][Patch] Current O3DE is incompatible with current azslc #54

Open
martinwinter-huawei opened this issue Aug 2, 2022 · 1 comment

Comments

@martinwinter-huawei
Copy link
Contributor

The --use-spaces change is a breaking change within current O3DE, as it is no longer a valid keyword.
To be able to use the current version of azslc with the current state of development of o3de, small changes are necessary.
The following patch (for o3de) introduces these fixes

diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp
index 38cd7af751..7663c90558 100644
--- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp
+++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp
@@ -448,8 +448,8 @@ namespace AZ
                 // since the register Id of the resource will not change even if the pipeline layout changes.
                 // We can pass in a default ShaderCompilerArguments because all we care about is whether the shaderPlatformInterface
                 // appends the "--use-spaces" flag.
-                const auto& azslcArguments = buildArgsManager.GetCurrentArguments().m_azslcArguments;
-                const bool platformUsesRegisterSpaces = RHI::ShaderBuildArguments::HasArgument(azslcArguments, "--use-spaces");
+                // const auto& azslcArguments = buildArgsManager.GetCurrentArguments().m_azslcArguments;
+                const bool platformUsesRegisterSpaces = true; // RHI::ShaderBuildArguments::HasArgument(azslcArguments, "--use-spaces");
 
                 uint32_t supervariantIndex = 0;
                 for (const auto& supervariantInfo : supervariantList)
diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp
index 41ef6dc7af..0d0b520f26 100644
--- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp
+++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp
@@ -866,9 +866,10 @@ namespace AZ
                     RHI::Ptr<RHI::PipelineLayoutDescriptor> pipelineLayoutDescriptor;
                     if (shaderPlatformInterface->VariantCompilationRequiresSrgLayoutData())
                     {
-                        const auto& azslcArguments = buildArgsManager.GetCurrentArguments().m_azslcArguments;
-                        const bool platformUsesRegisterSpaces = RHI::ShaderBuildArguments::HasArgument(azslcArguments, "--use-spaces");
-                    
+                        // const auto& azslcArguments = buildArgsManager.GetCurrentArguments().m_azslcArguments;
+                        const bool platformUsesRegisterSpaces =
+                            true; //= RHI::ShaderBuildArguments::HasArgument(azslcArguments, "--use-spaces");
+
                         RPI::ShaderResourceGroupLayoutList srgLayoutList;
                         RootConstantData rootConstantData;
                         if (!LoadSrgLayoutListFromShaderAssetBuilder(
diff --git a/Gems/Atom/Asset/Shader/Config/shader_build_options.json b/Gems/Atom/Asset/Shader/Config/shader_build_options.json
index df69bd17fd..f14ae106ee 100644
--- a/Gems/Atom/Asset/Shader/Config/shader_build_options.json
+++ b/Gems/Atom/Asset/Shader/Config/shader_build_options.json
@@ -5,7 +5,8 @@
               , "-+" // C++ mode
         ],
         "azslc": ["--full" // Always generate the *.json files with SRG and reflection info.
-                , "--use-spaces"
+				// ,
+				// "--use-spaces"
                 , "--Zpr" // Row major matrices.
                 , "--W1" // Warning Level 1
                 , "--strip-unused-srgs" // Remove unreferenced SRGs.
@santorac
Copy link
Contributor

I made similar (but more comprehensive) changes here, it's currently sitting on a feature branch for bindless support. aws-lumberyard-dev/o3de@3ffbe0c

The bindless support is likely to be done soon, and a new AZSLc package released by @siliconvoodoo , and that will clear everything up.

Sorry about the mixup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants