https://github.com/bob80905 closed
https://github.com/llvm/llvm-project/pull/98419
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/98419
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/damyanp approved this pull request.
https://github.com/llvm/llvm-project/pull/98419
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/98419
>From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Wed, 10 Jul 2024 17:10:26 -0700
Subject: [PATCH 1/8] split out resource class data from resource attr, add
some
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -o - %s -verify
+
+// expected-error@+1{{'resource_class' attribute takes one argument}}
+struct [[hlsl::resource_class()]] Eg1 {
+ int i;
+};
+
+Eg1 e1;
+
+// expected-error@+1{{invalid resource class
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -o - %s -verify
+
+// expected-error@+1{{'resource_class' attribute takes one argument}}
+struct [[hlsl::resource_class()]] Eg1 {
+ int i;
+};
+
+Eg1 e1;
+
+// expected-error@+1{{invalid resource class
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -o - %s -verify
+
+// expected-error@+1{{'resource_class' attribute takes one argument}}
+struct [[hlsl::resource_class()]] Eg1 {
+ int i;
+};
+
+Eg1 e1;
+
+// expected-error@+1{{invalid resource class
@@ -437,6 +437,33 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) {
+ if (!AL.isArgIdent(0)) {
+Diag(AL.getLoc(), diag::err_attribute_argument_type)
+
@@ -115,12 +115,19 @@ struct BuiltinTypeDeclBuilder {
return addMemberVariable("h", Ty, Access);
}
- BuiltinTypeDeclBuilder &annotateResourceClass(ResourceClass RC,
-ResourceKind RK, bool IsROV) {
+ BuiltinTypeDeclBuilder
@@ -437,6 +437,33 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) {
+ if (!AL.isArgIdent(0)) {
+Diag(AL.getLoc(), diag::err_attribute_argument_type)
+
@@ -437,6 +437,33 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) {
+ if (!AL.isArgIdent(0)) {
+Diag(AL.getLoc(), diag::err_attribute_argument_type)
+
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o
- %s | FileCheck %s
+
+
+// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} <> SRV
+struct [[hlsl::resource_class(SRV)]] Eg1 {
bogner wrote:
Ah, I hadn't noticed the "
@@ -7,7 +7,7 @@ struct [[hlsl::resource_class()]] Eg1 {
Eg1 e1;
-// expected-error@+1{{invalid resource class 'gibberish' used; expected 'SRV',
'UAV', 'CBuffer', or 'Sampler'}}
+// expected-warning@+1{{ResourceClass attribute argument not supported:
gibberish}}
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/98419
>From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Wed, 10 Jul 2024 17:10:26 -0700
Subject: [PATCH 1/6] split out resource class data from resource attr, add
some
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -o - %s -verify
+
+// expected-error@+1{{'resource_class' attribute takes one argument}}
+struct [[hlsl::resource_class()]] Eg1 {
+ int i;
+};
+
+Eg1 e1;
+
+// expected-error@+1{{invalid resource class
@@ -12313,6 +12313,7 @@ def err_hlsl_missing_semantic_annotation : Error<
def err_hlsl_init_priority_unsupported : Error<
"initializer priorities are not supported in HLSL">;
+def err_hlsl_unsupported_resource_class : Error<"invalid resource class '%0'
used; expected 'SRV',
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/98419
>From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Wed, 10 Jul 2024 17:10:26 -0700
Subject: [PATCH 1/5] split out resource class data from resource attr, add
some
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o
- %s | FileCheck %s
+
+
+// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} <> SRV
+struct [[hlsl::resource_class(SRV)]] Eg1 {
+ int i;
+};
+
+Eg1 e1;
+
+// CHECK: -CXXRecordDecl 0x{
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/98419
>From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Wed, 10 Jul 2024 17:10:26 -0700
Subject: [PATCH 1/4] split out resource class data from resource attr, add
some
https://github.com/bob80905 edited
https://github.com/llvm/llvm-project/pull/98419
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o
- %s | FileCheck %s
+
+
+// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} <> SRV
+struct [[hlsl::resource_class(SRV)]] Eg1 {
bogner wrote:
For the purpose of these t
@@ -437,6 +437,49 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+llvm::dxil::ResourceClass
+getResourceClassFromStr(StringRef ResourceClassTypeStrRef) {
+ if (ResourceClassTypeStrRef == "SRV")
+return llvm::dxil::ResourceC
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -o - %s -verify
+
+// expected-error@+1{{'resource_class' attribute takes one argument}}
+struct [[hlsl::resource_class()]] Eg1 {
+ int i;
+};
+
+Eg1 e1;
+
+// expected-error@+1{{invalid resource class
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o
- %s | FileCheck %s
+
+
+// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} <> SRV
+struct [[hlsl::resource_class(SRV)]] Eg1 {
+ int i;
+};
+
+Eg1 e1;
+
+// CHECK: -CXXRecordDecl 0x{
@@ -437,6 +437,49 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+llvm::dxil::ResourceClass
+getResourceClassFromStr(StringRef ResourceClassTypeStrRef) {
+ if (ResourceClassTypeStrRef == "SRV")
+return llvm::dxil::ResourceC
@@ -437,6 +437,49 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+llvm::dxil::ResourceClass
+getResourceClassFromStr(StringRef ResourceClassTypeStrRef) {
+ if (ResourceClassTypeStrRef == "SRV")
+return llvm::dxil::ResourceC
@@ -280,13 +280,15 @@ void CGHLSLRuntime::annotateHLSLResource(const VarDecl
*D, GlobalVariable *GV) {
const auto *RD = Ty->getAsCXXRecordDecl();
if (!RD)
return;
- const auto *Attr = RD->getAttr();
- if (!Attr)
+ const auto *HLSLResAttr = RD->getAttr();
+ const au
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o
- %s | FileCheck %s
+
+
+// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} <> SRV
+struct [[hlsl::resource_class(SRV)]] Eg1 {
damyanp wrote:
I thought that the idea w
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/98419
>From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Wed, 10 Jul 2024 17:10:26 -0700
Subject: [PATCH 1/3] split out resource class data from resource attr, add
some
https://github.com/bob80905 updated
https://github.com/llvm/llvm-project/pull/98419
>From b740aa9da3baf4fbd32b5a2c59d70bf2f224f700 Mon Sep 17 00:00:00 2001
From: Joshua Batista
Date: Wed, 10 Jul 2024 17:10:26 -0700
Subject: [PATCH 1/2] split out resource class data from resource attr, add
some
https://github.com/bob80905 edited
https://github.com/llvm/llvm-project/pull/98419
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-hlsl
Author: Joshua Batista (bob80905)
Changes
The ability to spell out and specify the resource class is necessary for
testing various resource behaviors. Though it is not intended for users to use
this in customized HLSL source code, the ability to s
https://github.com/bob80905 created
https://github.com/llvm/llvm-project/pull/98419
The ability to spell out and specify the resource class is necessary for
testing various resource behaviors. Though it is not intended for users to use
this in customized HLSL source code, the ability to specif
33 matches
Mail list logo