Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
03732bf
cmake: Remove redundant -std=c++11 flag
dneto0 Jul 25, 2023
2f512f4
ndk-build: Require C++17 (#1373)
dneto0 Sep 27, 2023
00defdd
Roll deps & fix tests (#1372)
s-perron Sep 27, 2023
e52be15
Update DEPS
dneto0 Oct 13, 2023
b9b557a
Make Shaderc v2023.7-rc1 release candidate
dneto0 Oct 13, 2023
3882b16
Shaderc v2303.7 release
dneto0 Oct 13, 2023
0d6f72f
Start Shaderc v2023.8-dev
dneto0 Oct 13, 2023
9b5ad16
Use TARGET_OBJECTS to replace archive acrobatics
kroppt Sep 7, 2023
2d4950d
Expose setting relaxed Vulkan rules from glslang
dnfield Nov 22, 2023
37e2553
initialize no matter what
dnfield Nov 22, 2023
40bced4
update Glslang and remove references to libs it has removed (#1384)
dneto0 Nov 30, 2023
aaa44b5
Fix for cmake policy CMP0148 (#1382)
stuart6854 Dec 1, 2023
09cfabc
Update deps
dneto0 Jan 3, 2024
e6edd6d
Finalize Shaderc v2023.8
dneto0 Jan 3, 2024
ae12287
Start Shaderc v2024.0-dev
dneto0 Jan 3, 2024
587ad80
Utility scripts use python3 explicitly (#1389)
dneto0 Jan 23, 2024
9bd299b
Update DEPS (#1390)
dneto0 Jan 23, 2024
65fa097
Update DEPS (#1395)
dneto0 Feb 12, 2024
f50d674
Update DEPS (#1402)
dneto0 Mar 5, 2024
4f37872
Fix Python (#1401)
moritz-h Mar 8, 2024
87223cc
Update DEPS
dneto0 Mar 8, 2024
d792558
Finalize Shaderc v2024.0
dneto0 Mar 8, 2024
9a658e2
Start Shaderc v2024.1
dneto0 Mar 8, 2024
e6187c7
Update DEPS (#1409)
dneto0 Apr 15, 2024
c789753
Propagate test/install options to Glslang. Update Glslang (#1397)
dneto0 Apr 16, 2024
4994385
Update DEPS
dneto0 Apr 30, 2024
47a9387
Finalize Shaderc v2024.1
dneto0 Apr 30, 2024
f59f0d1
Start Shaderc v2024.2-dev
dneto0 Apr 30, 2024
85e51d8
Fix comment typo in shaderc.hpp
TriceHelix May 20, 2024
db94deb
Update DEPS (#1417)
alan-baker Jun 3, 2024
d93a300
Update dependencies
dneto0 Jun 6, 2024
e3b6ed3
Update dependencies, except Glslang
dneto0 Jun 17, 2024
70552f5
Remove VS2017 from README and download links
dneto0 Jun 17, 2024
b1001b5
Remove kokoro scripts for VS2017
dneto0 Jun 17, 2024
2fc4823
Finalize Shaderc v2024.2, update dependencies
dneto0 Jun 21, 2024
3ac03b8
Finalize Shaderc v2024.2
dneto0 Jun 21, 2024
d875f30
Start Shaderc v2024.3-dev
dneto0 Jun 21, 2024
0f62fb2
Fix expectations: Glslang orders decorations on an object by enum
dneto0 Jul 4, 2024
237ac6f
Fix Python string escapes
dneto0 Jul 4, 2024
5d0f6ed
kokoro: use Python 3.12 on Linux
dneto0 Jul 5, 2024
6d28483
update DEPS: glslang, spirv-tools, spirv-headers (#1440)
dneto0 Aug 9, 2024
7bab426
Update deps, adapt ndk-build glsang dpeendencies
dneto0 Sep 11, 2024
3871c0a
Don't use friendly names for SPIR-V validation errors (#1442)
dneto0 Sep 16, 2024
9530b88
Update deps: glslang, spirv-tools
dneto0 Sep 20, 2024
eb47963
Update DEPS: Glslang
dneto0 Sep 23, 2024
ff84893
Finalize Shaderc v2024.3
dneto0 Sep 23, 2024
d2564ba
Start Shader v2024.4
dneto0 Sep 23, 2024
f77c871
Update dependencies to top of tree
dneto0 Oct 8, 2024
740fd36
Update SPIRV-Tools, SPIRV-Headers
dneto0 Oct 9, 2024
ddac450
Update dependencies: SPV_NV_cooperative_matrix2, SPV_NV_tensor_addres…
dneto0 Oct 24, 2024
8c4d729
Update glslang dep to include GLSL_NV_cooperative_matrix2 (#1451)
jeffbolznv Nov 6, 2024
ffd3be5
update dependencies
dneto0 Nov 25, 2024
082a73b
Update glslang, spirv-tools dependencies
dneto0 Nov 27, 2024
8d9eb88
Add Vulkan 1.4 support
dneto0 Dec 2, 2024
373ba6b
Update dependencies
dneto0 Dec 6, 2024
caa54d9
Finalize Shaderc v2024.4
dneto0 Dec 6, 2024
0faaad2
Start Shaderc v2024.5 development
dneto0 Dec 6, 2024
65a9e40
Update glslang, SPIRV-Tools
dneto0 Dec 12, 2024
e639dbc
kokoro: use CMake 3.31.2
dneto0 Dec 13, 2024
79d51f1
kokoro: windows: use Python 3.12
dneto0 Dec 17, 2024
690d259
Update cmake_minimum_required to 3.22.1
dneto0 Dec 23, 2024
76c3e73
Update effcee, spirv-tools
dneto0 Jan 7, 2025
90f2bda
kokoro: add VS2022 scripts
dneto0 Jan 9, 2025
b81a5e7
kokoro: delete VS 2019 debug build
dneto0 Jan 10, 2025
3158c54
Update spirv-tools, spirv-headers, Glslang
dneto0 Jan 16, 2025
674ed20
kokoro: use gcc 13
dneto0 Jan 23, 2025
9cf1c65
kokoro: use clang 13
dneto0 Jan 23, 2025
f5d626f
kokoro: use ndk-r27c
dneto0 Jan 29, 2025
ab0d3ed
Update dependencies
dneto0 Jan 29, 2025
6c245b0
kokoro: use streamlined license-check image
dneto0 Feb 19, 2025
2e56788
kokoro: linux: use cpp-builder instead of radial-build
dneto0 Feb 22, 2025
f6dee14
Update dependencies
dneto0 Feb 27, 2025
0968768
Finalize Shaderc v2025.1
dneto0 Feb 27, 2025
8be073a
Start Shaderc v2025.2 development
dneto0 Feb 27, 2025
acc976a
update deps
dneto0 Mar 25, 2025
0ab6bf5
Update dependencies
dneto0 Apr 10, 2025
0078f78
update glslang dependency
jeffbolznv Apr 12, 2025
030484b
Update to SPIRV-Tools v2025.2.rc2, SPIRV-Headers
dneto0 Apr 23, 2025
3362e24
Finalize Shaderc v2025.2
dneto0 Apr 23, 2025
a5a8caa
Start Shaderc v2025.3 development
dneto0 Apr 23, 2025
4e25659
Fixed glslc binaries being build even if enable install is off.
Z3DBreaker Jun 2, 2025
b31ef05
Added a way to disable the glsc CLI executable.
Z3DBreaker Jun 2, 2025
3f3d2b0
Fixed the messages being the wrong variable.
Z3DBreaker Jun 4, 2025
81afed4
fix SHADERC_ENABLE_TESTS leaving some tests active
zcorniere Jun 10, 2025
ecc3c48
Update dependencies to top of tree
dneto0 Jun 18, 2025
3cd03b2
Update deps
dneto0 Jun 24, 2025
8c2e602
Finalize Shaderc v2025.3
dneto0 Jun 24, 2025
7839e41
Start Shaderc v2025.4 development
dneto0 Jun 24, 2025
c845638
Update DEPS
dneto0 Jun 25, 2025
91a28dc
Update DEPS
dneto0 Aug 6, 2025
402a16e
Remove support for VS2019
dneto0 Aug 7, 2025
1dd61a4
Update dependencies
dneto0 Sep 4, 2025
3a44d5d
When glslc is not built, don't install or test it
dneto0 Sep 4, 2025
49d6a93
Add -fmax-id-bound flag
s-perron Sep 4, 2025
f4d3445
Update CHANGES with recent history
dneto0 Sep 25, 2025
1513939
Update dependencies
dneto0 Sep 25, 2025
c7e73e8
Finalize Shaderc v2025.4
dneto0 Sep 25, 2025
7374358
Start Shaderc v2025.5-dev
dneto0 Sep 25, 2025
5dcb000
Update deps
dneto0 Nov 12, 2025
fcd74b6
Add linux-headers package to provide missing futex.h
codeandkey Oct 20, 2025
6462349
Update depenendencies
dneto0 Nov 18, 2025
d7db7ea
Update dependencies
dneto0 Nov 27, 2025
c4b0af6
Finalize Shaderc v2025.5
dneto0 Nov 27, 2025
e0a5092
Start v2025.6-dev
dneto0 Nov 27, 2025
d15277d
Update depenendencies
dneto0 Jan 12, 2026
e6e2d2c
Update SPIRV-Tools, glslang
dneto0 Jan 19, 2026
0d7df6e
Update dependencies
dneto0 Jan 21, 2026
5375972
Add missing dates in CHANGES
dneto0 Jan 21, 2026
e5b1ffe
CHANGES file must have a valid version and date
dneto0 Jan 21, 2026
301b4ed
Finalize Shaderc v2026.1
dneto0 Jan 22, 2026
722b6db
Start Shaderc v2026.2-dev
dneto0 Jan 22, 2026
1d234d3
Test GL_EXT_descriptor_heap
dneto0 Jan 23, 2026
8d94c76
Update dependencies
dneto0 Feb 27, 2026
356c5e3
Reorganize kokoro configurations, step 1
dneto0 Mar 6, 2026
9e83db1
kokoro: remove old kokoro scripts and job configs
dneto0 Mar 9, 2026
42c364e
Update dependencies
dneto0 Mar 16, 2026
2eb0a8b
Merge remote-tracking branch 'google/main'
CADIndie Apr 8, 2026
72381d6
Remove second ``void shaderc_compile_options_set_vulkan_rules_relaxed``
CADIndie Apr 8, 2026
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
86 changes: 85 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,8 +1,92 @@
Revision history for Shaderc

v2023.8-dev 2023-10-12
v2026.2-dev 2026-01-22
- Start development

v2026.1 2026-01-23
- Update dependencies:
- Glslang 16.2.0
- SPIRV-Tools v2026.1rc1.
- SPIRV-Headers top of tree
Supports VK_EXT_descriptor_heap and other extensions.
- Require the CHANGES file to have a valid date on its version lines
This avoid the problem of stale version information in the
pkg-config configuration files.

v2025.5 2025-11-27
- Update dependencies

v2025.4 2025-09-25
- Update dependencies
- Add option to set max SPIR-V ID bound.
glslc: -fmax-id-bound
- CMake: Fix some install logic: when glslc is not built,
don't try to install it.
- Remove testing of VS 2019

v2025.3 2025-06-24
- Update dependencies
- CMake updates:
- Actually disable all tests when specified
- Add a way to disable building glslc

v2025.2 2025-04-23
- Update dependencies: Glslang, SPIRV-Tools, SPIRV-Headers
- Supports BFloat16 floating point types

v2025.1 2025-02-27
- Update tools and compilers tested:
- Clang 13
- GCC 13
- VisualStudio 2022
- CMake 3.31.2
- Python 3.12
- NDK r27c
- Skip version numbers to match SPIRV-Tools, to avoid
confusion.

v2024.4 2024-12-06
- Support Vulkan 1.4

v2024.3 2024-09-23
- Update dependencies: Glslang, SPRIV-Tools, SPIRV-Headers
- SPIRV-Tools is at v2024.4.rc1
- This incorporates a SPIRV-Tools fix which was limiting parallelism.
Validator friendly name generation was serializing on a mutex
protecting the locale object.
- During HLSL compilation or any optimizing compile, don't tell the
validator to use "friendly names". This should save time spent in the
initial validation step of the optimization recipe.
- Adapt test golden results to Glslang changes which reorder
decorations by object enum value.
- Fix ndk-build library dependencies: libshaderc_util depends on glslang
- Use Python 3.12 on Linux CI bots
- Fix Python 3.12 warnings for string escapes

v2024.2 2024-06-21
- Update dependencies:
Glslang: top of tree 2024-06-21
SPIRV-Header: top of tree 2024-06-21
SPIRV-Tools: v2024.3.rc1
- Build:
- Remove support for VS2017

v2024.1 2024-04-30
- Update dependencies
- Propagate test/install options to Glslang

v2024.0 2024-03-08
- Update dependencies
- Utilities:
- Use Python3 explicitly in utility scripts

v2023.8 2024-01-03
- API: Expose rlaxed Vulkan rules from glslang
- Update to Glslang 14.0.0
- CMake:
- Comply with CMP0148: Use PythonInterp
- Use TARGET_OBJECTS to simplify creating the shaderc_shared library.

v2023.7 2023-10-12
- Update dependencies
- Finish converting build instructions and flags to always use C++17
Expand Down
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.17.2)
cmake_minimum_required(VERSION 3.22.1)

project(shaderc)
enable_testing()
Expand Down Expand Up @@ -51,6 +51,16 @@ else()
message(STATUS "Configuring Shaderc to avoid building examples.")
endif()

option(SHADERC_SKIP_EXECUTABLES "Skip building executables." ${SHADERC_SKIP_EXECUTABLES})
if(NOT ${SHADERC_SKIP_EXECUTABLES})
set(SHADERC_ENABLE_EXECUTABLES ON)
endif()
if (${SHADERC_ENABLE_EXECUTABLES})
message(STATUS "Configuring Shaderc to build executables.")
else()
message(STATUS "Configuring Shaderc to avoid building executables.")
endif()

option(SHADERC_SKIP_COPYRIGHT_CHECK "Skip copyright check" ${SHADERC_SKIP_COPYRIGHT_CHECK})
if(NOT ${SHADERC_SKIP_COPYRIGHT_CHECK})
set(SHADERC_ENABLE_COPYRIGHT_CHECK ON)
Expand Down Expand Up @@ -99,14 +109,14 @@ endif ()

if (SHADERC_ENABLE_COPYRIGHT_CHECK)
add_custom_target(check-copyright ALL
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/utils/add_copyright.py
${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/utils/add_copyright.py
--check
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Check copyright")
endif()

add_custom_target(add-copyright
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/utils/add_copyright.py
${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/utils/add_copyright.py
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Add copyright")

Expand Down Expand Up @@ -134,7 +144,7 @@ if(${SHADERC_ENABLE_EXAMPLES})
endif()

add_custom_target(build-version
${PYTHON_EXECUTABLE}
${Python_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py
${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc
COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).")
Expand Down
14 changes: 7 additions & 7 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ vars = {
'google_git': 'https://github.com/google',
'khronos_git': 'https://github.com/KhronosGroup',

'abseil_revision': '5be22f98733c674d532598454ae729253bc53e82',
'effcee_revision' : '19b4aa87af25cb4ee779a071409732f34bfc305c',
'glslang_revision': '6be56e45e574b375d759b89dad35f780bbd4792f',
'googletest_revision': 'e47544ad31cb3ceecd04cc13e8fe556f8df9fe0b',
're2_revision': 'c9cba76063cf4235c1a15dd14a24a4ef8d623761',
'spirv_headers_revision': '4183b260f4cccae52a89efdfcdd43c4897989f42',
'spirv_tools_revision': '360d469b9eac54d6c6e20f609f9ec35e3a5380ad',
'abseil_revision': '1315c900e1ddbb08a23e06eeb9a06450052ccb5e',
'effcee_revision': '08da24ec245a274fea3a128ba50068f163390565',
'glslang_revision': '09c541ee5b22bbac307987b50d86ec2b4f683d75',
'googletest_revision': '1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2',
're2_revision': '4a8cee3dd3c3d81b6fe8b867811e193d5819df07',
'spirv_headers_revision': '465055f6c9128772e20082e893d974146acf7a02',
'spirv_tools_revision': 'e4bceacf59fdfe742047e94e41ef65a48999a0dd',
}

deps = {
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN apk add --update \
build-base \
cmake \
git \
linux-headers \
ninja \
python3 \
py-pip \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ to provide:

<img alt="Linux" src="kokoro/img/linux.png" width="20px" height="20px" hspace="2px"/>[![Linux Build Status](https://storage.googleapis.com/shaderc/badges/build_status_linux_clang_release.svg)](https://storage.googleapis.com/shaderc/badges/build_link_linux_clang_release.html)
<img alt="MacOS" src="kokoro/img/macos.png" width="20px" height="20px" hspace="2px"/>[![MacOS Build Status](https://storage.googleapis.com/shaderc/badges/build_status_macos_clang_release.svg)](https://storage.googleapis.com/shaderc/badges/build_link_macos_clang_release.html)
<img alt="Windows" src="kokoro/img/windows.png" width="20px" height="20px" hspace="2px"/>[![Windows Build Status](https://storage.googleapis.com/shaderc/badges/build_status_windows_vs2017_release.svg)](https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2017_release.html)
<img alt="Windows" src="kokoro/img/windows.png" width="20px" height="20px" hspace="2px"/>[![Windows Build Status](https://storage.googleapis.com/shaderc/badges/build_status_windows_vs2022_amd64_release.svg)](https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2022_release.html)

[More downloads](downloads.md)

Expand Down Expand Up @@ -176,7 +176,7 @@ On Linux, if cross compiling to Windows:

On Windows, the following tools should be installed and available on your path:

- Visual Studio 2017 or later. Previous versions of Visual Studio may work but
- Visual Studio 2022 or later. Previous versions of Visual Studio may work but
are untested and unsupported.
- Git - including the associated tools, Bash, `diff`.

Expand Down
8 changes: 4 additions & 4 deletions downloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Download the latest builds.
## Release
| Windows | Linux | MacOS |
| --- | --- | --- |
| [MSVC 2019](https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2019_release.html) | [clang](https://storage.googleapis.com/shaderc/badges/build_link_linux_clang_release.html) | [clang](https://storage.googleapis.com/shaderc/badges/build_link_macos_clang_release.html) |
| [MSVC 2017](https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2017_release.html) | [gcc](https://storage.googleapis.com/shaderc/badges/build_link_linux_gcc_release.html) | |
| [VS 2022](https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2022_amd64_release.html) | [clang](https://storage.googleapis.com/shaderc/badges/build_link_linux_clang_release.html) | [clang](https://storage.googleapis.com/shaderc/badges/build_link_macos_clang_release.html) |
| | [gcc](https://storage.googleapis.com/shaderc/badges/build_link_linux_gcc_release.html) | |

## Debug
| Windows | Linux | MacOS |
| --- | --- | --- |
| [MSVC 2019](https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2019_debug.html) | [clang](https://storage.googleapis.com/shaderc/badges/build_link_linux_clang_debug.html) | [clang](https://storage.googleapis.com/shaderc/badges/build_link_macos_clang_debug.html) |
| [MSVC 2017](https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2017_debug.html) | [gcc](https://storage.googleapis.com/shaderc/badges/build_link_linux_gcc_debug.html) | |
| [VS 2022](https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2022_amd64_debug.html) | [clang](https://storage.googleapis.com/shaderc/badges/build_link_linux_clang_debug.html) | [clang](https://storage.googleapis.com/shaderc/badges/build_link_macos_clang_debug.html) |
| | [gcc](https://storage.googleapis.com/shaderc/badges/build_link_linux_gcc_debug.html) | |
22 changes: 13 additions & 9 deletions glslc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ target_link_libraries(glslc PRIVATE
shaderc_util shaderc # internal Shaderc libraries
${CMAKE_THREAD_LIBS_INIT})

add_executable(glslc_exe src/main.cc)
shaderc_default_compile_options(glslc_exe)
target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${spirv-tools_SOURCE_DIR}/include)
set_target_properties(glslc_exe PROPERTIES OUTPUT_NAME glslc)
target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc)
add_dependencies(glslc_exe build-version)
if(SHADERC_ENABLE_EXECUTABLES)
add_executable(glslc_exe src/main.cc)
shaderc_default_compile_options(glslc_exe)
target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${spirv-tools_SOURCE_DIR}/include)
set_target_properties(glslc_exe PROPERTIES OUTPUT_NAME glslc)
target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc)
add_dependencies(glslc_exe build-version)
endif(SHADERC_ENABLE_EXECUTABLES)

shaderc_add_tests(
TEST_PREFIX glslc
Expand All @@ -66,9 +68,11 @@ shaderc_add_tests(
shaderc_add_asciidoc(glslc_doc_README README)

if(SHADERC_ENABLE_INSTALL)
install(TARGETS glslc_exe
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
if(SHADERC_ENABLE_EXECUTABLES)
install(TARGETS glslc_exe
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
endif(SHADERC_ENABLE_EXECUTABLES)
endif(SHADERC_ENABLE_INSTALL)

add_subdirectory(test)
2 changes: 2 additions & 0 deletions glslc/README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ the following:
* `vulkan1.0`: create SPIR-V under Vulkan 1.0 semantics.
* `vulkan1.1`: create SPIR-V under Vulkan 1.1 semantics.
* `vulkan1.2`: create SPIR-V under Vulkan 1.2 semantics.
* `vulkan1.3`: create SPIR-V under Vulkan 1.3 semantics.
* `vulkan1.4`: create SPIR-V under Vulkan 1.4 semantics.
* `opengl`: create SPIR-V under OpenGL 4.5 semantics.
* `opengl4.5`: create SPIR-V under OpenGL 4.5 semantics.

Expand Down
30 changes: 23 additions & 7 deletions glslc/src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ An input file of - represents standard input.
vulkan1.1
vulkan1.2
vulkan1.3
vulkan1.4
vulkan # Same as vulkan1.0
opengl4.5
opengl # Same as opengl4.5
Expand All @@ -174,8 +175,9 @@ An input file of - represents standard input.
required to be supported for the target environment.
For example, default for vulkan1.0 is spv1.0, and
the default for vulkan1.1 is spv1.3,
the default for vulkan1.2 is spv1.5.
the default for vulkan1.3 is spv1.6.
the default for vulkan1.2 is spv1.5,
the default for vulkan1.3 is spv1.6,
the default for vulkan1.4 is spv1.6.
Values are:
spv1.0, spv1.1, spv1.2, spv1.3, spv1.4, spv1.5, spv1.6
--version Display compiler version information.
Expand Down Expand Up @@ -265,8 +267,9 @@ int main(int argc, char** argv) {

// Sets binding base for the given uniform kind. If stage is
// shader_glsl_infer_from_source then set it for all shader stages.
auto set_binding_base = [&compiler](
shaderc_shader_kind stage, shaderc_uniform_kind kind, uint32_t base) {
auto set_binding_base = [&compiler](shaderc_shader_kind stage,
shaderc_uniform_kind kind,
uint32_t base) {
if (stage == shaderc_glsl_infer_from_source)
compiler.options().SetBindingBase(kind, base);
else
Expand Down Expand Up @@ -335,6 +338,15 @@ int main(int argc, char** argv) {
compiler.options().SetNanClamp(true);
} else if (arg.starts_with("-fpreserve-bindings")) {
compiler.options().SetPreserveBindings(true);
} else if (arg.starts_with("-fmax-id-bound=")) {
const string_piece value_str = arg.substr(std::strlen("-fmax-id-bound="));
uint32_t bound = 0;
if (!shaderc_util::ParseUint32(value_str.str(), &bound)) {
std::cerr << "glslc: error: invalid value '" << value_str << "' in '"
<< arg << "'" << std::endl;
return 1;
}
compiler.options().SetMaxIdBound(bound);
} else if (((u_kind = shaderc_uniform_kind_image),
(arg == "-fimage-binding-base")) ||
((u_kind = shaderc_uniform_kind_texture),
Expand Down Expand Up @@ -452,6 +464,9 @@ int main(int argc, char** argv) {
} else if (target_env_str == "vulkan1.3") {
target_env = shaderc_target_env_vulkan;
version = shaderc_env_version_vulkan_1_3;
} else if (target_env_str == "vulkan1.4") {
target_env = shaderc_target_env_vulkan;
version = shaderc_env_version_vulkan_1_4;
} else if (target_env_str == "opengl") {
target_env = shaderc_target_env_opengl;
} else if (target_env_str == "opengl4.5") {
Expand Down Expand Up @@ -675,9 +690,10 @@ int main(int argc, char** argv) {
// from the file name. If current_fshader_stage is specifed to one of
// the forced shader kinds, use that for the following compilation.
input_files.emplace_back(glslc::InputFileSpec{
arg.str(), (current_fshader_stage == shaderc_glsl_infer_from_source
? glslc::DeduceDefaultShaderKindFromFileName(arg)
: current_fshader_stage),
arg.str(),
(current_fshader_stage == shaderc_glsl_infer_from_source
? glslc::DeduceDefaultShaderKindFromFileName(arg)
: current_fshader_stage),
language, current_entry_point_name});
}
}
Expand Down
30 changes: 18 additions & 12 deletions glslc/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

add_test(NAME shaderc_expect_unittests
COMMAND ${PYTHON_EXECUTABLE} -m unittest expect_unittest.py
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test(NAME shaderc_glslc_test_framework_unittests
COMMAND ${PYTHON_EXECUTABLE} -m unittest glslc_test_framework_unittest.py
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

if(${SHADERC_ENABLE_TESTS})
add_test(NAME glslc_tests
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/glslc_test_framework.py
$<TARGET_FILE:glslc_exe> $<TARGET_FILE:spirv-dis>
--test-dir ${CMAKE_CURRENT_SOURCE_DIR})

add_test(NAME shaderc_expect_unittests
COMMAND ${Python_EXECUTABLE} -m unittest expect_unittest.py
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test(NAME shaderc_glslc_test_framework_unittests
COMMAND ${Python_EXECUTABLE} -m unittest glslc_test_framework_unittest.py
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

# These tests use the glslc executable, so they can only run if
# glslc has been built.
if(${SHADERC_ENABLE_EXECUTABLES})
add_test(NAME glslc_tests
COMMAND ${Python_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/glslc_test_framework.py
$<TARGET_FILE:glslc_exe> $<TARGET_FILE:spirv-dis>
--test-dir ${CMAKE_CURRENT_SOURCE_DIR})
endif()

endif()
Loading
Loading