Skip to content

Commit

Permalink
Merge pull request #11 from jkwak-work/merge/update
Browse files Browse the repository at this point in the history
Sync up to [KhronosGroup/SPIRV-Tools](https://github.com/KhronosGroup/SPIRV-Tools.git)
The ToT commitID is
```
commit 4d2f0b4 (HEAD -> merge/update, origin/merge/update)
Author: Cassandra Beckley <[email protected]>
Date:   Thu Dec 5 07:17:32 2024 -0800

    Prepare release (KhronosGroup#5905)

    This is the second release candidate for v2024.4. Includes new commits since September, including Vulkan 1.4 support.
```
  • Loading branch information
jkwak-work authored Dec 10, 2024
2 parents c4fb839 + 4d2f0b4 commit ea6d815
Show file tree
Hide file tree
Showing 92 changed files with 4,522 additions and 1,553 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/autoroll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Checkout the depot tools they are needed by roll_deps.sh
- name: Checkout depot tools
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,41 @@ jobs:
timeout-minutes: 120
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
os: [ubuntu-latest, windows-2019]

runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: '0'
- name: Download dependencies
run: python3 utils/git-sync-deps
- name: Mount Bazel cache
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/.bazel/cache
key: bazel-cache-${{ runner.os }}
- name: Build All
run: bazel --output_user_root=~/.bazel/cache build //...
- name: Test All
run: bazel --output_user_root=~/.bazel/cache test //...

# iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed
# The steps are unfortunately duplicated because github actions requires 2 jobs for a dependency
build-macos:
needs: build
timeout-minutes: 120
runs-on: macos-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: '0'
- name: Download dependencies
run: python3 utils/git-sync-deps
- name: Mount Bazel cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ~/.bazel/cache
key: bazel-cache-${{ runner.os }}
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ name: iOS
permissions:
contents: read

on: [push, pull_request, workflow_dispatch]
on:
workflow_run:
# iOS is 10x expensive to run on GitHub machines, so only run if we know something else passed
workflows: ["Wasm Build"]
types:
- completed

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest ]
runs-on: macos-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: lukka/get-cmake@b516803a3c5fac40e2e922349d15cdebdba01e60 # v3.30.5
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: lukka/get-cmake@71b7adfe2603f48bb9ed50d2b01a72499ae94885 # v3.31.0
- name: Download dependencies
run: python3 utils/git-sync-deps
# NOTE: The MacOS SDK ships universal binaries. CI should reflect this.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
prepare-release-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Prepare CHANGELOG for version
run: |
python utils/generate_changelog.py CHANGES "${{ github.ref_name }}" VERSION_CHANGELOG
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

Expand All @@ -48,6 +48,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: '0'
- name: Build web
Expand Down
1 change: 1 addition & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ SPVTOOLS_SRC_FILES := \
source/val/validate_ray_tracing_reorder.cpp \
source/val/validate_scopes.cpp \
source/val/validate_small_type_uses.cpp \
source/val/validate_tensor_layout.cpp \
source/val/validate_type.cpp

