Skip to content

Last sync before changing SPIR-V codegen logic (inout changing to copy-in/copy-out) #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
905add5
Bump cryptography from 42.0.4 to 43.0.1 in /utils/git (#6894)
dependabot[bot] Jan 13, 2025
5bf6f77
[DXIL] Avoid infinite loop / stack overflow on invalid instruction (#…
bob80905 Jan 14, 2025
e52b6bc
Update version to 1.8.2502 (#7065)
bob80905 Jan 15, 2025
e4636f0
[SPIR-V] Avoid emitting Int64 when loading Float64 (#7073)
Keenuts Jan 17, 2025
e3f0efc
[SPIRV] Move inline spirv test files in a directory (#7077)
s-perron Jan 22, 2025
a7b7a0c
Bump SM version to 6.9 (#7075)
bob80905 Jan 22, 2025
b148329
[Release] Add section for upcoming release (#7072)
bob80905 Jan 22, 2025
25faa88
Fix and/or intrinsics with non-int parameters (#7060)
pow2clk Jan 22, 2025
10b3328
Add Preview Hashing sentinel value to dxil validator (#7053)
bob80905 Jan 25, 2025
bf24b74
[Pipelines] Extend time and add PR trigger (#7071)
bob80905 Jan 27, 2025
1fdebc4
Use UMad for dot products on uint vectors (#7059)
pow2clk Jan 27, 2025
ef1472a
Fix and/or intrinsics with non-int parameters (cp to 1.8.2502) (#7091)
pow2clk Jan 27, 2025
99726f9
[Error Handling] Fix DxcContainerBuilder error handling (#7056)
bob80905 Jan 30, 2025
b65a931
Add a test target to run exec tests with latest warp from nuget (#7101)
alsepkow Jan 31, 2025
c2ed9ad
[SPIRV] Avoid invlid SIPR-V (#7107)
s-perron Feb 3, 2025
f8ef483
[NFC][Docs] Update release notes / release template process (#7100)
bob80905 Feb 7, 2025
20950d6
[NFC] Remove unused functions in ExecutionTest.cpp and assert.cpp (#7…
bob80905 Feb 7, 2025
6b68f3b
[SPIRV] Update link to inline spirv wiki (#7140)
s-perron Feb 18, 2025
d2f2aae
[SPIRV] Stop running ReplaceInvalidOpcPass (#7138)
s-perron Feb 18, 2025
fcbd2a1
[SPIRV] Add the vk::image_format to runtime arrays (#7128)
s-perron Feb 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ assignees: ''
- At this point, changes must be cherry-picked into the release branch in
order for them to be included in the release.
- [ ] MM/DD/YYYY - Release Candidate 1 (begin Ask Mode[^1] for release branch).
- At this point, changes must be approved by @microsoft/hlsl-release
- At this point, cherry-picked changes must be approved by @microsoft/hlsl-release
- [ ] MM/DD/YYYY - Final Release Candidate
- [ ] MM/DD/YYYY - Target Release Date

Expand All @@ -26,7 +26,7 @@ This part of the release process is to 'prime the pump' - that is to make sure
that all the various parts of the engineering system are set into place so that
we are confident we can generate builds for the new branch

- [ ] Update version number
- [ ] Update version numbers in utils/version/latest-release.json and utils/version/version.inc
- [ ] Create the release branch from `main`
- The release branch is kept into sync with main via regular fast-forward
merges.
Expand All @@ -39,7 +39,7 @@ we are confident we can generate builds for the new branch

## After Fork

- [ ] Update README.md
- [ ] Update README.md if necessary
- [ ] Create draft of Release post on GitHub

## Quality Sign Off
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ At the moment, the DirectX HLSL Compiler provides the following components:

- dxilconv.dll, a DLL providing a converter from DXBC (older shader bytecode format)

- dxv.exe, a command-line tool that validates DXIL IR (compiled HLSL programs).

- various other tools based on the above components

The Microsoft Windows SDK releases include a supported version of the compiler and validator.
Expand Down
12 changes: 10 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
trigger:
- main
- release*

pr:
- main
- release*

resources:
- repo: self
Expand All @@ -9,7 +13,7 @@ stages:
- stage: Build
jobs:
- job: Windows
timeoutInMinutes: 90
timeoutInMinutes: 120

pool:
vmImage: windows-2022
Expand Down Expand Up @@ -38,9 +42,13 @@ stages:
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
call utils\hct\hcttest.cmd -$(configuration) noexec
displayName: 'DXIL Tests'
- script: |
call utils\hct\hctstart.cmd %HLSL_SRC_DIR% %HLSL_BLD_DIR%
call utils\hct\hcttest.cmd -$(configuration) exec-warp
displayName: 'DXIL Execution Tests (Nuget WARP)'

- job: Nix
timeoutInMinutes: 90
timeoutInMinutes: 120

variables:
macOS: macOS-latest
Expand Down
233 changes: 233 additions & 0 deletions cmake/modules/Nuget.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
include_guard(GLOBAL)

if(NOT DEFINED BINARY_DIR)
message(SEND_ERROR "Callers must provide BINARY_DIR")
endif()

if(NOT DEFINED BUILD_TYPE)
message(SEND_ERROR "Callers must provide BUILD_TYPE")
endif()

if(NOT DEFINED ENV{USE_WARP_FROM_NUGET})
message(SEND_ERROR "Callers must set a string value for the environment variable USE_WARP_FROM_NUGET."
"Either 'LATEST_RELEASE' or 'LATEST_PREVIEW'")
endif()

set(USE_WARP_FROM_NUGET $ENV{USE_WARP_FROM_NUGET})

# Downloads nuget.exe to the given path if it doesn't exist yet.
function(EnsureNugetExists target_path)
# Download the latest nuget.exe to the given path.
if(NOT EXISTS ${target_path})
message(STATUS "Installing nuget.exe to ${target_path}...")
file(DOWNLOAD
https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
${target_path}
)
endif()
endfunction()

# Download the latest nuget package for the given ID. Can pass in a custom source, defaults to nuget public feed.
function(GetNuGetPackageLatestVersion)
set(params NAME ID SOURCE OUTPUT_DIR OUTPUT_VARIABLE PREVIEW)
cmake_parse_arguments(PARSE_ARGV 0 ARG "" "${params}" "")

if(NOT ARG_OUTPUT_DIR)
set(ARG_OUTPUT_DIR )
endif()

set(nuget_exe_path "${ARG_OUTPUT_DIR}\\nuget.exe install")
EnsureNugetExists(${nuget_exe_path})

if (${ARG_ID}_LATEST_VERSION)
set(${ARG_OUTPUT_VARIABLE} ${${ARG_ID}_LATEST_VERSION} PARENT_SCOPE)
else()
if(NOT ARG_SOURCE)
set(ARG_SOURCE https://api.nuget.org/v3/index.json)
endif()

if(NOT ARG_PREVIEW)
set(ARG_PREVIEW OFF)
endif()

if(ARG_PREVIEW)
# Note that '-Prerelease' options will only return a prerelease package if that is also the latest.
# If you want a prerelease package with an older version number than the latest release package then you
# need to pass a specific version number.
message("Will add '-Prelease' to nuget list command")
set(prerelease "-Prerelease")
endif()

execute_process(
COMMAND ${nuget_exe_path}
list ${ARG_ID}
-Source ${ARG_SOURCE}
${prerelease}
RESULT_VARIABLE result
OUTPUT_VARIABLE nuget_list_output
OUTPUT_STRIP_TRAILING_WHITESPACE
)

if(NOT ${result} STREQUAL "0")
message(FATAL_ERROR "NuGet failed to find latest version of package ${ARG_ID} with exit code ${result}.")
endif()

# Get last line of running nuget.exe list <ID>.
string(REPLACE "\n" ";" nuget_list_output ${nuget_list_output})
list(POP_BACK nuget_list_output nuget_list_last_line)
if(nuget_list_last_line STREQUAL "No packages found.")
message(FATAL_ERROR "NuGet failed to find latest version of package ${ARG_ID}.")
endif()

# The last line should have the format <ID> <VERSION>
string(REPLACE " " ";" nuget_list_last_line ${nuget_list_last_line})
list(POP_BACK nuget_list_last_line nuget_version)

if(NOT nuget_version)
message(FATAL_ERROR "NuGet failed to find latest version of package ${ARG_ID}.")
endif()

message("Nuget found version:${nuget_version} for ${ARG_ID}")

# Save output variable and cache the result so subsequent calls to the version-unspecified package
# are faster.
set(${ARG_OUTPUT_VARIABLE} ${nuget_version} PARENT_SCOPE)
set(${ARG_ID}_LATEST_VERSION ${nuget_version} CACHE INTERNAL "")
endif()
endfunction()

# Installs a NuGet package under OUTPUT_DIR.
#
# FetchNuGetPackage(
# ID Microsoft.Direct3D.WARP
# VERSION 1.0.13
# SOURCE https://api.nuget.org/v3/index.json
# )
#
# This function sets a variable <name>_SOURCE_DIR (e.g. Microsoft.Direct3D.WARP_SOURCE_DIR in above example) to the
# extract NuGet package contents.
function(FetchNuGetPackage)
set(params NAME ID VERSION SOURCE OUTPUT_DIR RELEASE_TYPE)
cmake_parse_arguments(PARSE_ARGV 0 ARG "" "${params}" "")

# The NAME parameter is optional: if it's not set then the package ID is used as the name. The
# reason for having a separate NAME is to allow a consistent identifier for packages whose ID
# changes with each release (e.g. GDK).
if(NOT ARG_NAME)
set(ARG_NAME ${ARG_ID})
endif()

if(NOT ARG_OUTPUT_DIR)
set(ARG_OUTPUT_DIR ${BINARY_DIR}/temp)
endif()

set(nuget_exe_path ${ARG_OUTPUT_DIR}/nuget.exe)

if(NOT ARG_SOURCE)
set(ARG_SOURCE https://api.nuget.org/v3/index.json)
endif()

if(NOT ARG_RELEASE_TYPE)
set(ARG_RELEASE_TYPE "LATEST_RELEASE")
endif()

set(PREVIEW OFF)

if(${ARG_RELEASE_TYPE} STREQUAL "LATEST_PREVIEW")
set(PREVIEW ON)
endif()

# Default to latest version
if(NOT ARG_VERSION)
GetNuGetPackageLatestVersion(
ID ${ARG_ID}
SOURCE ${ARG_SOURCE}
PREVIEW ${PREVIEW}
OUTPUT_DIR ${ARG_OUTPUT_DIR}
OUTPUT_VARIABLE ARG_VERSION
)
endif()

set(nupkg_path ${ARG_OUTPUT_DIR}/${ARG_ID}.${ARG_VERSION}/${ARG_ID}.${ARG_VERSION}.nupkg)

if(NOT EXISTS ${nupkg_path})
message(STATUS "NuGet: adding package ${ARG_ID}.${ARG_VERSION}")

EnsureNugetExists(${nuget_exe_path})

set(retry_count 0)
set(max_retries 10)
set(retry_delay 10)
set(result 1)

# Run NuGet CLI to download the package.
while(NOT ${result} STREQUAL "0" AND ${retry_count} LESS ${max_retries})
message(STATUS "'${nuget_exe_path}' install '${ARG_ID}' -Version '${ARG_VERSION}' -Source '${ARG_SOURCE}' -OutputDirectory '${ARG_OUTPUT_DIR}' -DependencyVersion Ignore -Verbosity quiet")
execute_process(
COMMAND
${nuget_exe_path}
install ${ARG_ID}
-Version ${ARG_VERSION}
-Source ${ARG_SOURCE}
-OutputDirectory ${ARG_OUTPUT_DIR}
-DependencyVersion Ignore
-Verbosity quiet
RESULT_VARIABLE result
)
if(NOT ${result} STREQUAL "0")
math(EXPR retry_count "${retry_count} + 1")

message(STATUS "Nuget failed: '${result}'. Retrying in ${retry_delay} seconds...")
execute_process(
COMMAND
${CMAKE_COMMAND} -E sleep ${retry_delay}
)
endif()
endwhile()

if(NOT ${result} STREQUAL "0")
message(FATAL_ERROR "NuGet failed: '${result}' Package '${ARG_NAME}' (${ARG_ID}.${ARG_VERSION})")
endif()
endif()

# Set output variable. The NAME parameter is optional: if it's not set then the package ID is used as the
# name. The reason for having a separate NAME is for packages whose IDs change (e.g. GDK) so that callers
# can use a fixed name in dependents. Example, targets can reference gdk_SOURCE_DIR with the snippet below
# instead of having to reference Microsoft.GDK.PC.230300_SOURCE_DIR.
#
# FetchNuGetPackage(
# NAME gdk
# ID Microsoft.GDK.PC.220300
# VERSION 10.0.22621.3049
# )
set(${ARG_NAME}_SOURCE_DIR ${ARG_OUTPUT_DIR}/${ARG_ID}.${ARG_VERSION} PARENT_SCOPE)
endfunction()

# Begin the 'main' logic of this file. Previous code is all defintions.
message("USE_WARP_FROM_NUGET: ${USE_WARP_FROM_NUGET}")
if(${USE_WARP_FROM_NUGET} STREQUAL "LATEST_RELEASE" OR ${USE_WARP_FROM_NUGET} STREQUAL "LATEST_PREVIEW")

message("Fetching warp from nuget")

FetchNuGetPackage(ID Microsoft.Direct3D.WARP OUTPUT_DIR ${BINARY_DIR}/temp RELEASE_TYPE ${USE_WARP_FROM_NUGET})

if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
set(ARCH "x64")
endif()
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "X86")
set(ARCH "win32")
endif()
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "ARM64")
set(ARCH "arm64")
endif()

set(WARP_SOURCE_PATH "${Microsoft.Direct3D.WARP_SOURCE_DIR}/build/native/bin/${ARCH}")
set(WARP_DEST_PATH "${BINARY_DIR}/${BUILD_TYPE}/bin/")
message("Copying d3d10warp.dll and d3d10warp.pdb \n"
" from: ${WARP_SOURCE_PATH}\n"
" to: ${WARP_DEST_PATH}")
file(COPY "${WARP_SOURCE_PATH}/d3d10warp.dll"
DESTINATION "${WARP_DEST_PATH}")
file(COPY "${WARP_SOURCE_PATH}/d3d10warp.pdb"
DESTINATION "${WARP_DEST_PATH}")
endif()
9 changes: 6 additions & 3 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ The included licenses apply to the following files:

Place release notes for the upcoming release below this line and remove this line upon naming this release.

- The incomplete WaveMatrix implementation has been removed.
- DXIL Validator Hash is open sourced.
- DXIL container validation for PSV0 part allows any content ordering inside string and semantic index tables.
### Version 1.8.2502

- The incomplete WaveMatrix implementation has been removed. [#6807](https://github.com/microsoft/DirectXShaderCompiler/pull/6807)
- DXIL Validator Hash is open sourced. [#6846](https://github.com/microsoft/DirectXShaderCompiler/pull/6846)
- DXIL container validation for PSV0 part allows any content ordering inside string and semantic index tables. [#6859](https://github.com/microsoft/DirectXShaderCompiler/pull/6859)
- The and() and or() intrinsics will now accept non-integer parameters by casting them to bools. [#7060](https://github.com/microsoft/DirectXShaderCompiler/pull/7060)

### Version 1.8.2407

Expand Down
2 changes: 1 addition & 1 deletion docs/SPIR-V.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4145,7 +4145,7 @@ GL_EXT_spirv_intrinsics is an extension of GLSL that allows users to embed
arbitrary SPIR-V instructions in the GLSL code similar to the concept of
inline assembly in the C code. We support the HLSL version of
GL_EXT_spirv_intrinsics. See
`wiki <https://github.com/microsoft/DirectXShaderCompiler/wiki/GL_EXT_spirv_intrinsics-for-SPIR-V-code-gen>`_
`wiki <https://github.com/microsoft/DirectXShaderCompiler/wiki/Inline-SPIR%E2%80%90V>`_
for the details.

Supported Command-line Options
Expand Down
2 changes: 1 addition & 1 deletion include/dxc/DXIL/DxilConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace DXIL {
const unsigned kDxilMajor = 1;
/* <py::lines('VALRULE-TEXT')>hctdb_instrhelp.get_dxil_version_minor()</py>*/
// VALRULE-TEXT:BEGIN
const unsigned kDxilMinor = 8;
const unsigned kDxilMinor = 9;
// VALRULE-TEXT:END

inline unsigned MakeDxilVersion(unsigned DxilMajor, unsigned DxilMinor) {
Expand Down
18 changes: 15 additions & 3 deletions include/dxc/DXIL/DxilShaderModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,24 @@ class ShaderModel {
public:
using Kind = DXIL::ShaderKind;

// Major/Minor version of highest shader model
// Major/Minor version of highest recognized shader model
// clang-format off
// Python lines need to be not formatted.
/* <py::lines('VALRULE-TEXT')>hctdb_instrhelp.get_highest_shader_model()</py>*/
// clang-format on
// VALRULE-TEXT:BEGIN
static const unsigned kHighestMajor = 6;
static const unsigned kHighestMinor = 8;
static const unsigned kHighestMinor = 9;
// VALRULE-TEXT:END

// Major/Minor version of highest released shader model
/* <py::lines('VALRULE-TEXT')>hctdb_instrhelp.get_highest_released_shader_model()</py>*/
// clang-format on
// VALRULE-TEXT:BEGIN
static const unsigned kHighestReleasedMajor = 6;
static const unsigned kHighestReleasedMinor = 8;
// VALRULE-TEXT:END

static const unsigned kOfflineMinor = 0xF;

bool IsPS() const { return m_Kind == Kind::Pixel; }
Expand Down Expand Up @@ -74,6 +83,7 @@ class ShaderModel {
bool IsSM66Plus() const { return IsSMAtLeast(6, 6); }
bool IsSM67Plus() const { return IsSMAtLeast(6, 7); }
bool IsSM68Plus() const { return IsSMAtLeast(6, 8); }
bool IsSM69Plus() const { return IsSMAtLeast(6, 9); }
// VALRULE-TEXT:END
const char *GetName() const { return m_pszName; }
const char *GetKindName() const;
Expand All @@ -85,6 +95,8 @@ class ShaderModel {
static const ShaderModel *Get(Kind Kind, unsigned Major, unsigned Minor);
static const ShaderModel *GetByName(llvm::StringRef Name);
static const char *GetKindName(Kind kind);
static bool IsPreReleaseShaderModel(int Major, int Minor);
static Kind GetKindFromName(llvm::StringRef Name);
static DXIL::ShaderKind KindFromFullName(llvm::StringRef Name);
static const llvm::StringRef FullNameFromKind(DXIL::ShaderKind sk);
static const char *GetNodeLaunchTypeName(DXIL::NodeLaunchType launchTy);
Expand Down Expand Up @@ -121,7 +133,7 @@ class ShaderModel {
bool m_bTypedUavs, unsigned m_UAVRegsLim);
/* <py::lines('VALRULE-TEXT')>hctdb_instrhelp.get_num_shader_models()</py>*/
// VALRULE-TEXT:BEGIN
static const unsigned kNumShaderModels = 92;
static const unsigned kNumShaderModels = 101;
// VALRULE-TEXT:END
static const ShaderModel ms_ShaderModels[kNumShaderModels];

Expand Down
Loading
Loading