[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer", we use a substitute UDT +// to test the 't' binding type for this test. + +template +struct [[hlsl::resource_class(SRV)]] Buffer { +

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer" +struct Eg1 { + float f; + // Buffer Buf; + RWBuffer RWBuf; + }; +Eg1 e1 : /* register(t0) :*/ register(u0); +// Valid: f is skip

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer", we use a substitute UDT +// to test the 't' binding type for this test. + +template +struct [[hlsl::resource_class(SRV)]] Buffer { +

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -492,14 +999,21 @@ void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { // Validate. if (!Slot.empty()) { switch (Slot[0]) { damyanp wrote: Can `getRegisterTypeIndex` be reused here? Seems like there's more than one table of

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-14 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] [HLSL] update default validator version to 1.8. (PR #104040)

2024-08-15 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/104040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] update default validator version to 1.8. (PR #104040)

2024-08-15 Thread Damyan Pepper via cfe-commits
damyanp wrote: How does this relate to #102963? https://github.com/llvm/llvm-project/pull/104040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] update default validator version to 1.8. (PR #104040)

2024-08-15 Thread Damyan Pepper via cfe-commits
damyanp wrote: > > How does this relate to #102963? > > It will make default 1.8 so default case will work. But we still need to have > a plan for what to do with -validator-version. Chatting with @bharadwajy, it sounds like this PR should also fix #102963. https://github.com/llvm/llvm-projec

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] [HLSL] Flesh out basic type typedefs (PR #104479)

2024-08-15 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/104479 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Damyan Pepper via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-15 Thread Damyan Pepper via cfe-commits
damyanp wrote: D3D at least tends to view "buffer" as another type of resource dimension. Wonder if this should be included, rather than having to assume that omission of the attribute means it must be a buffer. https://github.com/llvm/llvm-project/pull/104239

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer", we use a substitute UDT +// to test the 't' binding type for this test. + +template +struct [[hlsl::resource_class(SRV)]] Buffer { --

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-16 Thread Damyan Pepper via cfe-commits
@@ -551,24 +541,21 @@ getHLSLResourceAttrFromEitherDecl(VarDecl *VD, // the resource attr could be on the record decl itself or on one of // its fields (the resource handle, most commonly) -const auto *Attr = TheRecordDecl->getAttr(); +const auto *Attr = TheRec

[clang] [Doc][HLSL] Add documentation for root signature. (PR #83933)

2024-04-05 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,562 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bo

[clang] [Doc][HLSL] Add documentation for root signature. (PR #83933)

2024-04-05 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,562 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bo

[clang] [Doc][HLSL] Add documentation for root signature. (PR #83933)

2024-04-05 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. There are some open comments that don't seem like they've been resolved yet (along with a couple of typos I've pointed out). With 85 comments this PR is become quite hard to follow. I wonder if we're at a point now where it's either good

[clang] [HLSL] Change default linkage of HLSL functions and `groupshared` variables (PR #93336)

2024-06-12 Thread Damyan Pepper via cfe-commits
@@ -108,3 +108,16 @@ behavior between Clang and DXC. Some examples include: diagnostic notifying the user of the conversion rather than silently altering precision relative to the other overloads (as FXC does) or generating code that will fail validation (as DXC does). +

[clang] [HLSL] Change default linkage of HLSL functions and `groupshared` variables (PR #93336)

2024-06-17 Thread Damyan Pepper via cfe-commits
@@ -108,3 +108,16 @@ behavior between Clang and DXC. Some examples include: diagnostic notifying the user of the conversion rather than silently altering precision relative to the other overloads (as FXC does) or generating code that will fail validation (as DXC does). +

[clang] [HLSL] Change default linkage of HLSL functions and `groupshared` variables (PR #93336)

2024-06-17 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/93336 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/93860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
@@ -536,9 +536,34 @@ DiagnoseHLSLAvailability::FindAvailabilityAttr(const Decl *D) { void DiagnoseHLSLAvailability::CheckDeclAvailability(NamedDecl *D, const AvailabilityAttr *AA,

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
@@ -157,6 +157,18 @@ static bool ShouldDiagnoseAvailabilityInContext( } } + // In HLSL, emit diagnostic during parsing only if the diagnostic + // mode is set to strict (-fhlsl-strict-availability), and either the decl + // availability is not restricted to a specific

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
@@ -210,13 +222,16 @@ static bool ShouldDiagnoseAvailabilityInContext( return true; } -static bool -shouldDiagnoseAvailabilityByDefault(const ASTContext &Context, -const VersionTuple &DeploymentVersion, -

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/93860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
@@ -157,6 +157,18 @@ static bool ShouldDiagnoseAvailabilityInContext( } } + // In HLSL, emit diagnostic during parsing only if the diagnostic + // mode is set to strict (-fhlsl-strict-availability), and either the decl + // availability is not restricted to a specific

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
@@ -157,10 +157,12 @@ static bool ShouldDiagnoseAvailabilityInContext( } } - // In HLSL, emit diagnostic during parsing only if the diagnostic - // mode is set to strict (-fhlsl-strict-availability), and either the decl - // availability is not restricted to a specifi

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
@@ -536,9 +536,34 @@ DiagnoseHLSLAvailability::FindAvailabilityAttr(const Decl *D) { void DiagnoseHLSLAvailability::CheckDeclAvailability(NamedDecl *D, const AvailabilityAttr *AA,

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
@@ -157,6 +157,18 @@ static bool ShouldDiagnoseAvailabilityInContext( } } + // In HLSL, emit diagnostic during parsing only if the diagnostic + // mode is set to strict (-fhlsl-strict-availability), and either the decl + // availability is not restricted to a specific

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-17 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/93860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Strict Availability Diagnostics (PR #93860)

2024-06-18 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/93860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Move ResourceClass enum into DXILABI. NFC (PR #96335)

2024-06-21 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/96335 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

2024-06-21 Thread Damyan Pepper via cfe-commits
@@ -2646,6 +2646,9 @@ bool Parser::ParseCXXMemberDeclaratorBeforeInitializer( else DeclaratorInfo.SetIdentifier(nullptr, Tok.getLocation()); + if (getLangOpts().HLSL) damyanp wrote: It may be worth cleaning this up: I notice that there are two overload

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

2024-06-21 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s -verify + +// previously, this test would result in an error shown below on the line that +// declares variable a in struct Eg9: +// error: use of undeclared identifier +// 'SV_Dispat

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-28 Thread Damyan Pepper via cfe-commits
@@ -345,25 +347,26 @@ class DiagnoseHLSLAvailability // Helper methods for dealing with current stage context / environment void SetShaderStageContext(HLSLShaderAttr::ShaderType ShaderType) { +static_assert(HLSLShaderAttr::ShaderTypeMaxValue < 31, + "S

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-29 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/92704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-29 Thread Damyan Pepper via cfe-commits
@@ -350,7 +350,7 @@ class DiagnoseHLSLAvailability static_assert(HLSLShaderAttr::ShaderTypeMaxValue < 31, "ShaderType is too big for this bitmap"); assertunsigned)1) << (unsigned)ShaderType) != 0 && damyanp wrote: I wonder at this

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-29 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/92704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Use llvm::Triple::EnvironmentType instead of HLSLShaderAttr::ShaderType (PR #93847)

2024-05-30 Thread Damyan Pepper via cfe-commits
@@ -4469,36 +4469,20 @@ def HLSLShader : InheritableAttr { let Subjects = SubjectList<[HLSLEntry]>; let LangOpts = [HLSL]; let Args = [ -EnumArgument<"Type", "ShaderType", /*is_string=*/true, +EnumArgument<"Type", "llvm::Triple::EnvironmentType", /*is_string=*/tru

[clang] [HLSL] Use llvm::Triple::EnvironmentType instead of HLSLShaderAttr::ShaderType (PR #93847)

2024-05-30 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/93847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-04-15 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-04-15 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-04-15 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-04-15 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-04-15 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-04-15 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-04-15 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,291 @@ + +HLSL Root Signatures + + +.. contents:: + :local: + +Usage += + +In HLSL, the `root signature +`_ +defines what types of resources are bou

[clang] [Doc][HLSL] Add documentation for root signature (PR #88781)

2024-04-15 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp requested changes to this pull request. See other comments. https://github.com/llvm/llvm-project/pull/88781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Initialize DiagnoseHLSLAvailability members (PR #100778)

2024-07-26 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/100778 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -finclude-default-header -verify -Wdouble-promotion -Wconversion %s + +void OutVecFn(out float3) {} +void InOutVecFn(inout float3) {} + +// Case 1: Calling out and inout parameters with types that cannot

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-30 Thread Damyan Pepper via cfe-commits
@@ -4689,6 +4719,32 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, assert(type->isReferenceType() == E->isGLValue() && "reference binding to unmaterialized r-value!"); + // Add writeback for HLSLOutParamExpr. + if (const HLSLOutArgExpr *OE

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-30 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/101083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -finclude-default-header -verify -Wdouble-promotion -Wconversion %s + +void OutVecFn(out float3) {} +void InOutVecFn(inout float3) {} + +// Case 1: Calling out and inout parameters with types that cannot

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-30 Thread Damyan Pepper via cfe-commits
@@ -4613,14 +4613,13 @@ def HLSLGroupSharedAddressSpace : TypeAttr { let Documentation = [HLSLGroupSharedAddressSpaceDocs]; } -def HLSLParamModifier : TypeAttr { +def HLSLParamModifier : ParameterABIAttr { damyanp wrote: as an aside: what's the plan for / s

[clang] [HLSL] Implement output parameter (PR #101083)

2024-07-30 Thread Damyan Pepper via cfe-commits
@@ -5318,3 +5319,13 @@ OMPIteratorExpr *OMPIteratorExpr::CreateEmpty(const ASTContext &Context, alignof(OMPIteratorExpr)); return new (Mem) OMPIteratorExpr(EmptyShell(), NumIterators); } + +HLSLOutArgExpr *HLSLOutArgExpr::Create(const ASTContext &C, QualType Ty, +

[clang] [HLSL] Correctly set `__HLSL_ENABLE_16_BIT` (PR #89788)

2024-04-23 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/89788 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Set DXIL Version using shader model version in compilation target profile (PR #89823)

2024-04-23 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/89823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-04-26 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,229 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type -finclude-default-header -Wconversion -verify -o - %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type -finclude-default-header -ast-dump %s | FileCheck %

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-04-26 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/90222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-04-26 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/89836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-04-26 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/89836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-04-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,799 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the Di

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-04-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,799 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the Di

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-04-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,799 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the Di

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-04-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,799 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the Di

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-04-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,799 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the Di

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-04-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,799 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the Di

[clang] [llvm] [DirectX] Start documenting DXIL Resource handling (PR #90553)

2024-04-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,799 @@ +== +DXIL Resource Handling +== + +.. contents:: + :local: + +.. toctree:: + :hidden: + +Introduction + + +Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and +eventually lowered by the Di

[clang] [HLSL][Doc] Document multi-argument resolution (PR #104474)

2024-08-28 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/104474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-28 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer" +struct Eg1 { + float f; + // Buffer Buf; + RWBuffer RWBuf; + }; +Eg1 e1 : /* register(t0) :*/ register(u0); +// Valid: f is skip

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-28 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/97103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add StructuredBuffer to external sema source (PR #106316)

2024-08-29 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. I had a bunch of questions about the tests, but I see that what's happening here is that the same tests for RWBuffer are being adapter for StructuredBuffer. I don't know how much everything differs between the two...I'm wondering if there'

[clang] [HLSL] Adjust resource binding diagnostic flags code (PR #106657)

2024-08-30 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/106657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Adjust resource binding diagnostic flags code (PR #106657)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -480,6 +480,9 @@ struct RegisterBindingFlags { bool ContainsNumeric = false; bool DefaultGlobals = false; + + // used only when Resource == true + llvm::dxil::ResourceClass ResourceClass = llvm::dxil::ResourceClass::UAV; damyanp wrote: What is this w

[clang] [HLSL] Adjust resource binding diagnostic flags code (PR #106657)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -480,6 +480,9 @@ struct RegisterBindingFlags { bool ContainsNumeric = false; bool DefaultGlobals = false; + + // used only when Resource == true + llvm::dxil::ResourceClass ResourceClass = llvm::dxil::ResourceClass::UAV; damyanp wrote: Along with thi

[clang] [HLSL] Adjust resource binding diagnostic flags code (PR #106657)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -612,57 +588,61 @@ static RegisterBindingFlags HLSLFillRegisterBindingFlags(Sema &S, return Flags; } - if (!isDeclaredWithinCOrTBuffer(TheDecl)) { -// make sure the type is a basic / numeric type -if (TheVarDecl) { - QualType TheQualTy = TheVarDecl->get

[clang] [HLSL] Adjust resource binding diagnostic flags code (PR #106657)

2024-08-30 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/106657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-08-30 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/104844 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -673,9 +673,6 @@ float dot(float3, float3); _HLSL_BUILTIN_ALIAS(__builtin_hlsl_dot) float dot(float4, float4); -_HLSL_BUILTIN_ALIAS(__builtin_hlsl_dot) -double dot(double, double); - damyanp wrote: Surprised to see this here based on the description. Wonde

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -143,19 +143,3 @@ float test_dot_float3(float3 p0, float3 p1) { return dot(p0, p1); } // CHECK: %dx.dot = call float @llvm.dx.dot4.v4f32(<4 x float> %0, <4 x float> %1) // CHECK: ret float %dx.dot float test_dot_float4(float4 p0, float4 p1) { return dot(p0, p1); } - -// CH

[clang] [HLSL] Implement TransformHLSLAttributedResourceType (PR #106673)

2024-08-30 Thread Damyan Pepper via cfe-commits
damyanp wrote: > > Tests? > > There are no tests yet because the code that creates > HLSLAttributedResourceType is not in yet. Without the tests you're kind of asking the code reviewers to test your code in their heads Is there some other way to slice this so that there's a smaller part

[clang] [llvm] Add step builtins and step HLSL function to DirectX and SPIR-V backend (PR #106471)

2024-08-30 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/106471 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -817,8 +821,12 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc, S.Diag(TheDecl->getLocation(), diag::warn_hlsl_user_defined_type_missing_member) << regTypeNum; - -return; +// non-zero SpaceNum cannot be speci

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + + +// expected-error@+1 {{invalid space specifier 's2' used; expected 'space' followed by an integer, like space1}} +cbuffer a : register(b0, s2) { + +} + +// expe

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp requested changes to this pull request. https://github.com/llvm/llvm-project/pull/106782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + + +// expected-error@+1 {{invalid space specifier 's2' used; expected 'space' followed by an integer, like space1}} +cbuffer a : register(b0, s2) { + +} + +// expe

[clang] Fix implicit conversion rank ordering (PR #106811)

2024-08-30 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. https://github.com/llvm/llvm-project/pull/106811 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp requested changes to this pull request. https://github.com/llvm/llvm-project/pull/106782 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

2024-08-30 Thread Damyan Pepper via cfe-commits
@@ -795,6 +796,9 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc, S.Diag(ArgLoc, diag::warn_hlsl_deprecated_register_type_b); else if (regType != RegisterType::C) S.Diag(ArgLoc, diag::err_hlsl_binding_type_mismatch) << regType

<    1   2   3   4   5   6   >