Skip to content

Commit 9a4f2ba

Browse files
authored
Merge branch 'main' into texture1d
2 parents 26674de + 21f060b commit 9a4f2ba

112 files changed

Lines changed: 3393 additions & 1443 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/clang-format-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
--end-rev $END_REV \
8383
--changed-files "$CHANGED_FILES"
8484
apply_diff:
85-
if: ${{ github.event_name == 'issue_comment' && endsWith(github.event.comment.body, '- [x] Check this box to apply formatting changes to this branch.') }}
85+
if: ${{ github.event_name == 'issue_comment' && github.event.comment.user.login == 'github-actions[bot]' && endsWith(github.event.comment.body, '- [x] Check this box to apply formatting changes to this branch.') }}
8686
runs-on: ubuntu-latest
8787
env:
8888
TMP_DIFF_FILE: /tmp/diff.patch

azure-pipelines.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ stages:
3636
submodules: true
3737
- script: |
3838
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
39-
call utils\hct\hctbuild.cmd -$(platform) -$(configuration) -show-cmake-log -spirvtest -warp-nuget-version 1.0.16.1
39+
call utils\hct\hctbuild.cmd -vs2022 -$(platform) -$(configuration) -show-cmake-log -spirvtest -warp-nuget-version 1.0.16.1
4040
displayName: 'Building'
4141
- script: |
4242
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
@@ -78,7 +78,7 @@ stages:
7878

7979
variables:
8080
macOS: macOS-latest
81-
linux: Ubuntu-22.04 # FIXME: #7364, DXC does not build correctly with GCC 13+
81+
linux: Ubuntu-24.04
8282

8383
strategy:
8484
matrix:
@@ -99,13 +99,13 @@ stages:
9999
Linux_Gcc_Release:
100100
image: ${{ variables.linux }}
101101
configuration: Release
102-
CC: gcc-9
103-
CXX: g++-9
102+
CC: gcc
103+
CXX: g++
104104
Linux_Gcc_Debug:
105105
image: ${{ variables.linux }}
106106
configuration: Debug
107-
CC: gcc-9
108-
CXX: g++-9
107+
CC: gcc
108+
CXX: g++
109109
CMAKE_OPTS: -DLLVM_USE_SPLIT_DWARF=On
110110
MacOS_Clang_Release:
111111
image: ${{ variables.macOS }}
@@ -144,11 +144,6 @@ stages:
144144
displayName: 'Installing dependencies'
145145
condition: eq(variables['image'], variables['linux'])
146146
147-
- bash: |
148-
sudo apt-get install g++-9 -y
149-
displayName: 'Installing g++-9'
150-
condition: and(eq(variables['CXX'], 'g++-9'), eq(variables['image'], variables['linux']))
151-
152147
- bash: |
153148
brew update
154149
brew install ninja

cmake/modules/HandleLLVMOptions.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN)
1616
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
1717
message(FATAL_ERROR "Host GCC version must be at least 4.7!")
1818
endif()
19+
# GCC 13 has a known miscompilation bug in -funswitch-loops
20+
# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109934) that causes
21+
# widespread test failures at -O3. Disable -funswitch-loops for GCC 13.
22+
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0 AND
23+
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0)
24+
add_compile_options(-fno-unswitch-loops)
25+
message(STATUS "Disabling -funswitch-loops due to GCC 13 miscompilation bug (PR109934)")
26+
endif()
1927
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
2028
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
2129
message(FATAL_ERROR "Host Clang version must be at least 3.1!")

docs/CommandGuide/FileCheck.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ OPTIONS
6060
-verify``. With this option FileCheck will verify that input does not contain
6161
warnings not covered by any ``CHECK:`` patterns.
6262

63+
.. option:: -D<VAR=VALUE>
64+
65+
Sets a filecheck variable ``VAR`` with value ``VALUE`` that can be used in
66+
``CHECK:`` lines.
67+
6368
.. option:: -version
6469

6570
Show the version number of this program.

docs/ReleaseNotes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ line upon naming the release. Refer to previous for appropriate section names.
4141

