[llvm] [DXIL] Adding support to RootSignatureFlags in obj2yaml (PR #122396)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 22:51:14 PST 2025


================
@@ -228,6 +242,34 @@ void DXContainer::PartIterator::updateIteratorImpl(const uint32_t Offset) {
   IteratorState.Offset = Offset;
 }
 
+Error DirectX::RootSignature::parse() {
+  const char *Current = Data.begin();
+
+  Version = support::endian::read<uint32_t, llvm::endianness::little>(Current);
+  Current += sizeof(uint32_t);
+
+  NumParameters =
+      support::endian::read<uint32_t, llvm::endianness::little>(Current);
+  Current += sizeof(uint32_t);
+
+  RootParametersOffset =
+      support::endian::read<uint32_t, llvm::endianness::little>(Current);
+  Current += sizeof(uint32_t);
+
+  NumStaticSamplers =
+      support::endian::read<uint32_t, llvm::endianness::little>(Current);
+  Current += sizeof(uint32_t);
+
+  StaticSamplersOffset =
+      support::endian::read<uint32_t, llvm::endianness::little>(Current);
+  Current += sizeof(uint32_t);
+
+  Flags = support::endian::read<uint32_t, llvm::endianness::little>(Current);
+  Current += sizeof(uint32_t);
+
+  return Error::success();
----------------
bogner wrote:

It's a bit concerning that this method never fails. What if the data provided is less than 6*32 bytes?

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


More information about the llvm-commits mailing list