[llvm] [HLSL] Add in-memory representation of Semantic Signatures (PR #209907)

Finn Plummer via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 10:59:34 PDT 2026


================
@@ -0,0 +1,100 @@
+//===- SemanticSignatures.h - HLSL Semantic Signature helper objects ------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file This file contains structure definitions of HLSL Semantic Signature
+/// objects.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_FRONTEND_HLSL_SEMANTICSIGNATURES_H
+#define LLVM_FRONTEND_HLSL_SEMANTICSIGNATURES_H
+
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/BinaryFormat/DXContainer.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/Support/DXILABI.h"
+#include "llvm/Support/Error.h"
+#include <cstdint>
+
+namespace llvm {
+
+class LLVMContext;
+class MDNode;
+
+namespace hlsl {
+
+// Definitions of the in-memory data layout structures
+
+// Sentinel values denoting that an element is unallocated
+static constexpr uint32_t UnallocatedRow = ~0U;
+static constexpr uint8_t UnallocatedCol = 0xFF;
+
+// Models a single packed range of signature rows with its semantic name and
+// indices, register placement, component masks, and stage-specific attributes.
+struct SemanticSignatureElement {
+  uint32_t SigId;
----------------
inbelic wrote:

We have previously used the pattern that a value with a default value is optional to provide on construction. Although then I should remove some other default values.

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


More information about the llvm-commits mailing list