@@ -236,21 +272,33 @@ static void validateRootSignature(Module &M,
BoundRegs.findBoundReg(RC, Binding.Space, Binding.LowerBound,
Binding.LowerBound + Binding.Size - 1);
-if (Reg != nullptr) {
- const auto *ParamInfo =
-
@@ -1472,5 +1473,38 @@ IdentifierInfo *ParseHLSLRootSignature(Sema &Actions,
return DeclIdent;
}
+void HandleRootSignatureTarget(Sema &S, StringRef EntryRootSig) {
+ ASTConsumer *Consumer = &S.getASTConsumer();
+
+ // Minimally initalize the parser. This does a couple thin
@@ -140,8 +143,19 @@ analyzeModule(Module &M) {
RSD.StaticSamplersOffset = 0u;
RSDMap.insert(std::make_pair(F, RSD));
+ };
+
+ if (M.getTargetTriple().getEnvironment() ==
+ Triple::EnvironmentType::RootSignature) {
+assert(RootSignatureNode->getNumOperands()
@@ -1472,5 +1473,38 @@ IdentifierInfo *ParseHLSLRootSignature(Sema &Actions,
return DeclIdent;
}
+void HandleRootSignatureTarget(Sema &S, StringRef EntryRootSig) {
+ ASTConsumer *Consumer = &S.getASTConsumer();
+
+ // Minimally initalize the parser. This does a couple thin
@@ -1296,6 +1296,9 @@ class InjectRootSignatureCallback : public PPCallbacks {
void HLSLFrontendAction::ExecuteAction() {
// Pre-requisites to invoke
+ if (getCurrentFileKind().getLanguage() != Language::HLSL)
+return WrapperFrontendAction::ExecuteAction();
@@ -276,10 +276,6 @@ void DXContainerWriter::writeParts(raw_ostream &OS) {
for (DXContainerYAML::RootParameterLocationYaml &L :
P.RootSignature->Parameters.Locations) {
-assert(dxbc::isValidParameterType(L.Header.Type) &&
- "invalid DXCon
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/154827
___
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/bogner edited
https://github.com/llvm/llvm-project/pull/154631
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -51,13 +51,13 @@ static std::optional extractMdStringValue(MDNode
*Node,
return NodeText->getString();
}
-static Expected
-extractShaderVisibility(MDNode *Node, unsigned int OpId) {
+template , int> = 0>
bogner wrote:
You can simplify this slightly by j
https://github.com/bogner approved this pull request.
Looks reasonable. One comment on tightening up the template constraint.
https://github.com/llvm/llvm-project/pull/154631
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https
@@ -1268,11 +1268,34 @@ bool SemaHLSL::handleRootSignatureElements(
// value
ReportError(Loc, 1, 0xfffe);
}
+ switch (Clause->Type) {
bogner wrote:
This would be simpler with a `toDescriptorRangeType()` helper (whether as a
stat
@@ -325,25 +325,19 @@ Error
MetadataParser::parseDescriptorRange(mcdxbc::DescriptorTable &Table,
if (RangeDescriptorNode->getNumOperands() != 6)
return make_error("Descriptor Range");
- dxbc::RTS0::v2::DescriptorRange Range;
+ mcdxbc::DescriptorRange Range;
std::
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/152254
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
bogner wrote:
> This should be testable with a unit test in
> llvm/unittests/Fronted/HLSLBindingTest.cpp rather than via an assert in
> DXILPostOptimizationValidation
Something like this should catch it I think:
```c++
TEST(HLSLBindingTest, TestNoOverlapWithDuplicates) {
hlsl::BindingInfoBu
bogner wrote:
This should be testable with a unit test in
llvm/unittests/Fronted/HLSLBindingTest.cpp rather than via an assert in
DXILPostOptimizationValidation
https://github.com/llvm/llvm-project/pull/152253
___
llvm-branch-commits mailing list
llv
https://github.com/bogner commented:
Should we wait for https://github.com/llvm/llvm-project/pull/147117 so that we
can put this logic in RootSignatureValidations? We'll presumably need to move
this logic later otherwise.
https://github.com/llvm/llvm-project/pull/146785
___
bogner wrote:
This isn't the right place for these tests - we can't test backend behaviours
from clang tests. We need `.ll` tests in `llvm/test/CodeGen/DirectX` instead.
https://github.com/llvm/llvm-project/pull/146785
_
https://github.com/bogner edited
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/listinfo/llvm-branch-commits
@@ -31,6 +31,7 @@
; CHECK-NEXT: DXIL Module Metadata analysis
; CHECK-NEXT: DXIL Shader Flag Analysis
; CHECK-NEXT: DXIL Translate Metadata
+; CHECK-NEXT: DXIL Root Signature Analysis
bogner wrote:
This shouldn't be running twice. As per
https://githu
https://github.com/bogner approved this pull request.
Some minor comments but this looks good once they're accounted for.
https://github.com/llvm/llvm-project/pull/145828
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://l
@@ -29,6 +29,9 @@ using namespace llvm::hlsl::rootsig;
namespace {
+static const llvm::dxbc::RootSignatureVersion DefVersion =
+llvm::dxbc::RootSignatureVersion::V1_1;
bogner wrote:
I don't think this global makes the tests clearer. Maybe throw in a `usi
@@ -605,13 +608,159 @@ TEST_F(ParseHLSLRootSignatureTest,
ValidTrailingCommaTest) {
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
SmallVector Elements;
- hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
+ hlsl::RootSignatureParser Parser(DefVersion, Elements, L
@@ -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/bogner 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/bogner edited
https://github.com/llvm/llvm-project/pull/139963
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -1157,3 +1157,49 @@ TEST(RootSignature, ParseDescriptorTable) {
ASSERT_EQ(Range.OffsetInDescriptorsFromTableStart, -1);
}
}
+
+TEST(RootSignature, ParseStaticSamplers) {
+ {
+uint8_t Buffer[] = {
+0x44, 0x58, 0x42, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
https://github.com/bogner approved this pull request.
LGTM other than one comment about consistently using the `ASSERT_*` vs
`EXPECT_*` macros in the tests.
https://github.com/llvm/llvm-project/pull/139963
___
llvm-branch-commits mailing list
llvm-bra
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140294
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -198,6 +199,61 @@ class MetadataBuilder {
SmallVector GeneratedMetadata;
};
+// RangeInfo holds the information to correctly construct a ResourceRange
+// and retains this information to be used for displaying a better diagnostic
+struct RangeInfo {
+ const static uint32
@@ -198,6 +199,61 @@ class MetadataBuilder {
SmallVector GeneratedMetadata;
};
+// RangeInfo holds the information to correctly construct a ResourceRange
+// and retains this information to be used for displaying a better diagnostic
+struct RangeInfo {
+ const static uint32
https://github.com/bogner approved this pull request.
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140645
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140642
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140306
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140305
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -104,10 +107,11 @@ KEYWORD(numDescriptors)
KEYWORD(offset)
// StaticSampler Keywords:
-KEYWORD(mipLODBias)
+KEYWORD(filter)
KEYWORD(addressU)
KEYWORD(addressV)
KEYWORD(addressW)
+KEYWORD(mipLODBias)
KEYWORD(maxAnisotropy)
KEYWORD(minLOD)
KEYWORD(maxLOD)
--
@@ -76,6 +76,45 @@ enum class ShaderVisibility {
Mesh = 7,
};
+enum class Filter {
+ MinMagMipPoint = 0,
+ MinMagPointMipLinear = 0x1,
+ MinPointMagLinearMipPoint = 0x4,
+ MinPointMagMipLinear = 0x5,
+ MinLinearMagMipPoint = 0x10,
+ MinLinearMagPointMipLinear = 0x11,
+
@@ -6,6 +6,8 @@
//
//===--===//
+#include
bogner wrote:
Is this used?
https://github.com/llvm/llvm-project/pull/140181
___
llvm-branch-commits m
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -711,6 +734,35 @@ std::optional
RootSignatureParser::parseRegister() {
return Reg;
}
+std::optional RootSignatureParser::parseFloatParam() {
+ assert(CurToken.TokKind == TokenKind::pu_equal &&
+ "Expects to only be invoked starting at given keyword");
+ // Cons
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
@@ -711,6 +734,35 @@ std::optional
RootSignatureParser::parseRegister() {
return Reg;
}
+std::optional RootSignatureParser::parseFloatParam() {
+ assert(CurToken.TokKind == TokenKind::pu_equal &&
+ "Expects to only be invoked starting at given keyword");
+ // Cons
@@ -821,22 +873,115 @@ std::optional
RootSignatureParser::handleUIntLiteral() {
PP.getSourceManager(), PP.getLangOpts(),
PP.getTargetInfo(), PP.getDiagnostics());
if (Literal.hadError)
-return tr
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/140180
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/141173
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -539,19 +537,27 @@ static void initializeBuffer(CodeGenModule &CGM,
llvm::GlobalVariable *GV,
}
static void initializeBufferFromBinding(CodeGenModule &CGM,
-llvm::GlobalVariable *GV, unsigned
Slot,
-
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/137690
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/114104
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/138043
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/138007
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -1842,5 +1842,6 @@ def err_hlsl_unexpected_end_of_params
def err_hlsl_rootsig_repeat_param : Error<"specified the same parameter '%0'
multiple times">;
def err_hlsl_rootsig_missing_param : Error<"did not specify mandatory
parameter '%0'">;
def err_hlsl_number_literal_overf
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/138055
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/138002
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -149,6 +149,29 @@ void DescriptorTableClause::dump(raw_ostream &OS) const {
OS << ")";
}
+// Helper struct so that we can use the overloaded notation of std::visit
+template struct OverloadMethods : Ts... {
+ using Ts::operator()...;
+};
+
+template OverloadMethods(Ts.
@@ -149,6 +149,29 @@ void DescriptorTableClause::dump(raw_ostream &OS) const {
OS << ")";
}
+// Helper struct so that we can use the overloaded notation of std::visit
+template struct OverloadMethods : Ts... {
+ using Ts::operator()...;
+};
+
+template OverloadMethods(Ts.
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/137877
>From 20a1723d5f4f9132e44ba7d76e11f94ca367e269 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Tue, 29 Apr 2025 11:59:37 -0700
Subject: [PATCH 1/2] [HLSL] Overloads for `lerp` with a scalar weight
This adds o
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/137877
>From 20a1723d5f4f9132e44ba7d76e11f94ca367e269 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Tue, 29 Apr 2025 11:59:37 -0700
Subject: [PATCH] [HLSL] Overloads for `lerp` with a scalar weight
This adds overl
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/137877
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/137038
___
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/bogner approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/135287
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/136751
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/130338
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/130342
___
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/130323
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -99,18 +96,6 @@ static NamedMDNode *emitResourceMetadata(Module &M,
DXILBindingMap &DBM,
Metadata *SmpMD = Smps.empty() ? nullptr : MDNode::get(Context, Smps);
bool HasResources = !DBM.empty();
- if (MDResources.hasUAVs()) {
-assert(!UAVMD && "Old and new UAV repr
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/128577
___
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/bogner updated
https://github.com/llvm/llvm-project/pull/128699
>From be9554eabde52e6feb37ad91935ee73aacdf00d6 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Sat, 22 Feb 2025 12:40:46 -0800
Subject: [PATCH 1/2] [DirectX] Support the CBufferLoadLegacy operation
Fixes #112
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/128699
Fixes #112992
>From be9554eabde52e6feb37ad91935ee73aacdf00d6 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Sat, 22 Feb 2025 12:40:46 -0800
Subject: [PATCH] [DirectX] Support the CBufferLoadLegacy operation
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/128698
Make sure we're able to print cbuffer comments in a way that's compatible with
DXC.
Fixes #128562
>From 155483b100e7e60d62b966dfd56747a2c64a94dd Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Sat, 22 Feb 2
@@ -7,19 +7,42 @@
//===--===//
#include "llvm/BinaryFormat/DXContainer.h"
-#include
-#include
+#include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/raw_ostream.h"
+#include
+#include
-
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/125807
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -162,5 +219,371 @@ std::optional
RootSignatureLexer::PeekNextToken() {
return Result;
}
+// Parser Definitions
+
+RootSignatureParser::RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer,
+
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -162,5 +219,371 @@ std::optional
RootSignatureLexer::PeekNextToken() {
return Result;
}
+// Parser Definitions
+
+RootSignatureParser::RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer,
+
@@ -162,5 +219,371 @@ std::optional
RootSignatureLexer::PeekNextToken() {
return Result;
}
+// Parser Definitions
+
+RootSignatureParser::RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer,
+
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -306,4 +307,254 @@ TEST_F(ParseHLSLRootSignatureTest,
InvalidLexRegNumberTest) {
ASSERT_FALSE(Consumer->IsSatisfied());
}
+// Valid Parser Tests
+
+TEST_F(ParseHLSLRootSignatureTest, ValidParseEmptyTest) {
+ const llvm::StringLiteral Source = R"cc()cc";
+
+ TrivialModu
@@ -1,8 +1,65 @@
#include "clang/Parse/ParseHLSLRootSignature.h"
+#include "llvm/Support/raw_ostream.h"
+
+using namespace llvm::hlsl::rootsig;
+
namespace clang {
namespace hlsl {
+// Helper definitions
bogner wrote:
This comment isn't very helpful.
http
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -93,6 +96,108 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ RootSignatureLexer &Lexer, DiagnosticsEngine &Diags);
+
+ /// Iterates over the provided tokens and constructs the
@@ -5743,6 +5747,17 @@ HLSLBufferDecl
*HLSLBufferDecl::CreateDeserialized(ASTContext &C,
SourceLocation(), SourceLocation());
}
+const CXXRecordDecl *HLSLBufferDecl::getLayoutStruct() const {
+ // Layout struct is the last decl in the HLSL
@@ -0,0 +1,157 @@
+//===- DXILRootSignature.cpp - DXIL Root 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
@@ -15,16 +15,21 @@
#include "clang/AST/APValue.h"
#include "clang/Basic/DiagnosticLex.h"
+#include "clang/Basic/DiagnosticParse.h"
#include "clang/Lex/LiteralSupport.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
@@ -148,6 +148,347 @@ bool RootSignatureLexer::LexToken(RootSignatureToken
&Result) {
return false;
}
+// Parser Definitions
+
+RootSignatureParser::RootSignatureParser(
+SmallVector &Elements,
+const SmallVector &Tokens)
+: Elements(Elements) {
+ CurTok = Toke
@@ -80,6 +85,99 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ const SmallVector &Tokens,
+ DiagnosticsEngine &Diags);
+
+ // Iterates over the provided token
@@ -80,6 +85,99 @@ class RootSignatureLexer {
}
};
+class RootSignatureParser {
+public:
+ RootSignatureParser(SmallVector &Elements,
+ const SmallVector &Tokens,
+ DiagnosticsEngine &Diags);
+
+ // Iterates over the provided token
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/121725
This adds handling for raw and structured buffers when lowering resource access
via `llvm.dx.resource.getpointer`.
Fixes #121714
>From 192d20b16e418b89a549e93406f782ac0a0fa093 Mon Sep 17 00:00:00 2001
From: Jus
bogner wrote:
> ⚠️ undef deprecator found issues in your code. ⚠️
>
> You can test this locally with the following command:
> The following files introduce new uses of undef:
>
> * llvm/lib/Target/DirectX/DXILOpLowering.cpp
> * llvm/test/CodeGen/DirectX/BufferStore-sm61.ll
> * llvm/test/CodeGe
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/121282
This introduces `@llvm.dx.resource.store.rawbuffer` and generalizes the buffer
store docs under DirectX/DXILResources.
Fixes #106188
>From c49bc4714589cf548a6382ea5a99f31626d3d6a2 Mon Sep 17 00:00:00 2001
From:
https://github.com/bogner updated
https://github.com/llvm/llvm-project/pull/121012
>From 53bba63c6a55464ac1872dc60f39510eff426d64 Mon Sep 17 00:00:00 2001
From: Justin Bogner
Date: Thu, 19 Dec 2024 16:33:48 -0700
Subject: [PATCH 1/2] [DirectX] Implement the resource.load.rawbuffer intrinsic
Th
@@ -542,6 +542,48 @@ class OpLowerer {
});
}
+ [[nodiscard]] bool lowerRawBufferLoad(Function &F) {
+Triple TT(Triple(M.getTargetTriple()));
+VersionTuple DXILVersion = TT.getDXILVersion();
+const DataLayout &DL = F.getDataLayout();
+IRBuilder<> &IRB = O
https://github.com/bogner created
https://github.com/llvm/llvm-project/pull/121012
This introduces `@llvm.dx.resource.load.rawbuffer` and generalizes the buffer
load docs under DirectX/DXILResources.
This resolves the "load" parts of #106188
>From 53bba63c6a55464ac1872dc60f39510eff426d64 Mon
bogner wrote:
oops, forgot to update the destination branch - identical PR here: #120477
https://github.com/llvm/llvm-project/pull/120280
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/lis
https://github.com/bogner closed
https://github.com/llvm/llvm-project/pull/120280
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -303,44 +289,157 @@ class ResourceInfo {
dxil::SamplerFeedbackType getFeedbackType() const;
uint32_t getMultiSampleCount() const;
- StringRef getName() const {
-// TODO: Get the name from the symbol once we include one here.
-return "";
- }
dxil::ResourceCl
@@ -303,44 +289,157 @@ class ResourceInfo {
dxil::SamplerFeedbackType getFeedbackType() const;
uint32_t getMultiSampleCount() const;
- StringRef getName() const {
-// TODO: Get the name from the symbol once we include one here.
-return "";
- }
dxil::ResourceCl
1 - 100 of 298 matches
Mail list logo