-
Notifications
You must be signed in to change notification settings - Fork 14.2k
[HLSL][RootSignature] Add hlsl-rootsig-ver
option to specify root signature version
#144813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
fde2b30
8c2fd96
9408f86
a307907
4ef6b3a
3e795b2
0159366
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5179,6 +5179,8 @@ class HLSLRootSignatureDecl final | |
llvm::hlsl::rootsig::RootElement> { | ||
friend TrailingObjects; | ||
|
||
llvm::dxil::RootSignatureVersion RootSigVer; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a member of a HLSLRootSignatureDecl - it can probably just be called Version. |
||
|
||
unsigned NumElems; | ||
|
||
llvm::hlsl::rootsig::RootElement *getElems() { return getTrailingObjects(); } | ||
|
@@ -5188,16 +5190,20 @@ class HLSLRootSignatureDecl final | |
} | ||
|
||
HLSLRootSignatureDecl(DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID, | ||
llvm::dxil::RootSignatureVersion RootSigVer, | ||
unsigned NumElems); | ||
|
||
public: | ||
static HLSLRootSignatureDecl * | ||
Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, IdentifierInfo *ID, | ||
llvm::dxil::RootSignatureVersion RootSigVer, | ||
ArrayRef<llvm::hlsl::rootsig::RootElement> RootElements); | ||
|
||
static HLSLRootSignatureDecl *CreateDeserialized(ASTContext &C, | ||
GlobalDeclID ID); | ||
|
||
llvm::dxil::RootSignatureVersion getVersion() const { return RootSigVer; } | ||
|
||
ArrayRef<llvm::hlsl::rootsig::RootElement> getRootElements() const { | ||
return {getElems(), NumElems}; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// RUN: %clang_dxc -T cs_6_0 -fcgl %s | FileCheck %s --check-prefix=CHECK-V1_1 | ||
// RUN: %clang_dxc -T cs_6_0 -fcgl -hlsl-rootsig-ver rootsig_1_0 %s | FileCheck %s --check-prefix=CHECK-V1_0 | ||
// RUN: %clang_dxc -T cs_6_0 -fcgl -hlsl-rootsig-ver rootsig_1_1 %s | FileCheck %s --check-prefix=CHECK-V1_1 | ||
|
||
// Test to demonstrate that we can specify the root-signature versions | ||
|
||
// CHECK: !dx.rootsignatures = !{![[#EMPTY_ENTRY:]]} | ||
// CHECK: ![[#EMPTY_ENTRY]] = !{ptr @EmptyEntry, ![[#EMPTY:]], | ||
// CHECK-V1_0: i32 1} | ||
// CHECK-V1_1: i32 2} | ||
// CHECK: ![[#EMPTY]] = !{} | ||
|
||
[shader("compute"), RootSignature("")] | ||
[numthreads(1,1,1)] | ||
void EmptyEntry() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,12 @@ enum class SamplerFeedbackType : uint32_t { | |
const unsigned MinWaveSize = 4; | ||
const unsigned MaxWaveSize = 128; | ||
|
||
// D3D_ROOT_SIGNATURE_VERSION | ||
enum class RootSignatureVersion { | ||
rootsig_1_0 = 0x1, | ||
rootsig_1_1 = 0x2, | ||
}; | ||
Comment on lines
+102
to
+106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be defined in BinaryFormat/DXContainer.h with the other d3d12 constants? They don't seem like they belong in DXILABI to me. Also the naming here feels a bit awkward - we're kind of repeating ourselves with |
||
|
||
} // namespace dxil | ||
} // namespace llvm | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going through the commits 1 by 1 should be easier to read then from top to bottom of this diff.