[llvm] [NFC] Refactoring MCDXBC to support out of order storage of root parameters (PR #137284)

Sarah Spall via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 09:28:03 PDT 2025


================
@@ -76,29 +72,38 @@ void RootSignatureDesc::write(raw_ostream &OS) const {
   }
 
   assert(NumParameters == ParamsOffsets.size());
-  for (size_t I = 0; I < NumParameters; ++I) {
+  const RootParameterInfo *H = ParametersContainer.begin();
+  for (size_t I = 0; I < NumParameters; ++I, H++) {
     rewriteOffsetToCurrentByte(BOS, ParamsOffsets[I]);
-    const mcdxbc::RootParameter &P = Parameters[I];
-
-    switch (P.Header.ParameterType) {
-    case llvm::to_underlying(dxbc::RootParameterType::Constants32Bit):
-      support::endian::write(BOS, P.Constants.ShaderRegister,
+    auto P = ParametersContainer.getParameter(H);
+    if (!P)
+      continue;
----------------
spall wrote:

Same comment here as above. 

https://github.com/llvm/llvm-project/pull/137284


More information about the llvm-commits mailing list