Merge pull request #7 from KhronosGroup/master

Sync code from glslang base repo
This commit is contained in:
Roy.li 2019-12-18 15:21:32 +08:00 committed by GitHub
commit 4200c91666
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
805 changed files with 30766 additions and 12021 deletions

View file

@ -66,7 +66,6 @@ after_test:
bin\glslangValidator.exe
bin\spirv-remap.exe
include\glslang\*
include\SPIRV\*
lib\glslang%SUFFIX%.lib
lib\HLSL%SUFFIX%.lib
lib\OGLCompiler%SUFFIX%.lib

View file

@ -99,7 +99,6 @@ after_success:
zip ${TARBALL}
bin/glslangValidator
include/glslang/*
include/SPIRV/*
lib/libglslang${SUFFIX}.a
lib/libHLSL${SUFFIX}.a
lib/libOGLCompiler${SUFFIX}.a

245
BUILD.bazel Normal file
View file

@ -0,0 +1,245 @@
package(
default_visibility = ["//visibility:public"],
)
# Description:
#
# Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator.
licenses(["notice"])
exports_files(["LICENSE"])
COMMON_COPTS = select({
"@bazel_tools//src/conditions:windows": [""],
"//conditions:default": [
"-Wall",
"-Wuninitialized",
"-Wunused",
"-Wunused-local-typedefs",
"-Wunused-parameter",
"-Wunused-value",
"-Wunused-variable",
"-Wno-reorder",
"-std=c++11",
"-fvisibility=hidden",
"-fvisibility-inlines-hidden",
"-fno-exceptions",
"-fno-rtti",
],
})
cc_library(
name = "glslang",
srcs = glob(
[
"glslang/GenericCodeGen/*.cpp",
"glslang/MachineIndependent/*.cpp",
"glslang/MachineIndependent/preprocessor/*.cpp",
"hlsl/*.cpp",
],
exclude = [
"glslang/MachineIndependent/pch.cpp",
"glslang/MachineIndependent/pch.h",
"hlsl/pch.cpp",
"hlsl/pch.h",
],
) + [
"OGLCompilersDLL/InitializeDll.cpp",
] + select({
"@bazel_tools//src/conditions:windows":
["glslang/OSDependent/Windows/ossource.cpp"],
"//conditions:default":
["glslang/OSDependent/Unix/ossource.cpp"],
}),
hdrs = glob([
"glslang/Include/*.h",
"glslang/MachineIndependent/*.h",
"glslang/MachineIndependent/preprocessor/*.h",
"hlsl/*.h",
]) + [
"OGLCompilersDLL/InitializeDll.h",
"StandAlone/DirStackFileIncluder.h",
"glslang/OSDependent/osinclude.h",
"glslang/Public/ShaderLang.h",
],
copts = COMMON_COPTS,
defines = [
"AMD_EXTENSIONS",
"ENABLE_HLSL=0",
"ENABLE_OPT=0",
"NV_EXTENSIONS",
],
linkopts = select({
"@bazel_tools//src/conditions:windows": [""],
"//conditions:default": ["-lm", "-lpthread"],
}),
linkstatic = 1,
)
genrule(
name = "export_spirv_headers",
srcs = [
"SPIRV/GLSL.ext.AMD.h",
"SPIRV/GLSL.ext.EXT.h",
"SPIRV/GLSL.ext.KHR.h",
"SPIRV/GLSL.ext.NV.h",
"SPIRV/GLSL.std.450.h",
"SPIRV/spirv.hpp",
],
outs = [
"include/SPIRV/GLSL.ext.AMD.h",
"include/SPIRV/GLSL.ext.EXT.h",
"include/SPIRV/GLSL.ext.KHR.h",
"include/SPIRV/GLSL.ext.NV.h",
"include/SPIRV/GLSL.std.450.h",
"include/SPIRV/spirv.hpp",
],
cmd = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/",
)
cc_library(
name = "SPIRV_headers",
hdrs = [":export_spirv_headers"],
copts = COMMON_COPTS,
includes = [
"include",
"include/SPIRV",
],
linkstatic = 1,
)
cc_library(
name = "SPIRV",
srcs = glob(
["SPIRV/*.cpp"],
exclude = [
"SPIRV/SpvTools.cpp",
],
),
hdrs = [
"SPIRV/GlslangToSpv.h",
"SPIRV/Logger.h",
"SPIRV/SPVRemapper.h",
"SPIRV/SpvBuilder.h",
"SPIRV/SpvTools.h",
"SPIRV/bitutils.h",
"SPIRV/disassemble.h",
"SPIRV/doc.h",
"SPIRV/hex_float.h",
"SPIRV/spvIR.h",
],
copts = COMMON_COPTS,
includes = ["SPIRV"],
linkopts = select({
"@bazel_tools//src/conditions:windows": [""],
"//conditions:default": ["-lm"],
}),
linkstatic = 1,
deps = [
":SPIRV_headers",
":glslang",
],
)
cc_library(
name = "glslang-default-resource-limits",
srcs = ["StandAlone/ResourceLimits.cpp"],
hdrs = ["StandAlone/ResourceLimits.h"],
copts = COMMON_COPTS,
linkstatic = 1,
deps = [":glslang"],
)
cc_binary(
name = "glslangValidator",
srcs = [
"StandAlone/StandAlone.cpp",
"StandAlone/Worklist.h",
],
copts = COMMON_COPTS,
deps = [
":SPIRV",
":glslang",
":glslang-default-resource-limits",
],
)
cc_binary(
name = "spirv-remap",
srcs = ["StandAlone/spirv-remap.cpp"],
copts = COMMON_COPTS,
deps = [
":SPIRV",
":glslang",
":glslang-default-resource-limits",
],
)
filegroup(
name = "test_files",
srcs = glob(
["Test/**"],
exclude = [
"Test/bump",
"Test/glslangValidator",
"Test/runtests",
],
),
)
cc_library(
name = "glslang_test_lib",
testonly = 1,
srcs = [
"gtests/HexFloat.cpp",
"gtests/Initializer.h",
"gtests/Settings.cpp",
"gtests/Settings.h",
"gtests/TestFixture.cpp",
"gtests/TestFixture.h",
"gtests/main.cpp",
],
copts = COMMON_COPTS,
data = [":test_files"],
defines = select({
# Unfortunately we can't use $(location) in cc_library at the moment.
# See https://github.com/bazelbuild/bazel/issues/1023
# So we'll specify the path manually.
"@bazel_tools//src/conditions:windows":
["GLSLANG_TEST_DIRECTORY='\"../../../../../Test\"'"],
"//conditions:default":
["GLSLANG_TEST_DIRECTORY='\"Test\"'"],
}),
linkstatic = 1,
deps = [
":SPIRV",
":glslang",
":glslang-default-resource-limits",
"@com_google_googletest//:gtest",
],
)
GLSLANG_TESTS = glob(
["gtests/*.FromFile.cpp"],
# Since we are not building the SPIRV-Tools dependency, the following tests
# cannot be performed.
exclude = [
"gtests/Hlsl.FromFile.cpp",
"gtests/Spv.FromFile.cpp",
],
)
[cc_test(
name = test_file.replace("gtests/", "").replace(".FromFile.cpp", "") + "_test",
srcs = [test_file],
copts = COMMON_COPTS,
data = [
":test_files",
],
deps = [
":SPIRV",
":glslang",
":glslang_test_lib",
],
) for test_file in GLSLANG_TESTS]

View file

@ -33,6 +33,19 @@
import("//build_overrides/glslang.gni")
# Both Chromium and Fuchsia use by default a set of warning errors
# that is far too strict to compile this project. These are also
# typically appended after |cflags|, overriding target-specific
# definitions. To work around this, determine which configs to
# add and remove in order to succesfully build the project.
if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
_configs_to_remove = [ "//build/config:default_warnings" ]
_configs_to_add = []
} else {
_configs_to_remove = [ "//build/config/compiler:chromium_code" ]
_configs_to_add = [ "//build/config/compiler:no_chromium_code" ]
}
spirv_tools_dir = glslang_spirv_tools_dir
config("glslang_public") {
@ -47,8 +60,10 @@ source_set("glslang_sources") {
sources = [
"OGLCompilersDLL/InitializeDll.cpp",
"OGLCompilersDLL/InitializeDll.h",
"SPIRV/GLSL.ext.AMD.h",
"SPIRV/GLSL.ext.EXT.h",
"SPIRV/GLSL.ext.KHR.h",
"SPIRV/GLSL.ext.NV.h",
"SPIRV/GLSL.std.450.h",
"SPIRV/GlslangToSpv.cpp",
"SPIRV/GlslangToSpv.h",
@ -159,7 +174,7 @@ source_set("glslang_sources") {
}
if (is_clang) {
cflags_cc = [
cflags = [
"-Wno-extra-semi",
"-Wno-ignored-qualifiers",
"-Wno-implicit-fallthrough",
@ -167,6 +182,7 @@ source_set("glslang_sources") {
"-Wno-sign-compare",
"-Wno-unused-variable",
"-Wno-missing-field-initializers",
"-Wno-newline-eof",
]
}
if (is_win && !is_clang) {
@ -180,6 +196,9 @@ source_set("glslang_sources") {
"${spirv_tools_dir}:spvtools_opt",
"${spirv_tools_dir}:spvtools_val",
]
configs -= _configs_to_remove
configs += _configs_to_add
}
source_set("glslang_default_resource_limits_sources") {
@ -191,6 +210,9 @@ source_set("glslang_default_resource_limits_sources") {
":glslang_sources",
]
public_configs = [ ":glslang_public" ]
configs -= _configs_to_remove
configs += _configs_to_add
}
executable("glslang_validator") {
@ -206,6 +228,9 @@ executable("glslang_validator") {
":glslang_default_resource_limits_sources",
":glslang_sources",
]
configs -= _configs_to_remove
configs += _configs_to_add
}
executable("spirv-remap") {
@ -216,4 +241,7 @@ executable("spirv-remap") {
deps = [
":glslang_sources",
]
configs -= _configs_to_remove
configs += _configs_to_add
}

View file

@ -6,6 +6,9 @@ if (POLICY CMP0048)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Enable compile commands database
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Adhere to GNU filesystem layout conventions
include(GNUInstallDirs)
@ -13,6 +16,7 @@ include(GNUInstallDirs)
include(CMakeDependentOption)
option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
option(BUILD_EXTERNAL "Build external dependencies in /External" ON)
set(LIB_TYPE STATIC)
@ -28,13 +32,16 @@ option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON)
option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
option(ENABLE_GLSLANG_WEB "Reduces glslang to minumum needed for web use" OFF)
option(ENABLE_EMSCRIPTEN_SINGLE_FILE "If using emscripten, enables SINGLE_FILE build" OFF)
option(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE "If using emscripten, builds to run on Node instead of Web" OFF)
option(ENABLE_GLSLANG_WEB "Reduces glslang to minimum needed for web use" OFF)
option(ENABLE_GLSLANG_WEB_DEVEL "For ENABLE_GLSLANG_WEB builds, enables compilation error messages" OFF)
option(ENABLE_EMSCRIPTEN_SINGLE_FILE "If using Emscripten, enables SINGLE_FILE build" OFF)
option(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE "If using Emscripten, builds to run on Node instead of Web" OFF)
CMAKE_DEPENDENT_OPTION(ENABLE_HLSL "Enables HLSL input support" ON "NOT ENABLE_GLSLANG_WEB" OFF)
option(ENABLE_OPT "Enables spirv-opt capability if present" ON)
option(ENABLE_PCH "Enables Precompiled header" ON)
option(ENABLE_CTEST "Enables testing" ON)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "..." FORCE)
@ -50,7 +57,7 @@ endif()
# Precompiled header macro. Parameters are source file list and filename for pch cpp file.
macro(glslang_pch SRCS PCHCPP)
if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio")
if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio" AND ENABLE_PCH)
set(PCH_NAME "$(IntDir)\\pch.pch")
# make source files use/depend on PCH_NAME
set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS "/Yupch.h /FIpch.h /Fp${PCH_NAME} /Zm300" OBJECT_DEPENDS "${PCH_NAME}")
@ -61,8 +68,10 @@ macro(glslang_pch SRCS PCHCPP)
endmacro(glslang_pch)
project(glslang)
# make testing optional
include(CTest)
if(ENABLE_CTEST)
include(CTest)
endif()
if(ENABLE_HLSL)
add_definitions(-DENABLE_HLSL)
@ -70,6 +79,9 @@ endif(ENABLE_HLSL)
if(ENABLE_GLSLANG_WEB)
add_definitions(-DGLSLANG_WEB)
if(ENABLE_GLSLANG_WEB_DEVEL)
add_definitions(-DGLSLANG_WEB_DEVEL)
endif(ENABLE_GLSLANG_WEB_DEVEL)
endif(ENABLE_GLSLANG_WEB)
if(WIN32)
@ -98,38 +110,29 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
add_compile_options(/GR-) # Disable RTTI
endif()
if(ENABLE_GLSLANG_WEB)
if(EMSCRIPTEN)
add_compile_options(-Os -fno-exceptions)
add_compile_options("SHELL: -s WASM=1")
add_compile_options("SHELL: -s WASM_OBJECT_FILES=0")
add_link_options(-Os)
add_link_options("SHELL: -s FILESYSTEM=0")
add_link_options("SHELL: --llvm-lto 1")
add_link_options("SHELL: --closure 1")
add_link_options("SHELL: -s ALLOW_MEMORY_GROWTH=1")
if(EMSCRIPTEN)
add_compile_options(-Os -fno-exceptions)
add_compile_options("SHELL: -s WASM=1")
add_compile_options("SHELL: -s WASM_OBJECT_FILES=0")
add_link_options(-Os)
add_link_options("SHELL: -s FILESYSTEM=0")
add_link_options("SHELL: --llvm-lto 1")
add_link_options("SHELL: --closure 1")
add_link_options("SHELL: -s ALLOW_MEMORY_GROWTH=1")
add_link_options("SHELL: -s MODULARIZE=1")
if(ENABLE_EMSCRIPTEN_SINGLE_FILE)
add_link_options("SHELL: -s SINGLE_FILE=1")
endif(ENABLE_EMSCRIPTEN_SINGLE_FILE)
if(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE)
add_link_options("SHELL: -s ENVIRONMENT=node")
add_link_options("SHELL: -s BINARYEN_ASYNC_COMPILATION=0")
if(ENABLE_EMSCRIPTEN_SINGLE_FILE)
add_link_options("SHELL: -s SINGLE_FILE=1")
endif(ENABLE_EMSCRIPTEN_SINGLE_FILE)
else()
if(ENABLE_GLSLANG_WEB)
if(MSVC)
add_compile_options(/Os /GR-)
else()
add_link_options("SHELL: -s ENVIRONMENT=web,worker")
add_link_options("SHELL: -s EXPORT_ES6=1")
add_compile_options(-Os -fno-exceptions)
add_link_options(-Os)
endif()
else()
if(MSVC)
add_compile_options(/Os /GR-)
else()
add_compile_options(-Os -fno-exceptions)
add_link_options(-Os)
endif()
endif(EMSCRIPTEN)
endif(ENABLE_GLSLANG_WEB)
endif(ENABLE_GLSLANG_WEB)
endif(EMSCRIPTEN)
# Request C++11
if(${CMAKE_VERSION} VERSION_LESS 3.1)
@ -153,12 +156,12 @@ endfunction(glslang_set_link_args)
# CMake needs to find the right version of python, right from the beginning,
# otherwise, it will find the wrong version and fail later
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
find_package(PythonInterp 3 REQUIRED)
endif()
# We depend on these for later projects, so they should come first.
add_subdirectory(External)
# We depend on these for later projects, so they should come first.
add_subdirectory(External)
endif()
if(NOT TARGET SPIRV-Tools-opt)
set(ENABLE_OPT OFF)
@ -183,4 +186,29 @@ add_subdirectory(SPIRV)
if(ENABLE_HLSL)
add_subdirectory(hlsl)
endif(ENABLE_HLSL)
add_subdirectory(gtests)
if(ENABLE_CTEST)
add_subdirectory(gtests)
endif()
if(BUILD_TESTING)
# glslang-testsuite runs a bash script on Windows.
# Make sure to use '-o igncr' flag to ignore carriage returns (\r).
set(IGNORE_CR_FLAG "")
if(WIN32)
set(IGNORE_CR_FLAG -o igncr)
endif()
if (CMAKE_CONFIGURATION_TYPES)
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/localResults)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/glslangValidator)
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/spirv-remap)
else(CMAKE_CONFIGURATION_TYPES)
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator)
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
endif(CMAKE_CONFIGURATION_TYPES)
add_test(NAME glslang-testsuite
COMMAND bash ${IGNORE_CR_FLAG} runtests ${RESULTS_PATH} ${VALIDATOR_PATH} ${REMAP_PATH}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Test/)
endif(BUILD_TESTING)

View file

@ -9,6 +9,7 @@ if(WIN32)
endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
install(TARGETS OGLCompiler
install(TARGETS OGLCompiler EXPORT OGLCompilerTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT OGLCompilerTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif(ENABLE_GLSLANG_INSTALL)

View file

@ -28,6 +28,15 @@ comment in `glslang/MachineIndependent/Versions.cpp`.
Tasks waiting to be done are documented as GitHub issues.
Deprecations
------------
1. GLSLang, when installed through CMake, will install a `SPIRV` folder into
`${CMAKE_INSTALL_INCLUDEDIR}`. This `SPIRV` folder is being moved to
`glslang/SPIRV`. During the transition the `SPIRV` folder will be installed into
both locations. The old install of `SPIRV/` will be removed as a CMake install
target no sooner then May 1, 2020. See issue #1964.
Execution of Standalone Wrapper
-------------------------------
@ -94,8 +103,8 @@ cd ../..
```
If you wish to assure that SPIR-V generated from HLSL is legal for Vulkan,
or wish to invoke -Os to reduce SPIR-V size from HLSL or GLSL, install
spirv-tools with this:
wish to invoke -Os to reduce SPIR-V size from HLSL or GLSL, or wish to run the
integrated test suite, install spirv-tools with this:
```bash
./update_glslang_sources.py
@ -166,26 +175,30 @@ when executed from the glslang subdirectory of the glslang repository.
With no arguments it builds the full grammar, and with a "web" argument,
the web grammar subset (see more about the web subset in the next section).
### WASM for the the Web
### Building to WASM for the Web and Node
Use the steps in [Build Steps](#build-steps), which following notes/exceptions:
Use the steps in [Build Steps](#build-steps), with the following notes/exceptions:
* For building the web subset of core glslang:
+ `m4` also needs a `-DGLSLANG_WEB` argument, or simply execute `updateGrammar web` from the glslang subdirectory
+ turn off the CMAKE options for `BUILD_TESTING`, `ENABLE_OPT`, and `INSTALL_GTEST`,
while turning on `ENABLE_GLSLANG_WEB`
+ execute `updateGrammar web` from the glslang subdirectory
(or if using your own scripts, `m4` needs a `-DGLSLANG_WEB` argument)
+ set `-DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF`
+ turn on `-DENABLE_GLSLANG_WEB=ON`
+ optionally, for GLSL compilation error messages, turn on `-DENABLE_GLSLANG_WEB_DEVEL=ON`
* `emsdk` needs to be present in your executable search path, *PATH* for
Bash-like enivironments
+ Instructions located
[here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install)
* Do not checkout SPIRV-Tools into `External`
+ Does not work correctly with emscripten out of the box and we don't want it
in the build anyway. *TBD* Have build ignore SPIRV-Tools for web build
* Wrap call to `cmake` using `emconfigure` with ENABLE_GLSLANG_WEB=ON:
+ e.g. For Linux, `emconfigure cmake -DCMAKE_BUILD_TYPE=Release
-DENABLE_GLSLANG_WEB=ON -DCMAKE_INSTALL_PREFIX="$(pwd)/install" ..`
* To get a 'true' minimized build, make sure to use `brotli` to compress the .js
+ [Instructions located
here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install)
* Wrap cmake call: `emcmake cmake`
* To get a fully minimized build, make sure to use `brotli` to compress the .js
and .wasm files
Example:
```sh
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_WEB=ON \
-DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF ..
```
Testing
-------
@ -223,6 +236,11 @@ Running `runtests` script-backed tests:
cd $SOURCE_DIR/Test && ./runtests
```
If some tests fail with validation errors, there may be a mismatch between the
version of `spirv-val` on the system and the version of glslang. In this
case, it is necessary to run `update_glslang_sources.py`. See "Check-Out
External Projects" above for more details.
### Contributing tests
Test results should always be included with a pull request that modifies
@ -303,7 +321,7 @@ See `ShaderLang.h` and the usage of it in `StandAlone/StandAlone.cpp` for more
details. There is a block comment giving more detail above the calls for
`setEnvInput, setEnvClient, and setEnvTarget`.
### C Functional Interface (orignal)
### C Functional Interface (original)
This interface is in roughly the first 2/3 of `ShaderLang.h`, and referred to
as the `Sh*()` interface, as all the entry points start `Sh`.

23
SPIRV/CMakeLists.txt Normal file → Executable file
View file

@ -36,7 +36,9 @@ set(SPVREMAP_HEADERS
add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
set_property(TARGET SPIRV PROPERTY FOLDER glslang)
set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(SPIRV PUBLIC ..)
target_include_directories(SPIRV PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if (ENABLE_SPVREMAPPER)
add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
@ -57,7 +59,9 @@ if(ENABLE_OPT)
PRIVATE ${spirv-tools_SOURCE_DIR}/source
)
target_link_libraries(SPIRV glslang SPIRV-Tools-opt)
target_include_directories(SPIRV PUBLIC ../External)
target_include_directories(SPIRV PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
else()
target_link_libraries(SPIRV glslang)
endif(ENABLE_OPT)
@ -70,22 +74,29 @@ endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
if(BUILD_SHARED_LIBS)
if (ENABLE_SPVREMAPPER)
install(TARGETS SPVRemapper
install(TARGETS SPVRemapper EXPORT SPVRemapperTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(TARGETS SPIRV
install(TARGETS SPIRV EXPORT SPIRVTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
if (ENABLE_SPVREMAPPER)
install(TARGETS SPVRemapper
install(TARGETS SPVRemapper EXPORT SPVRemapperTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(TARGETS SPIRV
install(TARGETS SPIRV EXPORT SPIRVTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
if (ENABLE_SPVREMAPPER)
install(EXPORT SPVRemapperTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif()
install(EXPORT SPIRVTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/)
install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/SPIRV/)
endif(ENABLE_GLSLANG_INSTALL)

View file

@ -41,6 +41,7 @@ static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_stora
static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage";
static const char* const E_SPV_KHR_vulkan_memory_model = "SPV_KHR_vulkan_memory_model";
static const char* const E_SPV_EXT_physical_storage_buffer = "SPV_EXT_physical_storage_buffer";
static const char* const E_SPV_KHR_physical_storage_buffer = "SPV_KHR_physical_storage_buffer";
static const char* const E_SPV_EXT_fragment_shader_interlock = "SPV_EXT_fragment_shader_interlock";
static const char* const E_SPV_KHR_shader_clock = "SPV_KHR_shader_clock";

347
SPIRV/GlslangToSpv.cpp Normal file → Executable file
View file

@ -100,11 +100,11 @@ struct OpDecorations {
spv::Decoration precision;
#ifdef GLSLANG_WEB
void addNoContraction(spv::Builder&, spv::Id) const { };
void addNonUniform(spv::Builder&, spv::Id) const { };
void addNoContraction(spv::Builder&, spv::Id) const { }
void addNonUniform(spv::Builder&, spv::Id) const { }
#else
void addNoContraction(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, noContraction); };
void addNonUniform(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, nonUniform); };
void addNoContraction(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, noContraction); }
void addNonUniform(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, nonUniform); }
protected:
spv::Decoration noContraction;
spv::Decoration nonUniform;
@ -217,11 +217,6 @@ protected:
bool isTrivial(const glslang::TIntermTyped* node);
spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right);
spv::Id getExtBuiltins(const char* name);
void addPre13Extension(const char* ext)
{
if (builder.getSpvVersion() < glslang::EShTargetSpv_1_3)
builder.addExtension(ext);
}
std::pair<spv::Id, spv::Id> getForcedType(spv::BuiltIn, const glslang::TType&);
spv::Id translateForcedType(spv::Id object);
spv::Id createCompositeConstruct(spv::Id typeId, std::vector<spv::Id> constituents);
@ -297,8 +292,8 @@ spv::ExecutionModel TranslateExecutionModel(EShLanguage stage)
switch (stage) {
case EShLangVertex: return spv::ExecutionModelVertex;
case EShLangFragment: return spv::ExecutionModelFragment;
#ifndef GLSLANG_WEB
case EShLangCompute: return spv::ExecutionModelGLCompute;
#ifndef GLSLANG_WEB
case EShLangTessControl: return spv::ExecutionModelTessellationControl;
case EShLangTessEvaluation: return spv::ExecutionModelTessellationEvaluation;
case EShLangGeometry: return spv::ExecutionModelGeometry;
@ -379,22 +374,20 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useSto
// Translate glslang type to SPIR-V memory decorations.
void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector<spv::Decoration>& memory, bool useVulkanMemoryModel)
{
#ifndef GLSLANG_WEB
if (!useVulkanMemoryModel) {
if (qualifier.coherent)
if (qualifier.isCoherent())
memory.push_back(spv::DecorationCoherent);
if (qualifier.volatil) {
if (qualifier.isVolatile()) {
memory.push_back(spv::DecorationVolatile);
memory.push_back(spv::DecorationCoherent);
}
}
if (qualifier.restrict)
if (qualifier.isRestrict())
memory.push_back(spv::DecorationRestrict);
if (qualifier.isReadOnly())
memory.push_back(spv::DecorationNonWritable);
if (qualifier.isWriteOnly())
memory.push_back(spv::DecorationNonReadable);
#endif
}
// Translate glslang type to SPIR-V layout decorations.
@ -517,7 +510,7 @@ spv::Decoration TGlslangToSpvTraverser::TranslateNonUniformDecoration(const glsl
{
#ifndef GLSLANG_WEB
if (qualifier.isNonUniform()) {
builder.addExtension("SPV_EXT_descriptor_indexing");
builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5);
builder.addCapability(spv::CapabilityShaderNonUniformEXT);
return spv::DecorationNonUniformEXT;
} else
@ -678,6 +671,13 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
case glslang::EbvFace: return spv::BuiltInFrontFacing;
case glslang::EbvFragDepth: return spv::BuiltInFragDepth;
case glslang::EbvNumWorkGroups: return spv::BuiltInNumWorkgroups;
case glslang::EbvWorkGroupSize: return spv::BuiltInWorkgroupSize;
case glslang::EbvWorkGroupId: return spv::BuiltInWorkgroupId;
case glslang::EbvLocalInvocationId: return spv::BuiltInLocalInvocationId;
case glslang::EbvLocalInvocationIndex: return spv::BuiltInLocalInvocationIndex;
case glslang::EbvGlobalInvocationId: return spv::BuiltInGlobalInvocationId;
#ifndef GLSLANG_WEB
// These *Distance capabilities logically belong here, but if the member is declared and
// then never used, consumers of SPIR-V prefer the capability not be declared.
@ -701,7 +701,7 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
glslangIntermediate->getStage() == EShLangTessControl ||
glslangIntermediate->getStage() == EShLangTessEvaluation) {
builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer);
builder.addIncorporatedExtension(spv::E_SPV_EXT_shader_viewport_index_layer, spv::Spv_1_5);
builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT);
}
return spv::BuiltInViewportIndex;
@ -726,23 +726,23 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
glslangIntermediate->getStage() == EShLangTessControl ||
glslangIntermediate->getStage() == EShLangTessEvaluation) {
builder.addExtension(spv::E_SPV_EXT_shader_viewport_index_layer);
builder.addIncorporatedExtension(spv::E_SPV_EXT_shader_viewport_index_layer, spv::Spv_1_5);
builder.addCapability(spv::CapabilityShaderViewportIndexLayerEXT);
}
return spv::BuiltInLayer;
case glslang::EbvBaseVertex:
addPre13Extension(spv::E_SPV_KHR_shader_draw_parameters);
builder.addIncorporatedExtension(spv::E_SPV_KHR_shader_draw_parameters, spv::Spv_1_3);
builder.addCapability(spv::CapabilityDrawParameters);
return spv::BuiltInBaseVertex;
case glslang::EbvBaseInstance:
addPre13Extension(spv::E_SPV_KHR_shader_draw_parameters);
builder.addIncorporatedExtension(spv::E_SPV_KHR_shader_draw_parameters, spv::Spv_1_3);
builder.addCapability(spv::CapabilityDrawParameters);
return spv::BuiltInBaseInstance;
case glslang::EbvDrawId:
addPre13Extension(spv::E_SPV_KHR_shader_draw_parameters);
builder.addIncorporatedExtension(spv::E_SPV_KHR_shader_draw_parameters, spv::Spv_1_3);
builder.addCapability(spv::CapabilityDrawParameters);
return spv::BuiltInDrawIndex;
@ -762,12 +762,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
case glslang::EbvTessCoord: return spv::BuiltInTessCoord;
case glslang::EbvPatchVertices: return spv::BuiltInPatchVertices;
case glslang::EbvHelperInvocation: return spv::BuiltInHelperInvocation;
case glslang::EbvNumWorkGroups: return spv::BuiltInNumWorkgroups;
case glslang::EbvWorkGroupSize: return spv::BuiltInWorkgroupSize;
case glslang::EbvWorkGroupId: return spv::BuiltInWorkgroupId;
case glslang::EbvLocalInvocationId: return spv::BuiltInLocalInvocationId;
case glslang::EbvLocalInvocationIndex: return spv::BuiltInLocalInvocationIndex;
case glslang::EbvGlobalInvocationId: return spv::BuiltInGlobalInvocationId;
case glslang::EbvSubGroupSize:
builder.addExtension(spv::E_SPV_KHR_shader_ballot);
@ -874,12 +868,12 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
return spv::BuiltInBaryCoordPullModelAMD;
case glslang::EbvDeviceIndex:
addPre13Extension(spv::E_SPV_KHR_device_group);
builder.addIncorporatedExtension(spv::E_SPV_KHR_device_group, spv::Spv_1_3);
builder.addCapability(spv::CapabilityDeviceGroup);
return spv::BuiltInDeviceIndex;
case glslang::EbvViewIndex:
addPre13Extension(spv::E_SPV_KHR_multiview);
builder.addIncorporatedExtension(spv::E_SPV_KHR_multiview, spv::Spv_1_3);
builder.addCapability(spv::CapabilityMultiView);
return spv::BuiltInViewIndex;
@ -1192,7 +1186,7 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
}
if (glslangIntermediate->usingStorageBuffer() && type.getQualifier().storage == glslang::EvqBuffer) {
addPre13Extension(spv::E_SPV_KHR_storage_buffer_storage_class);
builder.addIncorporatedExtension(spv::E_SPV_KHR_storage_buffer_storage_class, spv::Spv_1_3);
return spv::StorageClassStorageBuffer;
}
@ -1208,8 +1202,8 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
case glslang::EvqGlobal: return spv::StorageClassPrivate;
case glslang::EvqConstReadOnly: return spv::StorageClassFunction;
case glslang::EvqTemporary: return spv::StorageClassFunction;
#ifndef GLSLANG_WEB
case glslang::EvqShared: return spv::StorageClassWorkgroup;
#ifndef GLSLANG_WEB
case glslang::EvqPayloadNV: return spv::StorageClassRayPayloadNV;
case glslang::EvqPayloadInNV: return spv::StorageClassIncomingRayPayloadNV;
case glslang::EvqHitAttrNV: return spv::StorageClassHitAttributeNV;
@ -1253,13 +1247,13 @@ void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TTyp
// assume a dynamically uniform index
if (baseType.getBasicType() == glslang::EbtSampler) {
if (baseType.getQualifier().hasAttachment()) {
builder.addExtension("SPV_EXT_descriptor_indexing");
builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5);
builder.addCapability(spv::CapabilityInputAttachmentArrayDynamicIndexingEXT);
} else if (baseType.isImage() && baseType.getSampler().isBuffer()) {
builder.addExtension("SPV_EXT_descriptor_indexing");
builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5);
builder.addCapability(spv::CapabilityStorageTexelBufferArrayDynamicIndexingEXT);
} else if (baseType.isTexture() && baseType.getSampler().isBuffer()) {
builder.addExtension("SPV_EXT_descriptor_indexing");
builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5);
builder.addCapability(spv::CapabilityUniformTexelBufferArrayDynamicIndexingEXT);
}
}
@ -1404,13 +1398,13 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
if (glslangIntermediate->usingPhysicalStorageBuffer()) {
addressingModel = spv::AddressingModelPhysicalStorageBuffer64EXT;
builder.addExtension(spv::E_SPV_EXT_physical_storage_buffer);
builder.addIncorporatedExtension(spv::E_SPV_EXT_physical_storage_buffer, spv::Spv_1_5);
builder.addCapability(spv::CapabilityPhysicalStorageBufferAddressesEXT);
};
if (glslangIntermediate->usingVulkanMemoryModel()) {
memoryModel = spv::MemoryModelVulkanKHR;
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
builder.addExtension(spv::E_SPV_KHR_vulkan_memory_model);
builder.addIncorporatedExtension(spv::E_SPV_KHR_vulkan_memory_model, spv::Spv_1_5);
}
builder.setMemoryModel(addressingModel, memoryModel);
@ -1470,13 +1464,20 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
if (mode != spv::ExecutionModeMax)
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
switch (glslangIntermediate->getInterlockOrdering()) {
case glslang::EioPixelInterlockOrdered: mode = spv::ExecutionModePixelInterlockOrderedEXT; break;
case glslang::EioPixelInterlockUnordered: mode = spv::ExecutionModePixelInterlockUnorderedEXT; break;
case glslang::EioSampleInterlockOrdered: mode = spv::ExecutionModeSampleInterlockOrderedEXT; break;
case glslang::EioSampleInterlockUnordered: mode = spv::ExecutionModeSampleInterlockUnorderedEXT; break;
case glslang::EioShadingRateInterlockOrdered: mode = spv::ExecutionModeShadingRateInterlockOrderedEXT; break;
case glslang::EioShadingRateInterlockUnordered: mode = spv::ExecutionModeShadingRateInterlockUnorderedEXT; break;
default: mode = spv::ExecutionModeMax; break;
case glslang::EioPixelInterlockOrdered: mode = spv::ExecutionModePixelInterlockOrderedEXT;
break;
case glslang::EioPixelInterlockUnordered: mode = spv::ExecutionModePixelInterlockUnorderedEXT;
break;
case glslang::EioSampleInterlockOrdered: mode = spv::ExecutionModeSampleInterlockOrderedEXT;
break;
case glslang::EioSampleInterlockUnordered: mode = spv::ExecutionModeSampleInterlockUnorderedEXT;
break;
case glslang::EioShadingRateInterlockOrdered: mode = spv::ExecutionModeShadingRateInterlockOrderedEXT;
break;
case glslang::EioShadingRateInterlockUnordered: mode = spv::ExecutionModeShadingRateInterlockUnorderedEXT;
break;
default: mode = spv::ExecutionModeMax;
break;
}
if (mode != spv::ExecutionModeMax) {
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
@ -1494,7 +1495,6 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
#endif
break;
#ifndef GLSLANG_WEB
case EShLangCompute:
builder.addCapability(spv::CapabilityShader);
builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
@ -1510,6 +1510,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives);
}
break;
#ifndef GLSLANG_WEB
case EShLangTessEvaluation:
case EShLangTessControl:
builder.addCapability(spv::CapabilityTessellation);
@ -1629,11 +1630,11 @@ void TGlslangToSpvTraverser::finishSpv()
for (auto it = iOSet.cbegin(); it != iOSet.cend(); ++it)
entryPoint->addIdOperand(*it);
#ifndef GLSLANG_WEB
// Add capabilities, extensions, remove unneeded decorations, etc.,
// Add capabilities, extensions, remove unneeded decorations, etc.,
// based on the resulting SPIR-V.
// Note: WebGPU code generation must have the opportunity to aggressively
// prune unreachable merge blocks and continue targets.
builder.postProcess();
#endif
}
// Write the SPV into 'out'.
@ -2551,7 +2552,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
binOp = glslang::EOpMod;
break;
#ifndef GLSLANG_WEB
case glslang::EOpEmitVertex:
case glslang::EOpEndPrimitive:
case glslang::EOpBarrier:
@ -2575,10 +2575,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
// These all have 0 operands and will naturally finish up in the code below for 0 operands
break;
case glslang::EOpAtomicStore:
noReturnValue = true;
// fallthrough
case glslang::EOpAtomicLoad:
case glslang::EOpAtomicAdd:
case glslang::EOpAtomicMin:
case glslang::EOpAtomicMax:
@ -2590,6 +2586,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
atomic = true;
break;
#ifndef GLSLANG_WEB
case glslang::EOpAtomicStore:
noReturnValue = true;
// fallthrough
case glslang::EOpAtomicLoad:
atomic = true;
break;
case glslang::EOpAtomicCounterAdd:
case glslang::EOpAtomicCounterSubtract:
case glslang::EOpAtomicCounterMin:
@ -2604,6 +2608,17 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
atomic = true;
break;
case glslang::EOpAbsDifference:
case glslang::EOpAddSaturate:
case glslang::EOpSubSaturate:
case glslang::EOpAverage:
case glslang::EOpAverageRounded:
case glslang::EOpMul32x16:
builder.addCapability(spv::CapabilityIntegerFunctions2INTEL);
builder.addExtension("SPV_INTEL_shader_integer_functions2");
binOp = node->getOp();
break;
case glslang::EOpIgnoreIntersectionNV:
case glslang::EOpTerminateRayNV:
case glslang::EOpTraceNV:
@ -2672,6 +2687,19 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
if (arg == 1)
lvalue = true;
break;
case glslang::EOpAtomicAdd:
case glslang::EOpAtomicMin:
case glslang::EOpAtomicMax:
case glslang::EOpAtomicAnd:
case glslang::EOpAtomicOr:
case glslang::EOpAtomicXor:
case glslang::EOpAtomicExchange:
case glslang::EOpAtomicCompSwap:
if (arg == 0)
lvalue = true;
break;
#ifndef GLSLANG_WEB
case glslang::EOpFrexp:
if (arg == 1)
@ -2690,14 +2718,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
invertedType = convertGlslangToSpvType(glslangOperands[0]->getAsBinaryNode()->getLeft()->getType());
}
break;
case glslang::EOpAtomicAdd:
case glslang::EOpAtomicMin:
case glslang::EOpAtomicMax:
case glslang::EOpAtomicAnd:
case glslang::EOpAtomicOr:
case glslang::EOpAtomicXor:
case glslang::EOpAtomicExchange:
case glslang::EOpAtomicCompSwap:
case glslang::EOpAtomicLoad:
case glslang::EOpAtomicStore:
case glslang::EOpAtomicCounterAdd:
@ -2823,12 +2843,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
builder.createNoResultOp(spv::OpCooperativeMatrixStoreNV, idImmOps);
result = 0;
} else if (atomic) {
// Handle all atomics
result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags);
} else
#endif
{
if (atomic) {
// Handle all atomics
result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags);
} else {
// Pass through to generic operations.
switch (glslangOperands.size()) {
case 0:
@ -3242,11 +3262,11 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
switch (storageClass) {
case spv::StorageClassInput:
case spv::StorageClassOutput:
addPre13Extension(spv::E_SPV_KHR_16bit_storage);
builder.addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3);
builder.addCapability(spv::CapabilityStorageInputOutput16);
break;
case spv::StorageClassUniform:
addPre13Extension(spv::E_SPV_KHR_16bit_storage);
builder.addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3);
if (node->getType().getQualifier().storage == glslang::EvqBuffer)
builder.addCapability(spv::CapabilityStorageUniformBufferBlock16);
else
@ -3254,12 +3274,12 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
break;
#ifndef GLSLANG_WEB
case spv::StorageClassPushConstant:
addPre13Extension(spv::E_SPV_KHR_16bit_storage);
builder.addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3);
builder.addCapability(spv::CapabilityStoragePushConstant16);
break;
case spv::StorageClassStorageBuffer:
case spv::StorageClassPhysicalStorageBufferEXT:
addPre13Extension(spv::E_SPV_KHR_16bit_storage);
builder.addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3);
builder.addCapability(spv::CapabilityStorageUniformBufferBlock16);
break;
#endif
@ -3274,13 +3294,13 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
if (node->getType().contains8BitInt()) {
if (storageClass == spv::StorageClassPushConstant) {
builder.addExtension(spv::E_SPV_KHR_8bit_storage);
builder.addIncorporatedExtension(spv::E_SPV_KHR_8bit_storage, spv::Spv_1_5);
builder.addCapability(spv::CapabilityStoragePushConstant8);
} else if (storageClass == spv::StorageClassUniform) {
builder.addExtension(spv::E_SPV_KHR_8bit_storage);
builder.addIncorporatedExtension(spv::E_SPV_KHR_8bit_storage, spv::Spv_1_5);
builder.addCapability(spv::CapabilityUniformAndStorageBuffer8BitAccess);
} else if (storageClass == spv::StorageClassStorageBuffer) {
builder.addExtension(spv::E_SPV_KHR_8bit_storage);
builder.addIncorporatedExtension(spv::E_SPV_KHR_8bit_storage, spv::Spv_1_5);
builder.addCapability(spv::CapabilityStorageBuffer8BitAccess);
} else {
builder.addCapability(spv::CapabilityInt8);
@ -3537,11 +3557,11 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
else {
#ifndef GLSLANG_WEB
if (!lastBufferBlockMember) {
builder.addExtension("SPV_EXT_descriptor_indexing");
builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5);
builder.addCapability(spv::CapabilityRuntimeDescriptorArrayEXT);
}
spvType = builder.makeRuntimeArray(spvType);
#endif
spvType = builder.makeRuntimeArray(spvType);
}
if (stride > 0)
builder.addDecoration(spvType, spv::DecorationArrayStride, stride);
@ -3706,6 +3726,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
for (unsigned int i = 0; i < memory.size(); ++i)
builder.addMemberDecoration(spvType, member, memory[i]);
}
#endif
// Location assignment was already completed correctly by the front end,
@ -4164,9 +4185,11 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
// memory and use RestrictPointer/AliasedPointer.
if (originalParam(type.getQualifier().storage, type, false) ||
!writableParam(type.getQualifier().storage)) {
decorations.push_back(type.getQualifier().restrict ? spv::DecorationRestrict : spv::DecorationAliased);
decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrict :
spv::DecorationAliased);
} else {
decorations.push_back(type.getQualifier().restrict ? spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT);
decorations.push_back(type.getQualifier().isRestrict() ? spv::DecorationRestrictPointerEXT :
spv::DecorationAliasedPointerEXT);
}
}
};
@ -4974,6 +4997,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
}
}
#ifndef GLSLANG_WEB
// nonprivate
if (imageType.getQualifier().nonprivate) {
params.nonprivate = true;
@ -4983,6 +5007,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
if (imageType.getQualifier().volatil) {
params.volatil = true;
}
#endif
std::vector<spv::Id> result( 1,
builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather,
@ -5217,6 +5242,30 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, OpD
binOp = spv::OpLogicalNotEqual;
break;
case glslang::EOpAbsDifference:
binOp = isUnsigned ? spv::OpAbsUSubINTEL : spv::OpAbsISubINTEL;
break;
case glslang::EOpAddSaturate:
binOp = isUnsigned ? spv::OpUAddSatINTEL : spv::OpIAddSatINTEL;
break;
case glslang::EOpSubSaturate:
binOp = isUnsigned ? spv::OpUSubSatINTEL : spv::OpISubSatINTEL;
break;
case glslang::EOpAverage:
binOp = isUnsigned ? spv::OpUAverageINTEL : spv::OpIAverageINTEL;
break;
case glslang::EOpAverageRounded:
binOp = isUnsigned ? spv::OpUAverageRoundedINTEL : spv::OpIAverageRoundedINTEL;
break;
case glslang::EOpMul32x16:
binOp = isUnsigned ? spv::OpUMul32x16INTEL : spv::OpIMul32x16INTEL;
break;
case glslang::EOpLessThan:
case glslang::EOpGreaterThan:
case glslang::EOpLessThanEqual:
@ -5731,6 +5780,18 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
libCall = spv::GLSLstd450FindSMsb;
break;
case glslang::EOpCountLeadingZeros:
builder.addCapability(spv::CapabilityIntegerFunctions2INTEL);
builder.addExtension("SPV_INTEL_shader_integer_functions2");
unaryOp = spv::OpUCountLeadingZerosINTEL;
break;
case glslang::EOpCountTrailingZeros:
builder.addCapability(spv::CapabilityIntegerFunctions2INTEL);
builder.addExtension("SPV_INTEL_shader_integer_functions2");
unaryOp = spv::OpUCountTrailingZerosINTEL;
break;
case glslang::EOpBallot:
case glslang::EOpReadFirstInvocation:
case glslang::EOpAnyInvocation:
@ -6278,6 +6339,13 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecora
case glslang::EOpConvPtrToUint64:
convOp = spv::OpConvertPtrToU;
break;
case glslang::EOpConvPtrToUvec2:
case glslang::EOpConvUvec2ToPtr:
if (builder.isVector(operand))
builder.promoteIncorporatedExtension(spv::E_SPV_EXT_physical_storage_buffer,
spv::E_SPV_KHR_physical_storage_buffer, spv::Spv_1_5);
convOp = spv::OpBitcast;
break;
#endif
default:
@ -6399,7 +6467,7 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
scopeId = builder.makeUintConstant(spv::ScopeDevice);
}
// semantics default to relaxed
spv::Id semanticsId = builder.makeUintConstant(lvalueCoherentFlags.isVolatile() ?
spv::Id semanticsId = builder.makeUintConstant(lvalueCoherentFlags.isVolatile() && glslangIntermediate->usingVulkanMemoryModel() ?
spv::MemorySemanticsVolatileMask :
spv::MemorySemanticsMaskNone);
spv::Id semanticsId2 = semanticsId;
@ -6837,8 +6905,9 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s
default: assert(0 && "Unhandled subgroup operation!");
}
const bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64;
const bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble;
const bool isUnsigned = isTypeUnsignedInt(typeProxy);
const bool isFloat = isTypeFloat(typeProxy);
const bool isBool = typeProxy == glslang::EbtBool;
spv::Op opCode = spv::OpNop;
@ -7167,6 +7236,48 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
case glslang::EOpRefract:
libCall = spv::GLSLstd450Refract;
break;
case glslang::EOpBarrier:
{
// This is for the extended controlBarrier function, with four operands.
// The unextended barrier() goes through createNoArgOperation.
assert(operands.size() == 4);
unsigned int executionScope = builder.getConstantScalar(operands[0]);
unsigned int memoryScope = builder.getConstantScalar(operands[1]);
unsigned int semantics = builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3]);
builder.createControlBarrier((spv::Scope)executionScope, (spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
spv::MemorySemanticsMakeVisibleKHRMask |
spv::MemorySemanticsOutputMemoryKHRMask |
spv::MemorySemanticsVolatileMask)) {
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
}
if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || memoryScope == spv::ScopeDevice)) {
builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
}
return 0;
}
break;
case glslang::EOpMemoryBarrier:
{
// This is for the extended memoryBarrier function, with three operands.
// The unextended memoryBarrier() goes through createNoArgOperation.
assert(operands.size() == 3);
unsigned int memoryScope = builder.getConstantScalar(operands[0]);
unsigned int semantics = builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2]);
builder.createMemoryBarrier((spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
spv::MemorySemanticsMakeVisibleKHRMask |
spv::MemorySemanticsOutputMemoryKHRMask |
spv::MemorySemanticsVolatileMask)) {
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
}
if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::ScopeDevice) {
builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
}
return 0;
}
break;
#ifndef GLSLANG_WEB
case glslang::EOpInterpolateAtSample:
if (typeProxy == glslang::EbtFloat16)
@ -7325,47 +7436,6 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
extBuiltins = getExtBuiltins(spv::E_SPV_AMD_shader_explicit_vertex_parameter);
libCall = spv::InterpolateAtVertexAMD;
break;
case glslang::EOpBarrier:
{
// This is for the extended controlBarrier function, with four operands.
// The unextended barrier() goes through createNoArgOperation.
assert(operands.size() == 4);
unsigned int executionScope = builder.getConstantScalar(operands[0]);
unsigned int memoryScope = builder.getConstantScalar(operands[1]);
unsigned int semantics = builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3]);
builder.createControlBarrier((spv::Scope)executionScope, (spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
spv::MemorySemanticsMakeVisibleKHRMask |
spv::MemorySemanticsOutputMemoryKHRMask |
spv::MemorySemanticsVolatileMask)) {
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
}
if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || memoryScope == spv::ScopeDevice)) {
builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
}
return 0;
}
break;
case glslang::EOpMemoryBarrier:
{
// This is for the extended memoryBarrier function, with three operands.
// The unextended memoryBarrier() goes through createNoArgOperation.
assert(operands.size() == 3);
unsigned int memoryScope = builder.getConstantScalar(operands[0]);
unsigned int semantics = builder.getConstantScalar(operands[1]) | builder.getConstantScalar(operands[2]);
builder.createMemoryBarrier((spv::Scope)memoryScope, (spv::MemorySemanticsMask)semantics);
if (semantics & (spv::MemorySemanticsMakeAvailableKHRMask |
spv::MemorySemanticsMakeVisibleKHRMask |
spv::MemorySemanticsOutputMemoryKHRMask |
spv::MemorySemanticsVolatileMask)) {
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
}
if (glslangIntermediate->usingVulkanMemoryModel() && memoryScope == spv::ScopeDevice) {
builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
}
return 0;
}
break;
case glslang::EOpReportIntersectionNV:
{
@ -7473,17 +7543,10 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
// Intrinsics with no arguments (or no return value, and no precision).
spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId)
{
#ifndef GLSLANG_WEB
// GLSL memory barriers use queuefamily scope in new model, device scope in old model
spv::Scope memoryBarrierScope = glslangIntermediate->usingVulkanMemoryModel() ? spv::ScopeQueueFamilyKHR : spv::ScopeDevice;
switch (op) {
case glslang::EOpEmitVertex:
builder.createNoResultOp(spv::OpEmitVertex);
return 0;
case glslang::EOpEndPrimitive:
builder.createNoResultOp(spv::OpEndPrimitive);
return 0;
case glslang::EOpBarrier:
if (glslangIntermediate->getStage() == EShLangTessControl) {
if (glslangIntermediate->usingVulkanMemoryModel()) {
@ -7504,18 +7567,10 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAllMemory |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
case glslang::EOpMemoryBarrierAtomicCounter:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAtomicCounterMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
case glslang::EOpMemoryBarrierBuffer:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsUniformMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
case glslang::EOpMemoryBarrierImage:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsImageMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
case glslang::EOpMemoryBarrierShared:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsWorkgroupMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
@ -7524,6 +7579,15 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsAllMemory |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
#ifndef GLSLANG_WEB
case glslang::EOpMemoryBarrierAtomicCounter:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsAtomicCounterMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
case glslang::EOpMemoryBarrierImage:
builder.createMemoryBarrier(memoryBarrierScope, spv::MemorySemanticsImageMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
return 0;
case glslang::EOpAllMemoryBarrierWithGroupSync:
builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice,
spv::MemorySemanticsAllMemory |
@ -7568,6 +7632,14 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
builder.createMemoryBarrier(spv::ScopeSubgroup, spv::MemorySemanticsWorkgroupMemoryMask |
spv::MemorySemanticsAcquireReleaseMask);
return spv::NoResult;
case glslang::EOpEmitVertex:
builder.createNoResultOp(spv::OpEmitVertex);
return 0;
case glslang::EOpEndPrimitive:
builder.createNoResultOp(spv::OpEndPrimitive);
return 0;
case glslang::EOpSubgroupElect: {
std::vector<spv::Id> operands;
return createSubgroupOperation(op, typeId, operands, glslang::EbtVoid);
@ -7615,10 +7687,10 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
builder.addCapability(spv::CapabilityShaderClockKHR);
return builder.createOp(spv::OpReadClockKHR, typeId, args);
}
#endif
default:
break;
}
#endif
logger->missingFunctionality("unknown operation with no arguments");
@ -7823,7 +7895,6 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
// We now know we have a specialization constant to build
#ifndef GLSLANG_WEB
// gl_WorkGroupSize is a special case until the front-end handles hierarchical specialization constants,
// even then, it's specialization ids are handled by special case syntax in GLSL: layout(local_size_x = ...
if (node.getType().getQualifier().builtIn == glslang::EbvWorkGroupSize) {
@ -7838,7 +7909,6 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
}
return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true);
}
#endif
// An AST node labelled as specialization constant should be a symbol node.
// Its initializer should either be a sub tree with constant nodes, or a constant union array.
@ -8174,7 +8244,8 @@ int GetSpirvGeneratorVersion()
// return 5; // make OpArrayLength result type be an int with signedness of 0
// return 6; // revert version 5 change, which makes a different (new) kind of incorrect code,
// versions 4 and 6 each generate OpArrayLength as it has long been done
return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent
// return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent
return 8; // switch to new dead block eliminator; use OpUnreachable
}
// Write SPIR-V out to a binary file

View file

@ -40,7 +40,7 @@
#endif
#include "SpvTools.h"
#include "../glslang/Include/intermediate.h"
#include "glslang/Include/intermediate.h"
#include <string>
#include <vector>

View file

@ -61,17 +61,22 @@ namespace {
// Use by calling visit() on the root block.
class ReadableOrderTraverser {
public:
explicit ReadableOrderTraverser(std::function<void(Block*)> callback) : callback_(callback) {}
ReadableOrderTraverser(std::function<void(Block*, spv::ReachReason, Block*)> callback)
: callback_(callback) {}
// Visits the block if it hasn't been visited already and isn't currently
// being delayed. Invokes callback(block), then descends into its
// being delayed. Invokes callback(block, why, header), then descends into its
// successors. Delays merge-block and continue-block processing until all
// the branches have been completed.
void visit(Block* block)
// the branches have been completed. If |block| is an unreachable merge block or
// an unreachable continue target, then |header| is the corresponding header block.
void visit(Block* block, spv::ReachReason why, Block* header)
{
assert(block);
if (why == spv::ReachViaControlFlow) {
reachableViaControlFlow_.insert(block);
}
if (visited_.count(block) || delayed_.count(block))
return;
callback_(block);
callback_(block, why, header);
visited_.insert(block);
Block* mergeBlock = nullptr;
Block* continueBlock = nullptr;
@ -87,27 +92,40 @@ public:
delayed_.insert(continueBlock);
}
}
const auto successors = block->getSuccessors();
for (auto it = successors.cbegin(); it != successors.cend(); ++it)
visit(*it);
if (why == spv::ReachViaControlFlow) {
const auto& successors = block->getSuccessors();
for (auto it = successors.cbegin(); it != successors.cend(); ++it)
visit(*it, why, nullptr);
}
if (continueBlock) {
const spv::ReachReason continueWhy =
(reachableViaControlFlow_.count(continueBlock) > 0)
? spv::ReachViaControlFlow
: spv::ReachDeadContinue;
delayed_.erase(continueBlock);
visit(continueBlock);
visit(continueBlock, continueWhy, block);
}
if (mergeBlock) {
const spv::ReachReason mergeWhy =
(reachableViaControlFlow_.count(mergeBlock) > 0)
? spv::ReachViaControlFlow
: spv::ReachDeadMerge;
delayed_.erase(mergeBlock);
visit(mergeBlock);
visit(mergeBlock, mergeWhy, block);
}
}
private:
std::function<void(Block*)> callback_;
std::function<void(Block*, spv::ReachReason, Block*)> callback_;
// Whether a block has already been visited or is being delayed.
std::unordered_set<Block *> visited_, delayed_;
// The set of blocks that actually are reached via control flow.
std::unordered_set<Block *> reachableViaControlFlow_;
};
}
void spv::inReadableOrder(Block* root, std::function<void(Block*)> callback)
void spv::inReadableOrder(Block* root, std::function<void(Block*, spv::ReachReason, Block*)> callback)
{
ReadableOrderTraverser(callback).visit(root);
ReadableOrderTraverser(callback).visit(root, spv::ReachViaControlFlow, nullptr);
}

View file

@ -67,6 +67,7 @@ typedef enum {
Spv_1_2 = (1 << 16) | (2 << 8),
Spv_1_3 = (1 << 16) | (3 << 8),
Spv_1_4 = (1 << 16) | (4 << 8),
Spv_1_5 = (1 << 16) | (5 << 8),
} SpvVersion;
class Builder {
@ -105,6 +106,20 @@ public:
void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
void setEmitOpLines() { emitOpLines = true; }
void addExtension(const char* ext) { extensions.insert(ext); }
void removeExtension(const char* ext)
{
extensions.erase(ext);
}
void addIncorporatedExtension(const char* ext, SpvVersion incorporatedVersion)
{
if (getSpvVersion() < static_cast<unsigned>(incorporatedVersion))
addExtension(ext);
}
void promoteIncorporatedExtension(const char* baseExt, const char* promoExt, SpvVersion incorporatedVersion)
{
removeExtension(baseExt);
addIncorporatedExtension(promoExt, incorporatedVersion);
}
void addInclude(const std::string& name, const std::string& text)
{
spv::Id incId = getStringId(name);
@ -668,16 +683,21 @@ public:
// based on the type of the base and the chain of dereferences.
Id accessChainGetInferredType();
// Add capabilities, extensions, remove unneeded decorations, etc.,
// Add capabilities, extensions, remove unneeded decorations, etc.,
// based on the resulting SPIR-V.
void postProcess();
// Prune unreachable blocks in the CFG and remove unneeded decorations.
void postProcessCFG();
#ifndef GLSLANG_WEB
// Add capabilities, extensions based on instructions in the module.
void postProcessFeatures();
// Hook to visit each instruction in a block in a function
void postProcess(Instruction&);
// Hook to visit each instruction in a reachable block in a function.
void postProcessReachable(const Instruction&);
// Hook to visit each non-32-bit sized float/int operation in a block.
void postProcessType(const Instruction&, spv::Id typeId);
#endif
void dump(std::vector<unsigned int>&) const;

View file

@ -39,6 +39,7 @@
#include <cassert>
#include <cstdlib>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
@ -57,6 +58,7 @@ namespace spv {
namespace spv {
#ifndef GLSLANG_WEB
// Hook to visit each operand type and result type of an instruction.
// Will be called multiple times for one instruction, once for each typed
// operand and the result.
@ -318,17 +320,16 @@ void Builder::postProcess(Instruction& inst)
}
}
}
// Called for each instruction in a reachable block.
void Builder::postProcessReachable(const Instruction&)
{
// did have code here, but questionable to do so without deleting the instructions
}
#endif
// comment in header
void Builder::postProcess()
void Builder::postProcessCFG()
{
// reachableBlocks is the set of blockss reached via control flow, or which are
// unreachable continue targert or unreachable merge.
std::unordered_set<const Block*> reachableBlocks;
std::unordered_map<Block*, Block*> headerForUnreachableContinue;
std::unordered_set<Block*> unreachableMerges;
std::unordered_set<Id> unreachableDefinitions;
// Collect IDs defined in unreachable blocks. For each function, label the
// reachable blocks first. Then for each unreachable block, collect the
@ -336,16 +337,41 @@ void Builder::postProcess()
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
Function* f = *fi;
Block* entry = f->getEntryBlock();
inReadableOrder(entry, [&reachableBlocks](const Block* b) { reachableBlocks.insert(b); });
inReadableOrder(entry,
[&reachableBlocks, &unreachableMerges, &headerForUnreachableContinue]
(Block* b, ReachReason why, Block* header) {
reachableBlocks.insert(b);
if (why == ReachDeadContinue) headerForUnreachableContinue[b] = header;
if (why == ReachDeadMerge) unreachableMerges.insert(b);
});
for (auto bi = f->getBlocks().cbegin(); bi != f->getBlocks().cend(); bi++) {
Block* b = *bi;
if (reachableBlocks.count(b) == 0) {
for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ii++)
if (unreachableMerges.count(b) != 0 || headerForUnreachableContinue.count(b) != 0) {
auto ii = b->getInstructions().cbegin();
++ii; // Keep potential decorations on the label.
for (; ii != b->getInstructions().cend(); ++ii)
unreachableDefinitions.insert(ii->get()->getResultId());
} else if (reachableBlocks.count(b) == 0) {
// The normal case for unreachable code. All definitions are considered dead.
for (auto ii = b->getInstructions().cbegin(); ii != b->getInstructions().cend(); ++ii)
unreachableDefinitions.insert(ii->get()->getResultId());
}
}
}
// Modify unreachable merge blocks and unreachable continue targets.
// Delete their contents.
for (auto mergeIter = unreachableMerges.begin(); mergeIter != unreachableMerges.end(); ++mergeIter) {
(*mergeIter)->rewriteAsCanonicalUnreachableMerge();
}
for (auto continueIter = headerForUnreachableContinue.begin();
continueIter != headerForUnreachableContinue.end();
++continueIter) {
Block* continue_target = continueIter->first;
Block* header = continueIter->second;
continue_target->rewriteAsCanonicalUnreachableContinue(header);
}
// Remove unneeded decorations, for unreachable instructions
decorations.erase(std::remove_if(decorations.begin(), decorations.end(),
[&unreachableDefinitions](std::unique_ptr<Instruction>& I) -> bool {
@ -353,7 +379,11 @@ void Builder::postProcess()
return unreachableDefinitions.count(decoration_id) != 0;
}),
decorations.end());
}
#ifndef GLSLANG_WEB
// comment in header
void Builder::postProcessFeatures() {
// Add per-instruction capabilities, extensions, etc.,
// Look for any 8/16 bit type in physical storage buffer class, and set the
@ -363,24 +393,17 @@ void Builder::postProcess()
Instruction* type = groupedTypes[OpTypePointer][t];
if (type->getImmediateOperand(0) == (unsigned)StorageClassPhysicalStorageBufferEXT) {
if (containsType(type->getIdOperand(1), OpTypeInt, 8)) {
addExtension(spv::E_SPV_KHR_8bit_storage);
addIncorporatedExtension(spv::E_SPV_KHR_8bit_storage, spv::Spv_1_5);
addCapability(spv::CapabilityStorageBuffer8BitAccess);
}
if (containsType(type->getIdOperand(1), OpTypeInt, 16) ||
containsType(type->getIdOperand(1), OpTypeFloat, 16)) {
addExtension(spv::E_SPV_KHR_16bit_storage);
addIncorporatedExtension(spv::E_SPV_KHR_16bit_storage, spv::Spv_1_3);
addCapability(spv::CapabilityStorageBuffer16BitAccess);
}
}
}
// process all reachable instructions...
for (auto bi = reachableBlocks.cbegin(); bi != reachableBlocks.cend(); ++bi) {
const Block* block = *bi;
const auto function = [this](const std::unique_ptr<Instruction>& inst) { postProcessReachable(*inst.get()); };
std::for_each(block->getInstructions().begin(), block->getInstructions().end(), function);
}
// process all block-contained instructions
for (auto fi = module.getFunctions().cbegin(); fi != module.getFunctions().cend(); fi++) {
Function* f = *fi;
@ -414,5 +437,14 @@ void Builder::postProcess()
}
}
}
#endif
// comment in header
void Builder::postProcess() {
postProcessCFG();
#ifndef GLSLANG_WEB
postProcessFeatures();
#endif
}
}; // end spv namespace

View file

@ -173,6 +173,7 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
if (options->generateDebugInfo) {
optimizer.RegisterPass(spvtools::CreatePropagateLineInfoPass());
}
optimizer.RegisterPass(spvtools::CreateWrapOpKillPass());
optimizer.RegisterPass(spvtools::CreateDeadBranchElimPass());
optimizer.RegisterPass(spvtools::CreateMergeReturnPass());
optimizer.RegisterPass(spvtools::CreateInlineExhaustivePass());
@ -196,8 +197,6 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector<unsigned int>
optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass());
if (options->optimizeSize) {
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
// TODO(greg-lunarg): Add this when AMD driver issues are resolved
// optimizer.RegisterPass(CreateCommonUniformElimPass());
}
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());

View file

@ -46,7 +46,7 @@
#include <ostream>
#endif
#include "../glslang/MachineIndependent/localintermediate.h"
#include "glslang/MachineIndependent/localintermediate.h"
#include "Logger.h"
namespace glslang {

View file

@ -931,6 +931,8 @@ const char* CapabilityString(int info)
case CapabilityDemoteToHelperInvocationEXT: return "DemoteToHelperInvocationEXT";
case CapabilityShaderClockKHR: return "ShaderClockKHR";
case CapabilityIntegerFunctions2INTEL: return "CapabilityIntegerFunctions2INTEL";
default: return "Bad";
}
}

View file

@ -91,6 +91,7 @@ enum AddressingModel {
AddressingModelLogical = 0,
AddressingModelPhysical32 = 1,
AddressingModelPhysical64 = 2,
AddressingModelPhysicalStorageBuffer64 = 5348,
AddressingModelPhysicalStorageBuffer64EXT = 5348,
AddressingModelMax = 0x7fffffff,
};
@ -99,6 +100,7 @@ enum MemoryModel {
MemoryModelSimple = 0,
MemoryModelGLSL450 = 1,
MemoryModelOpenCL = 2,
MemoryModelVulkan = 3,
MemoryModelVulkanKHR = 3,
MemoryModelMax = 0x7fffffff,
};
@ -183,6 +185,7 @@ enum StorageClass {
StorageClassHitAttributeNV = 5339,
StorageClassIncomingRayPayloadNV = 5342,
StorageClassShaderRecordBufferNV = 5343,
StorageClassPhysicalStorageBuffer = 5349,
StorageClassPhysicalStorageBufferEXT = 5349,
StorageClassMax = 0x7fffffff,
};
@ -311,9 +314,13 @@ enum ImageOperandsShift {
ImageOperandsConstOffsetsShift = 5,
ImageOperandsSampleShift = 6,
ImageOperandsMinLodShift = 7,
ImageOperandsMakeTexelAvailableShift = 8,
ImageOperandsMakeTexelAvailableKHRShift = 8,
ImageOperandsMakeTexelVisibleShift = 9,
ImageOperandsMakeTexelVisibleKHRShift = 9,
ImageOperandsNonPrivateTexelShift = 10,
ImageOperandsNonPrivateTexelKHRShift = 10,
ImageOperandsVolatileTexelShift = 11,
ImageOperandsVolatileTexelKHRShift = 11,
ImageOperandsSignExtendShift = 12,
ImageOperandsZeroExtendShift = 13,
@ -330,9 +337,13 @@ enum ImageOperandsMask {
ImageOperandsConstOffsetsMask = 0x00000020,
ImageOperandsSampleMask = 0x00000040,
ImageOperandsMinLodMask = 0x00000080,
ImageOperandsMakeTexelAvailableMask = 0x00000100,
ImageOperandsMakeTexelAvailableKHRMask = 0x00000100,
ImageOperandsMakeTexelVisibleMask = 0x00000200,
ImageOperandsMakeTexelVisibleKHRMask = 0x00000200,
ImageOperandsNonPrivateTexelMask = 0x00000400,
ImageOperandsNonPrivateTexelKHRMask = 0x00000400,
ImageOperandsVolatileTexelMask = 0x00000800,
ImageOperandsVolatileTexelKHRMask = 0x00000800,
ImageOperandsSignExtendMask = 0x00001000,
ImageOperandsZeroExtendMask = 0x00002000,
@ -448,8 +459,11 @@ enum Decoration {
DecorationPerViewNV = 5272,
DecorationPerTaskNV = 5273,
DecorationPerVertexNV = 5285,
DecorationNonUniform = 5300,
DecorationNonUniformEXT = 5300,
DecorationRestrictPointer = 5355,
DecorationRestrictPointerEXT = 5355,
DecorationAliasedPointer = 5356,
DecorationAliasedPointerEXT = 5356,
DecorationCounterBuffer = 5634,
DecorationHlslCounterBufferGOOGLE = 5634,
@ -630,8 +644,11 @@ enum MemorySemanticsShift {
MemorySemanticsCrossWorkgroupMemoryShift = 9,
MemorySemanticsAtomicCounterMemoryShift = 10,
MemorySemanticsImageMemoryShift = 11,
MemorySemanticsOutputMemoryShift = 12,
MemorySemanticsOutputMemoryKHRShift = 12,
MemorySemanticsMakeAvailableShift = 13,
MemorySemanticsMakeAvailableKHRShift = 13,
MemorySemanticsMakeVisibleShift = 14,
MemorySemanticsMakeVisibleKHRShift = 14,
MemorySemanticsVolatileShift = 15,
MemorySemanticsMax = 0x7fffffff,
@ -649,8 +666,11 @@ enum MemorySemanticsMask {
MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
MemorySemanticsImageMemoryMask = 0x00000800,
MemorySemanticsOutputMemoryMask = 0x00001000,
MemorySemanticsOutputMemoryKHRMask = 0x00001000,
MemorySemanticsMakeAvailableMask = 0x00002000,
MemorySemanticsMakeAvailableKHRMask = 0x00002000,
MemorySemanticsMakeVisibleMask = 0x00004000,
MemorySemanticsMakeVisibleKHRMask = 0x00004000,
MemorySemanticsVolatileMask = 0x00008000,
};
@ -659,8 +679,11 @@ enum MemoryAccessShift {
MemoryAccessVolatileShift = 0,
MemoryAccessAlignedShift = 1,
MemoryAccessNontemporalShift = 2,
MemoryAccessMakePointerAvailableShift = 3,
MemoryAccessMakePointerAvailableKHRShift = 3,
MemoryAccessMakePointerVisibleShift = 4,
MemoryAccessMakePointerVisibleKHRShift = 4,
MemoryAccessNonPrivatePointerShift = 5,
MemoryAccessNonPrivatePointerKHRShift = 5,
MemoryAccessMax = 0x7fffffff,
};
@ -670,8 +693,11 @@ enum MemoryAccessMask {
MemoryAccessVolatileMask = 0x00000001,
MemoryAccessAlignedMask = 0x00000002,
MemoryAccessNontemporalMask = 0x00000004,
MemoryAccessMakePointerAvailableMask = 0x00000008,
MemoryAccessMakePointerAvailableKHRMask = 0x00000008,
MemoryAccessMakePointerVisibleMask = 0x00000010,
MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
MemoryAccessNonPrivatePointerMask = 0x00000020,
MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
};
@ -681,6 +707,7 @@ enum Scope {
ScopeWorkgroup = 2,
ScopeSubgroup = 3,
ScopeInvocation = 4,
ScopeQueueFamily = 5,
ScopeQueueFamilyKHR = 5,
ScopeMax = 0x7fffffff,
};
@ -781,6 +808,8 @@ enum Capability {
CapabilityGroupNonUniformShuffleRelative = 66,
CapabilityGroupNonUniformClustered = 67,
CapabilityGroupNonUniformQuad = 68,
CapabilityShaderLayer = 69,
CapabilityShaderViewportIndex = 70,
CapabilitySubgroupBallotKHR = 4423,
CapabilityDrawParameters = 4427,
CapabilitySubgroupVoteKHR = 4431,
@ -825,21 +854,36 @@ enum Capability {
CapabilityFragmentDensityEXT = 5291,
CapabilityShadingRateNV = 5291,
CapabilityGroupNonUniformPartitionedNV = 5297,
CapabilityShaderNonUniform = 5301,
CapabilityShaderNonUniformEXT = 5301,
CapabilityRuntimeDescriptorArray = 5302,
CapabilityRuntimeDescriptorArrayEXT = 5302,
CapabilityInputAttachmentArrayDynamicIndexing = 5303,
CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303,
CapabilityUniformTexelBufferArrayDynamicIndexing = 5304,
CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304,
CapabilityStorageTexelBufferArrayDynamicIndexing = 5305,
CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305,
CapabilityUniformBufferArrayNonUniformIndexing = 5306,
CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306,
CapabilitySampledImageArrayNonUniformIndexing = 5307,
CapabilitySampledImageArrayNonUniformIndexingEXT = 5307,
CapabilityStorageBufferArrayNonUniformIndexing = 5308,
CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308,
CapabilityStorageImageArrayNonUniformIndexing = 5309,
CapabilityStorageImageArrayNonUniformIndexingEXT = 5309,
CapabilityInputAttachmentArrayNonUniformIndexing = 5310,
CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310,
CapabilityUniformTexelBufferArrayNonUniformIndexing = 5311,
CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
CapabilityRayTracingNV = 5340,
CapabilityVulkanMemoryModel = 5345,
CapabilityVulkanMemoryModelKHR = 5345,
CapabilityVulkanMemoryModelDeviceScope = 5346,
CapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
CapabilityPhysicalStorageBufferAddresses = 5347,
CapabilityPhysicalStorageBufferAddressesEXT = 5347,
CapabilityComputeDerivativeGroupLinearNV = 5350,
CapabilityCooperativeMatrixNV = 5357,

View file

@ -226,6 +226,36 @@ public:
return nullptr;
}
// Change this block into a canonical dead merge block. Delete instructions
// as necessary. A canonical dead merge block has only an OpLabel and an
// OpUnreachable.
void rewriteAsCanonicalUnreachableMerge() {
assert(localVariables.empty());
// Delete all instructions except for the label.
assert(instructions.size() > 0);
instructions.resize(1);
successors.clear();
Instruction* unreachable = new Instruction(OpUnreachable);
addInstruction(std::unique_ptr<Instruction>(unreachable));
}
// Change this block into a canonical dead continue target branching to the
// given header ID. Delete instructions as necessary. A canonical dead continue
// target has only an OpLabel and an unconditional branch back to the corresponding
// header.
void rewriteAsCanonicalUnreachableContinue(Block* header) {
assert(localVariables.empty());
// Delete all instructions except for the label.
assert(instructions.size() > 0);
instructions.resize(1);
successors.clear();
// Add OpBranch back to the header.
assert(header != nullptr);
Instruction* branch = new Instruction(OpBranch);
branch->addIdOperand(header->getId());
addInstruction(std::unique_ptr<Instruction>(branch));
successors.push_back(header);
}
bool isTerminated() const
{
switch (instructions.back()->getOpCode()) {
@ -235,6 +265,7 @@ public:
case OpKill:
case OpReturn:
case OpReturnValue:
case OpUnreachable:
return true;
default:
return false;
@ -268,10 +299,24 @@ protected:
bool unreachable;
};
// The different reasons for reaching a block in the inReadableOrder traversal.
enum ReachReason {
// Reachable from the entry block via transfers of control, i.e. branches.
ReachViaControlFlow = 0,
// A continue target that is not reachable via control flow.
ReachDeadContinue,
// A merge block that is not reachable via control flow.
ReachDeadMerge
};
// Traverses the control-flow graph rooted at root in an order suited for
// readable code generation. Invokes callback at every node in the traversal
// order.
void inReadableOrder(Block* root, std::function<void(Block*)> callback);
// order. The callback arguments are:
// - the block,
// - the reason we reached the block,
// - if the reason was that block is an unreachable continue or unreachable merge block
// then the last parameter is the corresponding header block.
void inReadableOrder(Block* root, std::function<void(Block*, ReachReason, Block* header)> callback);
//
// SPIR-V IR Function.
@ -321,7 +366,7 @@ public:
parameterInstructions[p]->dump(out);
// Blocks
inReadableOrder(blocks[0], [&out](const Block* b) { b->dump(out); });
inReadableOrder(blocks[0], [&out](const Block* b, ReachReason, Block*) { b->dump(out); });
Instruction end(0, 0, OpFunctionEnd);
end.dump(out);
}

View file

@ -4,25 +4,25 @@ set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(glslang-default-resource-limits
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PUBLIC ${PROJECT_SOURCE_DIR})
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
set(SOURCES StandAlone.cpp DirStackFileIncluder.h)
set(REMAPPER_SOURCES spirv-remap.cpp)
add_executable(glslangValidator ${SOURCES})
add_executable(spirv-remap ${REMAPPER_SOURCES})
set_property(TARGET glslangValidator PROPERTY FOLDER tools)
set_property(TARGET spirv-remap PROPERTY FOLDER tools)
glslang_set_link_args(glslangValidator)
glslang_set_link_args(spirv-remap)
set(LIBRARIES
glslang
SPIRV
SPVRemapper
glslang-default-resource-limits)
if(ENABLE_SPVREMAPPER)
set(LIBRARIES ${LIBRARIES} SPVRemapper)
endif()
if(WIN32)
set(LIBRARIES ${LIBRARIES} psapi)
elseif(UNIX)
@ -32,22 +32,36 @@ elseif(UNIX)
endif(WIN32)
target_link_libraries(glslangValidator ${LIBRARIES})
target_link_libraries(spirv-remap ${LIBRARIES})
target_include_directories(glslangValidator PUBLIC ../External)
target_include_directories(glslangValidator PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
if(ENABLE_SPVREMAPPER)
set(REMAPPER_SOURCES spirv-remap.cpp)
add_executable(spirv-remap ${REMAPPER_SOURCES})
set_property(TARGET spirv-remap PROPERTY FOLDER tools)
glslang_set_link_args(spirv-remap)
target_link_libraries(spirv-remap ${LIBRARIES})
endif()
if(WIN32)
source_group("Source" FILES ${SOURCES})
endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslangValidator
install(TARGETS glslangValidator EXPORT glslangValidatorTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(EXPORT glslangValidatorTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
install(TARGETS spirv-remap
if(ENABLE_SPVREMAPPER)
install(TARGETS spirv-remap EXPORT spirv-remapTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(EXPORT spirv-remapTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif()
if(BUILD_SHARED_LIBS)
install(TARGETS glslang-default-resource-limits
install(TARGETS glslang-default-resource-limits EXPORT glslang-default-resource-limitsTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT glslang-default-resource-limitsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif()
endif(ENABLE_GLSLANG_INSTALL)

View file

@ -615,8 +615,12 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
} else if (strcmp(argv[1], "spirv1.4") == 0) {
TargetLanguage = glslang::EShTargetSpv;
TargetVersion = glslang::EShTargetSpv_1_4;
} else if (strcmp(argv[1], "spirv1.5") == 0) {
TargetLanguage = glslang::EShTargetSpv;
TargetVersion = glslang::EShTargetSpv_1_5;
} else
Error("--target-env expected one of: vulkan1.0, vulkan1.1, opengl, spirv1.0, spirv1.1, spirv1.2, or spirv1.3");
Error("--target-env expected one of: vulkan1.0, vulkan1.1, opengl,\n"
"spirv1.0, spirv1.1, spirv1.2, spirv1.3, spirv1.4, or spirv1.5");
}
bumpArg();
} else if (lowerword == "variable-name" || // synonyms
@ -984,7 +988,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
// Set base bindings
shader->setShiftBinding(res, baseBinding[res][compUnit.stage]);
// Set bindings for particular resource sets
// TODO: use a range based for loop here, when available in all environments.
for (auto i = baseBindingForSet[res][compUnit.stage].begin();
@ -1618,7 +1622,7 @@ void usage()
" --stdin read from stdin instead of from a file;\n"
" requires providing the shader stage using -S\n"
" --target-env {vulkan1.0 | vulkan1.1 | opengl | \n"
" spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3}\n"
" spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3 | spirv1.4 | spirv1.5}\n"
" set execution environment that emitted code\n"
" will execute in (versus source language\n"
" semantics selected by --client) defaults:\n"

View file

@ -219,6 +219,9 @@ int init1 = gl_FrontFacing ? 1 : 2; // ERROR, non-const initializer
int init2 = gl_FrontFacing ? 1 : 2;
#define A__B // error
int a__b; // error
#pragma STDGL invariant(all)
#line 3000

View file

@ -167,3 +167,12 @@ void qux2()
}
layout(early_fragment_tests) out; // ERROR
#extension GL_ARB_explicit_uniform_location : enable
layout(location = 3) uniform vec4 ucolor0; // ERROR: explicit attrib location is also required for version < 330
#extension GL_ARB_explicit_attrib_location : enable
layout(location = 4) uniform vec4 ucolor1;

View file

@ -47,4 +47,5 @@ void barWxyz()
int primitiveID()
{
return gl_PrimitiveID;
gl_PerFragment; // ERROR, block name can't get reused
}

View file

@ -149,4 +149,17 @@ void fooKeyMem()
KeyMem.precise;
}
layout(location=28, index=2) out vec4 outIndex2; // ERROR index out of range
layout(location=28, index=2) out vec4 outIndex2; // ERROR index out of range
layout(location=4) uniform vec4 ucolor0; // ERROR: extension is not enabled
#extension GL_ARB_explicit_uniform_location : enable
layout(location=5) uniform vec4 ucolor1;
layout(location=6) uniform ColorsBuffer // ERROR: location cannot be applied in uniform buffer block
{
vec4 colors[128];
} colorsBuffer;

View file

@ -48,6 +48,9 @@ shared vec4 s;
layout(location = 2) shared vec4 sl; // ERROR
shared float fs = 4.2; // ERROR
layout(local_size_y = 1) in;
layout(local_size_y = 2) in; // ERROR, changing
layout(local_size_y = 1) in;
layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR
int arrX[gl_WorkGroupSize.x];

View file

@ -1,6 +1,6 @@
hlsl.aliasOpaque.frag
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 87
Capability Shader

View file

@ -1,6 +1,6 @@
hlsl.flattenOpaque.frag
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 185
Capability Shader

View file

@ -1,6 +1,6 @@
hlsl.flattenOpaqueInit.vert
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 134
Capability Shader

View file

@ -1,6 +1,6 @@
hlsl.flattenOpaqueInitMix.vert
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 97
Capability Shader

View file

@ -1,6 +1,6 @@
hlsl.flattenSubset.frag
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 66
Capability Shader

View file

@ -1,6 +1,6 @@
hlsl.flattenSubset2.frag
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 53
Capability Shader

View file

@ -1,6 +1,6 @@
hlsl.partialFlattenLocal.vert
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 158
Capability Shader

View file

@ -1,6 +1,6 @@
hlsl.partialFlattenMixed.vert
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 36
Capability Shader

View file

@ -83,9 +83,11 @@ ERROR: 0:193: '.length' : not supported for this version or the enabled extensio
ERROR: 0:194: '.' : cannot apply to an array: method
ERROR: 0:194: 'a' : can't use function syntax on variable
ERROR: 0:214: 'non-constant global initializer (needs GL_EXT_shader_non_constant_global_initializers)' : not supported for this version or the enabled extensions
ERROR: 0:222: '#define' : names containing consecutive underscores are reserved, and an error if version < 300: A__B
ERROR: 0:223: 'a__b' : identifiers containing consecutive underscores ("__") are reserved, and an error if version < 300
ERROR: 0:3000: '#error' : line of this error should be 3000
ERROR: 0:3002: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON
ERROR: 77 compilation errors. No code generated.
ERROR: 79 compilation errors. No code generated.
Shader version: 100
@ -421,6 +423,7 @@ ERROR: node is still EOpNull!
0:? 5.000000
0:? 'init1' ( global mediump int)
0:? 'init2' ( global mediump int)
0:? 'a__b' ( global mediump int)
Linked fragment stage:
@ -573,4 +576,5 @@ ERROR: node is still EOpNull!
0:? 5.000000
0:? 'init1' ( global mediump int)
0:? 'init2' ( global mediump int)
0:? 'a__b' ( global mediump int)

View file

@ -29,10 +29,13 @@ ERROR: 0:153: 'early_fragment_tests' : not supported for this version or the ena
ERROR: 0:154: 'image load store' : not supported for this version or the enabled extensions
ERROR: 0:154: 'iimage2D' : Reserved word.
ERROR: 0:169: 'early_fragment_tests' : can only apply to 'in'
ERROR: 28 compilation errors. No code generated.
ERROR: 0:173: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions
ERROR: 29 compilation errors. No code generated.
Shader version: 130
Requested GL_ARB_explicit_attrib_location
Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_gpu_shader5
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_shader_image_load_store
@ -402,12 +405,16 @@ ERROR: node is still EOpNull!
0:? 'gl_FogFragCoord' ( smooth in float)
0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D)
0:? 'iimg2D' (layout( r32i) uniform iimage2D)
0:? 'ucolor0' (layout( location=3) uniform 4-component vector of float)
0:? 'ucolor1' (layout( location=4) uniform 4-component vector of float)
Linked fragment stage:
Shader version: 130
Requested GL_ARB_explicit_attrib_location
Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_gpu_shader5
Requested GL_ARB_separate_shader_objects
Requested GL_ARB_shader_image_load_store
@ -457,4 +464,6 @@ ERROR: node is still EOpNull!
0:? 'gl_FogFragCoord' ( smooth in float)
0:? 'iimg2Dbad' (layout( r32i) uniform iimage2D)
0:? 'iimg2D' (layout( r32i) uniform iimage2D)
0:? 'ucolor0' (layout( location=3) uniform 4-component vector of float)
0:? 'ucolor1' (layout( location=4) uniform 4-component vector of float)

View file

@ -3,7 +3,9 @@ ERROR: 0:4: 'redeclaration' : cannot redeclare with different qualification: gl_
ERROR: 0:5: 'redeclaration' : cannot redeclare with different qualification: gl_FragCoord
ERROR: 0:6: 'layout qualifier' : can only apply origin_upper_left and pixel_center_origin to gl_FragCoord
ERROR: 0:14: 'gl_FragCoord' : cannot redeclare after use
ERROR: 4 compilation errors. No code generated.
ERROR: 0:50: 'gl_PerFragment' : cannot be used (maybe an instance name is needed)
ERROR: 0:50: 'gl_PerFragment' : undeclared identifier
ERROR: 6 compilation errors. No code generated.
Shader version: 150
@ -106,6 +108,7 @@ ERROR: node is still EOpNull!
0:49 Sequence
0:49 Branch: Return with expression
0:49 'gl_PrimitiveID' ( flat in int PrimitiveID)
0:50 'gl_PerFragment' ( temp float)
0:? Linker Objects
0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord)
0:? 'foo' ( smooth in 4-component vector of float)

View file

@ -1,9 +1,9 @@
300BuiltIns.frag
ERROR: 0:6: 'float' : type requires declaration of default precision qualifier
ERROR: 0:70: 'noise2' : no matching overloaded function found
ERROR: 0:72: 't__' : identifiers containing consecutive underscores ("__") are reserved, and an error if version <= 300
ERROR: 0:75: '#define' : names containing consecutive underscores are reserved, and an error if version <= 300: __D
ERROR: 4 compilation errors. No code generated.
WARNING: 0:72: 't__' : identifiers containing consecutive underscores ("__") are reserved
WARNING: 0:75: '#define' : names containing consecutive underscores are reserved: __D
ERROR: 2 compilation errors. No code generated.
Shader version: 300

View file

@ -40,11 +40,14 @@ ERROR: 0:140: 'assign' : cannot convert from ' const float' to ' temp 2-compone
ERROR: 0:141: 'textureQueryLod' : no matching overloaded function found
ERROR: 0:141: 'assign' : cannot convert from ' const float' to ' temp 2-component vector of float'
ERROR: 0:152: 'index' : value must be 0 or 1
ERROR: 41 compilation errors. No code generated.
ERROR: 0:154: 'location qualifier on uniform or buffer' : not supported for this version or the enabled extensions
ERROR: 0:160: 'location' : cannot apply to uniform or buffer block
ERROR: 43 compilation errors. No code generated.
Shader version: 330
Requested GL_ARB_enhanced_layouts
Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_separate_shader_objects
ERROR: node is still EOpNull!
0:8 Function Definition: main( ( global void)
@ -126,6 +129,9 @@ ERROR: node is still EOpNull!
0:? 'precise' ( global int)
0:? 'KeyMem' ( global structure{ global int precise})
0:? 'outIndex2' (layout( location=28 index=0) out 4-component vector of float)
0:? 'ucolor0' (layout( location=4) uniform 4-component vector of float)
0:? 'ucolor1' (layout( location=5) uniform 4-component vector of float)
0:? 'colorsBuffer' (layout( location=6 column_major shared) uniform block{layout( column_major shared) uniform 128-element array of 4-component vector of float colors})
Linked fragment stage:
@ -135,6 +141,7 @@ ERROR: Linking fragment stage: Cannot use both gl_FragColor and gl_FragData
Shader version: 330
Requested GL_ARB_enhanced_layouts
Requested GL_ARB_explicit_uniform_location
Requested GL_ARB_separate_shader_objects
ERROR: node is still EOpNull!
0:8 Function Definition: main( ( global void)
@ -191,4 +198,7 @@ ERROR: node is still EOpNull!
0:? 'precise' ( global int)
0:? 'KeyMem' ( global structure{ global int precise})
0:? 'outIndex2' (layout( location=28 index=0) out 4-component vector of float)
0:? 'ucolor0' (layout( location=4) uniform 4-component vector of float)
0:? 'ucolor1' (layout( location=5) uniform 4-component vector of float)
0:? 'colorsBuffer' (layout( location=6 column_major shared) uniform block{layout( column_major shared) uniform 128-element array of 4-component vector of float colors})

View file

@ -8,14 +8,15 @@ ERROR: 0:45: 'out' : global storage output qualifier cannot be used in a compute
ERROR: 0:48: 'shared' : cannot apply layout qualifiers to a shared variable
ERROR: 0:48: 'location' : can only apply to uniform, buffer, in, or out storage qualifiers
ERROR: 0:49: 'shared' : cannot initialize this type of qualifier
ERROR: 0:51: 'local_size' : can only apply to 'in'
ERROR: 0:51: 'local_size' : can only apply to 'in'
ERROR: 0:51: 'local_size' : can only apply to 'in'
ERROR: 0:65: 'assign' : l-value required "ro" (can't modify a readonly buffer)
ERROR: 0:77: '=' : cannot convert from ' temp double' to ' temp int'
ERROR: 0:81: 'input block' : not supported in this stage: compute
ERROR: 0:85: 'output block' : not supported in this stage: compute
ERROR: 16 compilation errors. No code generated.
ERROR: 0:52: 'local_size' : cannot change previously set size
ERROR: 0:54: 'local_size' : can only apply to 'in'
ERROR: 0:54: 'local_size' : can only apply to 'in'
ERROR: 0:54: 'local_size' : can only apply to 'in'
ERROR: 0:68: 'assign' : l-value required "ro" (can't modify a readonly buffer)
ERROR: 0:80: '=' : cannot convert from ' temp double' to ' temp int'
ERROR: 0:84: 'input block' : not supported in this stage: compute
ERROR: 0:88: 'output block' : not supported in this stage: compute
ERROR: 17 compilation errors. No code generated.
Shader version: 430
@ -51,77 +52,77 @@ ERROR: node is still EOpNull!
0:39 10 (const int)
0:39 true case
0:40 Barrier ( global void)
0:63 Function Definition: foo( ( global void)
0:63 Function Parameters:
0:65 Sequence
0:65 move second child to first child ( temp float)
0:65 direct index (layout( column_major shared) readonly temp float)
0:65 values: direct index for structure (layout( column_major shared) readonly buffer unsized 3-element array of float)
0:65 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer int value, layout( column_major shared) readonly buffer unsized 3-element array of float values})
0:65 Constant:
0:65 1 (const int)
0:65 Constant:
0:65 2 (const int)
0:65 Constant:
0:65 4.700000
0:66 array length ( temp int)
0:66 values: direct index for structure (layout( column_major shared) readonly buffer unsized 3-element array of float)
0:66 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer int value, layout( column_major shared) readonly buffer unsized 3-element array of float values})
0:66 Constant:
0:66 1 (const int)
0:67 Barrier ( global void)
0:72 Function Definition: fooaoeu( ( global void)
0:72 Function Parameters:
0:73 Sequence
0:73 Sequence
0:73 move second child to first child ( temp 2-component vector of int)
0:73 'storePos' ( temp 2-component vector of int)
0:73 Convert uint to int ( temp 2-component vector of int)
0:73 vector swizzle ( temp 2-component vector of uint)
0:73 'gl_GlobalInvocationID' ( in 3-component vector of uint GlobalInvocationID)
0:73 Sequence
0:73 Constant:
0:73 0 (const int)
0:73 Constant:
0:73 1 (const int)
0:74 Sequence
0:74 move second child to first child ( temp double)
0:74 'localCoef' ( temp double)
0:74 Convert float to double ( temp double)
0:74 length ( global float)
0:74 divide ( temp 2-component vector of float)
0:74 Convert int to float ( temp 2-component vector of float)
0:74 subtract ( temp 2-component vector of int)
0:74 Convert uint to int ( temp 2-component vector of int)
0:74 vector swizzle ( temp 2-component vector of uint)
0:74 'gl_LocalInvocationID' ( in 3-component vector of uint LocalInvocationID)
0:74 Sequence
0:74 Constant:
0:74 0 (const int)
0:74 Constant:
0:74 1 (const int)
0:74 Constant:
0:74 8 (const int)
0:74 Constant:
0:74 8.000000
0:75 Sequence
0:75 move second child to first child ( temp 4-component vector of double)
0:75 'aa' ( temp 4-component vector of double)
0:75 Constant:
0:75 0.400000
0:75 0.200000
0:75 0.300000
0:75 0.400000
0:66 Function Definition: foo( ( global void)
0:66 Function Parameters:
0:68 Sequence
0:68 move second child to first child ( temp float)
0:68 direct index (layout( column_major shared) readonly temp float)
0:68 values: direct index for structure (layout( column_major shared) readonly buffer unsized 3-element array of float)
0:68 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer int value, layout( column_major shared) readonly buffer unsized 3-element array of float values})
0:68 Constant:
0:68 1 (const int)
0:68 Constant:
0:68 2 (const int)
0:68 Constant:
0:68 4.700000
0:69 array length ( temp int)
0:69 values: direct index for structure (layout( column_major shared) readonly buffer unsized 3-element array of float)
0:69 'ro' (layout( column_major shared) readonly buffer block{layout( column_major shared) readonly buffer int value, layout( column_major shared) readonly buffer unsized 3-element array of float values})
0:69 Constant:
0:69 1 (const int)
0:70 Barrier ( global void)
0:75 Function Definition: fooaoeu( ( global void)
0:75 Function Parameters:
0:76 Sequence
0:76 Sequence
0:76 move second child to first child ( temp double)
0:76 'globalCoef' ( temp double)
0:76 Constant:
0:76 1.000000
0:76 move second child to first child ( temp 2-component vector of int)
0:76 'storePos' ( temp 2-component vector of int)
0:76 Convert uint to int ( temp 2-component vector of int)
0:76 vector swizzle ( temp 2-component vector of uint)
0:76 'gl_GlobalInvocationID' ( in 3-component vector of uint GlobalInvocationID)
0:76 Sequence
0:76 Constant:
0:76 0 (const int)
0:76 Constant:
0:76 1 (const int)
0:77 Sequence
0:77 move second child to first child ( temp double)
0:77 'localCoef' ( temp double)
0:77 Convert float to double ( temp double)
0:77 length ( global float)
0:77 divide ( temp 2-component vector of float)
0:77 Convert int to float ( temp 2-component vector of float)
0:77 subtract ( temp 2-component vector of int)
0:77 Convert uint to int ( temp 2-component vector of int)
0:77 vector swizzle ( temp 2-component vector of uint)
0:77 'gl_LocalInvocationID' ( in 3-component vector of uint LocalInvocationID)
0:77 Sequence
0:77 Constant:
0:77 0 (const int)
0:77 Constant:
0:77 1 (const int)
0:77 Constant:
0:77 8 (const int)
0:77 Constant:
0:77 8.000000
0:78 Sequence
0:78 move second child to first child ( temp double)
0:78 'di' ( temp double)
0:78 Convert int to double ( temp double)
0:78 'i' ( temp int)
0:78 move second child to first child ( temp 4-component vector of double)
0:78 'aa' ( temp 4-component vector of double)
0:78 Constant:
0:78 0.400000
0:78 0.200000
0:78 0.300000
0:78 0.400000
0:79 Sequence
0:79 move second child to first child ( temp double)
0:79 'globalCoef' ( temp double)
0:79 Constant:
0:79 1.000000
0:81 Sequence
0:81 move second child to first child ( temp double)
0:81 'di' ( temp double)
0:81 Convert int to double ( temp double)
0:81 'i' ( temp int)
0:? Linker Objects
0:? 'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize)
0:? 2 (const uint)

View file

@ -1,6 +1,6 @@
compoundsuffix.frag.hlsl
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 22
Capability Shader

View file

@ -85,11 +85,13 @@ ERROR: 0:95: 'subgroupPartitionedExclusiveMaxNV' : required extension not reques
ERROR: 0:96: 'subgroupPartitionedExclusiveAndNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
ERROR: 0:97: 'subgroupPartitionedExclusiveOrNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
ERROR: 0:98: 'subgroupPartitionedExclusiveXorNV' : required extension not requested: GL_NV_shader_subgroup_partitioned
ERROR: 0:232: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
ERROR: 0:233: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
ERROR: 0:234: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
ERROR: 0:235: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
ERROR: 90 compilation errors. No code generated.
ERROR: 0:124: 'id' : argument must be compile-time constant
ERROR: 0:199: 'id' : argument must be compile-time constant
ERROR: 0:236: 'gl_WarpsPerSMNV' : required extension not requested: GL_NV_shader_sm_builtins
ERROR: 0:237: 'gl_SMCountNV' : required extension not requested: GL_NV_shader_sm_builtins
ERROR: 0:238: 'gl_WarpIDNV' : required extension not requested: GL_NV_shader_sm_builtins
ERROR: 0:239: 'gl_SMIDNV' : required extension not requested: GL_NV_shader_sm_builtins
ERROR: 92 compilation errors. No code generated.
Shader version: 450
@ -352,270 +354,278 @@ ERROR: node is still EOpNull!
0:116 Function Definition: ballot_works(vf4; ( global void)
0:116 Function Parameters:
0:116 'f4' ( in 4-component vector of float)
0:117 Sequence
0:117 'gl_SubgroupEqMask' ( flat in 4-component vector of uint SubgroupEqMask)
0:118 'gl_SubgroupGeMask' ( flat in 4-component vector of uint SubgroupGeMask)
0:119 'gl_SubgroupGtMask' ( flat in 4-component vector of uint SubgroupGtMask)
0:120 'gl_SubgroupLeMask' ( flat in 4-component vector of uint SubgroupLeMask)
0:121 'gl_SubgroupLtMask' ( flat in 4-component vector of uint SubgroupLtMask)
0:122 subgroupBroadcast ( global 4-component vector of float)
0:122 'f4' ( in 4-component vector of float)
0:122 Constant:
0:122 0 (const uint)
0:123 subgroupBroadcastFirst ( global 4-component vector of float)
0:? Sequence
0:118 'gl_SubgroupEqMask' ( flat in 4-component vector of uint SubgroupEqMask)
0:119 'gl_SubgroupGeMask' ( flat in 4-component vector of uint SubgroupGeMask)
0:120 'gl_SubgroupGtMask' ( flat in 4-component vector of uint SubgroupGtMask)
0:121 'gl_SubgroupLeMask' ( flat in 4-component vector of uint SubgroupLeMask)
0:122 'gl_SubgroupLtMask' ( flat in 4-component vector of uint SubgroupLtMask)
0:123 subgroupBroadcast ( global 4-component vector of float)
0:123 'f4' ( in 4-component vector of float)
0:124 Sequence
0:124 move second child to first child ( temp 4-component vector of uint)
0:124 'ballot' ( temp 4-component vector of uint)
0:124 subgroupBallot ( global 4-component vector of uint)
0:124 Constant:
0:124 false (const bool)
0:125 subgroupInverseBallot ( global bool)
0:125 Constant:
0:125 1 (const uint)
0:125 1 (const uint)
0:125 1 (const uint)
0:125 1 (const uint)
0:126 subgroupBallotBitExtract ( global bool)
0:126 'ballot' ( temp 4-component vector of uint)
0:126 Constant:
0:126 0 (const uint)
0:127 subgroupBallotBitCount ( global uint)
0:127 'ballot' ( temp 4-component vector of uint)
0:128 subgroupBallotInclusiveBitCount ( global uint)
0:123 Constant:
0:123 0 (const uint)
0:124 subgroupBroadcast ( global 4-component vector of float)
0:124 'f4' ( in 4-component vector of float)
0:124 Convert int to uint ( temp uint)
0:124 'i' ( temp int)
0:125 subgroupBroadcastFirst ( global 4-component vector of float)
0:125 'f4' ( in 4-component vector of float)
0:126 Sequence
0:126 move second child to first child ( temp 4-component vector of uint)
0:126 'ballot' ( temp 4-component vector of uint)
0:126 subgroupBallot ( global 4-component vector of uint)
0:126 Constant:
0:126 false (const bool)
0:127 subgroupInverseBallot ( global bool)
0:127 Constant:
0:127 1 (const uint)
0:127 1 (const uint)
0:127 1 (const uint)
0:127 1 (const uint)
0:128 subgroupBallotBitExtract ( global bool)
0:128 'ballot' ( temp 4-component vector of uint)
0:129 subgroupBallotExclusiveBitCount ( global uint)
0:128 Constant:
0:128 0 (const uint)
0:129 subgroupBallotBitCount ( global uint)
0:129 'ballot' ( temp 4-component vector of uint)
0:130 subgroupBallotFindLSB ( global uint)
0:130 subgroupBallotInclusiveBitCount ( global uint)
0:130 'ballot' ( temp 4-component vector of uint)
0:131 subgroupBallotFindMSB ( global uint)
0:131 subgroupBallotExclusiveBitCount ( global uint)
0:131 'ballot' ( temp 4-component vector of uint)
0:135 Function Definition: vote_works(vf4; ( global void)
0:135 Function Parameters:
0:135 'f4' ( in 4-component vector of float)
0:137 Sequence
0:137 subgroupAll ( global bool)
0:137 Constant:
0:137 true (const bool)
0:138 subgroupAny ( global bool)
0:138 Constant:
0:138 false (const bool)
0:139 subgroupAllEqual ( global bool)
0:139 'f4' ( in 4-component vector of float)
0:144 Function Definition: shuffle_works(vf4; ( global void)
0:144 Function Parameters:
0:144 'f4' ( in 4-component vector of float)
0:146 Sequence
0:146 subgroupShuffle ( global 4-component vector of float)
0:146 'f4' ( in 4-component vector of float)
0:146 Constant:
0:146 0 (const uint)
0:147 subgroupShuffleXor ( global 4-component vector of float)
0:147 'f4' ( in 4-component vector of float)
0:147 Constant:
0:147 1 (const uint)
0:148 subgroupShuffleUp ( global 4-component vector of float)
0:132 subgroupBallotFindLSB ( global uint)
0:132 'ballot' ( temp 4-component vector of uint)
0:133 subgroupBallotFindMSB ( global uint)
0:133 'ballot' ( temp 4-component vector of uint)
0:137 Function Definition: vote_works(vf4; ( global void)
0:137 Function Parameters:
0:137 'f4' ( in 4-component vector of float)
0:139 Sequence
0:139 subgroupAll ( global bool)
0:139 Constant:
0:139 true (const bool)
0:140 subgroupAny ( global bool)
0:140 Constant:
0:140 false (const bool)
0:141 subgroupAllEqual ( global bool)
0:141 'f4' ( in 4-component vector of float)
0:146 Function Definition: shuffle_works(vf4; ( global void)
0:146 Function Parameters:
0:146 'f4' ( in 4-component vector of float)
0:148 Sequence
0:148 subgroupShuffle ( global 4-component vector of float)
0:148 'f4' ( in 4-component vector of float)
0:148 Constant:
0:148 1 (const uint)
0:149 subgroupShuffleDown ( global 4-component vector of float)
0:148 0 (const uint)
0:149 subgroupShuffleXor ( global 4-component vector of float)
0:149 'f4' ( in 4-component vector of float)
0:149 Constant:
0:149 1 (const uint)
0:153 Function Definition: arith_works(vf4; ( global void)
0:153 Function Parameters:
0:153 'f4' ( in 4-component vector of float)
0:150 subgroupShuffleUp ( global 4-component vector of float)
0:150 'f4' ( in 4-component vector of float)
0:150 Constant:
0:150 1 (const uint)
0:151 subgroupShuffleDown ( global 4-component vector of float)
0:151 'f4' ( in 4-component vector of float)
0:151 Constant:
0:151 1 (const uint)
0:155 Function Definition: arith_works(vf4; ( global void)
0:155 Function Parameters:
0:155 'f4' ( in 4-component vector of float)
0:? Sequence
0:156 subgroupAdd ( global 4-component vector of float)
0:156 'f4' ( in 4-component vector of float)
0:157 subgroupMul ( global 4-component vector of float)
0:157 'f4' ( in 4-component vector of float)
0:158 subgroupMin ( global 4-component vector of float)
0:158 subgroupAdd ( global 4-component vector of float)
0:158 'f4' ( in 4-component vector of float)
0:159 subgroupMax ( global 4-component vector of float)
0:159 subgroupMul ( global 4-component vector of float)
0:159 'f4' ( in 4-component vector of float)
0:160 subgroupAnd ( global 4-component vector of uint)
0:160 'ballot' ( temp 4-component vector of uint)
0:161 subgroupOr ( global 4-component vector of uint)
0:161 'ballot' ( temp 4-component vector of uint)
0:162 subgroupXor ( global 4-component vector of uint)
0:160 subgroupMin ( global 4-component vector of float)
0:160 'f4' ( in 4-component vector of float)
0:161 subgroupMax ( global 4-component vector of float)
0:161 'f4' ( in 4-component vector of float)
0:162 subgroupAnd ( global 4-component vector of uint)
0:162 'ballot' ( temp 4-component vector of uint)
0:163 subgroupInclusiveAdd ( global 4-component vector of float)
0:163 'f4' ( in 4-component vector of float)
0:164 subgroupInclusiveMul ( global 4-component vector of float)
0:164 'f4' ( in 4-component vector of float)
0:165 subgroupInclusiveMin ( global 4-component vector of float)
0:163 subgroupOr ( global 4-component vector of uint)
0:163 'ballot' ( temp 4-component vector of uint)
0:164 subgroupXor ( global 4-component vector of uint)
0:164 'ballot' ( temp 4-component vector of uint)
0:165 subgroupInclusiveAdd ( global 4-component vector of float)
0:165 'f4' ( in 4-component vector of float)
0:166 subgroupInclusiveMax ( global 4-component vector of float)
0:166 subgroupInclusiveMul ( global 4-component vector of float)
0:166 'f4' ( in 4-component vector of float)
0:167 subgroupInclusiveAnd ( global 4-component vector of uint)
0:167 'ballot' ( temp 4-component vector of uint)
0:168 subgroupInclusiveOr ( global 4-component vector of uint)
0:168 'ballot' ( temp 4-component vector of uint)
0:169 subgroupInclusiveXor ( global 4-component vector of uint)
0:167 subgroupInclusiveMin ( global 4-component vector of float)
0:167 'f4' ( in 4-component vector of float)
0:168 subgroupInclusiveMax ( global 4-component vector of float)
0:168 'f4' ( in 4-component vector of float)
0:169 subgroupInclusiveAnd ( global 4-component vector of uint)
0:169 'ballot' ( temp 4-component vector of uint)
0:170 subgroupExclusiveAdd ( global 4-component vector of float)
0:170 'f4' ( in 4-component vector of float)
0:171 subgroupExclusiveMul ( global 4-component vector of float)
0:171 'f4' ( in 4-component vector of float)
0:172 subgroupExclusiveMin ( global 4-component vector of float)
0:170 subgroupInclusiveOr ( global 4-component vector of uint)
0:170 'ballot' ( temp 4-component vector of uint)
0:171 subgroupInclusiveXor ( global 4-component vector of uint)
0:171 'ballot' ( temp 4-component vector of uint)
0:172 subgroupExclusiveAdd ( global 4-component vector of float)
0:172 'f4' ( in 4-component vector of float)
0:173 subgroupExclusiveMax ( global 4-component vector of float)
0:173 subgroupExclusiveMul ( global 4-component vector of float)
0:173 'f4' ( in 4-component vector of float)
0:174 subgroupExclusiveAnd ( global 4-component vector of uint)
0:174 'ballot' ( temp 4-component vector of uint)
0:175 subgroupExclusiveOr ( global 4-component vector of uint)
0:175 'ballot' ( temp 4-component vector of uint)
0:176 subgroupExclusiveXor ( global 4-component vector of uint)
0:174 subgroupExclusiveMin ( global 4-component vector of float)
0:174 'f4' ( in 4-component vector of float)
0:175 subgroupExclusiveMax ( global 4-component vector of float)
0:175 'f4' ( in 4-component vector of float)
0:176 subgroupExclusiveAnd ( global 4-component vector of uint)
0:176 'ballot' ( temp 4-component vector of uint)
0:180 Function Definition: clustered_works(vf4; ( global void)
0:180 Function Parameters:
0:180 'f4' ( in 4-component vector of float)
0:182 Sequence
0:182 Sequence
0:182 move second child to first child ( temp 4-component vector of uint)
0:182 'ballot' ( temp 4-component vector of uint)
0:182 Constant:
0:182 85 (const uint)
0:182 0 (const uint)
0:182 0 (const uint)
0:182 0 (const uint)
0:183 subgroupClusteredAdd ( global 4-component vector of float)
0:183 'f4' ( in 4-component vector of float)
0:183 Constant:
0:183 2 (const uint)
0:184 subgroupClusteredMul ( global 4-component vector of float)
0:184 'f4' ( in 4-component vector of float)
0:184 Constant:
0:184 2 (const uint)
0:185 subgroupClusteredMin ( global 4-component vector of float)
0:177 subgroupExclusiveOr ( global 4-component vector of uint)
0:177 'ballot' ( temp 4-component vector of uint)
0:178 subgroupExclusiveXor ( global 4-component vector of uint)
0:178 'ballot' ( temp 4-component vector of uint)
0:182 Function Definition: clustered_works(vf4; ( global void)
0:182 Function Parameters:
0:182 'f4' ( in 4-component vector of float)
0:184 Sequence
0:184 Sequence
0:184 move second child to first child ( temp 4-component vector of uint)
0:184 'ballot' ( temp 4-component vector of uint)
0:184 Constant:
0:184 85 (const uint)
0:184 0 (const uint)
0:184 0 (const uint)
0:184 0 (const uint)
0:185 subgroupClusteredAdd ( global 4-component vector of float)
0:185 'f4' ( in 4-component vector of float)
0:185 Constant:
0:185 2 (const uint)
0:186 subgroupClusteredMax ( global 4-component vector of float)
0:186 subgroupClusteredMul ( global 4-component vector of float)
0:186 'f4' ( in 4-component vector of float)
0:186 Constant:
0:186 2 (const uint)
0:187 subgroupClusteredAnd ( global 4-component vector of uint)
0:187 'ballot' ( temp 4-component vector of uint)
0:187 subgroupClusteredMin ( global 4-component vector of float)
0:187 'f4' ( in 4-component vector of float)
0:187 Constant:
0:187 2 (const uint)
0:188 subgroupClusteredOr ( global 4-component vector of uint)
0:188 'ballot' ( temp 4-component vector of uint)
0:188 subgroupClusteredMax ( global 4-component vector of float)
0:188 'f4' ( in 4-component vector of float)
0:188 Constant:
0:188 2 (const uint)
0:189 subgroupClusteredXor ( global 4-component vector of uint)
0:189 subgroupClusteredAnd ( global 4-component vector of uint)
0:189 'ballot' ( temp 4-component vector of uint)
0:189 Constant:
0:189 2 (const uint)
0:193 Function Definition: quad_works(vf4; ( global void)
0:193 Function Parameters:
0:193 'f4' ( in 4-component vector of float)
0:195 Sequence
0:195 subgroupQuadBroadcast ( global 4-component vector of float)
0:195 'f4' ( in 4-component vector of float)
0:195 Constant:
0:195 0 (const uint)
0:196 subgroupQuadSwapHorizontal ( global 4-component vector of float)
0:196 'f4' ( in 4-component vector of float)
0:197 subgroupQuadSwapVertical ( global 4-component vector of float)
0:197 'f4' ( in 4-component vector of float)
0:198 subgroupQuadSwapDiagonal ( global 4-component vector of float)
0:190 subgroupClusteredOr ( global 4-component vector of uint)
0:190 'ballot' ( temp 4-component vector of uint)
0:190 Constant:
0:190 2 (const uint)
0:191 subgroupClusteredXor ( global 4-component vector of uint)
0:191 'ballot' ( temp 4-component vector of uint)
0:191 Constant:
0:191 2 (const uint)
0:195 Function Definition: quad_works(vf4; ( global void)
0:195 Function Parameters:
0:195 'f4' ( in 4-component vector of float)
0:? Sequence
0:198 subgroupQuadBroadcast ( global 4-component vector of float)
0:198 'f4' ( in 4-component vector of float)
0:202 Function Definition: partitioned_works(vf4; ( global void)
0:202 Function Parameters:
0:202 'f4' ( in 4-component vector of float)
0:204 Sequence
0:204 Sequence
0:204 move second child to first child ( temp 4-component vector of uint)
0:204 'parti' ( temp 4-component vector of uint)
0:204 subgroupPartitionNV ( global 4-component vector of uint)
0:204 'f4' ( in 4-component vector of float)
0:205 Sequence
0:205 move second child to first child ( temp 4-component vector of uint)
0:205 'ballot' ( temp 4-component vector of uint)
0:205 Constant:
0:205 85 (const uint)
0:205 0 (const uint)
0:205 0 (const uint)
0:205 0 (const uint)
0:206 subgroupPartitionedAddNV ( global 4-component vector of float)
0:206 'f4' ( in 4-component vector of float)
0:206 'parti' ( temp 4-component vector of uint)
0:207 subgroupPartitionedMulNV ( global 4-component vector of float)
0:207 'f4' ( in 4-component vector of float)
0:207 'parti' ( temp 4-component vector of uint)
0:208 subgroupPartitionedMinNV ( global 4-component vector of float)
0:208 'f4' ( in 4-component vector of float)
0:208 'parti' ( temp 4-component vector of uint)
0:209 subgroupPartitionedMaxNV ( global 4-component vector of float)
0:209 'f4' ( in 4-component vector of float)
0:209 'parti' ( temp 4-component vector of uint)
0:210 subgroupPartitionedAndNV ( global 4-component vector of uint)
0:210 'ballot' ( temp 4-component vector of uint)
0:198 Constant:
0:198 0 (const uint)
0:199 subgroupQuadBroadcast ( global 4-component vector of float)
0:199 'f4' ( in 4-component vector of float)
0:199 Convert int to uint ( temp uint)
0:199 'i' ( temp int)
0:200 subgroupQuadSwapHorizontal ( global 4-component vector of float)
0:200 'f4' ( in 4-component vector of float)
0:201 subgroupQuadSwapVertical ( global 4-component vector of float)
0:201 'f4' ( in 4-component vector of float)
0:202 subgroupQuadSwapDiagonal ( global 4-component vector of float)
0:202 'f4' ( in 4-component vector of float)
0:206 Function Definition: partitioned_works(vf4; ( global void)
0:206 Function Parameters:
0:206 'f4' ( in 4-component vector of float)
0:208 Sequence
0:208 Sequence
0:208 move second child to first child ( temp 4-component vector of uint)
0:208 'parti' ( temp 4-component vector of uint)
0:208 subgroupPartitionNV ( global 4-component vector of uint)
0:208 'f4' ( in 4-component vector of float)
0:209 Sequence
0:209 move second child to first child ( temp 4-component vector of uint)
0:209 'ballot' ( temp 4-component vector of uint)
0:209 Constant:
0:209 85 (const uint)
0:209 0 (const uint)
0:209 0 (const uint)
0:209 0 (const uint)
0:210 subgroupPartitionedAddNV ( global 4-component vector of float)
0:210 'f4' ( in 4-component vector of float)
0:210 'parti' ( temp 4-component vector of uint)
0:211 subgroupPartitionedOrNV ( global 4-component vector of uint)
0:211 'ballot' ( temp 4-component vector of uint)
0:211 subgroupPartitionedMulNV ( global 4-component vector of float)
0:211 'f4' ( in 4-component vector of float)
0:211 'parti' ( temp 4-component vector of uint)
0:212 subgroupPartitionedXorNV ( global 4-component vector of uint)
0:212 'ballot' ( temp 4-component vector of uint)
0:212 subgroupPartitionedMinNV ( global 4-component vector of float)
0:212 'f4' ( in 4-component vector of float)
0:212 'parti' ( temp 4-component vector of uint)
0:213 subgroupPartitionedInclusiveAddNV ( global 4-component vector of float)
0:213 subgroupPartitionedMaxNV ( global 4-component vector of float)
0:213 'f4' ( in 4-component vector of float)
0:213 'parti' ( temp 4-component vector of uint)
0:214 subgroupPartitionedInclusiveMulNV ( global 4-component vector of float)
0:214 'f4' ( in 4-component vector of float)
0:214 subgroupPartitionedAndNV ( global 4-component vector of uint)
0:214 'ballot' ( temp 4-component vector of uint)
0:214 'parti' ( temp 4-component vector of uint)
0:215 subgroupPartitionedInclusiveMinNV ( global 4-component vector of float)
0:215 'f4' ( in 4-component vector of float)
0:215 subgroupPartitionedOrNV ( global 4-component vector of uint)
0:215 'ballot' ( temp 4-component vector of uint)
0:215 'parti' ( temp 4-component vector of uint)
0:216 subgroupPartitionedInclusiveMaxNV ( global 4-component vector of float)
0:216 'f4' ( in 4-component vector of float)
0:216 subgroupPartitionedXorNV ( global 4-component vector of uint)
0:216 'ballot' ( temp 4-component vector of uint)
0:216 'parti' ( temp 4-component vector of uint)
0:217 subgroupPartitionedInclusiveAndNV ( global 4-component vector of uint)
0:217 'ballot' ( temp 4-component vector of uint)
0:217 subgroupPartitionedInclusiveAddNV ( global 4-component vector of float)
0:217 'f4' ( in 4-component vector of float)
0:217 'parti' ( temp 4-component vector of uint)
0:218 subgroupPartitionedInclusiveOrNV ( global 4-component vector of uint)
0:218 'ballot' ( temp 4-component vector of uint)
0:218 subgroupPartitionedInclusiveMulNV ( global 4-component vector of float)
0:218 'f4' ( in 4-component vector of float)
0:218 'parti' ( temp 4-component vector of uint)
0:219 subgroupPartitionedInclusiveXorNV ( global 4-component vector of uint)
0:219 'ballot' ( temp 4-component vector of uint)
0:219 subgroupPartitionedInclusiveMinNV ( global 4-component vector of float)
0:219 'f4' ( in 4-component vector of float)
0:219 'parti' ( temp 4-component vector of uint)
0:220 subgroupPartitionedExclusiveAddNV ( global 4-component vector of float)
0:220 subgroupPartitionedInclusiveMaxNV ( global 4-component vector of float)
0:220 'f4' ( in 4-component vector of float)
0:220 'parti' ( temp 4-component vector of uint)
0:221 subgroupPartitionedExclusiveMulNV ( global 4-component vector of float)
0:221 'f4' ( in 4-component vector of float)
0:221 subgroupPartitionedInclusiveAndNV ( global 4-component vector of uint)
0:221 'ballot' ( temp 4-component vector of uint)
0:221 'parti' ( temp 4-component vector of uint)
0:222 subgroupPartitionedExclusiveMinNV ( global 4-component vector of float)
0:222 'f4' ( in 4-component vector of float)
0:222 subgroupPartitionedInclusiveOrNV ( global 4-component vector of uint)
0:222 'ballot' ( temp 4-component vector of uint)
0:222 'parti' ( temp 4-component vector of uint)
0:223 subgroupPartitionedExclusiveMaxNV ( global 4-component vector of float)
0:223 'f4' ( in 4-component vector of float)
0:223 subgroupPartitionedInclusiveXorNV ( global 4-component vector of uint)
0:223 'ballot' ( temp 4-component vector of uint)
0:223 'parti' ( temp 4-component vector of uint)
0:224 subgroupPartitionedExclusiveAndNV ( global 4-component vector of uint)
0:224 'ballot' ( temp 4-component vector of uint)
0:224 subgroupPartitionedExclusiveAddNV ( global 4-component vector of float)
0:224 'f4' ( in 4-component vector of float)
0:224 'parti' ( temp 4-component vector of uint)
0:225 subgroupPartitionedExclusiveOrNV ( global 4-component vector of uint)
0:225 'ballot' ( temp 4-component vector of uint)
0:225 subgroupPartitionedExclusiveMulNV ( global 4-component vector of float)
0:225 'f4' ( in 4-component vector of float)
0:225 'parti' ( temp 4-component vector of uint)
0:226 subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
0:226 'ballot' ( temp 4-component vector of uint)
0:226 subgroupPartitionedExclusiveMinNV ( global 4-component vector of float)
0:226 'f4' ( in 4-component vector of float)
0:226 'parti' ( temp 4-component vector of uint)
0:230 Function Definition: sm_builtins_err( ( global void)
0:230 Function Parameters:
0:232 Sequence
0:232 'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
0:233 'gl_SMCountNV' ( flat in uint SMCountNV)
0:234 'gl_WarpIDNV' ( flat in uint WarpIDNV)
0:235 'gl_SMIDNV' ( flat in uint SMIDNV)
0:242 Function Definition: sm_builtins( ( global void)
0:242 Function Parameters:
0:244 Sequence
0:244 'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
0:245 'gl_SMCountNV' ( flat in uint SMCountNV)
0:246 'gl_WarpIDNV' ( flat in uint WarpIDNV)
0:247 'gl_SMIDNV' ( flat in uint SMIDNV)
0:227 subgroupPartitionedExclusiveMaxNV ( global 4-component vector of float)
0:227 'f4' ( in 4-component vector of float)
0:227 'parti' ( temp 4-component vector of uint)
0:228 subgroupPartitionedExclusiveAndNV ( global 4-component vector of uint)
0:228 'ballot' ( temp 4-component vector of uint)
0:228 'parti' ( temp 4-component vector of uint)
0:229 subgroupPartitionedExclusiveOrNV ( global 4-component vector of uint)
0:229 'ballot' ( temp 4-component vector of uint)
0:229 'parti' ( temp 4-component vector of uint)
0:230 subgroupPartitionedExclusiveXorNV ( global 4-component vector of uint)
0:230 'ballot' ( temp 4-component vector of uint)
0:230 'parti' ( temp 4-component vector of uint)
0:234 Function Definition: sm_builtins_err( ( global void)
0:234 Function Parameters:
0:236 Sequence
0:236 'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
0:237 'gl_SMCountNV' ( flat in uint SMCountNV)
0:238 'gl_WarpIDNV' ( flat in uint WarpIDNV)
0:239 'gl_SMIDNV' ( flat in uint SMIDNV)
0:246 Function Definition: sm_builtins( ( global void)
0:246 Function Parameters:
0:248 Sequence
0:248 'gl_WarpsPerSMNV' ( flat in uint WarpsPerSMNV)
0:249 'gl_SMCountNV' ( flat in uint SMCountNV)
0:250 'gl_WarpIDNV' ( flat in uint WarpIDNV)
0:251 'gl_SMIDNV' ( flat in uint SMIDNV)
0:? Linker Objects
0:? 'data' (layout( location=0) out 4-component vector of uint)

View file

@ -2,7 +2,7 @@ glsl.entryPointRename.vert
ERROR: Source entry point must be "main"
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader

View file

@ -1,6 +1,6 @@
glsl.entryPointRename.vert
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 20
Capability Shader

View file

@ -1,6 +1,6 @@
glspv.esversion.vert
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 10
Capability Shader

View file

@ -2,7 +2,7 @@ glspv.version.frag
ERROR: #version: compilation for SPIR-V does not support the compatibility profile
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 6
Capability Shader

View file

@ -71,7 +71,7 @@ output primitive = line_strip
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 36
Capability Geometry

View file

@ -38,7 +38,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out float PointSize)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 16
Capability Shader

View file

@ -143,7 +143,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 64
Capability Shader

View file

@ -160,7 +160,7 @@ gl_FragCoord origin is upper left
0:? 'm' ( global 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 57
Capability Shader

View file

@ -345,7 +345,7 @@ gl_FragCoord origin is upper left
0:? 'ps_output.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 143
Capability Shader

View file

@ -290,7 +290,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 126
Capability Shader

View file

@ -163,7 +163,7 @@ gl_FragCoord origin is upper left
0:? 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f})
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 72
Capability Shader

View file

@ -134,7 +134,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 57
Capability Shader

View file

@ -132,7 +132,7 @@ gl_FragCoord origin is upper left
0:? 'a5' (layout( location=4) in 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 58
Capability Shader

View file

@ -82,7 +82,7 @@ local_size = (4, 6, 8)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 39
Capability Shader

View file

@ -50,7 +50,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 24
Capability Shader

View file

@ -95,7 +95,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 51
Capability Shader

View file

@ -56,7 +56,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 28
Capability Shader

View file

@ -64,7 +64,7 @@ local_size = (1, 1, 1)
0:? 'gti' ( in 3-component vector of int LocalInvocationID)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 38
Capability Shader

View file

@ -188,7 +188,7 @@ output primitive = line_strip
0:? 'OutputStream.something' (layout( location=1) out int)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 68
Capability Geometry

View file

@ -204,7 +204,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 99
Capability Shader

View file

@ -147,7 +147,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 73
Capability Shader

View file

@ -358,7 +358,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 148
Capability Shader

View file

@ -358,7 +358,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 148
Capability Shader

View file

@ -70,7 +70,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 34
Capability Shader

View file

@ -250,7 +250,7 @@ Shader version: 500
0:? 'input.Norm' (layout( location=1) in 3-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 93
Capability Shader

View file

@ -146,7 +146,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 58
Capability Shader

View file

@ -74,7 +74,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 30
Capability Shader

View file

@ -98,7 +98,7 @@ gl_FragCoord origin is upper left
0:? 'cull' ( in 1-element array of float CullDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 53
Capability Shader

View file

@ -550,7 +550,7 @@ output primitive = line_strip
0:? 'OutputStream.clip' ( out 2-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 118
Capability Geometry

View file

@ -108,7 +108,7 @@ Shader version: 500
0:? 'cull' ( out 1-element array of float CullDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 46
Capability Shader

View file

@ -290,7 +290,7 @@ gl_FragCoord origin is upper left
0:? 'cull' ( in 4-element array of float CullDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 84
Capability Shader

View file

@ -724,7 +724,7 @@ output primitive = line_strip
0:? 'OutputStream.clip' ( out 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 128
Capability Geometry

View file

@ -420,7 +420,7 @@ Shader version: 500
0:? 'cull' ( out 4-element array of float CullDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 89
Capability Shader

View file

@ -98,7 +98,7 @@ gl_FragCoord origin is upper left
0:? 'cull' ( in 2-element array of float CullDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 53
Capability Shader

View file

@ -630,7 +630,7 @@ output primitive = line_strip
0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 127
Capability Geometry

View file

@ -136,7 +136,7 @@ Shader version: 500
0:? 'cull' ( out 2-element array of float CullDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 51
Capability Shader

View file

@ -174,7 +174,7 @@ gl_FragCoord origin is upper left
0:? 'v.ClipRect' ( in 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 57
Capability Shader

View file

@ -612,7 +612,7 @@ output primitive = line_strip
0:? 'OutputStream.clip1' ( out 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 130
Capability Geometry

View file

@ -270,7 +270,7 @@ Shader version: 500
0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 72
Capability Shader

View file

@ -232,7 +232,7 @@ gl_FragCoord origin is upper left
0:? 'v.ClipRect' ( in 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 62
Capability Shader

View file

@ -318,7 +318,7 @@ Shader version: 500
0:? '@entryPointOutput.ClipRect' ( out 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 73
Capability Shader

View file

@ -282,7 +282,7 @@ gl_FragCoord origin is upper left
0:? 'v.clip1' ( in 8-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 79
Capability Shader

View file

@ -428,7 +428,7 @@ Shader version: 500
0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 86
Capability Shader

View file

@ -270,7 +270,7 @@ gl_FragCoord origin is upper left
0:? 'v.clip1' ( in 8-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 78
Capability Shader

View file

@ -384,7 +384,7 @@ Shader version: 500
0:? '@entryPointOutput.clip1' ( out 8-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 81
Capability Shader

View file

@ -186,7 +186,7 @@ gl_FragCoord origin is upper left
0:? 'v.clip1' ( in 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 65
Capability Shader

View file

@ -240,7 +240,7 @@ Shader version: 500
0:? '@entryPointOutput.clip1' ( out 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 62
Capability Shader

View file

@ -144,7 +144,7 @@ gl_FragCoord origin is upper left
0:? 'clip0' ( in 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 68
Capability Shader

View file

@ -194,7 +194,7 @@ Shader version: 500
0:? 'clip0' ( out 4-element array of float ClipDistance)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 67
Capability Shader

View file

@ -356,7 +356,7 @@ triangle order = cw
0:? '@patchConstantOutput.inside' ( patch out 2-element array of float TessLevelInner)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 127
Capability Tessellation

View file

@ -262,7 +262,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 96
Capability Shader

View file

@ -522,7 +522,7 @@ gl_FragCoord origin is upper left
0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 206
Capability Shader

View file

@ -133,7 +133,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 66
Capability Shader
@ -240,6 +240,5 @@ Validation failed
60: 7(fvec4) CompositeConstruct 59 59 59 59
ReturnValue 60
30: Label
62: 7(fvec4) Undef
ReturnValue 62
Unreachable
FunctionEnd

View file

@ -268,7 +268,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 89
Capability Shader

View file

@ -104,7 +104,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader

View file

@ -545,7 +545,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 98
Capability Shader

View file

@ -119,7 +119,7 @@ gl_FragCoord origin is upper left
Validation failed
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 52
Capability Shader

View file

@ -1,6 +1,6 @@
hlsl.dashI.vert
// Module Version 10000
// Generated by (magic number): 80007
// Generated by (magic number): 80008
// Id's are bound by 40
Capability Shader

Some files were not shown because too many files have changed in this diff Show more