================ @@ -105,6 +113,56 @@ static bool parseRootConstants(LLVMContext *Ctx, mcdxbc::RootSignatureDesc &RSD, return false; } +static bool parseRootDescriptors(LLVMContext *Ctx, + mcdxbc::RootSignatureDesc &RSD, + MDNode *RootDescriptorNode) { + + if (RootDescriptorNode->getNumOperands() != 5) + return reportError(Ctx, "Invalid format for RootConstants Element"); + + std::optional<StringRef> ElementText = + extractMdStringValue(RootDescriptorNode, 0); + assert(!ElementText->empty()); + + dxbc::RootParameterHeader Header; + Header.ParameterType = + StringSwitch<uint32_t>(*ElementText) + .Case("RootCBV", llvm::to_underlying(dxbc::RootParameterType::CBV)) + .Case("RootSRV", llvm::to_underlying(dxbc::RootParameterType::SRV)) + .Case("RootUAV", llvm::to_underlying(dxbc::RootParameterType::UAV)); ---------------- joaosaffran wrote:
I did some research, it seems that it would be undefined behavior, @bogner correct me if I am wrong please. Will update to handle it better https://github.com/llvm/llvm-project/pull/139781 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits