Skip to content

Commit ddeb1bd

Browse files
committed
Merge remote-tracking branch 'upstream/main' into user/alsepkow/fix-min-precision-vector-load
2 parents e13d0dc + 80ffa2e commit ddeb1bd

185 files changed

Lines changed: 6988 additions & 1108 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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3838
with:
3939
repository: microsoft/DirectXShaderCompiler
40-
ref: ${{ github.base_ref }}
40+
ref: ${{ github.event.repository.default_branch }}
4141
sparse-checkout: |
4242
utils/git/requirements_formatting.txt
4343
utils/git/code-format-helper.py
@@ -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
@@ -113,7 +113,7 @@ jobs:
113113
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
114114
with:
115115
repository: microsoft/DirectXShaderCompiler
116-
ref: ${{ github.base_ref }}
116+
ref: ${{ github.event.repository.default_branch }}
117117
sparse-checkout: |
118118
utils/git/requirements_formatting.txt
119119
utils/git/code-format-helper.py

azure-pipelines.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

external/SPIRV-Tools

Submodule SPIRV-Tools updated 113 files

include/dxc/DXIL/DxilConstants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ enum class ComponentType : uint32_t {
183183
PackedU8x32 = 18,
184184

185185
// BEGIN NEW FOR SM 6.9
186-
U8 = 19,
187-
I8 = 20,
186+
I8 = 19,
187+
U8 = 20,
188188
F8_E4M3 = 21,
189189
F8_E5M2 = 22,
190190
// END

include/dxc/DXIL/DxilInstructions.h

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10606,7 +10606,7 @@ struct DxilInst_LinAlgMatrixLoadFromDescriptor {
1060610606
// Validation support
1060710607
bool isAllowed() const { return true; }
1060810608
bool isArgumentListValid() const {
10609-
if (5 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands())
10609+
if (6 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands())
1061010610
return false;
1061110611
return true;
1061210612
}
@@ -10618,6 +10618,7 @@ struct DxilInst_LinAlgMatrixLoadFromDescriptor {
1061810618
arg_offset = 2,
1061910619
arg_stride = 3,
1062010620
arg_layout = 4,
10621+
arg_align = 5,
1062110622
};
1062210623
// Accessors
1062310624
llvm::Value *get_handle() const { return Instr->getOperand(1); }
@@ -10628,6 +10629,8 @@ struct DxilInst_LinAlgMatrixLoadFromDescriptor {
1062810629
void set_stride(llvm::Value *val) { Instr->setOperand(3, val); }
1062910630
llvm::Value *get_layout() const { return Instr->getOperand(4); }
1063010631
void set_layout(llvm::Value *val) { Instr->setOperand(4, val); }
10632+
llvm::Value *get_align() const { return Instr->getOperand(5); }
10633+
void set_align(llvm::Value *val) { Instr->setOperand(5, val); }
1063110634
};
1063210635

1063310636
/// This instruction fills a matrix with data from a groupshared array
@@ -10651,14 +10654,14 @@ struct DxilInst_LinAlgMatrixLoadFromMemory {
1065110654
bool requiresUniformInputs() const { return false; }
1065210655
// Operand indexes
1065310656
enum OperandIdx {
10654-
arg_groupsharedArr = 1,
10657+
arg_memory = 1,
1065510658
arg_offset = 2,
1065610659
arg_stride = 3,
1065710660
arg_layout = 4,
1065810661
};
1065910662
// Accessors
10660-
llvm::Value *get_groupsharedArr() const { return Instr->getOperand(1); }
10661-
void set_groupsharedArr(llvm::Value *val) { Instr->setOperand(1, val); }
10663+
llvm::Value *get_memory() const { return Instr->getOperand(1); }
10664+
void set_memory(llvm::Value *val) { Instr->setOperand(1, val); }
1066210665
llvm::Value *get_offset() const { return Instr->getOperand(2); }
1066310666
void set_offset(llvm::Value *val) { Instr->setOperand(2, val); }
1066410667
llvm::Value *get_stride() const { return Instr->getOperand(3); }
@@ -10805,7 +10808,7 @@ struct DxilInst_LinAlgMatrixStoreToDescriptor {
1080510808
// Validation support
1080610809
bool isAllowed() const { return true; }
1080710810
bool isArgumentListValid() const {
10808-
if (6 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands())
10811+
if (7 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands())
1080910812
return false;
1081010813
return true;
1081110814
}
@@ -10818,6 +10821,7 @@ struct DxilInst_LinAlgMatrixStoreToDescriptor {
1081810821
arg_offset = 3,
1081910822
arg_stride = 4,
1082010823
arg_layout = 5,
10824+
arg_align = 6,
1082110825
};
1082210826
// Accessors
1082310827
llvm::Value *get_matrix() const { return Instr->getOperand(1); }
@@ -10830,6 +10834,8 @@ struct DxilInst_LinAlgMatrixStoreToDescriptor {
1083010834
void set_stride(llvm::Value *val) { Instr->setOperand(4, val); }
1083110835
llvm::Value *get_layout() const { return Instr->getOperand(5); }
1083210836
void set_layout(llvm::Value *val) { Instr->setOperand(5, val); }
10837+
llvm::Value *get_align() const { return Instr->getOperand(6); }
10838+
void set_align(llvm::Value *val) { Instr->setOperand(6, val); }
1083310839
};
1083410840

1083510841
/// This instruction stores a matrix to groupshared memory
@@ -10854,16 +10860,16 @@ struct DxilInst_LinAlgMatrixStoreToMemory {
1085410860
// Operand indexes
1085510861
enum OperandIdx {
1085610862
arg_matrix = 1,
10857-
arg_groupsharedArr = 2,
10863+
arg_memory = 2,
1085810864
arg_offset = 3,
1085910865
arg_stride = 4,
1086010866
arg_layout = 5,
1086110867
};
1086210868
// Accessors
1086310869
llvm::Value *get_matrix() const { return Instr->getOperand(1); }
1086410870
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); }
10871+
llvm::Value *get_memory() const { return Instr->getOperand(2); }
10872+
void set_memory(llvm::Value *val) { Instr->setOperand(2, val); }
1086710873
llvm::Value *get_offset() const { return Instr->getOperand(3); }
1086810874
void set_offset(llvm::Value *val) { Instr->setOperand(3, val); }
1086910875
llvm::Value *get_stride() const { return Instr->getOperand(4); }
@@ -11042,7 +11048,7 @@ struct DxilInst_LinAlgMatrixAccumulateToDescriptor {
1104211048
// Validation support
1104311049
bool isAllowed() const { return true; }
1104411050
bool isArgumentListValid() const {
11045-
if (6 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands())
11051+
if (7 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands())
1104611052
return false;
1104711053
return true;
1104811054
}
@@ -11055,6 +11061,7 @@ struct DxilInst_LinAlgMatrixAccumulateToDescriptor {
1105511061
arg_offset = 3,
1105611062
arg_stride = 4,
1105711063
arg_layout = 5,
11064+
arg_align = 6,
1105811065
};
1105911066
// Accessors
1106011067
llvm::Value *get_matrix() const { return Instr->getOperand(1); }
@@ -11067,6 +11074,8 @@ struct DxilInst_LinAlgMatrixAccumulateToDescriptor {
1106711074
void set_stride(llvm::Value *val) { Instr->setOperand(4, val); }
1106811075
llvm::Value *get_layout() const { return Instr->getOperand(5); }
1106911076
void set_layout(llvm::Value *val) { Instr->setOperand(5, val); }
11077+
llvm::Value *get_align() const { return Instr->getOperand(6); }
11078+
void set_align(llvm::Value *val) { Instr->setOperand(6, val); }
1107011079
};
1107111080

1107211081
/// This instruction accumulates a matrix to groupshared memory
@@ -11091,16 +11100,16 @@ struct DxilInst_LinAlgMatrixAccumulateToMemory {
1109111100
// Operand indexes
1109211101
enum OperandIdx {
1109311102
arg_matrix = 1,
11094-
arg_groupsharedArr = 2,
11103+
arg_memory = 2,
1109511104
arg_offset = 3,
1109611105
arg_stride = 4,
1109711106
arg_layout = 5,
1109811107
};
1109911108
// Accessors
1110011109
llvm::Value *get_matrix() const { return Instr->getOperand(1); }
1110111110
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); }
11111+
llvm::Value *get_memory() const { return Instr->getOperand(2); }
11112+
void set_memory(llvm::Value *val) { Instr->setOperand(2, val); }
1110411113
llvm::Value *get_offset() const { return Instr->getOperand(3); }
1110511114
void set_offset(llvm::Value *val) { Instr->setOperand(3, val); }
1110611115
llvm::Value *get_stride() const { return Instr->getOperand(4); }

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)