SPVTOOLS_OPT_SRC_FILES := \
Expand Down
2 changes: 2 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ cc_library(
cc_library(
name = "tools_io",
hdrs = ["tools/io.h"],
srcs = ["tools/io.cpp"],
copts = COMMON_COPTS,
)

Expand Down Expand Up @@ -446,6 +447,7 @@ cc_library(
"tools_util",
":spirv_tools_internal",
":test_lib",
":tools_io",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand Down
20 changes: 20 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ static_library("spvtools_val") {
"source/val/validate_scopes.cpp",
"source/val/validate_scopes.h",
"source/val/validate_small_type_uses.cpp",
"source/val/validate_tensor_layout.cpp",
"source/val/validate_type.cpp",
"source/val/validation_state.cpp",
"source/val/validation_state.h",
Expand Down Expand Up @@ -1376,6 +1377,7 @@ if (build_with_chromium && spvtools_build_executables) {
"test/fix_word_test.cpp",
"test/generator_magic_number_test.cpp",
"test/hex_float_test.cpp",
"test/hex_to_text_test.cpp",
"test/immediate_int_test.cpp",
"test/libspirv_macros_test.cpp",
"test/name_mapper_test.cpp",
Expand Down Expand Up @@ -1423,6 +1425,7 @@ if (build_with_chromium && spvtools_build_executables) {
":spvtools_language_header_cldebuginfo100",
":spvtools_language_header_debuginfo",
":spvtools_language_header_vkdebuginfo100",
":spvtools_tools_io",
":spvtools_val",
"//testing/gmock",
"//testing/gtest",
Expand Down Expand Up @@ -1465,13 +1468,23 @@ source_set("spvtools_tools_util") {
configs += [ ":spvtools_internal_config" ]
}

source_set("spvtools_tools_io") {
sources = [
"tools/io.cpp",
"tools/io.h",
]
deps = [ ":spvtools_headers" ]
configs += [ ":spvtools_internal_config" ]
}

if (spvtools_build_executables) {
executable("spirv-as") {
sources = [ "tools/as/as.cpp" ]
deps = [
":spvtools",
":spvtools_software_version",
":spvtools_tools_util",
":spvtools_tools_io",
]
configs += [ ":spvtools_internal_config" ]
}
Expand All @@ -1482,6 +1495,7 @@ if (spvtools_build_executables) {
":spvtools",
":spvtools_software_version",
":spvtools_tools_util",
":spvtools_tools_io",
]
configs += [ ":spvtools_internal_config" ]
}
Expand All @@ -1492,6 +1506,7 @@ if (spvtools_build_executables) {
":spvtools",
":spvtools_software_version",
":spvtools_tools_util",
":spvtools_tools_io",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
Expand All @@ -1507,6 +1522,7 @@ if (spvtools_build_executables) {
":spvtools",
":spvtools_software_version",
":spvtools_tools_util",
":spvtools_tools_io",
]
configs += [ ":spvtools_internal_config" ]
}
Expand All @@ -1518,6 +1534,7 @@ if (spvtools_build_executables) {
":spvtools_opt",
":spvtools_software_version",
":spvtools_tools_util",
":spvtools_tools_io",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
Expand All @@ -1531,6 +1548,7 @@ if (spvtools_build_executables) {
":spvtools_opt",
":spvtools_software_version",
":spvtools_tools_util",
":spvtools_tools_io",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
Expand All @@ -1551,6 +1569,7 @@ if (!is_ios && !spirv_is_winuwp && build_with_chromium && spvtools_build_executa
":spvtools_reduce",
":spvtools_software_version",
":spvtools_tools_util",
":spvtools_tools_io",
":spvtools_val",
"//third_party/protobuf:protobuf_full",
]
Expand All @@ -1570,6 +1589,7 @@ if (!is_ios && !spirv_is_winuwp && spvtools_build_executables) {
":spvtools_reduce",
":spvtools_software_version",
":spvtools_tools_util",
":spvtools_tools_io",
":spvtools_val",
]
configs += [ ":spvtools_internal_config" ]
Expand Down
7 changes: 6 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
Revision history for SPIRV-Tools

v2024.4 2024-09-19
v2024.4 2024-12-04
- General
- Add FPEncoding operand type. (#5726)
- Support SPV_KHR_untyped_pointers (#5736)
- add support for SPV_INTEL_global_variable_host_access (#5786)
- Add support for SPV_KHR_compute_shader_derivative (#5817)
- Accept hex representation as binary input (#5870)
- Vulkan 1.4 support (#5899)
- Optimizer
- Add knowledge of cooperative matrices (#5720)
- Add struct-packing pass and unit test. (#5778)
- Validator
- Validate presence of Stride operand to OpCooperativeMatrix{Load,Store}KHR (#5777)
- Update sampled image validation (#5789)
- Disallow stores according to VUID 06924 (#5368)
- Add validation for SPV_NV_tensor_addressing and SPV_NV_cooperative_matrix2 (#5865)
- Linker
- allow linking functions with different pointer arguments (#5534)

Expand Down
24 changes: 0 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,13 @@ option(ENABLE_RTTI "Enables RTTI" OFF)
option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON)

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
add_definitions(-DSPIRV_LINUX)
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
add_definitions(-DSPIRV_EMSCRIPTEN)
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
add_definitions(-DSPIRV_WINDOWS)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
add_definitions(-DSPIRV_WINDOWS)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
add_definitions(-DSPIRV_MAC)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS")
add_definitions(-DSPIRV_IOS)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "tvOS")
add_definitions(-DSPIRV_TVOS)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "visionOS")
add_definitions(-DSPIRV_VISIONOS)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
add_definitions(-DSPIRV_ANDROID)
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
add_definitions(-DSPIRV_FREEBSD)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
add_definitions(-DSPIRV_OPENBSD)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
add_definitions(-DSPIRV_FUCHSIA)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
add_definitions(-DSPIRV_GNU)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "QNX")
add_definitions(-DSPIRV_QNX)
else()
message(FATAL_ERROR "Your platform '${CMAKE_SYSTEM_NAME}' is not supported!")
endif()

if (${SPIRV_TIMER_ENABLED})
Expand Down
6 changes: 3 additions & 3 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ use_relative_paths = True
vars = {
'github': 'https://github.com',

'abseil_revision': '40cab244558f225cadcb943f84c5209f7ce876b1',
'abseil_revision': '7316f5616bad0a794b2a75901cc20b0099718085',

'effcee_revision': '2c97e5689ed8d7ab6ae5820f884f03a601ae124b',

'googletest_revision': '71815bbf7de6e10c11821d654a2fae2cf42de0f7',
'googletest_revision': '35d0c365609296fa4730d62057c487e3cfa030ff',

# Use protobufs before they gained the dependency on abseil
'protobuf_revision': 'v21.12',

're2_revision': '6dcd83d60f7944926bfd308cc13979fc53dd69ca',

'spirv_headers_revision': '50bc4debdc3eec5045edbeb8ce164090e29b91f3',
'spirv_headers_revision': '3f17b2af6784bfa2c5aa5dbb8e0e74a607dd8b3b',
}

deps = {
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ further notice.
* Assembler only does basic syntax checking. No cross validation of
IDs or types is performed, except to check literal arguments to
`OpConstant`, `OpSpecConstant`, and `OpSwitch`.
* Where tools expect binary input, a hex stream may be provided instead. See
`spirv-dis --help`.

See [`docs/syntax.md`](docs/syntax.md) for the assembly language syntax.

Expand Down
2 changes: 1 addition & 1 deletion external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (IS_DIRECTORY ${SPIRV_HEADER_DIR})
endif()
else()
message(FATAL_ERROR
"SPIRV-Headers was not found - please checkout a copy under external/.")
"SPIRV-Headers was not found - please checkout a copy at external/spirv-headers.")
endif()

if (NOT ${SPIRV_SKIP_TESTS})
Expand Down
8 changes: 8 additions & 0 deletions include/spirv-tools/libspirv.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ typedef enum spv_operand_type_t {
SPV_OPERAND_TYPE_RAW_ACCESS_CHAIN_OPERANDS,
// Optional enum type from SPV_NV_raw_access_chains
SPV_OPERAND_TYPE_OPTIONAL_RAW_ACCESS_CHAIN_OPERANDS,
// Enum type from SPV_NV_tensor_addressing
SPV_OPERAND_TYPE_TENSOR_CLAMP_MODE,
// Enum type from SPV_NV_cooperative_matrix2
SPV_OPERAND_TYPE_COOPERATIVE_MATRIX_REDUCE,
// Enum type from SPV_NV_cooperative_matrix2
SPV_OPERAND_TYPE_TENSOR_ADDRESSING_OPERANDS,

// This is a sentinel value, and does not represent an operand type.
// It should come last.
Expand Down Expand Up @@ -534,6 +540,7 @@ SPIRV_TOOLS_EXPORT const char* spvSoftwareVersionDetailsString(void);
// SPV_ENV_VULKAN_1_1_SPIRV_1_4 -> SPIR-V 1.4
// SPV_ENV_VULKAN_1_2 -> SPIR-V 1.5
// SPV_ENV_VULKAN_1_3 -> SPIR-V 1.6
// SPV_ENV_VULKAN_1_4 -> SPIR-V 1.6
// Consult the description of API entry points for specific rules.
typedef enum {
SPV_ENV_UNIVERSAL_1_0, // SPIR-V 1.0 latest revision, no other restrictions.
Expand Down Expand Up @@ -571,6 +578,7 @@ typedef enum {

SPV_ENV_UNIVERSAL_1_6, // SPIR-V 1.6 latest revision, no other restrictions.
SPV_ENV_VULKAN_1_3, // Vulkan 1.3 latest revision.
SPV_ENV_VULKAN_1_4, // Vulkan 1.4 latest revision.

SPV_ENV_MAX // Keep this as the last enum value.
} spv_target_env;
Expand Down
1 change: 1 addition & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ set(SPIRV_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_ray_tracing_reorder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_scopes.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_small_type_uses.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_tensor_layout.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_type.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/decoration.h
${CMAKE_CURRENT_SOURCE_DIR}/val/basic_block.cpp
Expand Down
Loading

0 comments on commit ea6d815

Please sign in to comment.