[llvm-branch-commits] [llvm] [NFC] Refactoring DXContainerYaml Root Parameter representation (PR #138318)

2025-05-02 Thread Damyan Pepper via llvm-branch-commits
@@ -278,33 +280,35 @@ void DXContainerWriter::writeParts(raw_ostream &OS) { auto Header = dxbc::RootParameterHeader{Param.Type, Param.Visibility, Param.Offset}; -switch (Param.Type) { -case llvm::to_underl

[llvm-branch-commits] [llvm] [NFC] Refactoring DXContainerYaml Root Parameter representation (PR #138318)

2025-05-02 Thread Damyan Pepper via llvm-branch-commits
@@ -278,33 +280,35 @@ void DXContainerWriter::writeParts(raw_ostream &OS) { auto Header = dxbc::RootParameterHeader{Param.Type, Param.Visibility, Param.Offset}; -switch (Param.Type) { -case llvm::to_underl

[llvm-branch-commits] [llvm] [NFC] Refactoring DXContainerYaml Root Parameter representation (PR #138318)

2025-05-02 Thread Damyan Pepper via llvm-branch-commits
@@ -37,17 +37,6 @@ Parts: ShaderRegister: 31 RegisterSpace: 32 DATA_STATIC_WHILE_SET_AT_EXECUTE: true - - ParameterType: 0 # SRV damyanp wrote: Why is this removed? Is this somehow a result of switching to use std::variant?

[llvm-branch-commits] [clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-23 Thread Damyan Pepper via llvm-branch-commits
damyanp wrote: Is this ready to retarget to main? https://github.com/llvm/llvm-project/pull/136747 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-10 Thread Damyan Pepper via llvm-branch-commits
@@ -1529,72 +1529,80 @@ void SemaHLSL::handleResourceBindingAttr(Decl *TheDecl, const ParsedAttr &AL) { diag::err_incomplete_type)) return; } - StringRef Space = "space0"; + StringRef Slot = ""; + StringRef Space = ""; + Source

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-10 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp edited 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

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-10 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp commented: LGTM, wondering about negative slots though. 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] [clang] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-02-27 Thread Damyan Pepper via llvm-branch-commits
@@ -179,21 +179,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) { return cast(QT.getTypePtr()); } +// Iterates over all declarations in the HLSL buffer and based on the +// packoffset or register(c#) annotations it fills outs the Layout +// vector with the user-s

[llvm-branch-commits] [clang] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-02-26 Thread Damyan Pepper via llvm-branch-commits
@@ -179,21 +179,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) { return cast(QT.getTypePtr()); } +// Iterates over all declarations in the HLSL buffer and based on the +// packoffset or register(c#) annotations it fills outs the Layout +// vector with the user-s

[llvm-branch-commits] [clang] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-02-26 Thread Damyan Pepper via llvm-branch-commits
@@ -179,21 +179,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) { return cast(QT.getTypePtr()); } +// Iterates over all declarations in the HLSL buffer and based on the +// packoffset or register(c#) annotations it fills outs the Layout +// vector with the user-s

[llvm-branch-commits] [clang] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-02-26 Thread Damyan Pepper via llvm-branch-commits
@@ -179,21 +179,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) { return cast(QT.getTypePtr()); } +// Iterates over all declarations in the HLSL buffer and based on the +// packoffset or register(c#) annotations it fills outs the Layout +// vector with the user-s

[llvm-branch-commits] [clang] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-02-26 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp commented: LGTM. A typo and a nag about a naked constant value. https://github.com/llvm/llvm-project/pull/128991 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[llvm-branch-commits] [clang] [HLSL] Implement explicit layout for default constant buffer ($Globals) (PR #128991)

2025-02-26 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/128991 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-25 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp 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

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-25 Thread Damyan Pepper via llvm-branch-commits
@@ -134,12 +134,12 @@ TEST(RootSignature, ParseRootFlags) { )")); uint8_t Buffer[] = { - 0x44, 0x58, 0x42, 0x43, 0x32, 0x9A, 0x53, 0xD8, 0xEC, 0xBE, 0x35, 0x6F, - 0x05, 0x39, 0xE1, 0xFE, 0x31, 0x20, 0xF0, 0xC1, 0x01, 0x00, 0x00, 0x00, + 0x44, 0x58, 0x42, 0

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-25 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp requested changes to this pull request. A few nits, and I want to make sure that existing clients of this binary format can cope with a value of 0 for StaticSamplersOffset. https://github.com/llvm/llvm-project/pull/128577 __

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-25 Thread Damyan Pepper via llvm-branch-commits
@@ -12,44 +12,59 @@ using namespace llvm; using namespace llvm::mcdxbc; +void setRewrite(raw_ostream &Stream, uint32_t &Offset) { + const uint32_t DummyValue = std::numeric_limits::max(); + Offset = Stream.tell(); + support::endian::write(Stream, DummyValue, llvm::endiannes

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-25 Thread Damyan Pepper via llvm-branch-commits
@@ -12,44 +12,59 @@ using namespace llvm; using namespace llvm::mcdxbc; +void setRewrite(raw_ostream &Stream, uint32_t &Offset) { + const uint32_t DummyValue = std::numeric_limits::max(); + Offset = Stream.tell(); + support::endian::write(Stream, DummyValue, llvm::endiannes

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-25 Thread Damyan Pepper via llvm-branch-commits
@@ -12,44 +12,59 @@ using namespace llvm; using namespace llvm::mcdxbc; +void setRewrite(raw_ostream &Stream, uint32_t &Offset) { + const uint32_t DummyValue = std::numeric_limits::max(); + Offset = Stream.tell(); + support::endian::write(Stream, DummyValue, llvm::endiannes

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-25 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp edited 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

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-25 Thread Damyan Pepper via llvm-branch-commits
@@ -12,44 +12,59 @@ using namespace llvm; using namespace llvm::mcdxbc; +void setRewrite(raw_ostream &Stream, uint32_t &Offset) { + const uint32_t DummyValue = std::numeric_limits::max(); + Offset = Stream.tell(); + support::endian::write(Stream, DummyValue, llvm::endiannes

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-25 Thread Damyan Pepper via llvm-branch-commits
@@ -12,44 +12,59 @@ using namespace llvm; using namespace llvm::mcdxbc; +void setRewrite(raw_ostream &Stream, uint32_t &Offset) { damyanp wrote: I think these two functions are only used from within this cpp. Should either be marked as static, or in an anon

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-24 Thread Damyan Pepper via llvm-branch-commits
@@ -7,53 +7,109 @@ //===--===// #include "llvm/MC/DXContainerRootSignature.h" -#include "llvm/Support/EndianStream.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Twine.h" +#include "llvm/Support/Bi

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-24 Thread Damyan Pepper via llvm-branch-commits
@@ -7,53 +7,109 @@ //===--===// #include "llvm/MC/DXContainerRootSignature.h" -#include "llvm/Support/EndianStream.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Twine.h" +#include "llvm/Support/Bi

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-24 Thread Damyan Pepper via llvm-branch-commits
@@ -7,53 +7,109 @@ //===--===// #include "llvm/MC/DXContainerRootSignature.h" -#include "llvm/Support/EndianStream.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Twine.h" +#include "llvm/Support/Bi

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-24 Thread Damyan Pepper via llvm-branch-commits
@@ -7,53 +7,109 @@ //===--===// #include "llvm/MC/DXContainerRootSignature.h" -#include "llvm/Support/EndianStream.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Twine.h" +#include "llvm/Support/Bi

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-24 Thread Damyan Pepper via llvm-branch-commits
@@ -7,53 +7,109 @@ //===--===// #include "llvm/MC/DXContainerRootSignature.h" -#include "llvm/Support/EndianStream.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Twine.h" +#include "llvm/Support/Bi

[llvm-branch-commits] [llvm] [HLSL] Refactor Offset calculation while writing Root Signatures. (PR #128577)

2025-02-24 Thread Damyan Pepper via llvm-branch-commits
@@ -25,7 +25,7 @@ Parts: # CHECK-NEXT:RootSignature: # CHECK-NEXT: Version: 2 # CHECK-NEXT: NumStaticSamplers: 0 -# CHECK-NEXT: StaticSamplersOffset: 24 +# CHECK-NEXT: StaticSamplersOffset: 0 damyanp wrote: This suggests that this is a

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-07 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,199 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-compute \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s + +// CHECK: %struct.__cblayout_CBScalars = type <{ float, double, half, i64, i32, i16, i

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-07 Thread Damyan Pepper via llvm-branch-commits
@@ -257,8 +258,10 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl *BufDecl) { VarDecl *NextVar = PackOffsetVec[i + 1].first; S.Diag(NextVar->getLocation(), diag::err_hlsl_packoffset_overlap) << NextVar << Var; + IsValid = false; } }

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-07 Thread Damyan Pepper via llvm-branch-commits
@@ -5032,6 +5032,11 @@ class HLSLBufferDecl final : public NamedDecl, public DeclContext { SourceLocation KwLoc; /// IsCBuffer - Whether the buffer is a cbuffer (and not a tbuffer). bool IsCBuffer; + /// HasValidPackoffset - Whether the buffer has valid packoffset annot

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-07 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,199 @@ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-compute \ +// RUN: -fnative-half-type -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s + +// CHECK: %struct.__cblayout_CBScalars = type <{ float, double, half, i64, i32, i16, i

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -144,6 +149,27 @@ void DXContainerGlobals::addSignature(Module &M, Globals.emplace_back(buildSignature(M, OutputSig, "dx.osg1", "OSG1")); } +void DXContainerGlobals::addRootSignature(Module &M, + SmallVector &Globals) { + + std::

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,158 @@ +//===- 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

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,134 @@ +//===- 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-Identi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,158 @@ +//===- 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

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp requested changes to this pull request. This PR is targetting llvm:users/jaosaffran/122396, rather than llvm:main, so I'm not quite sure what we're reviewing now. https://github.com/llvm/llvm-project/pull/123147 ___ llvm-bra

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,159 @@ +//===- 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

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,158 @@ +//===- 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

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/123147 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,74 @@ +//===- DXILRootSignature.h - 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-Identifie

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,73 @@ +//===- DXILRootSignature.h - 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-Identifie

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,134 @@ +//===- 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-Identi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-30 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,159 @@ +//===- 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

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,159 @@ +//===- 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

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,159 @@ +//===- 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

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,159 @@ +//===- 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

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,134 @@ +//===- 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-Identi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp commented: I've not had time for a more complete review, but some more notes. https://github.com/llvm/llvm-project/pull/123147 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/123147 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,134 @@ +//===- 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-Identi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,134 @@ +//===- 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-Identi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp commented: See https://github.com/llvm/llvm-project/pull/122982#pullrequestreview-2567668635 for some notes on the reasons why it is preferable to include all the error handling in one PR rather than subsequent ones. https://github.com/llvm/llvm-project/pull/12314

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,73 @@ +//===- DXILRootSignature.h - 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-Identifie

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,134 @@ +//===- 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-Identi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,134 @@ +//===- 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-Identi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,134 @@ +//===- 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-Identi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,134 @@ +//===- 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-Identi

[llvm-branch-commits] [llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

2025-01-29 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp edited https://github.com/llvm/llvm-project/pull/123147 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-23 Thread Damyan Pepper via llvm-branch-commits
@@ -89,6 +91,75 @@ class RootSignatureLexer { } }; +class RootSignatureParser { +public: + RootSignatureParser(SmallVector &Elements, + const SmallVector &Tokens); + + // Iterates over the provided tokens and constructs the in-memory + // representati

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-23 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,140 @@ +//===- HLSLRootSignature.h - HLSL 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: Ap

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-23 Thread Damyan Pepper via llvm-branch-commits
@@ -148,6 +148,347 @@ bool RootSignatureLexer::LexToken(RootSignatureToken &Result) { return false; } +// Parser Definitions + +RootSignatureParser::RootSignatureParser( +SmallVector &Elements, +const SmallVector &Tokens) +: Elements(Elements) { + CurTok = Toke

[llvm-branch-commits] [clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-01-23 Thread Damyan Pepper via llvm-branch-commits
@@ -0,0 +1,140 @@ +//===- HLSLRootSignature.h - HLSL 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: Ap

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

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

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-09-09 Thread Damyan Pepper via llvm-branch-commits
@@ -388,10 +432,13 @@ class OpLowerer { case Intrinsic::dx_typedBufferLoad: lowerTypedBufferLoad(F); break; + case Intrinsic::dx_typedBufferStore: +lowerTypedBufferStore(F); +break; } Updated = true; } -if (Updat

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

2024-09-09 Thread Damyan Pepper via llvm-branch-commits
@@ -259,6 +259,114 @@ class OpLowerer { lowerToBindAndAnnotateHandle(F); } + /// Replace uses of \c V with the values in the `dx.ResRet` of \c Op. Since we + /// expect to be post-scalarization, make an effort to avoid vectors. + Error replaceResRetUses(CallInst *I

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

2024-09-09 Thread Damyan Pepper via llvm-branch-commits
@@ -259,6 +259,114 @@ class OpLowerer { lowerToBindAndAnnotateHandle(F); } + /// Replace uses of \c V with the values in the `dx.ResRet` of \c Op. Since we damyanp wrote: What is `V` in this context? https://github.com/llvm/llvm-project/pull/104252

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

2024-09-09 Thread Damyan Pepper via llvm-branch-commits
@@ -450,6 +462,10 @@ CallInst *DXILOpBuilder::createOp(dxil::OpCode OpCode, ArrayRef Args, return *Result; } +StructType *DXILOpBuilder::getResRetType(Type *ElementTy) { + return ::getResRetType(ElementTy); damyanp wrote: Trying to understand this pattern

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

2024-09-09 Thread Damyan Pepper via llvm-branch-commits
@@ -267,45 +267,38 @@ Examples: @llvm.dx.handle.fromHeap.tdx.RawBuffer_v4f32_1_0( i32 2, i1 false) -Buffer Loads and Stores - -*relevant types: Buffers* - -We need to treat buffer loads and stores from "dx.TypedBuffer"

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

2024-09-09 Thread Damyan Pepper via llvm-branch-commits
@@ -30,6 +30,9 @@ def int_dx_handle_fromBinding [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i32_ty, llvm_i1_ty], [IntrNoMem]>; +def int_dx_typedBufferLoad damyanp wrote: Should I expect to find the `checkbit` version in here as well? htt

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

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

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

2024-09-09 Thread Damyan Pepper via llvm-branch-commits
https://github.com/damyanp approved this pull request. LGTM, some nits. https://github.com/llvm/llvm-project/pull/104252 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch

[llvm-branch-commits] [DirectX] Add resource handling to the DXIL pretty printer (PR #104448)

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

[llvm-branch-commits] [DirectX] Implement metadata lowering for resources (PR #104447)

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

[llvm-branch-commits] [DirectX] Move resource logic into PrettyPrinter and TranslateMetadata. NFC (PR #104446)

2024-08-16 Thread Damyan Pepper via llvm-branch-commits
@@ -12,13 +12,27 @@ #include "llvm/ADT/StringRef.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" +#include "llvm/Support/FormatVariadic.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; static void prettyPrintResources(raw_ostream &OS,

[llvm-branch-commits] [DirectX] Move resource logic into PrettyPrinter and TranslateMetadata. NFC (PR #104446)

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

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

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

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferLoad` to DXIL ops (PR #104252)

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

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

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

[llvm-branch-commits] [llvm] [DirectX] Register a few DXIL passes with the new PM (PR #104250)

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

[llvm-branch-commits] [llvm] [DirectX] Register a few DXIL passes with the new PM (PR #104250)

2024-08-16 Thread Damyan Pepper via llvm-branch-commits
@@ -46,14 +46,14 @@ define void @test_typedbuffer() { ; Buffer Buf[24] : register(t3, space5) %typed2 = call target("dx.TypedBuffer", <4 x i32>, 0, 0, 0) @llvm.dx.handle.fromBinding.tdx.TypedBuffer_i32_0_0t( - i32 2, i32 7, i32 24, i32 0, i1 false) +

[llvm-branch-commits] [DirectX] Encapsulate DXILOpLowering's state into a class. NFC (PR #104248)

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

[llvm-branch-commits] [DirectX] Disentangle DXIL.td's op types from LLVMType. NFC (PR #104247)

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

[llvm-branch-commits] [DirectX] Differentiate between 0/1 overloads in the OpBuilder. NFC (PR #104246)

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

[llvm-branch-commits] [llvm] [DirectX] Make DXILOpBuilder's API more useable (PR #101250)

2024-07-30 Thread Damyan Pepper via llvm-branch-commits
@@ -289,24 +289,25 @@ static ShaderKind getShaderKindEnum(Triple::EnvironmentType EnvType) { /// its specification in DXIL.td. /// \param OverloadTy Return type to be used to construct DXIL function type. damyanp wrote: The doxygen comment about

[llvm-branch-commits] [llvm] [DirectX] Make DXILOpBuilder's API more useable (PR #101250)

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

[llvm-branch-commits] [DirectX] Simplify tablegen'd OpCode and OpClass enums (PR #101249)

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

[llvm-branch-commits] [DXIL][Analysis] Boilerplate for DXILResourceAnalysis pass (PR #100700)

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

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

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

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-07-26 Thread Damyan Pepper via llvm-branch-commits
@@ -331,6 +336,249 @@ std::pair ResourceInfo::getAnnotateProps() const { return {Word0, Word1}; } +void ResourceInfo::print(raw_ostream &OS) const { + OS << " Symbol: "; + Symbol->printAsOperand(OS); + OS << "\n"; + + OS << " Name: \"" << Name << "\"\n" + << " Bi

[llvm-branch-commits] [DirectX] Remove new-pm versions of DXILResource passes. NFC (PR #100698)

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

[llvm-branch-commits] [DXIL][Analysis] Make the DXILResource binding optional. NFC (PR #100623)

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