Skip to content

Commit 3e2dd30

Browse files
committed
Merge branch 'main' of github.com:microsoft/DirectXShaderCompiler
2 parents 0e5849d + 78c43dd commit 3e2dd30

File tree

551 files changed

+33412
-7712
lines changed

Some content is hidden

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

551 files changed

+33412
-7712
lines changed

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

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
permissions:
1313
pull-requests: write
1414
steps:
15-
- name: Fetch LLVM sources
15+
- name: Fetch DirectXShaderCompiler sources
1616
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1717
with:
1818
ref: ${{ github.event.pull_request.head.sha }}
@@ -31,6 +31,20 @@ jobs:
3131
separator: ","
3232
skip_initial_fetch: true
3333

34+
# We need to pull the script from the main branch, so that we ensure
35+
# we get the latest version of this script.
36+
- name: Fetch code formatting utils
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
with:
39+
repository: microsoft/DirectXShaderCompiler
40+
ref: ${{ github.base_ref }}
41+
sparse-checkout: |
42+
utils/git/requirements_formatting.txt
43+
utils/git/code-format-helper.py
44+
utils/git/code-format-save-diff.py
45+
sparse-checkout-cone-mode: false
46+
path: code-format-tools
47+
3448
- name: "Listed files"
3549
env:
3650
LISTED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
@@ -48,10 +62,10 @@ jobs:
4862
with:
4963
python-version: '3.11'
5064
cache: 'pip'
51-
cache-dependency-path: 'utils/git/requirements_formatting.txt'
65+
cache-dependency-path: 'code-format-tools/utils/git/requirements_formatting.txt'
5266

5367
- name: Install python dependencies
54-
run: pip install -r utils/git/requirements_formatting.txt
68+
run: pip install -r code-format-tools/utils/git/requirements_formatting.txt
5569

5670
- name: Run code formatter
5771
id: formatter
@@ -61,7 +75,7 @@ jobs:
6175
END_REV: ${{ github.event.pull_request.head.sha }}
6276
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
6377
run: |
64-
python utils/git/code-format-helper.py \
78+
python code-format-tools/utils/git/code-format-helper.py \
6579
--token ${{ secrets.GITHUB_TOKEN }} \
6680
--issue-number $GITHUB_PR_NUMBER \
6781
--start-rev $START_REV \
@@ -92,28 +106,37 @@ jobs:
92106
} catch (err) {
93107
core.setFailed(`Request failed with error ${err}`)
94108
}
95-
- name: Fetch LLVM sources
96-
uses: actions/checkout@v4
109+
110+
# We need to pull the script from the main branch, so that we ensure
111+
# we get the latest version of this script.
112+
- name: Fetch code formatting utils
113+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
97114
with:
98-
fetch-depth: 2
99-
path: build/main_src
115+
repository: microsoft/DirectXShaderCompiler
116+
ref: ${{ github.base_ref }}
117+
sparse-checkout: |
118+
utils/git/requirements_formatting.txt
119+
utils/git/code-format-helper.py
120+
utils/git/code-format-save-diff.py
121+
sparse-checkout-cone-mode: false
122+
path: code-format-tools
100123

101124
- name: Setup Python env
102125
uses: actions/setup-python@v4
103126
with:
104127
python-version: '3.11'
105128
cache: 'pip'
106-
cache-dependency-path: 'build/main_src/utils/git/requirements_formatting.txt'
129+
cache-dependency-path: 'code-format-tools/utils/git/requirements_formatting.txt'
107130

108131
- name: Install python dependencies
109-
run: pip install -r build/main_src/utils/git/requirements_formatting.txt
132+
run: pip install -r code-format-tools/utils/git/requirements_formatting.txt
110133

