Skip to content

Commit

Permalink
Merge pull request #7 from shader-slang/kai/merge_upstream_main
Browse files Browse the repository at this point in the history
Merge upstream/main
  • Loading branch information
csyonghe authored Apr 9, 2024
2 parents f0cc85e + 5b9002a commit 443486f
Show file tree
Hide file tree
Showing 116 changed files with 7,922 additions and 1,044 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Enable Bzlmod for every Bazel command
common --enable_bzlmod

build --enable_platform_specific_config
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0
7.0.2
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

# Checkout the depot tools they are needed by roll_deps.sh
- name: Checkout depot tools
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: '0'
- name: Download dependencies
run: python3 utils/git-sync-deps
- name: Mount Bazel cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.bazel/cache
key: bazel-cache-${{ runner.os }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
matrix:
os: [ macos-12, macos-13 ]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: lukka/get-cmake@4865386b66955d11be0abf8c112d0230023e742a # v3.27.9
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: lukka/get-cmake@b111a57714ab6e67a65d3f857b72b148554c4262 # v3.29.1
- name: Download dependencies
run: python3 utils/git-sync-deps
# NOTE: The MacOS SDK ships universal binaries. CI should reflect this.
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ on:
push:
tags:
- 'v[0-9]+.[0-9]+'
- 'vulkan-sdk-[0-9]+.[0-9]+.[0-9]+.[0-9]+'
- '!v[0-9]+.[0-9]+.rc*'

jobs:
prepare-release-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Prepare CHANGELOG for version
run: |
python utils/generate_changelog.py CHANGES "${{ github.ref_name }}" VERSION_CHANGELOG
Expand Down
6 changes: 3 additions & 3 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
persist-credentials: false

Expand All @@ -40,14 +40,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2.22.8
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: '0'
- name: Build web
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bazel-out
bazel-spirv-tools
bazel-SPIRV-Tools
bazel-testlogs
MODULE.bazel.lock

# Vim
[._]*.s[a-w][a-z]
Expand Down
2 changes: 2 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/loop_utils.cpp \
source/opt/mem_pass.cpp \
source/opt/merge_return_pass.cpp \
source/opt/modify_maximal_reconvergence.cpp \
source/opt/module.cpp \
source/opt/optimizer.cpp \
source/opt/pass.cpp \
Expand Down Expand Up @@ -288,6 +289,7 @@ $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),spv-amd-shader-bal
$(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),spv-amd-shader-explicit-vertex-parameter,""))
$(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),spv-amd-shader-trinary-minmax,""))
$(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),nonsemantic.clspvreflection,""))
$(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),nonsemantic.vkspreflection,""))

define gen_spvtools_enum_string_mapping
$(call generate-file-dir,$(1)/extension_enum.inc.inc)
Expand Down
59 changes: 31 additions & 28 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ generate_vendor_tables(extension = "debuginfo")

generate_vendor_tables(extension = "nonsemantic.clspvreflection")

generate_vendor_tables(extension = "nonsemantic.vkspreflection")

