Skip to content

Commit 0bd2f04

Browse files
committed
Merge branch 'main' of github.com:microsoft/DirectXShaderCompiler into devshFixes
2 parents dafad1d + 9bcce40 commit 0bd2f04

188 files changed

Lines changed: 6686 additions & 3679 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.

azure-pipelines.yml

Lines changed: 24 additions & 3 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
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%
@@ -45,7 +45,23 @@ stages:
4545
- script: |
4646
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
4747
call utils\hct\hcttest.cmd -$(configuration) exec
48-
displayName: 'DXIL Execution Tests'
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
5167
timeoutInMinutes: 165
@@ -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
@@ -117,6 +134,11 @@ stages:
117134
displayName: 'Installing dependencies'
118135
condition: eq(variables['image'], variables['linux'])
119136
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+
120142
- bash: |
121143
brew update
122144
brew install ninja
@@ -143,4 +165,3 @@ stages:
143165
testResultsFormat: 'JUnit'
144166
testResultsFiles: '**/testresults.xunit.xml'
145167
condition: succeededOrFailed()
146-

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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,19 @@ if(LLVM_USE_SANITIZER)
567567
endif()
568568
endif()
569569

570-
# Turn on -gsplit-dwarf if requested
571-
if(LLVM_USE_SPLIT_DWARF)
572-
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()
573583
endif()
574584

575585
add_llvm_definitions( -D__STDC_CONSTANT_MACROS )

