Sfoglia il codice sorgente

Merge branch 'development' into fix-option-min

Signed-off-by: siliconvoodoo <[email protected]>
siliconvoodoo 2 anni fa
parent
commit
a313882b04
2 ha cambiato i file con 9 aggiunte e 7 eliminazioni
  1. 7 6
      src/AzslcBackend.cpp
  2. 2 1
      src/AzslcMain.cpp

+ 7 - 6
src/AzslcBackend.cpp

@@ -636,7 +636,7 @@ namespace AZ::ShaderCompiler
 
             for (const auto tId : srgInfo->m_srViews)
             {
-                if (useUniqueIndices && !srgInfo->m_unboundedArrays.empty() && srgInfo->m_unboundedArrays[0] == tId)
+                if (useUniqueIndices && std::find(srgInfo->m_unboundedArrays.begin(), srgInfo->m_unboundedArrays.end(), tId) != srgInfo->m_unboundedArrays.end())
                 {
                     // This variable will be added to the end of the binding table.
                     // See: "REMARK: --unique-idx" a few lines below.
@@ -679,12 +679,13 @@ namespace AZ::ShaderCompiler
             // they are sharing the same register index range. Because an unbounded array
             // takes ownership of the remaining register range within a register space, it always
             // must be added after that last resource in the register space.
-            if (useUniqueIndices && !srgInfo->m_unboundedArrays.empty())
+            if (useUniqueIndices)
             {
-                // Only srgInfo->m_unboundedArrays[0] is reflected because the "AzslcSemanticOrchestrator" already
-                // makes sure that only one unbounded array is declared inside the SRG when --unique-idx is enabled.
-                srgDesc.m_parameters.push_back(
-                    ReflectOneExternalResourceAndWrapWithUnifyIndices(srgInfo->m_unboundedArrays[0], bindInfo, rootSig));
+                for (const auto tId : srgInfo->m_unboundedArrays)
+                {
+                    srgDesc.m_parameters.push_back(
+                        ReflectOneExternalResourceAndWrapWithUnifyIndices(tId, bindInfo, rootSig));
+                }
             }
 
             bindInfo.SignalIncrementSpace(/*overshoot callback:*/[&, srgInfo = srgInfo, srgUid = srgUid](int numSpaces, int spacesAvailable)

+ 2 - 1
src/AzslcMain.cpp

@@ -23,7 +23,8 @@ namespace StdFs = std::filesystem;
 // For large features or milestones. Minor version allows for breaking changes. Existing tests can change.
 #define AZSLC_MINOR "8"   // last change: introduction of class inheritance
 // For small features or bug fixes. They cannot introduce breaking changes. Existing tests shouldn't change.
-#define AZSLC_REVISION "14"  // last change: add min in option value key-extracter's function for range & enum
+#define AZSLC_REVISION "15"  // last change: add min in option value key-extracter's function for range & enum
+                    // "14"          change: [5a1b711] Fixing order of multiple unbounded arrays when unique indices are used.
 
 namespace AZ::ShaderCompiler
 {