https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/147832
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -27,51 +36,68 @@ RootSignatureParser::RootSignatureParser(
bool RootSignatureParser::parse() {
// Iterate as many RootSignatureElements as possible, until we hit the
// end of the stream
+ bool HadError = false;
inbelic wrote:
The pattern that I have s
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/147832
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -27,51 +36,68 @@ RootSignatureParser::RootSignatureParser(
bool RootSignatureParser::parse() {
// Iterate as many RootSignatureElements as possible, until we hit the
// end of the stream
+ bool HadError = false;
while (!peekExpectedToken(TokenKind::end_of_stream)) {
@@ -27,51 +36,68 @@ RootSignatureParser::RootSignatureParser(
bool RootSignatureParser::parse() {
// Iterate as many RootSignatureElements as possible, until we hit the
// end of the stream
+ bool HadError = false;
while (!peekExpectedToken(TokenKind::end_of_stream)) {
@@ -27,51 +36,68 @@ RootSignatureParser::RootSignatureParser(
bool RootSignatureParser::parse() {
// Iterate as many RootSignatureElements as possible, until we hit the
// end of the stream
+ bool HadError = false;
while (!peekExpectedToken(TokenKind::end_of_stream)) {
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147832
>From 7ec7e32d2ac4945a489d5463b9fb700b0cceff9d Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Wed, 9 Jul 2025 21:21:53 +
Subject: [PATCH 1/3] [HLSL][RootSignature] Implement multiple diagnostics in
`Root
@@ -0,0 +1,160 @@
+; RUN: not opt -S -passes='dxil-post-optimization-validation'
-mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1
+
+; CHECK: error: register cbuffer (space=665, register=3) is not defined in
Root Signature
+; CHECK: error: register srv (space=0, register=0) is n
@@ -14,10 +14,129 @@
#ifndef LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H
#define LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H
+#include "DXILRootSignature.h"
+#include "llvm/ADT/IntervalMap.h"
+#include "llvm/Analysis/DXILResource.h"
#include "llvm/IR
@@ -14,10 +14,129 @@
#ifndef LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H
#define LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H
+#include "DXILRootSignature.h"
+#include "llvm/ADT/IntervalMap.h"
+#include "llvm/Analysis/DXILResource.h"
#include "llvm/IR
@@ -0,0 +1,160 @@
+; RUN: not opt -S -passes='dxil-post-optimization-validation'
-mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1
+
+; CHECK: error: register cbuffer (space=665, register=3) is not defined in
Root Signature
+; CHECK: error: register srv (space=0, register=0) is n
@@ -94,14 +147,83 @@ static void reportErrors(Module &M, DXILResourceMap &DRM,
assert(!DRBI.hasImplicitBinding() && "implicit bindings should be handled in
"
"DXILResourceImplicitBinding pass");
+
+ if (auto RSD = getRootSignature(RSB
@@ -14,10 +14,129 @@
#ifndef LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H
#define LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H
+#include "DXILRootSignature.h"
+#include "llvm/ADT/IntervalMap.h"
+#include "llvm/Analysis/DXILResource.h"
#include "llvm/IR
inbelic wrote:
Ah okay, didn't realize it follows a different structure here. Thanks for
checking
https://github.com/llvm/llvm-project/pull/146785
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.o
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/147832
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/147832
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147832
>From 7ec7e32d2ac4945a489d5463b9fb700b0cceff9d Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Wed, 9 Jul 2025 21:21:53 +
Subject: [PATCH] [HLSL][RootSignature] Implement multiple diagnostics in
`RootSign
https://github.com/inbelic ready_for_review
https://github.com/llvm/llvm-project/pull/147800
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -14,10 +14,129 @@
#ifndef LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H
#define LLVM_LIB_TARGET_DIRECTX_DXILPOSTOPTIMIZATIONVALIDATION_H
+#include "DXILRootSignature.h"
+#include "llvm/ADT/IntervalMap.h"
+#include "llvm/Analysis/DXILResource.h"
#include "llvm/IR
@@ -0,0 +1,160 @@
+; RUN: not opt -S -passes='dxil-post-optimization-validation'
-mtriple=dxil-pc-shadermodel6.6-compute %s 2>&1
+
+; CHECK: error: register cbuffer (space=665, register=3) is not defined in
Root Signature
+; CHECK: error: register srv (space=0, register=0) is n
inbelic wrote:
This should be in the include directory
https://github.com/llvm/llvm-project/pull/146785
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/li
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147800
>From 95166f5e2bfb2816ce39d3abd1823486742109bd Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Wed, 9 Jul 2025 15:50:55 +
Subject: [PATCH 01/11] remove confusing hlsl_unexpected_end_of_params
diagnostic
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147115
>From bef7466d6110c682ee5887b7fc98c980f7a1ec94 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 27 Jun 2025 18:36:38 +
Subject: [PATCH 01/15] nfc: introduce wrapper `RootSignatureElement` around
`Root
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147115
>From bef7466d6110c682ee5887b7fc98c980f7a1ec94 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 27 Jun 2025 18:36:38 +
Subject: [PATCH 01/14] nfc: introduce wrapper `RootSignatureElement` around
`Root
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/147115
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -32,6 +32,9 @@ struct RangeInfo {
llvm::dxil::ResourceClass Class;
uint32_t Space;
llvm::dxbc::ShaderVisibility Visibility;
+
+ // The index retains its original position before being sorted by group.
+ size_t Index;
inbelic wrote:
Okay, so I messed
@@ -130,12 +149,13 @@ class SemaHLSL : public SemaBase {
/// Creates the Root Signature decl of the parsed Root Signature elements
/// onto the AST and push it onto current Scope
- void ActOnFinishRootSignatureDecl(
- SourceLocation Loc, IdentifierInfo *DeclIdent,
-
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147115
>From cb29c3acd72990b35e7be85d2f9796fb8098f3d2 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 27 Jun 2025 18:36:38 +
Subject: [PATCH 01/15] nfc: introduce wrapper `RootSignatureElement` around
`Root
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/147115
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
inbelic wrote:
Contemplating if I should split this into two prs. Will see if there is a nice
way to de-couple the improve and fix error portions of this.
https://github.com/llvm/llvm-project/pull/147350
___
llvm-branch-commits mailing list
llvm-branc
https://github.com/inbelic converted_to_draft
https://github.com/llvm/llvm-project/pull/147350
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147117
>From d66a67d9660ab1114d55f75ef2ad5a9cfd35f8f6 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 4 Jul 2025 22:17:37 +
Subject: [PATCH 1/2] self-review: remove unused Loc
---
clang/include/clang/Sema/
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147115
>From 4a5cde3f77dc0c371d1f33b10be9507d3aeff3e3 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 27 Jun 2025 18:36:38 +
Subject: [PATCH 1/9] nfc: introduce wrapper `RootSignatureElement` around
`RootEl
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/147117
This pr abstracts out the logic of detecting resource range overlap from
`SemaHLSL` into the `RootSignatureValidations` library.
For more context see linked issue.
- Moves the validation logic from `SemaHLSL`
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147115
>From 4a5cde3f77dc0c371d1f33b10be9507d3aeff3e3 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 27 Jun 2025 18:36:38 +
Subject: [PATCH 1/9] nfc: introduce wrapper `RootSignatureElement` around
`RootEl
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/147115
At the moment, when we report diagnostics from `SemaHLSL` we only provide the
source location of the root signature attr. This allows for significantly less
helpful diagnostics (for eg. reporting resource range
inbelic wrote:
Whoops, accidently pushed to the wrong upstream branch. Looks like I can't
unmerge it to the stacked branch...
https://github.com/llvm/llvm-project/pull/147094
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
http
https://github.com/inbelic closed
https://github.com/llvm/llvm-project/pull/147094
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -1064,21 +1064,25 @@ SemaHLSL::ActOnStartRootSignatureDecl(StringRef
Signature) {
void SemaHLSL::ActOnFinishRootSignatureDecl(
SourceLocation Loc, IdentifierInfo *DeclIdent,
-SmallVector &Elements) {
+ArrayRef RootElements) {
+
+ if (handleRootSignatureElement
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/147111
>From ab274d239bd12e39fc91d7cc2fc7e899be274e55 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 4 Jul 2025 20:54:50 +
Subject: [PATCH 1/6] [HLSL][DirectX] Add `verifyNumDescriptors`
---
.../Frontend/
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/147111
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/147111
This pr resolves some discrepancies in verification during `validate` in
`DXILRootSignature.cpp`.
Namely,
- `verifyDescriptorFlag` should be updated to check what flags are valid based
on the root signature ve
https://github.com/inbelic ready_for_review
https://github.com/llvm/llvm-project/pull/147094
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -1103,9 +1107,15 @@ bool
SemaHLSL::handleRootSignatureDecl(HLSLRootSignatureDecl *D,
using ResourceRange = llvm::hlsl::rootsig::ResourceRange;
using GroupT = std::pair;
+ // Introduce a mapping from the collected RangeInfos back to the
+ // RootSignatureElement that
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/147094
At the moment, when we report diagnostics from `SemaHLSL` we only provide the
source location of the root signature attr. This allows for significantly less
helpful diagnostics (for eg. reporting resource range
https://github.com/inbelic closed
https://github.com/llvm/llvm-project/pull/146150
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/146124
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/145828
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/145828
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -55,7 +59,9 @@
// CHECK-SAME: numClauses = 3, visibility = All
// CHECK-SAME: ),
// CHECK-SAME: Sampler(
-// CHECK-SAME: s0, numDescriptors = 4, space = 1, offset =
DescriptorTableOffsetAppend, flags = None
+// CHECK-SAME: s0, numDescriptors = 4, space = 1, offset =
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/145828
>From 471a4a556ad0653792e39c99da2423d5e3ed933f Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 27 Jun 2025 16:39:13 +
Subject: [PATCH 01/10] update `setDefaultFlags`
---
.../llvm/Frontend/HLSL/HLSLR
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/146150
None
>From 18edab1fc3ab4a137de935abff5bb4716cc9a5fd Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 27 Jun 2025 18:36:38 +
Subject: [PATCH 1/5] nfc: introduce wrapper `RootSignatureElement` around
`
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/146124
This pr breaks-up `HLSLRootSignatureUtils` into separate orthogonal and
meaningful libraries. This prevents it end up as a dumping grounds of many
different parts.
- Creates a library `RootSignatureMetadata` t
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/146124
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/145828
>From 471a4a556ad0653792e39c99da2423d5e3ed933f Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 27 Jun 2025 16:39:13 +
Subject: [PATCH 1/7] update `setDefaultFlags`
---
.../llvm/Frontend/HLSL/HLSLRoo
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/145828
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/144465
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
inbelic wrote:
I guess the awkward part is that it might be nice to clean up all the current
error tests that are spread across many files to just one for each param type.
https://github.com/llvm/llvm-project/pull/144465
___
@@ -399,6 +486,127 @@ static bool verifyDescriptorRangeFlag(uint32_t Version,
uint32_t Type,
return false;
}
+static bool verifySamplerFilter(uint32_t Filter) {
+ switch (Filter) {
+ case llvm::to_underlying(dxbc::StaticSamplerFilter::MIN_MAG_MIP_POINT):
@@ -456,6 +664,48 @@ static bool validate(LLVMContext *Ctx, const
mcdxbc::RootSignatureDesc &RSD) {
}
}
+ for (const dxbc::RTS0::v1::StaticSampler &Sampler : RSD.StaticSamplers) {
+if (!verifySamplerFilter(Sampler.Filter))
+ return reportValueError(Ctx, "Filte
inbelic wrote:
accidently included
https://github.com/llvm/llvm-project/pull/143422
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-c
https://github.com/inbelic converted_to_draft
https://github.com/llvm/llvm-project/pull/143198
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -71,6 +71,199 @@ static raw_ostream &operator<<(raw_ostream &OS,
return OS;
}
+static raw_ostream &operator<<(raw_ostream &OS, const SamplerFilter &Filter) {
+ switch (Filter) {
+ case SamplerFilter::MinMagMipPoint:
+OS << "MinMagMipPoint";
inbelic
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/143198
Implements serialization of the remaining completely defined `RootElement`s,
namely `RootDescriptor`s and `RootFlag`s.
- Adds unit testing for the serialization methods
Resolves https://github.com/llvm/llvm-pr
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/140962
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -973,6 +1076,8 @@ void SemaHLSL::handleRootSignatureAttr(Decl *D, const
ParsedAttr &AL) {
if (auto *SignatureDecl =
dyn_cast(R.getFoundDecl())) {
// Perform validation of constructs here
+ if (handleRootSignatureDecl(SignatureDecl, AL.getLoc()))
+
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/140962
>From bcc056ea5c753c3b1fa83d214c6bd14e90d9ee25 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Wed, 21 May 2025 00:12:04 +
Subject: [PATCH 1/4] [HLSL][RootSignature] Plug into the thing
---
.../clang/Bas
@@ -951,6 +952,108 @@ void SemaHLSL::emitLogicalOperatorFixIt(Expr *LHS, Expr
*RHS,
<< NewFnName << FixItHint::CreateReplacement(FullRange, OS.str());
}
+namespace {
+
+// A resource range overlaps with another resource range if they have:
+// - equivalent ResourceClass
@@ -973,6 +1076,8 @@ void SemaHLSL::handleRootSignatureAttr(Decl *D, const
ParsedAttr &AL) {
if (auto *SignatureDecl =
dyn_cast(R.getFoundDecl())) {
// Perform validation of constructs here
+ if (handleRootSignatureDecl(SignatureDecl, AL.getLoc()))
+
@@ -951,6 +952,108 @@ void SemaHLSL::emitLogicalOperatorFixIt(Expr *LHS, Expr
*RHS,
<< NewFnName << FixItHint::CreateReplacement(FullRange, OS.str());
}
+namespace {
+
+// A resource range overlaps with another resource range if they have:
+// - equivalent ResourceClass
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/140293
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -50,15 +51,55 @@ static void reportInvalidDirection(Module &M,
DXILResourceMap &DRM) {
}
}
-} // namespace
+static void reportOverlappingError(Module &M, ResourceInfo R1,
+ ResourceInfo R2) {
+ SmallString<64> Message;
+ raw_svector_os
@@ -50,15 +51,55 @@ static void reportInvalidDirection(Module &M,
DXILResourceMap &DRM) {
}
}
-} // namespace
+static void reportOverlappingError(Module &M, ResourceInfo R1,
+ ResourceInfo R2) {
+ SmallString<64> Message;
+ raw_svector_os
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/140181
>From f9fbe391091fbf23203d6cc997e19d05d92a4a18 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Thu, 15 May 2025 23:14:10 +
Subject: [PATCH 01/10] pre-req: add missing token to Lexer
---
clang/include/cla
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/140181
>From f9fbe391091fbf23203d6cc997e19d05d92a4a18 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Thu, 15 May 2025 23:14:10 +
Subject: [PATCH 01/10] pre-req: add missing token to Lexer
---
clang/include/cla
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/140181
>From f9fbe391091fbf23203d6cc997e19d05d92a4a18 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Thu, 15 May 2025 23:14:10 +
Subject: [PATCH 1/9] pre-req: add missing token to Lexer
---
clang/include/clang
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/140291
>From d6148b7d9815c2543f37d50a7a611e482c99b91c Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Fri, 16 May 2025 16:08:36 +
Subject: [PATCH 1/8] pre-req: add keywords
---
clang/include/clang/Lex/HLSLRootS
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/140957
>From a3240de319d3ef455b5db83b66b5bd601cecc0b3 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Tue, 20 May 2025 19:47:29 +
Subject: [PATCH 1/2] [HLSL][RootSignature] Implement resource register
validation
https://github.com/inbelic approved this pull request.
Ha the diff confused me, the diff makes it look like `RootDescriptor` is moving
namespaces but in reality it is all the ones in between that are changing.
https://github.com/llvm/llvm-project/pull/141173
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/141130
- Implements serialization of the currently completely defined `RootElement`s,
namely `RootConstants` and `RootFlags`
- Adds unit testing for the serialization methods
Resolves: https://github.com/llvm/llvm-pro
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/140957
A resource range consists of a closed interval, `[a;b]`, denoting which shader
registers it is bound to.
For instance:
- `CBV(b1)` corresponds to the resource range of `[1;1]`
- `CBV(b0, numDescriptors = 3)`
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/140962
>From bcc056ea5c753c3b1fa83d214c6bd14e90d9ee25 Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Wed, 21 May 2025 00:12:04 +
Subject: [PATCH] [HLSL][RootSignature] Plug into the thing
---
.../clang/Basic/D
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/140962
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/140957
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic created
https://github.com/llvm/llvm-project/pull/140962
As was established
[previously](https://github.com/llvm/llvm-project/pull/140957), we created a
structure to model a resource range and to detect an overlap in a given set of
these.
However, a resource range
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/140957
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/140148
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/140151
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/140152
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic edited
https://github.com/llvm/llvm-project/pull/140148
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/inbelic updated
https://github.com/llvm/llvm-project/pull/140148
>From 994bc35f7eb1707097511a121d2a5a0b6f42637c Mon Sep 17 00:00:00 2001
From: Finn Plummer
Date: Thu, 15 May 2025 19:49:44 +
Subject: [PATCH 1/2] [HLSL][RootSignature] Add parsing of Register in params
for
@@ -91,6 +99,23 @@ struct RootParam {
Register Reg;
uint32_t Space = 0;
ShaderVisibility Visibility = ShaderVisibility::All;
+ RootDescriptorFlags Flags;
+
+ void setDefaultFlags() {
+assert(Type != ParamType::Sampler &&
+ "Sampler is not a valid type of P
@@ -105,6 +113,56 @@ static bool parseRootConstants(LLVMContext *Ctx,
mcdxbc::RootSignatureDesc &RSD,
return false;
}
+static bool parseRootDescriptors(LLVMContext *Ctx,
+ mcdxbc::RootSignatureDesc &RSD,
+ MDNo
@@ -105,6 +113,56 @@ static bool parseRootConstants(LLVMContext *Ctx,
mcdxbc::RootSignatureDesc &RSD,
return false;
}
+static bool parseRootDescriptors(LLVMContext *Ctx,
+ mcdxbc::RootSignatureDesc &RSD,
+ MDNo
@@ -155,6 +217,16 @@ static bool verifyVersion(uint32_t Version) {
return (Version == 1 || Version == 2);
}
+static bool verifyRegisterValue(uint32_t RegisterValue) {
+ return !(RegisterValue == 0x);
+}
+
+static bool verifyRegisterSpace(uint32_t RegisterSpace) {
+
@@ -308,6 +413,21 @@ PreservedAnalyses RootSignatureAnalysisPrinter::run(Module
&M,
<< "Shader Register: " << Constants->ShaderRegister << "\n";
OS << indent(Space + 2)
<< "Num 32 Bit Values: " << Constants->Num32BitValues << "\n";
+ } else i
@@ -278,33 +280,40 @@ void DXContainerWriter::writeParts(raw_ostream &OS) {
auto Header = dxbc::RootParameterHeader{Param.Type, Param.Visibility,
Param.Offset};
-switch (Param.Type) {
-case llvm::to_underl
@@ -112,98 +113,17 @@ struct DescriptorTableYaml {
SmallVector Ranges;
};
+using ParameterData =
+std::variant;
+
struct RootParameterYamlDesc {
uint32_t Type;
inbelic wrote:
This field can be removed now right? IIUC, it is held in the variant
edit
@@ -606,6 +644,30 @@
RootSignatureParser::parseDescriptorTableClauseParams(TokenKind RegType) {
return Params;
}
+std::optional
+RootSignatureParser::parseStaticSamplerParams() {
+ assert(CurToken.TokKind == TokenKind::pu_l_paren &&
+ "Expects to only be invoked st
@@ -223,6 +223,34 @@ TEST_F(ParseHLSLRootSignatureTest,
ValidParseDTClausesTest) {
ASSERT_TRUE(Consumer->isSatisfied());
}
+TEST_F(ParseHLSLRootSignatureTest, ValidParseStaticSamplerTest) {
inbelic wrote:
I opted-out to reduce redundancy, as there is alrea
1 - 100 of 222 matches
Mail list logo