docs/BuildingAndTestingDXC.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Building on windows additionally requires:
3636
* [Visual Studio 2019 or later](https://www.visualstudio.com/downloads) - select the following workloads:
3737
* Universal Windows Platform Development
3838
* Desktop Development with C++
39-
* [Windows SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk) - version 10.0.18362.0 or newer
39+
* [Windows SDK](https://developer.microsoft.com/en-US/windows/downloads/windows-sdk) - version 10.0.26100.0 or newer
4040
* [Windows Driver Kit](https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) - same version as the SDK
4141

4242
Note: DXC uses submodules for some external dependencies. You must initialize

docs/DXIL.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ Each HLSL signature parameter is defined via C-like type, interpolation mode, an
616616

617617
SV semantics add specific meanings and constraints to associated parameters. A parameter may be supplied by the hardware, and is then known as a System Generated Value (SGV). Alternatively, a parameter may be interpreted by the hardware and is then known as System Interpreted Value (SIV). SGVs and SIVs are pipeline-stage dependent; moreover, some participate in signature packing and some do not. Non-SV semantics always participate in signature packing.
618618

619-
Most System Generated Values (SGV) are loaded using special Dxil intrinsic functions, rather than loading the input from a signature. These usually will not be present in the signature at all. Their presence may be detected by the declaration and use of the special instrinsic function itself. The exceptions to this are notible. In one case they are present and loaded from the signature instead of a special intrinsic because they must be part of the packed signature potentially passed from the prior stage, allowing the prior stage to override these values, such as for SV_PrimitiveID and SV_IsFrontFace that may be written in the the Geometry Shader. In another case, they identify signature elements that still contribute to DXBC signature for informational purposes, but will only use the special intrinsic function to read the value, such as for SV_PrimitiveID for GS input and SampleIndex for PS input.
619+
Most System Generated Values (SGV) are loaded using special Dxil intrinsic functions, rather than loading the input from a signature. These usually will not be present in the signature at all. Their presence may be detected by the declaration and use of the special instrinsic function itself. The exceptions to this are notable. In one case they are present and loaded from the signature instead of a special intrinsic because they must be part of the packed signature potentially passed from the prior stage, allowing the prior stage to override these values, such as for SV_PrimitiveID and SV_IsFrontFace that may be written in the the Geometry Shader. In another case, they identify signature elements that still contribute to DXBC signature for informational purposes, but will only use the special intrinsic function to read the value, such as for SV_PrimitiveID for GS input and SampleIndex for PS input.
620620

621621
The classification of behavior for various system values in various signature locations is described in a table organized by SemanticKind and SigPointKind. The SigPointKind is a new classification that uniquely identifies each set of parameters that may be input or output for each entry point. For each combination of SemanticKind and SigPointKind, there is a SemanticInterpretationKind that defines the class of treatment for that location.
622622

docs/ReleaseNotes.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ The included licenses apply to the following files:
1919

2020
### Upcoming Release
2121

22-
- Fix regression: [#7510](https://github.com/microsoft/DirectXShaderCompiler/issues/7510) crash when calling `sizeof` on templated type.
23-
- Fix regression: [#7508](https://github.com/microsoft/DirectXShaderCompiler/issues/7508) crash when calling `Load` with `status`.
22+
- Fixed regression: [#7510](https://github.com/microsoft/DirectXShaderCompiler/issues/7510) crash when calling `sizeof` on templated type.
23+
- Fixed regression: [#7508](https://github.com/microsoft/DirectXShaderCompiler/issues/7508) crash when calling `Load` with `status`.
2424
- Header file `dxcpix.h` was added to the release package.
25+
- Moved Linear Algebra (Cooperative Vector) DXIL Opcodes to experimental Shader Model 6.10
2526

2627
### Version 1.8.2505
2728

docs/SPIR-V.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,21 @@ Right now the following ``<builtin>`` are supported:
285285
Please see Vulkan spec. `15.9. Built-In Variables <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#interfaces-builtin-variables>`_
286286
for detailed explanation of these builtins.
287287

288+
Helper Lane Support
289+
~~~~~~~~~~~~~~~~~~~
290+
291+
Shader Model 6.7 introduces the `[WaveOpsIncludeHelperLanes]` attribute. When this
292+
attribute is applied to a shader entry point, the SPIR-V backend will:
293+
294+
1. Add the ``SPV_KHR_maximal_reconvergence`` and ``SPV_KHR_quad_control``
295+
extensions to the module.
296+
2. Add the ``QuadControlKHR`` capability.
297+
3. Add the ``MaximallyReconvergesKHR`` and ``RequireFullQuadsKHR`` execution modes
298+
to the entry point.
299+
300+
This ensures that helper lanes are included in wave operations, which is the
301+
behavior required by the HLSL specification.
302+
288303
Supported extensions
289304
~~~~~~~~~~~~~~~~~~~~
290305

external/SPIRV-Tools

Submodule SPIRV-Tools updated 66 files

include/dxc/DXIL/DxilConstants.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace DXIL {
2929
const unsigned kDxilMajor = 1;
3030
/* <py::lines('VALRULE-TEXT')>hctdb_instrhelp.get_dxil_version_minor()</py>*/
3131
// VALRULE-TEXT:BEGIN
32-
const unsigned kDxilMinor = 9;
32+
const unsigned kDxilMinor = 10;
3333
// VALRULE-TEXT:END
3434

3535
inline unsigned MakeDxilVersion(unsigned DxilMajor, unsigned DxilMinor) {
@@ -1087,6 +1087,7 @@ enum class OpCode : unsigned {
10871087
NumOpCodes_Dxil_1_6 = 222,
10881088
NumOpCodes_Dxil_1_7 = 226,
10891089
NumOpCodes_Dxil_1_8 = 258,
1090+
NumOpCodes_Dxil_1_9 = 312,
10901091

10911092
NumOpCodes = 312 // exclusive last value of enumeration
10921093
};
@@ -1422,6 +1423,7 @@ enum class OpCodeClass : unsigned {
14221423
NumOpClasses_Dxil_1_6 = 149,
14231424
NumOpClasses_Dxil_1_7 = 153,
14241425
NumOpClasses_Dxil_1_8 = 174,
1426+
NumOpClasses_Dxil_1_9 = 196,
14251427

14261428
NumOpClasses = 196 // exclusive last value of enumeration
14271429
};

0 commit comments

Comments
 (0)