111134
- name: Apply code diff
112135
env:
113136
GITHUB_PR_NUMBER: ${{ github.event.issue.number }}
114137
COMMENT_ID: ${{ github.event.comment.id }}
115138
run: |
116-
python build/main_src/utils/git/code-format-save-diff.py \
139+
python code-format-tools/utils/git/code-format-save-diff.py \
117140
--token ${{ secrets.GITHUB_TOKEN }} \
118141
--issue-number $GITHUB_PR_NUMBER \
119142
--tmp-diff-file $TMP_DIFF_FILE \

autoconf/config.guess

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,9 @@ EOF
929929
ia64:Linux:*:*)
930930
echo ${UNAME_MACHINE}-unknown-linux-gnu
931931
exit ;;
932+
loongarch64:Linux:*:*)
933+
echo ${UNAME_MACHINE}-unknown-linux-gnu
934+
exit ;;
932935
m32r*:Linux:*:*)
933936
echo ${UNAME_MACHINE}-unknown-linux-gnu
934937
exit ;;

azure-pipelines.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ stages:
1313
- stage: Build
1414
jobs:
1515
- job: Windows
16-
timeoutInMinutes: 120
16+
timeoutInMinutes: 165
1717

1818
pool:
1919
vmImage: windows-2022
@@ -36,33 +36,49 @@ 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
39+
call utils\hct\hctbuild.cmd -$(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%
4343
call utils\hct\hcttest.cmd -$(configuration) noexec
4444
displayName: 'DXIL Tests'
4545
- script: |
4646
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
47-
call utils\hct\hcttest.cmd -$(configuration) exec-warp
48-
displayName: 'DXIL Execution Tests (Nuget WARP)'
47+
call utils\hct\hcttest.cmd -$(configuration) exec
48+
displayName: 'DXIL Execution Tests'
49+
- script: |
50+
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
51+
call utils\hct\hcttest.cmd -$(configuration) compat-suite 1.6
52+
displayName: 'DXIL Compat Suite Tests (1.6 release)'
53+
condition: succeededOrFailed()
54+
- script: |
55+
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
56+
call utils\hct\hcttest.cmd -$(configuration) compat-suite 1.7
57+
displayName: 'DXIL Compat Suite Tests (1.7 release)'
58+
condition: succeededOrFailed()
59+
- script: |
60+
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
61+
call utils\hct\hcttest.cmd -$(configuration) compat-suite 1.8
62+
displayName: 'DXIL Compat Suite Tests (1.8 release)'
63+
condition: succeededOrFailed()
64+
4965
5066
- job: Nix
51-
timeoutInMinutes: 120
67+
timeoutInMinutes: 165
5268

5369
variables:
5470
macOS: macOS-latest
5571
linux: Ubuntu-22.04 # FIXME: #7364, DXC does not build correctly with GCC 13+
5672

5773
strategy:
5874
matrix:
59-
Linux_Clang_Release:
75+
Linux_Clang_RelWithDebInfo:
6076
image: ${{ variables.linux }}
61-
configuration: Release
77+
configuration: RelWithDebInfo
6278
CC: clang-18
6379
CXX: clang++-18
64-
CMAKE_OPTS: -DLLVM_ENABLE_WERROR=On -DLLVM_USE_SANITIZER='Address;Undefined' -DLLVM_ENABLE_LIBCXX=On -DLLVM_USE_LINKER=lld
65-
CHECK_ALL_ENV: ASAN_OPTIONS=alloc_dealloc_mismatch=0
80+
CMAKE_OPTS: -DLLVM_ENABLE_WERROR=On -DLLVM_USE_SANITIZER='Address;Undefined' -DLLVM_ENABLE_LIBCXX=On -DLLVM_USE_LINKER=lld-18
81+
CHECK_ALL_ENV: ASAN_OPTIONS=alloc_dealloc_mismatch=0 LSAN_OPTIONS=suppressions=$BUILD_SOURCESDIRECTORY/utils/asan/x86_64-pc-linux-gnu.lsan.supp:print_suppressions=0 ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-18 LSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-18
6682
OS: Linux
6783
Linux_Clang_Debug:
6884
image: ${{ variables.linux }}
@@ -80,6 +96,7 @@ stages:
8096
configuration: Debug
8197
CC: gcc-9
8298
CXX: g++-9
99+
CMAKE_OPTS: -DLLVM_USE_SPLIT_DWARF=On
83100
MacOS_Clang_Release:
84101
image: ${{ variables.macOS }}
85102
configuration: Release
@@ -107,6 +124,8 @@ stages:
107124
versionSpec: '3.x'
108125

109126
- bash: |
127+
sudo apt-get update
128+
sudo apt-get upgrade libc6 libc6-dbg
110129
sudo apt-get install ninja-build
111130
wget https://apt.llvm.org/llvm.sh
112131
chmod u+x llvm.sh
@@ -115,6 +134,11 @@ stages:
115134
displayName: 'Installing dependencies'
116135
condition: eq(variables['image'], variables['linux'])
117136
137+
- bash: |
138+
sudo apt-get install g++-9 -y
139+
displayName: 'Installing g++-9'
140+
condition: and(eq(variables['CXX'], 'g++-9'), eq(variables['image'], variables['linux']))
141+
118142
- bash: |
119143
brew update
120144
brew install ninja
@@ -141,4 +165,3 @@ stages:
141165
testResultsFormat: 'JUnit'
142166
testResultsFiles: '**/testresults.xunit.xml'
143167
condition: succeededOrFailed()
144-

cmake/config-ix.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ elseif (LLVM_NATIVE_ARCH MATCHES "wasm64")
367367
set(LLVM_NATIVE_ARCH WebAssembly)
368368
elseif (LLVM_NATIVE_ARCH MATCHES "riscv64")
369369
set(LLVM_NATIVE_ARCH RISCV)
370+
elseif (LLVM_NATIVE_ARCH MATCHES "loongarch64")
371+
set(LLVM_NATIVE_ARCH LoongArch)
370372
elseif (LLVM_NATIVE_ARCH MATCHES "e2k")
371373
set(LLVM_NATIVE_ARCH E2K)
372374
else ()

cmake/modules/AddLLVM.cmake

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,35 @@ function(set_output_directory target bindir libdir)
222222
set(moddir ${libdir})
223223
endif()
224224
if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
225+
# HLSL change begin: work around broken MSVC_BUILD_AS_X
226+
get_target_property(target_type ${target} TYPE)
227+
if(target_type STREQUAL "SHARED_LIBRARY" AND MSVC_BUILD_AS_X EQUAL 1)
228+
set(arm64x_workaround 1)
229+
message(NOTICE "Working around ARM64X / MSVC_BUILD_AS_X bug for ${target}")
230+
else()
231+
set(arm64x_workaround 0)
232+
endif()
233+
# HLSL change end
234+
225235
foreach(build_mode ${CMAKE_CONFIGURATION_TYPES})
226236
string(TOUPPER "${build_mode}" CONFIG_SUFFIX)
227237
string(REPLACE ${CMAKE_CFG_INTDIR} ${build_mode} bi ${bindir})
228238
string(REPLACE ${CMAKE_CFG_INTDIR} ${build_mode} li ${libdir})
229239
string(REPLACE ${CMAKE_CFG_INTDIR} ${build_mode} mi ${moddir})
240+
241+
# HLSL change begin: work around broken MSVC_BUILD_AS_X
242+
#
243+
# MSVC_BUILD_AS_X generates a vcxproj that builds for both ARM64 and
244+
# ARM64EC, but these two platforms are only visible in msbuild. It also
245+
# currently configures the import libraries to all be output to the same
246+
# location, which means it's a race for if we get the ARM64 or ARM64X
247+
# version there. The appended $(PLATFORM) is evaluated by msbuild at
248+
# build time to separate the ARM64EC from ARM64 builds.
249+
if(arm64x_workaround EQUAL 1)
250+
string(APPEND li "/$(PLATFORM)")
251+
endif()
252+
# HLSL change end
253+
230254
set_target_properties(${target} PROPERTIES "RUNTIME_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${bi})
231255
set_target_properties(${target} PROPERTIES "ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${li})
232256
set_target_properties(${target} PROPERTIES "LIBRARY_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${mi})

cmake/modules/FindTAEF.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ set(TAEF_SDK_BIN ${TAEF_INCLUDE_DIR}/../../Runtimes/TAEF)
4444
if ((CMAKE_GENERATOR_PLATFORM STREQUAL "x64") OR ("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "x64"))
4545
set(TAEF_BIN_ARCH "amd64")
4646
set(TAEF_ARCH "x64")
47-
elseif ((CMAKE_GENERATOR_PLATFORM STREQUAL "x86") OR ("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "x86"))
47+
elseif ((CMAKE_GENERATOR_PLATFORM STREQUAL "Win32") OR ("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "X86"))
4848
set(TAEF_BIN_ARCH "x86")
4949
set(TAEF_ARCH "x86")
5050
elseif ((CMAKE_GENERATOR_PLATFORM MATCHES "ARM64.*") OR ("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" MATCHES "ARM64.*"))
@@ -53,7 +53,12 @@ elseif ((CMAKE_GENERATOR_PLATFORM MATCHES "ARM64.*") OR ("${CMAKE_C_COMPILER_ARC
5353
elseif ((CMAKE_GENERATOR_PLATFORM MATCHES "ARM.*") OR ("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" MATCHES "ARM.*"))
5454
set(TAEF_BIN_ARCH "arm")
5555
set(TAEF_ARCH "arm")
56-
endif((CMAKE_GENERATOR_PLATFORM STREQUAL "x64") OR ("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "x64"))
56+
else ()
57+
message(FATAL_ERROR
58+
"Unable to determine TAEF architecture - CMAKE_GENERATOR_PLATFORM is "
59+
"${CMAKE_GENERATOR_PLATFORM}, CMAKE_C_COMPILER_ARCHITECTURE_ID is "
60+
"${CMAKE_C_COMPILER_ARCHITECTURE_ID}.")
61+
endif()
5762

5863
set (TAEF_ARCH ${TAEF_ARCH} CACHE INTERNAL "arch for taef test")
5964
find_program(TAEF_EXECUTABLE te.exe PATHS

cmake/modules/HandleLLVMOptions.cmake

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ if( MSVC )
301301

302302
set(msvc_warning_flags
303303
# Disabled warnings.
304-
-wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned'
305304
-wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored'
306305
-wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data'
307306
-wd4258 # Suppress ''var' : definition from the for loop is ignored; the definition from the enclosing scope is used'
@@ -568,9 +567,19 @@ if(LLVM_USE_SANITIZER)
568567
endif()
569568
endif()
570569

571-
# Turn on -gsplit-dwarf if requested
572-
if(LLVM_USE_SPLIT_DWARF)
573-
add_definitions("-gsplit-dwarf")
570+
# Turn on -gsplit-dwarf if requested in debug builds.
571+
if (LLVM_USE_SPLIT_DWARF AND
572+
((uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") OR
573+
(uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")))
574+
# Limit to clang and gcc so far. Add compilers supporting this option.
575+
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
576+
CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
577+
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-gsplit-dwarf>)
578+
include(CheckLinkerFlag)
579+
check_linker_flag(CXX "-Wl,--gdb-index" LINKER_SUPPORTS_GDB_INDEX)
580+
append_if(LINKER_SUPPORTS_GDB_INDEX "-Wl,--gdb-index"
581+
CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
582+
endif()
574583
endif()
575584

576585
add_llvm_definitions( -D__STDC_CONSTANT_MACROS )

0 commit comments

Comments
 (0)