generate_vendor_tables(
extension = "opencl.debuginfo.100",
operand_kind_prefix = "CLDEBUG100_",
Expand Down Expand Up @@ -146,6 +148,7 @@ cc_library(
":gen_opencl_tables_unified1",
":gen_vendor_tables_debuginfo",
":gen_vendor_tables_nonsemantic_clspvreflection",
":gen_vendor_tables_nonsemantic_vkspreflection",
":gen_vendor_tables_nonsemantic_shader_debuginfo_100",
":gen_vendor_tables_opencl_debuginfo_100",
":gen_vendor_tables_spv_amd_gcn_shader",
Expand Down Expand Up @@ -426,7 +429,7 @@ cc_library(
copts = TEST_COPTS,
deps = [
":spirv_tools_internal",
"@com_google_googletest//:gtest",
"@googletest//:gtest",
],
)

Expand All @@ -446,8 +449,8 @@ cc_library(
"tools_util",
":spirv_tools_internal",
":test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
[
Expand All @@ -467,8 +470,8 @@ cc_test(
linkstatic = 1,
deps = [
":spirv_tools_opt_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
"@spirv_headers//:spirv_cpp11_headers",
],
)
Expand All @@ -481,8 +484,8 @@ cc_test(
linkstatic = 1,
deps = [
":spirv_tools_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)

Expand All @@ -508,8 +511,8 @@ cc_library(
linkstatic = 1,
deps = [
":link_test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/link/*_test.cpp"],
Expand All @@ -525,8 +528,8 @@ cc_library(
":spirv_tools",
":spirv_tools_lint_internal",
":spirv_tools_opt_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/lint/*_test.cpp"],
Expand All @@ -550,7 +553,7 @@ cc_library(
":spirv_tools_internal",
":spirv_tools_opt_internal",
"@com_google_effcee//:effcee",
"@com_google_googletest//:gtest",
"@googletest//:gtest",
],
)

Expand All @@ -566,8 +569,8 @@ cc_library(
":spirv_tools_opt_internal",
":test_lib",
"@com_google_effcee//:effcee",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(["test/opt/*_test.cpp"])]

Expand All @@ -580,8 +583,8 @@ cc_library(
deps = [
":opt_test_lib",
":spirv_tools_opt_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/opt/dominator_tree/*.cpp"],
Expand All @@ -599,8 +602,8 @@ cc_library(
":spirv_tools",
":spirv_tools_opt_internal",
"@com_google_effcee//:effcee",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/opt/loop_optimizations/*.cpp"],
Expand All @@ -621,7 +624,7 @@ cc_library(
":spirv_tools_reduce",
":test_lib",
":tools_io",
"@com_google_googletest//:gtest",
"@googletest//:gtest",
],
)

Expand All @@ -636,7 +639,7 @@ cc_library(
":spirv_tools_internal",
":spirv_tools_opt_internal",
":spirv_tools_reduce",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest_main",
],
) for f in glob(["test/reduce/*_test.cpp"])]

Expand All @@ -648,8 +651,8 @@ cc_library(
linkstatic = 1,
deps = [
":spirv_tools_internal",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(["test/util/*_test.cpp"])]

Expand Down Expand Up @@ -680,8 +683,8 @@ cc_library(
":spirv_tools_internal",
":test_lib",
":val_test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
) for f in glob(
["test/val/val_*_test.cpp"],
Expand All @@ -702,8 +705,8 @@ cc_test(
":spirv_tools_internal",
":test_lib",
":val_test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)

Expand All @@ -719,7 +722,7 @@ cc_test(
deps = [
":test_lib",
":val_test_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)
6 changes: 6 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ spvtools_vendor_tables = [
"nonsemantic.clspvreflection",
"...nil...",
],
[
"nonsemantic.vkspreflection",
"...nil...",
],
[
"nonsemantic.shader.debuginfo.100",
"SHDEBUG100_",
Expand Down Expand Up @@ -737,6 +741,8 @@ static_library("spvtools_opt") {
"source/opt/mem_pass.h",
"source/opt/merge_return_pass.cpp",
"source/opt/merge_return_pass.h",
"source/opt/modify_maximal_reconvergence.cpp",
"source/opt/modify_maximal_reconvergence.h",
"source/opt/module.cpp",
"source/opt/module.h",
"source/opt/null_pass.h",
Expand Down
32 changes: 32 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
Revision history for SPIRV-Tools

v2024.1 2024-03-06
- General
- Add tooling support for SPV_KHR_maximal_reconvergence (#5542)
- Add support for SPV_KHR_float_controls2 (#5543)
- SPV_KHR_quad_control (#5547)
- Fold 64-bit int operations (#5561)
- update image enum tests to remove Kernel capability (#5562)
- Support operand kind for SPV_INTEL_maximum_registers (#5580)
- SPV_NV_shader_atomic_fp16_vector (#5581)
- Support for SPV_QCOM_image_processing2 (#5582)
- Fix access chain struct checks (#5592)
- Optimizer
- opt: add Int16 and Float16 to capability trim pass (#5519)
- Add preserver-interface option to spirv-opt (#5524)
- spirv-opt: Fix OpCompositeExtract relaxation with struct operands (#5536)
- opt: Add VulkanMemoryModelDeviceScope to trim (#5544)
- opt: Add TrimCapabilities pass to spirv-opt tool (#5545)
- Add modify-maximal-reconvergence to spirv-opt help (#5546)
- opt: add SPV_EXT_mesh_shader to opt allowlist (#5551)
- opt: Add OpEntryPoint to DescriptorScalarReplacement pass (#5553)
- opt: prevent meld to merge block with MaximalReconvergence (#5557)
- [OPT] Use new instruction folder for for all opcodes in spec consti folding (#5569)
- [OPT] Identify arrays with unknown length in copy prop arrays (#5570)
- [OPT] Add removed unused interface var pass to legalization passes (#5579)
- Validator
- spirv-val: Re-enable OpControlBarrier VU (#5527)
- spirv-val: Add Mesh Primitive Built-In validaiton (#5529)
- spirv-val: Validate PhysicalStorageBuffer Stage Interface (#5539)
- spirv-val: Multiple interface var with same SC (#5528)
- spirv-val: Revert Validate PhysicalStorageBuffer Stage Interface (#5575)
- spirv-val: Make Constant evaluation consistent (#5587)

v2023.6 2023-12-18
- General
- update_build_version.py produce deterministic header. (#5426)
Expand Down
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ set(SPIRV_SHARED_LIBRARIES "-lSPIRV-Tools-shared")

# Build pkg-config file
# Use a first-class target so it's regenerated when relevant files are updated.
add_custom_target(spirv-tools-pkg-config ALL
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc
COMMAND ${CMAKE_COMMAND}
-DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES
-DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools.pc.in
Expand All @@ -397,8 +398,9 @@ add_custom_target(spirv-tools-pkg-config ALL
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
-DSPIRV_LIBRARIES=${SPIRV_LIBRARIES}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake
DEPENDS "CHANGES" "cmake/SPIRV-Tools.pc.in" "cmake/write_pkg_config.cmake")
add_custom_target(spirv-tools-shared-pkg-config ALL
DEPENDS "CHANGES" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools.pc.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake")
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc
COMMAND ${CMAKE_COMMAND}
-DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES
-DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools-shared.pc.in
Expand All @@ -408,7 +410,10 @@ add_custom_target(spirv-tools-shared-pkg-config ALL
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
-DSPIRV_SHARED_LIBRARIES=${SPIRV_SHARED_LIBRARIES}
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake
DEPENDS "CHANGES" "cmake/SPIRV-Tools-shared.pc.in" "cmake/write_pkg_config.cmake")
DEPENDS "CHANGES" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools-shared.pc.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake")
add_custom_target(spirv-tools-pkg-config
ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc)

# Install pkg-config file
if (ENABLE_SPIRV_TOOLS_INSTALL)
Expand Down
Loading

0 comments on commit 443486f

Please sign in to comment.