4242
- Fixed non-deterministic DXIL/PDB output when compiling shaders with resource arrays, debug info, and SM 6.6+. [#8171](https://github.com/microsoft/DirectXShaderCompiler/issues/8171)
4343
- Fixed mesh shader semantics that were incorrectly case sensitive.
44+
- DXIL validation: added validation for `CreateHandleFromBinding`.
45+
- DXIL validation now rejects non-standard integer bit widths (e.g. `i25`) in instructions.
46+
47+
#### Other Changes
48+
49+
- `/P` now matches `cl.exe` behavior: preprocesses to `<inputname>.i` by
50+
default, with `/Fi` to override the output filename. The old FXC-style `/P
51+
<filename>` positional syntax has been renamed to `/Po`.
52+
[#4611](https://github.com/microsoft/DirectXShaderCompiler/issues/4611).
53+
4454

4555
### Version 1.9.2602
4656

include/dxc/DXIL/DxilInstructions.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10651,14 +10651,14 @@ struct DxilInst_LinAlgMatrixLoadFromMemory {
1065110651
bool requiresUniformInputs() const { return false; }
1065210652
// Operand indexes
1065310653
enum OperandIdx {
10654-
arg_groupsharedArr = 1,
10654+
arg_memory = 1,
1065510655
arg_offset = 2,
1065610656
arg_stride = 3,
1065710657
arg_layout = 4,
1065810658
};
1065910659
// Accessors
10660-
llvm::Value *get_groupsharedArr() const { return Instr->getOperand(1); }
10661-
void set_groupsharedArr(llvm::Value *val) { Instr->setOperand(1, val); }
10660+
llvm::Value *get_memory() const { return Instr->getOperand(1); }
10661+
void set_memory(llvm::Value *val) { Instr->setOperand(1, val); }
1066210662
llvm::Value *get_offset() const { return Instr->getOperand(2); }
1066310663
void set_offset(llvm::Value *val) { Instr->setOperand(2, val); }
1066410664
llvm::Value *get_stride() const { return Instr->getOperand(3); }
@@ -10854,16 +10854,16 @@ struct DxilInst_LinAlgMatrixStoreToMemory {
1085410854
// Operand indexes
1085510855
enum OperandIdx {
1085610856
arg_matrix = 1,
10857-
arg_groupsharedArr = 2,
10857+
arg_memory = 2,
1085810858
arg_offset = 3,
1085910859
arg_stride = 4,
1086010860
arg_layout = 5,
1086110861
};
1086210862
// Accessors
1086310863
llvm::Value *get_matrix() const { return Instr->getOperand(1); }
1086410864
void set_matrix(llvm::Value *val) { Instr->setOperand(1, val); }
10865-
llvm::Value *get_groupsharedArr() const { return Instr->getOperand(2); }
10866-
void set_groupsharedArr(llvm::Value *val) { Instr->setOperand(2, val); }
10865+
llvm::Value *get_memory() const { return Instr->getOperand(2); }
10866+
void set_memory(llvm::Value *val) { Instr->setOperand(2, val); }
1086710867
llvm::Value *get_offset() const { return Instr->getOperand(3); }
1086810868
void set_offset(llvm::Value *val) { Instr->setOperand(3, val); }
1086910869
llvm::Value *get_stride() const { return Instr->getOperand(4); }
@@ -11091,16 +11091,16 @@ struct DxilInst_LinAlgMatrixAccumulateToMemory {
1109111091
// Operand indexes
1109211092
enum OperandIdx {
1109311093
arg_matrix = 1,
11094-
arg_groupsharedArr = 2,
11094+
arg_memory = 2,
1109511095
arg_offset = 3,
1109611096
arg_stride = 4,
1109711097
arg_layout = 5,
1109811098
};
1109911099
// Accessors
1110011100
llvm::Value *get_matrix() const { return Instr->getOperand(1); }
1110111101
void set_matrix(llvm::Value *val) { Instr->setOperand(1, val); }
11102-
llvm::Value *get_groupsharedArr() const { return Instr->getOperand(2); }
11103-
void set_groupsharedArr(llvm::Value *val) { Instr->setOperand(2, val); }
11102+
llvm::Value *get_memory() const { return Instr->getOperand(2); }
11103+
void set_memory(llvm::Value *val) { Instr->setOperand(2, val); }
1110411104
llvm::Value *get_offset() const { return Instr->getOperand(3); }
1110511105
void set_offset(llvm::Value *val) { Instr->setOperand(3, val); }
1110611106
llvm::Value *get_stride() const { return Instr->getOperand(4); }

include/dxc/DXIL/DxilMetadataHelper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ class DxilMDHelper {
648648
public:
649649
// Utility functions.
650650
static bool IsKnownNamedMetaData(const llvm::NamedMDNode &Node);
651+
static bool IsKnownGeneratedMetaData(const llvm::NamedMDNode &Node);
651652
static bool IsKnownMetadataID(llvm::LLVMContext &Ctx, unsigned ID);
652653
static void GetKnownMetadataIDs(llvm::LLVMContext &Ctx,
653654
llvm::SmallVectorImpl<unsigned> *pIDs);

include/dxc/DXIL/DxilOperations.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class OP {
145145
static bool CheckOpCodeTable();
146146
static bool IsDxilOpFuncName(llvm::StringRef name);
147147
static bool IsDxilOpFunc(const llvm::Function *F);
148+
static bool IsDxilOpLinAlgFuncName(llvm::StringRef Name);
148149
static bool IsDxilOpFuncCallInst(const llvm::Instruction *I);
149150
static bool IsDxilOpFuncCallInst(const llvm::Instruction *I, OpCode opcode);
150151
static bool IsDxilOpWave(OpCode C);
@@ -286,6 +287,7 @@ class OP {
286287
static const char *m_NamePrefix;
287288
static const char *m_TypePrefix;
288289
static const char *m_MatrixTypePrefix;
290+
static const char *m_LinAlgNamePrefix;
289291
static unsigned GetTypeSlot(llvm::Type *pType);
290292
static const char *GetOverloadTypeName(unsigned TypeSlot);
291293
static llvm::StringRef GetTypeName(llvm::Type *Ty,

include/dxc/DXIL/DxilUtil.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ llvm::Type *GetHLSLHitObjectType(llvm::Module *M);
166166
bool IsHLSLHitObjectType(llvm::Type *Ty);
167167
bool IsHLSLLinAlgMatrixType(llvm::Type *Ty);
168168
llvm::StringRef GetHLSLLinAlgMatrixTypeMangling(llvm::StructType *Ty);
169+
bool IsHLSLKnownTargetType(llvm::Type *Ty);
169170
bool IsHLSLResourceDescType(llvm::Type *Ty);
170171
bool IsResourceSingleComponent(llvm::Type *Ty);
171172
uint8_t GetResourceComponentCount(llvm::Type *Ty);

include/dxc/DxilRootSignature/DxilRootSignature.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static const uint32_t DxilMapAnisotropy = 16;
5555

5656
// Enumerations and flags.
5757
enum class DxilComparisonFunc : unsigned {
58+
None = 0,
5859
Never = 1,
5960
Less = 2,
6061
Equal = 3,

0 commit comments

Comments
 (0)