Merge pull request #4 from kd-11/sdk_268

Sync with SDK ver 1.3.268.0
This commit is contained in:
kd-11 2023-12-11 23:04:54 +03:00 committed by GitHub
commit 57e6cbfc72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1145 changed files with 52241 additions and 21461 deletions

View File

@ -1,108 +0,0 @@
# Windows Build Configuration for AppVeyor
# http://www.appveyor.com/docs/appveyor-yml
# build version format
version: "{build}"
os: Visual Studio 2015
platform:
- x64
configuration:
- Debug
- Release
branches:
only:
- master
# changes to these files don't need to trigger testing
skip_commits:
files:
- README.md
- README-spirv-remap.txt
- LICENSE.txt
- CODE_OF_CONDUCT.md
- BUILD.*
- WORKSPACE
- kokoro/*
- make-revision
- Android.mk
- _config.yml
# Travis advances the master-tot tag to current top of the tree after
# each push into the master branch, because it relies on that tag to
# upload build artifacts to the master-tot release. This will cause
# double testing for each push on Appveyor: one for the push, one for
# the tag advance. Disable testing tags.
skip_tags: true
clone_depth: 5
matrix:
fast_finish: true # Show final status immediately if a test fails.
# scripts that run after cloning repository
install:
- C:/Python27/python.exe update_glslang_sources.py
- set PATH=C:\ninja;C:\Python36;%PATH%
- git clone https://github.com/google/googletest.git External/googletest
build:
parallel: true # enable MSBuild parallel builds
verbosity: minimal
build_script:
- mkdir build && cd build
- cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=install ..
- cmake --build . --config %CONFIGURATION% --target install
test_script:
- ctest -C %CONFIGURATION% --output-on-failure
- cd ../Test && bash runtests
- cd ../build
after_test:
# For debug build, the generated dll has a postfix "d" in its name.
- ps: >-
If ($env:configuration -Match "Debug") {
$env:SUFFIX="d"
} Else {
$env:SUFFIX=""
}
- cd install
# Zip all glslang artifacts for uploading and deploying
- 7z a glslang-master-windows-"%PLATFORM%"-"%CONFIGURATION%".zip
bin\glslangValidator.exe
bin\spirv-remap.exe
include\glslang\*
lib\GenericCodeGen%SUFFIX%.lib
lib\glslang%SUFFIX%.lib
lib\glslang-default-resource-limits%SUFFIX%.lib
lib\HLSL%SUFFIX%.lib
lib\MachineIndependent%SUFFIX%.lib
lib\OGLCompiler%SUFFIX%.lib
lib\OSDependent%SUFFIX%.lib
lib\SPIRV%SUFFIX%.lib
lib\SPVRemapper%SUFFIX%.lib
lib\SPIRV-Tools%SUFFIX%.lib
lib\SPIRV-Tools-opt%SUFFIX%.lib
artifacts:
- path: build\install\*.zip
name: artifacts-zip
deploy:
- provider: GitHub
auth_token:
secure: YglcSYdl0TylEa59H4K6lylBEDr586NAt2EMgZquSo+iuPrwgZQuJLPCoihSm9y6
release: master-tot
description: "Continuous build of the latest master branch by Appveyor and Github"
artifact: artifacts-zip
draft: false
prerelease: false
force_update: true
on:
branch: master
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015

22
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,22 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: 2
updates:
- package-ecosystem: "github-actions" # Necessary to update action hashes
directory: "/"
schedule:
interval: "weekly"
# Allow up to 3 opened pull requests for github-actions versions
open-pull-requests-limit: 3

View File

@ -20,11 +20,26 @@ on:
workflow_dispatch:
push:
branches:
- master
- main
paths-ignore:
- 'README.md'
- 'README-spirv-remap.txt'
- 'LICENSE.txt'
- 'CODE_OF_CONDUCT.md'
- 'BUILD.*'
- 'WORKSPACE'
- 'kokoro/*'
- 'make-revision'
- 'Android.mk'
- '_config.yml'
permissions: read-all
jobs:
linux:
runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
@ -32,8 +47,9 @@ jobs:
compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Install Ubuntu Package Dependencies
@ -71,10 +87,11 @@ jobs:
- name: Zip
if: ${{ matrix.compiler.cc == 'clang' }}
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
run: |
cd build/install
zip ${ARCHIVE} \
bin/glslang \
bin/glslangValidator \
include/glslang/* \
include/glslang/**/* \
@ -92,8 +109,8 @@ jobs:
- name: Deploy
if: ${{ matrix.compiler.cc == 'clang' }}
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@v5
ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const script = require('.github/workflows/deploy.js')
@ -101,6 +118,8 @@ jobs:
macos:
runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
@ -108,8 +127,9 @@ jobs:
compiler: [{cc: clang, cxx: clang++}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Install GoogleTest
@ -142,10 +162,11 @@ jobs:
cd ../Test && ./runtests
- name: Zip
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
run: |
cd build/install
zip ${ARCHIVE} \
bin/glslang \
bin/glslangValidator \
include/glslang/* \
include/glslang/**/* \
@ -162,8 +183,100 @@ jobs:
lib/libSPIRV-Tools-opt.a
- name: Deploy
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@v5
ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const script = require('.github/workflows/deploy.js')
await script({github, context, core})
windows:
runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
os: [{genus: windows-2019, family: windows}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
# issue 3128 is fixed
# git clone --depth=1 https://github.com/google/googletest.git External/googletest
mkdir -p External/googletest
cd External/googletest
git init
git remote add origin https://github.com/google/googletest.git
git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: |
python update_glslang_sources.py
- name: Build
run: |
cmake -S. -Bbuild -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install"
cmake --build build --config ${{matrix.cmake_build_type}} --target install
- name: Test
run: |
cd build
ctest -C ${{matrix.cmake_build_type}} --output-on-failure
cd ../Test && bash runtests
- name: Zip
if: ${{ matrix.cmake_build_type == 'Debug' }}
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-Debug.zip
run: |
cd build/install
7z a ${{env.ARCHIVE}} `
bin/glslang.exe `
bin/glslangValidator.exe `
bin/spirv-remap.exe `
include/glslang/* `
lib/GenericCodeGend.lib `
lib/glslangd.lib `
lib/glslang-default-resource-limitsd.lib `
lib/HLSLd.lib `
lib/MachineIndependentd.lib `
lib/OGLCompilerd.lib `
lib/OSDependentd.lib `
lib/SPIRVd.lib `
lib/SPVRemapperd.lib `
lib/SPIRV-Toolsd.lib `
lib/SPIRV-Tools-optd.lib
- name: Zip
if: ${{ matrix.cmake_build_type == 'Release' }}
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-Release.zip
run: |
cd build/install
7z a ${{env.ARCHIVE}} `
bin/glslang.exe `
bin/glslangValidator.exe `
bin/spirv-remap.exe `
include/glslang/* `
lib/GenericCodeGen.lib `
lib/glslang.lib `
lib/glslang-default-resource-limits.lib `
lib/HLSL.lib `
lib/MachineIndependent.lib `
lib/OGLCompiler.lib `
lib/OSDependent.lib `
lib/SPIRV.lib `
lib/SPVRemapper.lib `
lib/SPIRV-Tools.lib `
lib/SPIRV-Tools-opt.lib
- name: Deploy
env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const script = require('.github/workflows/deploy.js')

View File

@ -10,26 +10,28 @@ on:
workflow_dispatch:
pull_request:
branches:
- master
- main
permissions: read-all
jobs:
linux:
runs-on: ${{matrix.os}}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Install Ubuntu Package Dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y clang-6.0
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
@ -43,35 +45,137 @@ jobs:
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: |
./update_glslang_sources.py
- name: Build
run: ./update_glslang_sources.py
- name: Configure
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install ..
make -j4 install
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
linux-asan:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [{cc: gcc, cxx: g++}]
cmake_build_type: [Debug]
flags: ['-fsanitize=address', '-fsanitize=thread']
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}-${{matrix.flags}}
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
# issue 3128 is fixed
# git clone --depth=1 https://github.com/google/googletest.git External/googletest
mkdir -p External/googletest
cd External/googletest
git init
git remote add origin https://github.com/google/googletest.git
git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CFLAGS: ${{matrix.flags}}
CXXFLAGS: ${{matrix.flags}}
LDFLAGS: ${{matrix.flags}}
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
# Ensure we can compile/run on an older distro
linux_min:
name: Linux Backcompat
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
with:
cmakeVersion: 3.17.2
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: linux_backcompat
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
# issue 3128 is fixed
# git clone --depth=1 https://github.com/google/googletest.git External/googletest
mkdir -p External/googletest
cd External/googletest
git init
git remote add origin https://github.com/google/googletest.git
git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
macos:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [macos-11]
compiler: [{cc: clang, cxx: clang++}]
os: [macos-11, macos-12]
compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
@ -85,49 +189,37 @@ jobs:
git reset --hard FETCH_HEAD
cd ../..
- name: Update Glslang Sources
run: |
./update_glslang_sources.py
- name: Build
run: ./update_glslang_sources.py
- name: Configure
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -G "Ninja"
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install ..
make -j4 install
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test
run: |
cd build
ctest --output-on-failure &&
cd ../Test && ./runtests
android:
runs-on: ${{matrix.os}}
windows:
runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
compiler: [{cc: clang, cxx: clang++}]
cmake_build_type: [Release]
os: [{genus: windows-2019, family: windows}]
cmake_build_type: [Debug, Release]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- name: Install Ubuntu Package Dependencies
if: ${{matrix.os == 'ubuntu-20.04'}}
run: |
sudo apt-get -qq update
sudo apt-get install -y clang-6.0
- name: Install Android NDK
run: |
export ANDROID_NDK=$HOME/android-ndk
git init $ANDROID_NDK
pushd $ANDROID_NDK
git remote add dneto0 https://github.com/dneto0/android-ndk.git
git fetch --depth=1 dneto0 r17b-strip
git checkout FETCH_HEAD
popd
- name: Install GoogleTest
run: |
# check out pre-breakage version of googletest; can be deleted when
@ -142,16 +234,74 @@ jobs:
cd ../..
- name: Update Glslang Sources
run: |
./update_glslang_sources.py
python update_glslang_sources.py
- name: Build
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
run: |
export ANDROID_NDK=$HOME/android-ndk
export TOOLCHAIN_PATH=$ANDROID_NDK/build/cmake/android.toolchain.cmake
echo $ANDROID_NDK
echo $TOOLCHAIN_PATH
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH} -DANDROID_NATIVE_API_LEVEL=android-14 -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DANDROID_ABI="armeabi-v7a with NEON" -DBUILD_TESTING=OFF ..
make -j4
cmake -S. -Bbuild -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install"
cmake --build build --config ${{matrix.cmake_build_type}} --target install
- name: Test
run: |
cd build
ctest -C ${{matrix.cmake_build_type}} --output-on-failure
cd ../Test && bash runtests
android:
runs-on: ubuntu-22.04
strategy:
matrix:
# Android NDK currently offers 2 different toolchains.
# Test both to ensure we are compatible with either approach.
LEGACY: [ON, OFF]
# Oldest/newest NDK currently provided by GitHub runners
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#android
NDK: [23.2.8568313, 25.2.9519653]
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: android-${{ matrix.LEGACY }}-${{ matrix.NDK }}
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: |
cmake -S . -B build/ \
--toolchain $ANDROID_HOME/ndk/${{ matrix.NDK }}/build/cmake/android.toolchain.cmake \
-D CMAKE_BUILD_TYPE=Release \
-D ANDROID_ABI=armeabi-v7a \
-D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=${{ matrix.LEGACY }} \
-D BUILD_TESTING=OFF
env:
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build
run: cmake --build build/
emscripten:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.7'
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- name: Setup ccache
uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: ubuntu-emscripten
- uses: mymindstorm/setup-emsdk@ab889da2abbcbb280f91ec4c215d3bb4f3a8f775 # v12
- name: Update Glslang Sources
run: ./update_glslang_sources.py
- name: Configure
run: emcmake cmake -GNinja -Bbuild/web -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON -DBUILD_TESTING=OFF -DENABLE_OPT=OFF
env:
CMAKE_GENERATOR: Ninja
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build
run: cmake --build build/web

View File

@ -3,11 +3,11 @@ module.exports = async ({github, context, core}) => {
await github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/master-tot',
ref: 'tags/main-tot',
sha: context.sha
})
} catch (error) {
core.setFailed(`upload master-tot tag; ${error.name}; ${error.message}`)
core.setFailed(`upload main-tot tag; ${error.name}; ${error.message}`)
}
let release
@ -15,10 +15,10 @@ module.exports = async ({github, context, core}) => {
release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: 'master-tot'
tag: 'main-tot'
})
} catch (error) {
core.setFailed(`get the master release; ${error.name}; ${error.message}`)
core.setFailed(`get the main release; ${error.name}; ${error.message}`)
}
try {
@ -28,7 +28,7 @@ module.exports = async ({github, context, core}) => {
release_id: release.data.id
})
} catch (error) {
core.setFailed(`update the master release; ${error.name}; ${error.message}`)
core.setFailed(`update the main release; ${error.name}; ${error.message}`)
}
let release_assets

53
.github/workflows/scorecard.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '36 17 * * 5'
push:
branches: [ "main" ]
# Declare default permissions as read only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
security-events: write # to upload the results to code-scanning dashboard
id-token: write # to publish results and get a badge
steps:
- name: "Checkout code"
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0
with:
results_file: results.sarif
results_format: sarif
# To enable Branch-Protection uncomment the `repo_token` line below
# To create the Fine-grained PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
publish_results: true # allows the repo to include the Scorecard badge
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
with:
sarif_file: results.sarif

1
.gitignore vendored
View File

@ -11,6 +11,7 @@ Test/localResults/
External/googletest
External/spirv-tools
out/
CMakeUserPresets.json
# GN generated files
.cipd/

3
.mailmap Normal file
View File

@ -0,0 +1,3 @@
Faith Ekstrand <faith.ekstrand@collabora.com> <jason@jlekstrand.net>
Faith Ekstrand <faith.ekstrand@collabora.com> <jason.ekstrand@intel.com>
Faith Ekstrand <faith.ekstrand@collabora.com> <jason.ekstrand@collabora.com>

View File

@ -1,4 +1,4 @@
# Copyright (C) 2020 The Khronos Group Inc.
# Copyright (C) 2020-2023 The Khronos Group Inc.
#
# All rights reserved.
#
@ -53,11 +53,11 @@ $(eval $(call gen_glslang_build_info_h))
GLSLANG_OS_FLAGS := -DGLSLANG_OSINCLUDE_UNIX
# AMD and NV extensions are turned on by default in upstream Glslang.
GLSLANG_DEFINES:= -DAMD_EXTENSIONS -DNV_EXTENSIONS -DENABLE_HLSL $(GLSLANG_OS_FLAGS)
GLSLANG_DEFINES:= -DENABLE_HLSL $(GLSLANG_OS_FLAGS)
include $(CLEAR_VARS)
LOCAL_MODULE:=OSDependent
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:=glslang/OSDependent/Unix/ossource.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/OSDependent/Unix/
@ -66,7 +66,7 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE:=OGLCompiler
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:=OGLCompilersDLL/InitializeDll.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH)/OGLCompiler
@ -78,7 +78,7 @@ include $(BUILD_STATIC_LIBRARY)
# instead.
include $(CLEAR_VARS)
LOCAL_MODULE:=HLSL
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_SRC_FILES:= \
hlsl/stub.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
@ -93,7 +93,7 @@ $(LOCAL_PATH)/glslang/MachineIndependent/ShaderLang.cpp: \
$(GLSLANG_BUILD_INFO_H)
LOCAL_MODULE:=glslang
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:= \
glslang/CInterface/glslang_c_interface.cpp \
@ -148,7 +148,7 @@ $(LOCAL_PATH)/SPIRV/GlslangToSpv.cpp: \
$(GLSLANG_BUILD_INFO_H)
LOCAL_MODULE:=SPIRV
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror $(GLSLANG_DEFINES)
LOCAL_CXXFLAGS:=-std=c++17 -fno-exceptions -fno-rtti -Werror $(GLSLANG_DEFINES)
LOCAL_SRC_FILES:= \
SPIRV/CInterface/spirv_c_interface.cpp \
SPIRV/GlslangToSpv.cpp \

View File

@ -1,309 +0,0 @@
# Copyright (C) 2020 The Khronos Group Inc.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# Neither the name of The Khronos Group Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
package(
default_visibility = ["//visibility:public"],
)
# Description:
#
# Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator.
licenses(["notice"])
exports_files(["LICENSE"])
# Build information generation script
py_binary(
name = "build_info",
srcs = ["build_info.py"],
)
py_binary(
name = "gen_extension_headers",
srcs = ["gen_extension_headers.py"],
)
genrule(
name = "gen_build_info_h",
srcs = ["CHANGES.md", "build_info.h.tmpl"],
outs = ["glslang/build_info.h"],
cmd_bash = "$(location build_info) $$(dirname $(location CHANGES.md)) -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)",
cmd_bat = "for %F in ($(location CHANGES.md)) do $(location build_info) %~dpF -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)",
tools = [":build_info"],
)
genrule(
name = "gen_extension_headers_h",
srcs = ["glslang/ExtensionHeaders", "gen_extension_headers.py"],
outs = ["glslang/glsl_intrinsic_header.h"],
cmd_bash = "$(location gen_extension_headers) -i $(location glslang/ExtensionHeaders) -o $(location glslang/glsl_intrinsic_header.h)",
tools = [":gen_extension_headers"],
)
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/HLSL/*.cpp",
"glslang/MachineIndependent/*.cpp",
"glslang/MachineIndependent/preprocessor/*.cpp",
],
exclude = [
"glslang/HLSL/pch.h",
"glslang/MachineIndependent/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/HLSL/*.h",
"glslang/Include/*.h",
"glslang/MachineIndependent/*.h",
"glslang/MachineIndependent/preprocessor/*.h",
]) + [
"OGLCompilersDLL/InitializeDll.h",
"StandAlone/DirStackFileIncluder.h",
"glslang/OSDependent/osinclude.h",
"glslang/Public/ShaderLang.h",
":gen_build_info_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/NonSemanticDebugPrintf.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/NonSemanticDebugPrintf.h",
"include/SPIRV/spirv.hpp",
],
cmd_bash = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/",
cmd_bat = "(if not exist $(@D)\\include\\SPIRV mkdir $(@D)\\include\\SPIRV) && (for %S in ($(SRCS)) do @xcopy /q %S $(@D)\\include\\SPIRV\\ >NUL)",
)
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",
":glslang/glsl_intrinsic_header.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

@ -96,9 +96,6 @@ action("glslang_extension_headers") {
}
spirv_tools_dir = glslang_spirv_tools_dir
if (!defined(glslang_angle)) {
glslang_angle = false
}
config("glslang_public") {
include_dirs = [ "." ]
@ -126,6 +123,8 @@ template("glslang_sources_common") {
"SPIRV/GLSL.ext.EXT.h",
"SPIRV/GLSL.ext.KHR.h",
"SPIRV/GLSL.ext.NV.h",
"SPIRV/GLSL.ext.ARM.h",
"SPIRV/GLSL.ext.QCOM.h",
"SPIRV/GLSL.std.450.h",
"SPIRV/GlslangToSpv.cpp",
"SPIRV/GlslangToSpv.h",
@ -133,6 +132,7 @@ template("glslang_sources_common") {
"SPIRV/Logger.cpp",
"SPIRV/Logger.h",
"SPIRV/NonSemanticDebugPrintf.h",
"SPIRV/NonSemanticShaderDebugInfo100.h",
"SPIRV/SPVRemapper.cpp",
"SPIRV/SPVRemapper.h",
"SPIRV/SpvBuilder.cpp",
@ -241,9 +241,6 @@ template("glslang_sources_common") {
sources += [ "SPIRV/SpvTools.cpp" ]
defines += [ "ENABLE_OPT=1" ]
}
if (invoker.is_angle) {
defines += [ "GLSLANG_ANGLE" ]
}
if (is_win) {
sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
@ -292,21 +289,19 @@ template("glslang_sources_common") {
}
glslang_sources_common("glslang_lib_sources") {
enable_opt = !glslang_angle
enable_hlsl = !glslang_angle
is_angle = glslang_angle
enable_opt = true
enable_hlsl = true
}
glslang_sources_common("glslang_sources") {
enable_opt = true
enable_hlsl = true
is_angle = false
}
source_set("glslang_default_resource_limits_sources") {
sources = [
"StandAlone/ResourceLimits.cpp",
"StandAlone/ResourceLimits.h",
"glslang/ResourceLimits/ResourceLimits.cpp",
"glslang/Public/ResourceLimits.h",
"glslang/Include/ResourceLimits.h",
]
public_configs = [ ":glslang_public" ]

View File

@ -3,6 +3,109 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).
## 13.1.1 2023-10-16
* Initialize compile_only field in C interface
## 13.1.0 2023-10-13
* Support GL_EXT_texture_shadow_lod
* Support GL_NV_displacement_micromap
* Fix ByteAddressBuffer when used a function parameter
* Add more verbose messages if SPIRV-Tools is not found
* Fix names for explicitly sized types when emitting nonsemantic debug info
* Emit error for r-value arguments in atomic memory operations
* Add --no-link option
* Beautify preprocessor output format
* Fix race condition in glslangValidator
* Only set LocalSizeId mode when necessary
* Don't emit invalid debug info for buffer references
## 13.0.0 2023-08-23
### Breaking changes
* Simplify PoolAlloc via thread_local
* Remove InitializeDLL functions
* Remove OSDependent TLS functions
* Remove GLSLANG_WEB and GLSLANG_WEB_DEVEL code paths
### Other changes
* Raise CMAKE minimum to 3.17.2
* Support GL_KHR_cooperative_matrix
* Support GL_QCOM_image_processing_support
* Support outputting each module to a filename with spirv-remap
* Generate an error when gl_PrimitiveShaderRateEXT is used without enabling the extension
* Improve layout checking when GL_EXT_spirv_intrinsics is enabled
## 12.3.1 2023-07-20
### Other changes
* Improve backward compatibility for glslangValidator rename on Windows
## 12.3.0 2023-07-19
### Other changes
* Rename glslangValidator to glslang and create glslangValidator symlink
* Support HLSL binary literals
* Add missing initialization members for web
* Improve push_constant upgrading
* Fix race condition in spirv remap
* Support pre and post HLSL qualifier validation
* Force generateDebugInfo when non-semantic debug info is enabled
* Exit with error if output file cannot be written
* Fix struct member buffer reference decorations
## 12.2.0 2023-05-17
### Other changes
* Support GLSL_EXT_shader_tile_image
* Support GL_EXT_ray_tracing_position_fetch
* Support custom include callbacks via the C API
* Add preamble-text command-line option
* Accept variables as parameters of spirv_decorate_id
* Fix generation of conditionals with a struct result
* Fix double expansion of macros
* Fix DebugCompilationUnit scope
* Improve line information
## 12.1.0 2023-03-21
### Other changes
* Reject non-float inputs/outputs for version less than 120
* Fix invalid BufferBlock decoration for SPIR-V 1.3 and above
* Add HLSL relaxed-precision float/int matrix expansions
* Block decorate Vulkan structs with RuntimeArrays
* Support InterlockedAdd on float types
## 12.0.0 2023-01-18
### Breaking changes
* An ABI was accidentally broken in #3014. Consequently, we have incremented the major revision number.
### Other changes
* Add support for ARB_bindless_texture.
* Add support for GL_NV_shader_invocation_reorder.
* Fix const parameter debug types when using NonSemantic.Shader.DebugInfo.100.
* Fix NonSemantic.Shader.DebugInfo.100 disassembly.
* Fix MaxDualSourceDrawBuffersEXT usage.
* Fix structure member reference crash.
## 11.13.0 2022-12-06
### Other changes
* Make HelperInvocation accesses volatile for SPIR-V 1.6.
* Improve forward compatibility of ResourceLimits interface
* Remove GLSLANG_ANGLE
## 11.12.0 2022-10-12
### Other changes
* Update generator version
* Add support for GL_EXT_mesh_shader
* Add support for NonSemantic.Shader.DebugInfo.100
* Make OpEmitMeshTasksEXT a terminal instruction
* Make gl_SubGroupARB a flat in int in Vulkan
* Add support for GL_EXT_opacity_micromap
* Add preamble support to C interface
## 11.11.0 2022-08-11
### Other changes

View File

@ -1,4 +1,4 @@
# Copyright (C) 2020 The Khronos Group Inc.
# Copyright (C) 2020-2023 The Khronos Group Inc.
#
# All rights reserved.
#
@ -30,24 +30,11 @@
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# increase to 3.1 once all major distributions
# include a version of CMake >= 3.1
cmake_minimum_required(VERSION 3.14.0)
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
project(glslang LANGUAGES CXX)
cmake_minimum_required(VERSION 3.17.2)
project(glslang)
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)
include(CMakePackageConfigHelpers)
@ -78,18 +65,10 @@ if(NOT ${SKIP_GLSLANG_INSTALL})
endif()
option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON)
option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
option(ENABLE_GLSLANG_BINARIES "Builds glslang and spirv-remap" ON)
option(ENABLE_GLSLANG_JS
"If using Emscripten, build glslang.js. Otherwise, builds a sample executable for binary-size testing." OFF)
CMAKE_DEPENDENT_OPTION(ENABLE_GLSLANG_WEBMIN
"Reduces glslang to minimum needed for web use"
OFF "ENABLE_GLSLANG_JS"
OFF)
CMAKE_DEPENDENT_OPTION(ENABLE_GLSLANG_WEBMIN_DEVEL
"For ENABLE_GLSLANG_WEBMIN builds, enables compilation error messages"
OFF "ENABLE_GLSLANG_WEBMIN"
OFF)
CMAKE_DEPENDENT_OPTION(ENABLE_EMSCRIPTEN_SINGLE_FILE
"If using Emscripten, enables SINGLE_FILE build"
OFF "ENABLE_GLSLANG_JS AND EMSCRIPTEN"
@ -99,11 +78,7 @@ CMAKE_DEPENDENT_OPTION(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE
OFF "ENABLE_GLSLANG_JS AND EMSCRIPTEN"
OFF)
CMAKE_DEPENDENT_OPTION(ENABLE_HLSL
"Enables HLSL input support"
ON "NOT ENABLE_GLSLANG_WEBMIN"
OFF)
option(ENABLE_HLSL "Enables HLSL input support" ON)
option(ENABLE_RTTI "Enables RTTI" OFF)
option(ENABLE_EXCEPTIONS "Enables Exceptions" OFF)
option(ENABLE_OPT "Enables spirv-opt capability if present" ON)
@ -117,18 +92,6 @@ else()
endif()
option(ENABLE_CTEST "Enables testing" ON)
if(ENABLE_GLSLANG_INSTALL AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "..." FORCE)
endif()
option(USE_CCACHE "Use ccache" OFF)
if(USE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
endif()
endif()
if(ENABLE_CTEST)
include(CTest)
endif()
@ -137,13 +100,6 @@ if(ENABLE_HLSL)
add_definitions(-DENABLE_HLSL)
endif()
if(ENABLE_GLSLANG_WEBMIN)
add_definitions(-DGLSLANG_WEB)
if(ENABLE_GLSLANG_WEBMIN_DEVEL)
add_definitions(-DGLSLANG_WEB_DEVEL)
endif()
endif()
if(WIN32)
set(CMAKE_DEBUG_POSTFIX "d")
option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON)
@ -151,7 +107,7 @@ if(WIN32)
include(ChooseMSVCCRT.cmake)
endif()
add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
elseif(UNIX)
elseif(UNIX OR ANDROID)
add_definitions(-DGLSLANG_OSINCLUDE_UNIX)
else()
message("unknown platform")
@ -160,7 +116,6 @@ endif()
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs
-Wunused-parameter -Wunused-value -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable -fno-exceptions)
add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over.
if(NOT ENABLE_RTTI)
add_compile_options(-fno-rtti)
endif()
@ -171,16 +126,13 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
add_compile_options(-Werror=deprecated-copy)
endif()
if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# Error if there's symbols that are not found at link time.
# add_link_options() was added in CMake 3.13 - if using an earlier
# version don't set this - it should be caught by presubmits anyway.
add_link_options("-Wl,--no-undefined")
endif()
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC)
add_compile_options(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs
-Wunused-parameter -Wunused-value -Wunused-variable)
add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over.
if(NOT ENABLE_RTTI)
add_compile_options(-fno-rtti)
endif()
@ -188,14 +140,12 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC)
add_compile_options(-fno-exceptions)
endif()
if(NOT CMAKE_VERSION VERSION_LESS "3.13")
# Error if there's symbols that are not found at link time.
# add_link_options() was added in CMake 3.13 - if using an earlier
# version don't set this - it should be caught by presubmits anyway.
if (WIN32)
add_link_options("-Wl,--no-undefined")
else()
if(NOT (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR CMAKE_SYSTEM_NAME STREQUAL "Emscripten"))
# Error if there's symbols that are not found at link time. Some linkers do not support this flag.
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_link_options("-Wl,-undefined,error")
elseif(NOT APPLE)
add_link_options("-Wl,--no-undefined")
endif()
endif()
elseif(MSVC)
@ -227,21 +177,16 @@ if(ENABLE_GLSLANG_JS)
endif()
endif()
# Request C++11
if(${CMAKE_VERSION} VERSION_LESS 3.1)
# CMake versions before 3.1 do not understand CMAKE_CXX_STANDARD
# remove this block once CMake >=3.1 has fixated in the ecosystem
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# Request C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
function(glslang_set_link_args TARGET)
# For MinGW compiles, statically link against the GCC and C++ runtimes.
# This avoids the need to ship those runtimes as DLLs.
if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
# This is supported by GCC and Clang.
if(WIN32 AND NOT MSVC)
set_target_properties(${TARGET} PROPERTIES
LINK_FLAGS "-static -static-libgcc -static-libstdc++")
endif()
@ -289,10 +234,9 @@ endfunction()
function(glslang_only_export_explicit_symbols target)
if(BUILD_SHARED_LIBS)
target_compile_definitions(${target} PUBLIC "GLSLANG_IS_SHARED_LIBRARY=1")
set_target_properties(${target} PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden)
if(WIN32)
target_compile_definitions(${target} PRIVATE "GLSLANG_EXPORTING=1")
else()
target_compile_options(${target} PRIVATE "-fvisibility=hidden")
endif()
endif()
endfunction()
@ -313,14 +257,30 @@ else()
endif()
if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
find_host_package(PythonInterp 3 REQUIRED)
find_host_package(Python3 REQUIRED)
# We depend on these for later projects, so they should come first.
add_subdirectory(External)
endif()
option(ALLOW_EXTERNAL_SPIRV_TOOLS "Allows to build against installed SPIRV-Tools-opt" OFF)
if(NOT TARGET SPIRV-Tools-opt)
set(ENABLE_OPT OFF)
if(ALLOW_EXTERNAL_SPIRV_TOOLS)
# Look for external SPIR-V Tools build, if not building in-tree
message(STATUS "Trying to find local SPIR-V tools")
find_package(SPIRV-Tools-opt)
if(NOT TARGET SPIRV-Tools-opt)
if(ENABLE_OPT)
message(WARNING "ENABLE_OPT set but SPIR-V tools not found! Disabling SPIR-V optimization.")
endif()
set(ENABLE_OPT OFF)
endif()
else()
if(ENABLE_OPT)
message(SEND_ERROR "ENABLE_OPT set but SPIR-V tools not found. Please run update_glslang_sources.py, "
"set the ALLOW_EXTERNAL_SPIRV_TOOLS option to use a local install of SPIRV-Tools, or set ENABLE_OPT=0.")
endif()
endif()
endif()
if(ENABLE_OPT)
@ -355,12 +315,12 @@ if(ENABLE_CTEST AND BUILD_TESTING)
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)
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/localResults)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/glslang)
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/spirv-remap)
else()
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslang)
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
endif()
@ -372,34 +332,42 @@ endif()
if(ENABLE_GLSLANG_INSTALL)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake.in" [=[
@PACKAGE_INIT@
@INSTALL_CONFIG_UNIX@
include("@PACKAGE_PATH_EXPORT_TARGETS@")
]=])
set(PATH_EXPORT_TARGETS "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/glslang-targets.cmake")
set(PATH_EXPORT_TARGETS "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake")
if(UNIX OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
set(INSTALL_CONFIG_UNIX [=[
include(CMakeFindDependencyMacro)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_dependency(Threads REQUIRED)
]=])
endif()
configure_package_config_file(
"${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake"
PATH_VARS
PATH_EXPORT_TARGETS
INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/glslang-config-version.cmake"
VERSION ${GLSLANG_VERSION}
COMPATIBILITY SameMajorVersion
)
install(
EXPORT glslang-targets
NAMESPACE "glslang::"
DESTINATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/glslang-config-version.cmake"
DESTINATION
"${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}"
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
endif()
endif()

View File

@ -41,7 +41,7 @@ if(WIN32)
source_group("Source" FILES ${SOURCES})
endif(WIN32)
if(ENABLE_GLSLANG_INSTALL)
if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
install(TARGETS OGLCompiler EXPORT glslang-targets)
# Backward compatibility
@ -49,11 +49,11 @@ if(ENABLE_GLSLANG_INSTALL)
message(WARNING \"Using `OGLCompilerTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::OGLCompiler)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/glslang-targets.cmake\")
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(OGLCompiler ALIAS glslang::OGLCompiler)
")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/OGLCompilerTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif(ENABLE_GLSLANG_INSTALL)
endif()

View File

@ -32,134 +32,6 @@
// POSSIBILITY OF SUCH DAMAGE.
//
#define SH_EXPORTING
#include <cassert>
#include "InitializeDll.h"
#include "../glslang/Include/InitializeGlobals.h"
#include "../glslang/Public/ShaderLang.h"
#include "../glslang/Include/PoolAlloc.h"
namespace glslang {
OS_TLSIndex ThreadInitializeIndex = OS_INVALID_TLS_INDEX;
// Per-process initialization.
// Needs to be called at least once before parsing, etc. is done.
// Will also do thread initialization for the calling thread; other
// threads will need to do that explicitly.
bool InitProcess()
{
glslang::GetGlobalLock();
if (ThreadInitializeIndex != OS_INVALID_TLS_INDEX) {
//
// Function is re-entrant.
//
glslang::ReleaseGlobalLock();
return true;
}
ThreadInitializeIndex = OS_AllocTLSIndex();
if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) {
assert(0 && "InitProcess(): Failed to allocate TLS area for init flag");
glslang::ReleaseGlobalLock();
return false;
}
if (! InitializePoolIndex()) {
assert(0 && "InitProcess(): Failed to initialize global pool");
glslang::ReleaseGlobalLock();
return false;
}
if (! InitThread()) {
assert(0 && "InitProcess(): Failed to initialize thread");
glslang::ReleaseGlobalLock();
return false;
}
glslang::ReleaseGlobalLock();
return true;
}
// Per-thread scoped initialization.
// Must be called at least once by each new thread sharing the
// symbol tables, etc., needed to parse.
bool InitThread()
{
//
// This function is re-entrant
//
if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) {
assert(0 && "InitThread(): Process hasn't been initalised.");
return false;
}
if (OS_GetTLSValue(ThreadInitializeIndex) != 0)
return true;
if (! OS_SetTLSValue(ThreadInitializeIndex, (void *)1)) {
assert(0 && "InitThread(): Unable to set init flag.");
return false;
}
glslang::SetThreadPoolAllocator(nullptr);
return true;
}
// Not necessary to call this: InitThread() is reentrant, and the need
// to do per thread tear down has been removed.
//
// This is kept, with memory management removed, to satisfy any exiting
// calls to it that rely on it.
bool DetachThread()
{
bool success = true;
if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX)
return true;
//
// Function is re-entrant and this thread may not have been initialized.
//
if (OS_GetTLSValue(ThreadInitializeIndex) != 0) {
if (!OS_SetTLSValue(ThreadInitializeIndex, (void *)0)) {
assert(0 && "DetachThread(): Unable to clear init flag.");
success = false;
}
}
return success;
}
// Not necessary to call this: InitProcess() is reentrant.
//
// This is kept, with memory management removed, to satisfy any exiting
// calls to it that rely on it.
//
// Users of glslang should call shFinalize() or glslang::FinalizeProcess() for
// process-scoped memory tear down.
bool DetachProcess()
{
bool success = true;
if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX)
return true;
success = DetachThread();
OS_FreeTLSIndex(ThreadInitializeIndex);
ThreadInitializeIndex = OS_INVALID_TLS_INDEX;
return success;
}
} // end namespace glslang

View File

@ -38,10 +38,10 @@
namespace glslang {
bool InitProcess();
bool InitThread();
bool DetachThread(); // not called from standalone, perhaps other tools rely on parts of it
bool DetachProcess(); // not called from standalone, perhaps other tools rely on parts of it
inline bool InitProcess() { return true; } // DEPRECATED
inline bool InitThread() { return true; } // DEPRECATED
inline bool DetachThread() { return true; } // DEPRECATED
inline bool DetachProcess() { return true; } // DEPRECATED
} // end namespace glslang

View File

@ -112,7 +112,7 @@ BUILD DEPENDENCIES:
BUILDING
--------------------------------------------------------------------------------
The standalone remapper is built along side glslangValidator through its
The standalone remapper is built along side glslang through its
normal build process.

View File

@ -1,26 +1,19 @@
# News
1. Visual Studio 2013 is no longer supported
1. [As discussed in #3107](https://github.com/KhronosGroup/glslang/issues/3107), the default branch of this repository is now 'main'. This change should be transparent to repository users, since github rewrites many references to the old 'master' branch to 'main'. However, if you have a checked-out local clone, you may wish to take the following steps as recommended by github:
[As scheduled](https://github.com/KhronosGroup/glslang/blob/9eef54b2513ca6b40b47b07d24f453848b65c0df/README.md#planned-deprecationsremovals),
Microsoft Visual Studio 2013 is no longer officially supported. \
Please upgrade to at least Visual Studio 2015.
```sh
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
```
2. The versioning scheme is being improved, and you might notice some differences. This is currently WIP, but will be coming soon. See, for example, PR #2277.
2. C++17 (all platforms) and Visual Studio 2019 (Windows) are now required. This change was driven by the external dependency on SPIRV-Tools.
3. If you get a new **compilation error due to a missing header**, it might be caused by this planned removal:
**SPIRV Folder, 1-May, 2020.** 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 than May 1, 2020.
See issue #1964.
If people are only using this location to get spirv.hpp, I recommend they get that from [SPIRV-Headers](https://github.com/KhronosGroup/SPIRV-Headers) instead.
[![appveyor status](https://ci.appveyor.com/api/projects/status/q6fi9cb0qnhkla68/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/glslang/branch/master)
![Continuous Integration](https://github.com/KhronosGroup/glslang/actions/workflows/continuous_integration.yml/badge.svg)
![Continuous Deployment](https://github.com/KhronosGroup/glslang/actions/workflows/continuous_deployment.yml/badge.svg)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/KhronosGroup/glslang/badge)](https://securityscorecards.dev/viewer/?uri=github.com/KhronosGroup/glslang)
# Glslang Components and Status
@ -55,7 +48,7 @@ An API for getting reflection information from the AST, reflection types/variabl
### Standalone Wrapper
`glslangValidator` is command-line tool for accessing the functionality above.
`glslang` is command-line tool for accessing the functionality above.
Status: Complete.
@ -73,7 +66,7 @@ The above page, while not kept up to date, includes additional information regar
## Execution of Standalone Wrapper
To use the standalone binary form, execute `glslangValidator`, and it will print
To use the standalone binary form, execute `glslang`, and it will print
a usage statement. Basic operation is to give it a file containing a shader,
and it will print out warnings/errors and optionally an AST.
@ -99,15 +92,15 @@ There is also a non-shader extension:
## Building (CMake)
Instead of building manually, you can also download the binaries for your
platform directly from the [master-tot release][master-tot-release] on GitHub.
platform directly from the [main-tot release][main-tot-release] on GitHub.
Those binaries are automatically uploaded by the buildbots after successful
testing and they always reflect the current top of the tree of the master
testing and they always reflect the current top of the tree of the main
branch.
### Dependencies
* A C++11 compiler.
(For MSVS: use 2015 or later.)
* A C++17 compiler.
(For MSVS: use 2019 or later.)
* [CMake][cmake]: for generating compilation targets.
* make: _Linux_, ninja is an alternative, if configured.
* [Python 3.x][python]: for executing SPIRV-Tools scripts. (Optional if not using SPIRV-Tools and the 'External' subdirectory does not exist.)
@ -242,16 +235,13 @@ changes are quite infrequent. For windows you can get binaries from
The command to rebuild is:
```bash
m4 -P MachineIndependent/glslang.m4 > MachineIndependent/glslang.y
bison --defines=MachineIndependent/glslang_tab.cpp.h
-t MachineIndependent/glslang.y
-o MachineIndependent/glslang_tab.cpp
```
The above commands are also available in the bash script in `updateGrammar`,
The above command is also available in the bash script in `updateGrammar`,
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).
### Building to WASM for the Web and Node
### Building a standalone JS/WASM library for the Web and Node
@ -261,15 +251,9 @@ Use the steps in [Build Steps](#build-steps), with the following notes/exception
Bash-like environments:
+ [Instructions located here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install)
* Wrap cmake call: `emcmake cmake`
* Set `-DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF`.
* Set `-DBUILD_TESTING=OFF -DENABLE_OPT=OFF`.
* Set `-DENABLE_HLSL=OFF` if HLSL is not needed.
* For a standalone JS/WASM library, turn on `-DENABLE_GLSLANG_JS=ON`.
* For building a minimum-size web subset of core glslang:
+ turn on `-DENABLE_GLSLANG_WEBMIN=ON` (disables HLSL)
+ execute `updateGrammar web` from the glslang subdirectory
(or if using your own scripts, `m4` needs a `-DGLSLANG_WEB` argument)
+ optionally, for GLSL compilation error messages, turn on
`-DENABLE_GLSLANG_WEBMIN_DEVEL=ON`
* To get a fully minimized build, make sure to use `brotli` to compress the .js
and .wasm files
@ -277,7 +261,7 @@ Example:
```sh
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON \
-DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF ..
-DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF ..
```
## Building glslang - Using vcpkg
@ -433,9 +417,18 @@ warning/error and other options for controlling compilation.
This interface is located `glslang_c_interface.h` and exposes functionality similar to the C++ interface. The following snippet is a complete example showing how to compile GLSL into SPIR-V 1.5 for Vulkan 1.2.
```cxx
std::vector<uint32_t> compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const char* shaderSource, const char* fileName)
{
```c
#include <glslang/Include/glslang_c_interface.h>
// Required for use of glslang_default_resource
#include <glslang/Public/resource_limits_c.h>
typedef struct SpirVBinary {
uint32_t *words; // SPIR-V words
int size; // number of words in SPIR-V binary
} SpirVBinary;
SpirVBinary compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const char* shaderSource, const char* fileName) {
const glslang_input_t input = {
.language = GLSLANG_SOURCE_GLSL,
.stage = stage,
@ -449,18 +442,22 @@ std::vector<uint32_t> compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const c
.force_default_version_and_profile = false,
.forward_compatible = false,
.messages = GLSLANG_MSG_DEFAULT_BIT,
.resource = reinterpret_cast<const glslang_resource_t*>(&glslang::DefaultTBuiltInResource),
.resource = glslang_default_resource(),
};
glslang_shader_t* shader = glslang_shader_create(&input);
SpirVBinary bin = {
.words = NULL,
.size = 0,
};
if (!glslang_shader_preprocess(shader, &input)) {
printf("GLSL preprocessing failed %s\n", fileName);
printf("%s\n", glslang_shader_get_info_log(shader));
printf("%s\n", glslang_shader_get_info_debug_log(shader));
printf("%s\n", input.code);
glslang_shader_delete(shader);
return std::vector<uint32_t>();
return bin;
}
if (!glslang_shader_parse(shader, &input)) {
@ -469,7 +466,7 @@ std::vector<uint32_t> compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const c
printf("%s\n", glslang_shader_get_info_debug_log(shader));
printf("%s\n", glslang_shader_get_preprocessed_code(shader));
glslang_shader_delete(shader);
return std::vector<uint32_t>();
return bin;
}
glslang_program_t* program = glslang_program_create();
@ -481,13 +478,14 @@ std::vector<uint32_t> compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const c
printf("%s\n", glslang_program_get_info_debug_log(program));
glslang_program_delete(program);
glslang_shader_delete(shader);
return std::vector<uint32_t>();
return bin;
}
glslang_program_SPIRV_generate(program, stage);
std::vector<uint32_t> outShaderModule(glslang_program_SPIRV_get_size(program));
glslang_program_SPIRV_get(program, outShaderModule.data());
bin.size = glslang_program_SPIRV_get_size(program);
bin.words = malloc(bin.size * sizeof(uint32_t));
glslang_program_SPIRV_get(program, bin.words);
const char* spirv_messages = glslang_program_SPIRV_get_messages(program);
if (spirv_messages)
@ -496,7 +494,7 @@ std::vector<uint32_t> compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const c
glslang_program_delete(program);
glslang_shader_delete(shader);
return outShaderModule;
return bin;
}
```
@ -555,4 +553,4 @@ std::vector<uint32_t> compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const c
[bison]: https://www.gnu.org/software/bison/
[googletest]: https://github.com/google/googletest
[bison-gnu-win32]: http://gnuwin32.sourceforge.net/packages/bison.htm
[master-tot-release]: https://github.com/KhronosGroup/glslang/releases/tag/master-tot
[main-tot-release]: https://github.com/KhronosGroup/glslang/releases/tag/main-tot

6
SECURITY.md Normal file
View File

@ -0,0 +1,6 @@
# Security Policy
To report a security issue, please disclose it at [security advisory](https://github.com/KhronosGroup/glslang/security/advisories/new).
This project is maintained by a team of volunteers on a reasonable-effort basis. As
such, please give us at least 90 days to work on a fix before public exposure.

View File

@ -59,22 +59,22 @@ static EShLanguage c_shader_stage(glslang_stage_t stage)
return EShLangFragment;
case GLSLANG_STAGE_COMPUTE:
return EShLangCompute;
case GLSLANG_STAGE_RAYGEN_NV:
case GLSLANG_STAGE_RAYGEN:
return EShLangRayGen;
case GLSLANG_STAGE_INTERSECT_NV:
case GLSLANG_STAGE_INTERSECT:
return EShLangIntersect;
case GLSLANG_STAGE_ANYHIT_NV:
case GLSLANG_STAGE_ANYHIT:
return EShLangAnyHit;
case GLSLANG_STAGE_CLOSESTHIT_NV:
case GLSLANG_STAGE_CLOSESTHIT:
return EShLangClosestHit;
case GLSLANG_STAGE_MISS_NV:
case GLSLANG_STAGE_MISS:
return EShLangMiss;
case GLSLANG_STAGE_CALLABLE_NV:
case GLSLANG_STAGE_CALLABLE:
return EShLangCallable;
case GLSLANG_STAGE_TASK_NV:
return EShLangTaskNV;
case GLSLANG_STAGE_MESH_NV:
return EShLangMeshNV;
case GLSLANG_STAGE_TASK:
return EShLangTask;
case GLSLANG_STAGE_MESH:
return EShLangMesh;
default:
break;
}
@ -86,10 +86,13 @@ GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, g
glslang_spv_options_t spv_options;
spv_options.generate_debug_info = false;
spv_options.strip_debug_info = false;
spv_options.emit_nonsemantic_shader_debug_info = false;
spv_options.emit_nonsemantic_shader_debug_source = false;
spv_options.disable_optimizer = true;
spv_options.optimize_size = false;
spv_options.disassemble = false;
spv_options.validate = true;
spv_options.compile_only = false;
glslang_program_SPIRV_generate_with_options(program, stage, &spv_options);
}

View File

@ -62,15 +62,20 @@ set(HEADERS
disassemble.h
GLSL.ext.AMD.h
GLSL.ext.NV.h
NonSemanticDebugPrintf.h)
GLSL.ext.ARM.h
NonSemanticDebugPrintf.h
NonSemanticShaderDebugInfo100.h)
set(SPVREMAP_HEADERS
SPVRemapper.h
doc.h)
add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
set_property(TARGET SPIRV PROPERTY FOLDER glslang)
set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON)
set_target_properties(SPIRV PROPERTIES
FOLDER glslang
POSITION_INDEPENDENT_CODE ON
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}")
target_include_directories(SPIRV PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
@ -79,8 +84,11 @@ glslang_add_build_info_dependency(SPIRV)
if (ENABLE_SPVREMAPPER)
add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
set_property(TARGET SPVRemapper PROPERTY FOLDER glslang)
set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON)
set_target_properties(SPVRemapper PROPERTIES
FOLDER glslang
POSITION_INDEPENDENT_CODE ON
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}")
endif()
if(WIN32 AND BUILD_SHARED_LIBS)
@ -121,7 +129,7 @@ if(ENABLE_GLSLANG_INSTALL)
message(WARNING \"Using `SPVRemapperTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::SPVRemapper)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/glslang-targets.cmake\")
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(SPVRemapper ALIAS glslang::SPVRemapper)
@ -133,7 +141,7 @@ if(ENABLE_GLSLANG_INSTALL)
message(WARNING \"Using `SPIRVTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::SPIRV)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/glslang-targets.cmake\")
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(SPIRV ALIAS glslang::SPIRV)

35
SPIRV/GLSL.ext.ARM.h Normal file
View File

@ -0,0 +1,35 @@
/*
** Copyright (c) 2022 ARM Limited
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and/or associated documentation files (the "Materials"),
** to deal in the Materials without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Materials, and to permit persons to whom the
** Materials are furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Materials.
**
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
** IN THE MATERIALS.
*/
#ifndef GLSLextARM_H
#define GLSLextARM_H
static const int GLSLextARMVersion = 100;
static const int GLSLextARMRevision = 1;
static const char * const E_SPV_ARM_core_builtins = "SPV_ARM_core_builtins";
#endif // #ifndef GLSLextARM_H

View File

@ -39,5 +39,7 @@ static const char* const E_SPV_EXT_shader_atomic_float_add = "SPV_EXT_shader_ato
static const char* const E_SPV_EXT_shader_atomic_float16_add = "SPV_EXT_shader_atomic_float16_add";
static const char* const E_SPV_EXT_shader_atomic_float_min_max = "SPV_EXT_shader_atomic_float_min_max";
static const char* const E_SPV_EXT_shader_image_int64 = "SPV_EXT_shader_image_int64";
static const char* const E_SPV_EXT_shader_tile_image = "SPV_EXT_shader_tile_image";
static const char* const E_SPV_EXT_mesh_shader = "SPV_EXT_mesh_shader";
#endif // #ifndef GLSLextEXT_H

View File

@ -54,5 +54,7 @@ static const char* const E_SPV_KHR_workgroup_memory_explicit_layout = "SPV_KHR_w
static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subgroup_uniform_control_flow";
static const char* const E_SPV_KHR_fragment_shader_barycentric = "SPV_KHR_fragment_shader_barycentric";
static const char* const E_SPV_AMD_shader_early_and_late_fragment_tests = "SPV_AMD_shader_early_and_late_fragment_tests";
static const char* const E_SPV_KHR_ray_tracing_position_fetch = "SPV_KHR_ray_tracing_position_fetch";
static const char* const E_SPV_KHR_cooperative_matrix = "SPV_KHR_cooperative_matrix";
#endif // #ifndef GLSLextKHR_H

View File

@ -81,4 +81,10 @@ const char* const E_SPV_NV_cooperative_matrix = "SPV_NV_cooperative_matrix";
//SPV_NV_shader_sm_builtins
const char* const E_SPV_NV_shader_sm_builtins = "SPV_NV_shader_sm_builtins";
//SPV_NV_shader_execution_reorder
const char* const E_SPV_NV_shader_invocation_reorder = "SPV_NV_shader_invocation_reorder";
//SPV_NV_displacement_micromap
const char* const E_SPV_NV_displacement_micromap = "SPV_NV_displacement_micromap";
#endif // #ifndef GLSLextNV_H

41
SPIRV/GLSL.ext.QCOM.h Normal file
View File

@ -0,0 +1,41 @@
/*
** Copyright (c) 2021 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and/or associated documentation files (the "Materials"),
** to deal in the Materials without restriction, including without limitation
** the rights to use, copy, modify, merge, publish, distribute, sublicense,
** and/or sell copies of the Materials, and to permit persons to whom the
** Materials are furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Materials.
**
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
** IN THE MATERIALS.
*/
#ifndef GLSLextQCOM_H
#define GLSLextQCOM_H
enum BuiltIn;
enum Decoration;
enum Op;
enum Capability;
static const int GLSLextQCOMVersion = 100;
static const int GLSLextQCOMRevision = 1;
//SPV_QCOM_image_processing
const char* const E_SPV_QCOM_image_processing = "SPV_QCOM_image_processing";
#endif // #ifndef GLSLextQCOM_H

View File

@ -13,7 +13,7 @@
**
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

1492
SPIRV/GlslangToSpv.cpp Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -55,7 +55,7 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
SpvOptions* options = nullptr);
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger* logger, SpvOptions* options = nullptr);
void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName);
void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, const char* varName);
bool OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName);
bool OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, const char* varName);
}

View File

@ -32,8 +32,6 @@
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#ifndef GLSLANG_WEB
#include "Logger.h"
#include <algorithm>
@ -68,5 +66,3 @@ std::string SpvBuildLogger::getAllMessages() const {
}
} // end spv namespace
#endif

View File

@ -46,14 +46,6 @@ class SpvBuildLogger {
public:
SpvBuildLogger() {}
#ifdef GLSLANG_WEB
void tbdFunctionality(const std::string& f) { }
void missingFunctionality(const std::string& f) { }
void warning(const std::string& w) { }
void error(const std::string& e) { errors.push_back(e); }
std::string getAllMessages() { return ""; }
#else
// Registers a TBD functionality.
void tbdFunctionality(const std::string& f);
// Registers a missing functionality.
@ -67,7 +59,6 @@ public:
// Returns all messages accumulated in the order of:
// TBD functionalities, missing functionalities, warnings, errors.
std::string getAllMessages() const;
#endif
private:
SpvBuildLogger(const SpvBuildLogger&);

View File

@ -1,5 +1,5 @@
// Copyright (c) 2020 The Khronos Group Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
@ -7,15 +7,15 @@
// distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to
// the following conditions:
//
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials.
//
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
// https://www.khronos.org/registry/
//
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@ -23,7 +23,7 @@
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
//
//
#ifndef SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_
#define SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_

View File

@ -0,0 +1,171 @@
// Copyright (c) 2018 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
// to deal in the Materials without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Materials, and to permit persons to whom the
// Materials are furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
// IN THE MATERIALS.
#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_
#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_
#ifdef __cplusplus
extern "C" {
#endif
enum {
NonSemanticShaderDebugInfo100Version = 100,
NonSemanticShaderDebugInfo100Version_BitWidthPadding = 0x7fffffff
};
enum {
NonSemanticShaderDebugInfo100Revision = 6,
NonSemanticShaderDebugInfo100Revision_BitWidthPadding = 0x7fffffff
};
enum NonSemanticShaderDebugInfo100Instructions {
NonSemanticShaderDebugInfo100DebugInfoNone = 0,
NonSemanticShaderDebugInfo100DebugCompilationUnit = 1,
NonSemanticShaderDebugInfo100DebugTypeBasic = 2,
NonSemanticShaderDebugInfo100DebugTypePointer = 3,
NonSemanticShaderDebugInfo100DebugTypeQualifier = 4,
NonSemanticShaderDebugInfo100DebugTypeArray = 5,
NonSemanticShaderDebugInfo100DebugTypeVector = 6,
NonSemanticShaderDebugInfo100DebugTypedef = 7,
NonSemanticShaderDebugInfo100DebugTypeFunction = 8,
NonSemanticShaderDebugInfo100DebugTypeEnum = 9,
NonSemanticShaderDebugInfo100DebugTypeComposite = 10,
NonSemanticShaderDebugInfo100DebugTypeMember = 11,
NonSemanticShaderDebugInfo100DebugTypeInheritance = 12,
NonSemanticShaderDebugInfo100DebugTypePtrToMember = 13,
NonSemanticShaderDebugInfo100DebugTypeTemplate = 14,
NonSemanticShaderDebugInfo100DebugTypeTemplateParameter = 15,
NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter = 16,
NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack = 17,
NonSemanticShaderDebugInfo100DebugGlobalVariable = 18,
NonSemanticShaderDebugInfo100DebugFunctionDeclaration = 19,
NonSemanticShaderDebugInfo100DebugFunction = 20,
NonSemanticShaderDebugInfo100DebugLexicalBlock = 21,
NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator = 22,
NonSemanticShaderDebugInfo100DebugScope = 23,
NonSemanticShaderDebugInfo100DebugNoScope = 24,
NonSemanticShaderDebugInfo100DebugInlinedAt = 25,
NonSemanticShaderDebugInfo100DebugLocalVariable = 26,
NonSemanticShaderDebugInfo100DebugInlinedVariable = 27,
NonSemanticShaderDebugInfo100DebugDeclare = 28,
NonSemanticShaderDebugInfo100DebugValue = 29,
NonSemanticShaderDebugInfo100DebugOperation = 30,
NonSemanticShaderDebugInfo100DebugExpression = 31,
NonSemanticShaderDebugInfo100DebugMacroDef = 32,
NonSemanticShaderDebugInfo100DebugMacroUndef = 33,
NonSemanticShaderDebugInfo100DebugImportedEntity = 34,
NonSemanticShaderDebugInfo100DebugSource = 35,
NonSemanticShaderDebugInfo100DebugFunctionDefinition = 101,
NonSemanticShaderDebugInfo100DebugSourceContinued = 102,
NonSemanticShaderDebugInfo100DebugLine = 103,
NonSemanticShaderDebugInfo100DebugNoLine = 104,
NonSemanticShaderDebugInfo100DebugBuildIdentifier = 105,
NonSemanticShaderDebugInfo100DebugStoragePath = 106,
NonSemanticShaderDebugInfo100DebugEntryPoint = 107,
NonSemanticShaderDebugInfo100DebugTypeMatrix = 108,
NonSemanticShaderDebugInfo100InstructionsMax = 0x7fffffff
};
enum NonSemanticShaderDebugInfo100DebugInfoFlags {
NonSemanticShaderDebugInfo100None = 0x0000,
NonSemanticShaderDebugInfo100FlagIsProtected = 0x01,
NonSemanticShaderDebugInfo100FlagIsPrivate = 0x02,
NonSemanticShaderDebugInfo100FlagIsPublic = 0x03,
NonSemanticShaderDebugInfo100FlagIsLocal = 0x04,
NonSemanticShaderDebugInfo100FlagIsDefinition = 0x08,
NonSemanticShaderDebugInfo100FlagFwdDecl = 0x10,
NonSemanticShaderDebugInfo100FlagArtificial = 0x20,
NonSemanticShaderDebugInfo100FlagExplicit = 0x40,
NonSemanticShaderDebugInfo100FlagPrototyped = 0x80,
NonSemanticShaderDebugInfo100FlagObjectPointer = 0x100,
NonSemanticShaderDebugInfo100FlagStaticMember = 0x200,
NonSemanticShaderDebugInfo100FlagIndirectVariable = 0x400,
NonSemanticShaderDebugInfo100FlagLValueReference = 0x800,
NonSemanticShaderDebugInfo100FlagRValueReference = 0x1000,
NonSemanticShaderDebugInfo100FlagIsOptimized = 0x2000,
NonSemanticShaderDebugInfo100FlagIsEnumClass = 0x4000,
NonSemanticShaderDebugInfo100FlagTypePassByValue = 0x8000,
NonSemanticShaderDebugInfo100FlagTypePassByReference = 0x10000,
NonSemanticShaderDebugInfo100FlagUnknownPhysicalLayout = 0x20000,
NonSemanticShaderDebugInfo100DebugInfoFlagsMax = 0x7fffffff
};
enum NonSemanticShaderDebugInfo100BuildIdentifierFlags {
NonSemanticShaderDebugInfo100IdentifierPossibleDuplicates = 0x01,
NonSemanticShaderDebugInfo100BuildIdentifierFlagsMax = 0x7fffffff
};
enum NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncoding {
NonSemanticShaderDebugInfo100Unspecified = 0,
NonSemanticShaderDebugInfo100Address = 1,
NonSemanticShaderDebugInfo100Boolean = 2,
NonSemanticShaderDebugInfo100Float = 3,
NonSemanticShaderDebugInfo100Signed = 4,
NonSemanticShaderDebugInfo100SignedChar = 5,
NonSemanticShaderDebugInfo100Unsigned = 6,
NonSemanticShaderDebugInfo100UnsignedChar = 7,
NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff
};
enum NonSemanticShaderDebugInfo100DebugCompositeType {
NonSemanticShaderDebugInfo100Class = 0,
NonSemanticShaderDebugInfo100Structure = 1,
NonSemanticShaderDebugInfo100Union = 2,
NonSemanticShaderDebugInfo100DebugCompositeTypeMax = 0x7fffffff
};
enum NonSemanticShaderDebugInfo100DebugTypeQualifier {
NonSemanticShaderDebugInfo100ConstType = 0,
NonSemanticShaderDebugInfo100VolatileType = 1,
NonSemanticShaderDebugInfo100RestrictType = 2,
NonSemanticShaderDebugInfo100AtomicType = 3,
NonSemanticShaderDebugInfo100DebugTypeQualifierMax = 0x7fffffff
};
enum NonSemanticShaderDebugInfo100DebugOperation {
NonSemanticShaderDebugInfo100Deref = 0,
NonSemanticShaderDebugInfo100Plus = 1,
NonSemanticShaderDebugInfo100Minus = 2,
NonSemanticShaderDebugInfo100PlusUconst = 3,
NonSemanticShaderDebugInfo100BitPiece = 4,
NonSemanticShaderDebugInfo100Swap = 5,
NonSemanticShaderDebugInfo100Xderef = 6,
NonSemanticShaderDebugInfo100StackValue = 7,
NonSemanticShaderDebugInfo100Constu = 8,
NonSemanticShaderDebugInfo100Fragment = 9,
NonSemanticShaderDebugInfo100DebugOperationMax = 0x7fffffff
};
enum NonSemanticShaderDebugInfo100DebugImportedEntity {
NonSemanticShaderDebugInfo100ImportedModule = 0,
NonSemanticShaderDebugInfo100ImportedDeclaration = 1,
NonSemanticShaderDebugInfo100DebugImportedEntityMax = 0x7fffffff
};
#ifdef __cplusplus
}
#endif
#endif // SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_

View File

@ -36,10 +36,6 @@
#include "SPVRemapper.h"
#include "doc.h"
#if !defined (use_cpp11)
// ... not supported before C++11
#else // defined (use_cpp11)
#include <algorithm>
#include <cassert>
#include "../glslang/Include/Common.h"
@ -684,6 +680,7 @@ namespace spv {
case spv::OperandKernelEnqueueFlags:
case spv::OperandKernelProfilingInfo:
case spv::OperandCapability:
case spv::OperandCooperativeMatrixOperands:
++word;
break;
@ -1528,5 +1525,3 @@ namespace spv {
} // namespace SPV
#endif // defined (use_cpp11)

View File

@ -43,12 +43,6 @@
namespace spv {
// MSVC defines __cplusplus as an older value, even when it supports almost all of 11.
// We handle that here by making our own symbol.
#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1700)
# define use_cpp11 1
#endif
class spirvbin_base_t
{
public:
@ -74,27 +68,6 @@ public:
} // namespace SPV
#if !defined (use_cpp11)
#include <cstdio>
#include <cstdint>
namespace spv {
class spirvbin_t : public spirvbin_base_t
{
public:
spirvbin_t(int /*verbose = 0*/) { }
void remap(std::vector<std::uint32_t>& /*spv*/, unsigned int /*opts = 0*/)
{
printf("Tool not compiled for C++11, which is required for SPIR-V remapping.\n");
exit(5);
}
};
} // namespace SPV
#else // defined (use_cpp11)
#include <functional>
#include <cstdint>
#include <unordered_map>
@ -308,5 +281,4 @@ private:
} // namespace SPV
#endif // defined (use_cpp11)
#endif // SPIRVREMAPPER_H

File diff suppressed because it is too large Load Diff

View File

@ -50,6 +50,10 @@
#include "Logger.h"
#include "spirv.hpp"
#include "spvIR.h"
namespace spv {
#include "GLSL.ext.KHR.h"
#include "NonSemanticShaderDebugInfo100.h"
}
#include <algorithm>
#include <map>
@ -82,7 +86,7 @@ public:
void setSource(spv::SourceLanguage lang, int version)
{
source = lang;
sourceLang = lang;
sourceVersion = version;
}
spv::Id getStringId(const std::string& str)
@ -99,18 +103,32 @@ public:
stringIds[file_c_str] = strId;
return strId;
}
spv::Id getSourceFile() const
spv::Id getSourceFile() const
{
return sourceFileStringId;
}
void setSourceFile(const std::string& file)
{
sourceFileStringId = getStringId(file);
currentFileId = sourceFileStringId;
}
void setSourceText(const std::string& text) { sourceText = text; }
void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); }
void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
void setEmitOpLines() { emitOpLines = true; }
void setEmitNonSemanticShaderDebugInfo(bool const emit)
{
emitNonSemanticShaderDebugInfo = emit;
if(emit)
{
importNonSemanticShaderDebugInfoInstructions();
}
}
void setEmitNonSemanticShaderDebugSource(bool const src)
{
emitNonSemanticShaderDebugSource = src;
}
void addExtension(const char* ext) { extensions.insert(ext); }
void removeExtension(const char* ext)
{
@ -163,10 +181,11 @@ public:
void setLine(int line, const char* filename);
// Low-level OpLine. See setLine() for a layered helper.
void addLine(Id fileName, int line, int column);
void addDebugScopeAndLine(Id fileName, int line, int column);
// For creating new types (will return old type if the requested one was already made).
Id makeVoidType();
Id makeBoolType();
Id makeBoolType(bool const compilerGenerated = true);
Id makePointer(StorageClass, Id pointee);
Id makeForwardPointer(StorageClass);
Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee);
@ -174,7 +193,7 @@ public:
Id makeIntType(int width) { return makeIntegerType(width, true); }
Id makeUintType(int width) { return makeIntegerType(width, false); }
Id makeFloatType(int width);
Id makeStructType(const std::vector<Id>& members, const char*);
Id makeStructType(const std::vector<Id>& members, const char* name, bool const compilerGenerated = true);
Id makeStructResultType(Id type0, Id type1);
Id makeVectorType(Id component, int size);
Id makeMatrixType(Id component, int cols, int rows);
@ -184,13 +203,47 @@ public:
Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format);
Id makeSamplerType();
Id makeSampledImageType(Id imageType);
Id makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols);
Id makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use);
Id makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols);
Id makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType);
Id makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands);
// SPIR-V NonSemantic Shader DebugInfo Instructions
struct DebugTypeLoc {
std::string name {};
int line {0};
int column {0};
};
std::unordered_map<Id, DebugTypeLoc> debugTypeLocs;
Id makeDebugInfoNone();
Id makeBoolDebugType(int const size);
Id makeIntegerDebugType(int const width, bool const hasSign);
Id makeFloatDebugType(int const width);
Id makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType);
Id makeArrayDebugType(Id const baseType, Id const componentCount);
Id makeVectorDebugType(Id const baseType, int const componentCount);
Id makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor = true);
Id makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc);
Id makeCompositeDebugType(std::vector<Id> const& memberTypes, char const*const name,
NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType = false);
Id makeDebugSource(const Id fileName);
Id makeDebugCompilationUnit();
Id createDebugGlobalVariable(Id const type, char const*const name, Id const variable);
Id createDebugLocalVariable(Id type, char const*const name, size_t const argNumber = 0);
Id makeDebugExpression();
Id makeDebugDeclare(Id const debugLocalVariable, Id const localVariable);
Id makeDebugValue(Id const debugLocalVariable, Id const value);
Id makeDebugFunctionType(Id returnType, const std::vector<Id>& paramTypes);
Id makeDebugFunction(Function* function, Id nameId, Id funcTypeId);
Id makeDebugLexicalBlock(uint32_t line);
std::string unmangleFunctionName(std::string const& name) const;
// accelerationStructureNV type
Id makeAccelerationStructureType();
// rayQueryEXT type
Id makeRayQueryType();
// hitObjectNV type
Id makeHitObjectNVType();
// For querying about types.
Id getTypeId(Id resultId) const { return module.getTypeId(resultId); }
@ -208,6 +261,7 @@ public:
ImageFormat getImageTypeFormat(Id typeId) const
{ return (ImageFormat)module.getInstruction(typeId)->getImmediateOperand(6); }
Id getResultingAccessChainType() const;
Id getIdOperand(Id resultId, int idx) { return module.getInstruction(resultId)->getIdOperand(idx); }
bool isPointer(Id resultId) const { return isPointerType(getTypeId(resultId)); }
bool isScalar(Id resultId) const { return isScalarType(getTypeId(resultId)); }
@ -232,11 +286,10 @@ public:
bool isMatrixType(Id typeId) const { return getTypeClass(typeId) == OpTypeMatrix; }
bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; }
bool isArrayType(Id typeId) const { return getTypeClass(typeId) == OpTypeArray; }
#ifdef GLSLANG_WEB
bool isCooperativeMatrixType(Id typeId)const { return false; }
#else
bool isCooperativeMatrixType(Id typeId)const { return getTypeClass(typeId) == OpTypeCooperativeMatrixNV; }
#endif
bool isCooperativeMatrixType(Id typeId)const
{
return getTypeClass(typeId) == OpTypeCooperativeMatrixKHR || getTypeClass(typeId) == OpTypeCooperativeMatrixNV;
}
bool isAggregateType(Id typeId) const
{ return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; }
@ -261,6 +314,8 @@ public:
// See if a resultId is valid for use as an initializer.
bool isValidInitializer(Id resultId) const { return isConstant(resultId) || isGlobalVariable(resultId); }
bool isRayTracingOpCode(Op opcode) const;
int getScalarTypeWidth(Id typeId) const
{
Id scalarTypeId = getScalarTypeId(typeId);
@ -322,6 +377,8 @@ public:
Id makeFloat16Constant(float f16, bool specConstant = false);
Id makeFpConstant(Id type, double d, bool specConstant = false);
Id importNonSemanticShaderDebugInfoInstructions();
// Turn the array of constants into a proper spv constant of the requested type.
Id makeCompositeConstant(Id type, const std::vector<Id>& comps, bool specConst = false);
@ -336,6 +393,7 @@ public:
void addDecoration(Id, Decoration, const char*);
void addDecoration(Id, Decoration, const std::vector<unsigned>& literals);
void addDecoration(Id, Decoration, const std::vector<const char*>& strings);
void addLinkageDecoration(Id id, const char* name, spv::LinkageType linkType);
void addDecorationId(Id id, Decoration, Id idDecoration);
void addDecorationId(Id id, Decoration, const std::vector<Id>& operandIds);
void addMemberDecoration(Id, unsigned int member, Decoration, int num = -1);
@ -344,7 +402,12 @@ public:
void addMemberDecoration(Id, unsigned int member, Decoration, const std::vector<const char*>& strings);
// At the end of what block do the next create*() instructions go?
void setBuildPoint(Block* bp) { buildPoint = bp; }
// Also reset current last DebugScope and current source line to unknown
void setBuildPoint(Block* bp) {
buildPoint = bp;
lastDebugScopeId = NoResult;
currentLine = 0;
}
Block* getBuildPoint() const { return buildPoint; }
// Make the entry-point function. The returned pointer is only valid
@ -355,12 +418,23 @@ public:
// Return the function, pass back the entry.
// The returned pointer is only valid for the lifetime of this builder.
Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name,
const std::vector<Id>& paramTypes, const std::vector<std::vector<Decoration>>& precisions, Block **entry = 0);
LinkageType linkType, const std::vector<Id>& paramTypes,
const std::vector<char const*>& paramNames,
const std::vector<std::vector<Decoration>>& precisions, Block **entry = nullptr);
// Create a return. An 'implicit' return is one not appearing in the source
// code. In the case of an implicit return, no post-return block is inserted.
void makeReturn(bool implicit, Id retVal = 0);
// Initialize state and generate instructions for new lexical scope
void enterScope(uint32_t line);
// Set state and generate instructions to exit current lexical scope
void leaveScope();
// Prepare builder for generation of instructions for a function.
void enterFunction(Function const* function);
// Generate all the code needed to finish up a function.
void leaveFunction();
@ -368,9 +442,13 @@ public:
// discard, terminate-invocation, terminateRayEXT, or ignoreIntersectionEXT
void makeStatementTerminator(spv::Op opcode, const char *name);
// Create block terminator instruction for statements that have input operands
// such as OpEmitMeshTasksEXT
void makeStatementTerminator(spv::Op opcode, const std::vector<Id>& operands, const char* name);
// Create a global or function local or IO variable.
Id createVariable(Decoration precision, StorageClass, Id type, const char* name = nullptr,
Id initializer = NoResult);
Id createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name = nullptr,
Id initializer = NoResult, bool const compilerGenerated = true);
// Create an intermediate with an undefined value.
Id createUndefined(Id type);
@ -390,8 +468,10 @@ public:
// Create an OpArrayLength instruction
Id createArrayLength(Id base, unsigned int member);
// Create an OpCooperativeMatrixLengthKHR instruction
Id createCooperativeMatrixLengthKHR(Id type);
// Create an OpCooperativeMatrixLengthNV instruction
Id createCooperativeMatrixLength(Id type);
Id createCooperativeMatrixLengthNV(Id type);
// Create an OpCompositeExtract instruction
Id createCompositeExtract(Id composite, Id typeId, unsigned index);
@ -626,11 +706,6 @@ public:
// Accumulate whether anything in the chain of structures has coherent decorations.
struct CoherentFlags {
CoherentFlags() { clear(); }
#ifdef GLSLANG_WEB
void clear() { }
bool isVolatile() const { return false; }
CoherentFlags operator |=(const CoherentFlags &other) { return *this; }
#else
bool isVolatile() const { return volatil; }
bool isNonUniform() const { return nonUniform; }
bool anyCoherent() const {
@ -675,7 +750,6 @@ public:
nonUniform |= other.nonUniform;
return *this;
}
#endif
};
CoherentFlags coherentFlags;
};
@ -756,19 +830,17 @@ public:
// Add capabilities, extensions, remove unneeded decorations, etc.,
// based on the resulting SPIR-V.
void postProcess();
void postProcess(bool compileOnly);
// 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 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;
@ -805,13 +877,23 @@ public:
const;
unsigned int spvVersion; // the version of SPIR-V to emit in the header
SourceLanguage source;
SourceLanguage sourceLang;
int sourceVersion;
spv::Id sourceFileStringId;
spv::Id nonSemanticShaderCompilationUnitId {0};
spv::Id nonSemanticShaderDebugInfo {0};
spv::Id debugInfoNone {0};
spv::Id debugExpression {0}; // Debug expression with zero operations.
std::string sourceText;
int currentLine;
const char* currentFile;
spv::Id currentFileId;
std::stack<spv::Id> currentDebugScopeId;
spv::Id lastDebugScopeId;
bool emitOpLines;
bool emitNonSemanticShaderDebugInfo;
bool restoreNonSemanticShaderDebugInfo;
bool emitNonSemanticShaderDebugSource;
std::set<std::string> extensions;
std::vector<const char*> sourceExtensions;
std::vector<const char*> moduleProcesses;
@ -845,6 +927,8 @@ public:
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedStructConstants;
// map type opcodes to type instructions
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedTypes;
// map type opcodes to debug type instructions
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedDebugTypes;
// list of OpConstantNull instructions
std::vector<Instruction*> nullConstants;
@ -860,6 +944,12 @@ public:
// map from include file name ids to their contents
std::map<spv::Id, const std::string*> includeFiles;
// map from core id to debug id
std::map <spv::Id, spv::Id> debugId;
// map from file name string id to DebugSource id
std::unordered_map<spv::Id, spv::Id> debugSourceId;
// The stream for outputting warnings and errors.
SpvBuildLogger* logger;
}; // end Builder class

View File

@ -52,11 +52,12 @@ namespace spv {
#include "GLSL.ext.EXT.h"
#include "GLSL.ext.AMD.h"
#include "GLSL.ext.NV.h"
#include "GLSL.ext.ARM.h"
#include "GLSL.ext.QCOM.h"
}
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.
@ -333,7 +334,6 @@ void Builder::postProcess(Instruction& inst)
}
}
}
#endif
// comment in header
void Builder::postProcessCFG()
@ -394,7 +394,6 @@ void Builder::postProcessCFG()
decorations.end());
}
#ifndef GLSLANG_WEB
// comment in header
void Builder::postProcessFeatures() {
// Add per-instruction capabilities, extensions, etc.,
@ -482,14 +481,15 @@ void Builder::postProcessFeatures() {
}
}
}
#endif
// comment in header
void Builder::postProcess() {
postProcessCFG();
#ifndef GLSLANG_WEB
postProcessFeatures();
#endif
void Builder::postProcess(bool compileOnly)
{
// postProcessCFG needs an entrypoint to determine what is reachable, but if we are not creating an "executable" shader, we don't have an entrypoint
if (!compileOnly)
postProcessCFG();
postProcessFeatures();
}
}; // end spv namespace

View File

@ -212,7 +212,7 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
optimizer.RegisterPass(spvtools::CreateInterpolateFixupPass());
if (options->optimizeSize) {
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass());
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsSafePass());
}
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
@ -223,6 +223,56 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
}
bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
std::unordered_set<uint32_t>* live_locs,
std::unordered_set<uint32_t>* live_builtins,
spv::SpvBuildLogger*)
{
spvtools::Optimizer optimizer(target_env);
optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
optimizer.RegisterPass(spvtools::CreateAnalyzeLiveInputPass(live_locs, live_builtins));
spvtools::OptimizerOptions spvOptOptions;
optimizer.SetTargetEnv(target_env);
spvOptOptions.set_run_validator(false);
return optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
}
void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
std::unordered_set<uint32_t>* live_locs,
std::unordered_set<uint32_t>* live_builtins,
spv::SpvBuildLogger*)
{
spvtools::Optimizer optimizer(target_env);
optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
optimizer.RegisterPass(spvtools::CreateEliminateDeadOutputStoresPass(live_locs, live_builtins));
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass(false, true));
optimizer.RegisterPass(spvtools::CreateEliminateDeadOutputComponentsPass());
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass(false, true));
spvtools::OptimizerOptions spvOptOptions;
optimizer.SetTargetEnv(target_env);
spvOptOptions.set_run_validator(false);
optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
}
void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger*)
{
spvtools::Optimizer optimizer(target_env);
optimizer.SetMessageConsumer(OptimizerMesssageConsumer);
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass());
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
spvtools::OptimizerOptions spvOptOptions;
optimizer.SetTargetEnv(target_env);
spvOptOptions.set_run_validator(false);
optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions);
}
// Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by
// SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if
// optimization is disabled.

View File

@ -53,18 +53,22 @@
namespace glslang {
struct SpvOptions {
SpvOptions() : generateDebugInfo(false), stripDebugInfo(false), disableOptimizer(true),
optimizeSize(false), disassemble(false), validate(false) { }
bool generateDebugInfo;
bool stripDebugInfo;
bool disableOptimizer;
bool optimizeSize;
bool disassemble;
bool validate;
bool generateDebugInfo {false};
bool stripDebugInfo {false};
bool disableOptimizer {true};
bool optimizeSize {false};
bool disassemble {false};
bool validate {false};
bool emitNonSemanticShaderDebugInfo {false};
bool emitNonSemanticShaderDebugSource{ false };
bool compileOnly{false};
};
#if ENABLE_OPT
// Translate glslang's view of target versioning to what SPIRV-Tools uses.
spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLogger* logger);
// Use the SPIRV-Tools disassembler to print SPIR-V using a SPV_ENV_UNIVERSAL_1_3 environment.
void SpirvToolsDisassemble(std::ostream& out, const std::vector<unsigned int>& spirv);
@ -80,6 +84,22 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector<
void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger*, const SpvOptions*);
// Apply the SPIRV-Tools EliminateDeadInputComponents pass to generated SPIR-V. Put result in |spirv|.
void SpirvToolsEliminateDeadInputComponents(spv_target_env target_env, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger*);
// Apply the SPIRV-Tools AnalyzeDeadOutputStores pass to generated SPIR-V. Put result in |live_locs|.
// Return true if the result is valid.
bool SpirvToolsAnalyzeDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
std::unordered_set<uint32_t>* live_locs,
std::unordered_set<uint32_t>* live_builtins, spv::SpvBuildLogger*);
// Apply the SPIRV-Tools EliminateDeadOutputStores and AggressiveDeadCodeElimination passes to generated SPIR-V using
// |live_locs|. Put result in |spirv|.
void SpirvToolsEliminateDeadOutputStores(spv_target_env target_env, std::vector<unsigned int>& spirv,
std::unordered_set<uint32_t>* live_locs,
std::unordered_set<uint32_t>* live_builtins, spv::SpvBuildLogger*);
// Apply the SPIRV-Tools optimizer to strip debug info from SPIR-V. This is implicitly done by
// SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if
// optimization is disabled.

View File

@ -54,6 +54,9 @@ namespace spv {
#include "GLSL.std.450.h"
#include "GLSL.ext.AMD.h"
#include "GLSL.ext.NV.h"
#include "GLSL.ext.ARM.h"
#include "NonSemanticShaderDebugInfo100.h"
#include "GLSL.ext.QCOM.h"
}
}
const char* GlslStd450DebugNames[spv::GLSLstd450Count];
@ -62,6 +65,7 @@ namespace spv {
static const char* GLSLextAMDGetDebugNames(const char*, unsigned);
static const char* GLSLextNVGetDebugNames(const char*, unsigned);
static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned);
static void Kill(std::ostream& out, const char* message)
{
@ -76,6 +80,7 @@ enum ExtInstSet {
GLSLextNVInst,
OpenCLExtInst,
NonSemanticDebugPrintfExtInst,
NonSemanticShaderDebugInfo100
};
// Container class for a single instance of a SPIR-V stream, with methods for disassembly.
@ -501,6 +506,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
extInstSet = OpenCLExtInst;
} else if (strcmp("NonSemantic.DebugPrintf", name) == 0) {
extInstSet = NonSemanticDebugPrintfExtInst;
} else if (strcmp("NonSemantic.Shader.DebugInfo.100", name) == 0) {
extInstSet = NonSemanticShaderDebugInfo100;
} else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 ||
strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 ||
strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, name) == 0 ||
@ -509,7 +516,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
} else if (strcmp(spv::E_SPV_NV_sample_mask_override_coverage, name) == 0 ||
strcmp(spv::E_SPV_NV_geometry_shader_passthrough, name) == 0 ||
strcmp(spv::E_SPV_NV_viewport_array2, name) == 0 ||
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 ||
strcmp(spv::E_SPV_NVX_multiview_per_view_attributes, name) == 0 ||
strcmp(spv::E_SPV_NV_fragment_shader_barycentric, name) == 0 ||
strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) {
extInstSet = GLSLextNVInst;
@ -526,6 +533,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")";
} else if (extInstSet == NonSemanticDebugPrintfExtInst) {
out << "(DebugPrintf)";
} else if (extInstSet == NonSemanticShaderDebugInfo100) {
out << "(" << NonSemanticShaderDebugInfo100GetDebugNames(entrypoint) << ")";
}
}
break;
@ -749,6 +758,59 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
return "Bad";
}
static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned entrypoint)
{
switch (entrypoint) {
case NonSemanticShaderDebugInfo100DebugInfoNone: return "DebugInfoNone";
case NonSemanticShaderDebugInfo100DebugCompilationUnit: return "DebugCompilationUnit";
case NonSemanticShaderDebugInfo100DebugTypeBasic: return "DebugTypeBasic";
case NonSemanticShaderDebugInfo100DebugTypePointer: return "DebugTypePointer";
case NonSemanticShaderDebugInfo100DebugTypeQualifier: return "DebugTypeQualifier";
case NonSemanticShaderDebugInfo100DebugTypeArray: return "DebugTypeArray";
case NonSemanticShaderDebugInfo100DebugTypeVector: return "DebugTypeVector";
case NonSemanticShaderDebugInfo100DebugTypedef: return "DebugTypedef";
case NonSemanticShaderDebugInfo100DebugTypeFunction: return "DebugTypeFunction";
case NonSemanticShaderDebugInfo100DebugTypeEnum: return "DebugTypeEnum";
case NonSemanticShaderDebugInfo100DebugTypeComposite: return "DebugTypeComposite";
case NonSemanticShaderDebugInfo100DebugTypeMember: return "DebugTypeMember";
case NonSemanticShaderDebugInfo100DebugTypeInheritance: return "DebugTypeInheritance";
case NonSemanticShaderDebugInfo100DebugTypePtrToMember: return "DebugTypePtrToMember";
case NonSemanticShaderDebugInfo100DebugTypeTemplate: return "DebugTypeTemplate";
case NonSemanticShaderDebugInfo100DebugTypeTemplateParameter: return "DebugTypeTemplateParameter";
case NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter: return "DebugTypeTemplateTemplateParameter";
case NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack: return "DebugTypeTemplateParameterPack";
case NonSemanticShaderDebugInfo100DebugGlobalVariable: return "DebugGlobalVariable";
case NonSemanticShaderDebugInfo100DebugFunctionDeclaration: return "DebugFunctionDeclaration";
case NonSemanticShaderDebugInfo100DebugFunction: return "DebugFunction";
case NonSemanticShaderDebugInfo100DebugLexicalBlock: return "DebugLexicalBlock";
case NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator: return "DebugLexicalBlockDiscriminator";
case NonSemanticShaderDebugInfo100DebugScope: return "DebugScope";
case NonSemanticShaderDebugInfo100DebugNoScope: return "DebugNoScope";
case NonSemanticShaderDebugInfo100DebugInlinedAt: return "DebugInlinedAt";
case NonSemanticShaderDebugInfo100DebugLocalVariable: return "DebugLocalVariable";
case NonSemanticShaderDebugInfo100DebugInlinedVariable: return "DebugInlinedVariable";
case NonSemanticShaderDebugInfo100DebugDeclare: return "DebugDeclare";
case NonSemanticShaderDebugInfo100DebugValue: return "DebugValue";
case NonSemanticShaderDebugInfo100DebugOperation: return "DebugOperation";
case NonSemanticShaderDebugInfo100DebugExpression: return "DebugExpression";
case NonSemanticShaderDebugInfo100DebugMacroDef: return "DebugMacroDef";
case NonSemanticShaderDebugInfo100DebugMacroUndef: return "DebugMacroUndef";
case NonSemanticShaderDebugInfo100DebugImportedEntity: return "DebugImportedEntity";
case NonSemanticShaderDebugInfo100DebugSource: return "DebugSource";
case NonSemanticShaderDebugInfo100DebugFunctionDefinition: return "DebugFunctionDefinition";
case NonSemanticShaderDebugInfo100DebugSourceContinued: return "DebugSourceContinued";
case NonSemanticShaderDebugInfo100DebugLine: return "DebugLine";
case NonSemanticShaderDebugInfo100DebugNoLine: return "DebugNoLine";
case NonSemanticShaderDebugInfo100DebugBuildIdentifier: return "DebugBuildIdentifier";
case NonSemanticShaderDebugInfo100DebugStoragePath: return "DebugStoragePath";
case NonSemanticShaderDebugInfo100DebugEntryPoint: return "DebugEntryPoint";
case NonSemanticShaderDebugInfo100DebugTypeMatrix: return "DebugTypeMatrix";
default: return "Bad";
}
return "Bad";
}
void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream)
{
SpirvStream SpirvStream(out, stream);

3092
SPIRV/doc.cpp Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -156,6 +156,7 @@ enum OperandClass {
OperandKernelEnqueueFlags,
OperandKernelProfilingInfo,
OperandCapability,
OperandCooperativeMatrixOperands,
OperandOpcode,
@ -190,15 +191,15 @@ protected:
// Parameterize an enumerant
class EnumParameters {
public:
EnumParameters() : desc(0) { }
EnumParameters() : desc(nullptr) { }
const char* desc;
};
// Parameterize a set of enumerants that form an enum
class EnumDefinition : public EnumParameters {
public:
EnumDefinition() :
ceiling(0), bitmask(false), getName(0), enumParams(0), operandParams(0) { }
EnumDefinition() :
ceiling(0), bitmask(false), getName(nullptr), enumParams(nullptr), operandParams(nullptr) { }
void set(int ceil, const char* (*name)(int), EnumParameters* ep, bool mask = false)
{
ceiling = ceil;

View File

@ -23,19 +23,6 @@
#include <limits>
#include <sstream>
#if defined(_MSC_VER) && _MSC_VER < 1800
namespace std {
bool isnan(double f)
{
return ::_isnan(f) != 0;
}
bool isinf(double f)
{
return ::_finite(f) == 0;
}
}
#endif
#include "bitutils.h"
namespace spvutils {

File diff suppressed because it is too large Load Diff

View File

@ -97,6 +97,8 @@ public:
explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { }
virtual ~Instruction() {}
void addIdOperand(Id id) {
// ids can't be 0
assert(id);
operands.push_back(id);
idOperand.push_back(true);
}
@ -321,7 +323,7 @@ void inReadableOrder(Block* root, std::function<void(Block*, ReachReason, Block*
class Function {
public:
Function(Id id, Id resultType, Id functionType, Id firstParam, Module& parent);
Function(Id id, Id resultType, Id functionType, Id firstParam, LinkageType linkage, const std::string& name, Module& parent);
virtual ~Function()
{
for (int i = 0; i < (int)parameterInstructions.size(); ++i)
@ -349,6 +351,7 @@ public:
const std::vector<Block*>& getBlocks() const { return blocks; }
void addLocalVariable(std::unique_ptr<Instruction> inst);
Id getReturnType() const { return functionInstruction.getTypeId(); }
Id getFuncId() const { return functionInstruction.getResultId(); }
void setReturnPrecision(Decoration precision)
{
if (precision == DecorationRelaxedPrecision)
@ -385,7 +388,7 @@ public:
if (lineInstruction != nullptr) {
lineInstruction->dump(out);
}
// OpFunction
functionInstruction.dump(out);
@ -399,6 +402,9 @@ public:
end.dump(out);
}
LinkageType getLinkType() const { return linkType; }
const char* getExportName() const { return exportName.c_str(); }
protected:
Function(const Function&);
Function& operator=(Function&);
@ -411,6 +417,8 @@ protected:
bool implicitThis; // true if this is a member function expecting to be passed a 'this' as the first argument
bool reducedPrecisionReturn;
std::set<int> reducedPrecisionParams; // list of parameter indexes that need a relaxed precision arg
LinkageType linkType;
std::string exportName;
};
//
@ -470,10 +478,11 @@ protected:
// Add both
// - the OpFunction instruction
// - all the OpFunctionParameter instructions
__inline Function::Function(Id id, Id resultType, Id functionType, Id firstParamId, Module& parent)
__inline Function::Function(Id id, Id resultType, Id functionType, Id firstParamId, LinkageType linkage, const std::string& name, Module& parent)
: parent(parent), lineInstruction(nullptr),
functionInstruction(id, resultType, OpFunction), implicitThis(false),
reducedPrecisionReturn(false)
reducedPrecisionReturn(false),
linkType(linkage)
{
// OpFunction
functionInstruction.addImmediateOperand(FunctionControlMaskNone);
@ -489,6 +498,11 @@ __inline Function::Function(Id id, Id resultType, Id functionType, Id firstParam
parent.mapInstruction(param);
parameterInstructions.push_back(param);
}
// If importing/exporting, save the function name (without the mangled parameters) for the linkage decoration
if (linkType != LinkageTypeMax) {
exportName = name.substr(0, name.find_first_of('('));
}
}
__inline void Function::addLocalVariable(std::unique_ptr<Instruction> inst)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2020 The Khronos Group Inc.
# Copyright (C) 2020-2023 The Khronos Group Inc.
#
# All rights reserved.
#
@ -31,7 +31,7 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
find_host_package(PythonInterp 3 REQUIRED)
find_host_package(Python3 REQUIRED)
set(GLSLANG_INTRINSIC_H "${GLSLANG_GENERATED_INCLUDEDIR}/glslang/glsl_intrinsic_header.h")
set(GLSLANG_INTRINSIC_PY "${CMAKE_CURRENT_SOURCE_DIR}/../gen_extension_headers.py")
@ -39,54 +39,40 @@ set(GLSLANG_INTRINSIC_HEADER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../glslang/Extensi
add_custom_command(
OUTPUT ${GLSLANG_INTRINSIC_H}
COMMAND ${PYTHON_EXECUTABLE} "${GLSLANG_INTRINSIC_PY}"
COMMAND Python3::Interpreter "${GLSLANG_INTRINSIC_PY}"
"-i" ${GLSLANG_INTRINSIC_HEADER_DIR}
"-o" ${GLSLANG_INTRINSIC_H}
DEPENDS ${GLSLANG_INTRINSIC_PY}
COMMENT "Generating ${GLSLANG_INTRINSIC_H}")
#add_custom_target(glslangValidator DEPENDS ${GLSLANG_INTRINSIC_H})
add_library(glslang-default-resource-limits
${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp
${CMAKE_CURRENT_SOURCE_DIR}/resource_limits_c.cpp)
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 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
set(SOURCES StandAlone.cpp DirStackFileIncluder.h ${GLSLANG_INTRINSIC_H})
add_executable(glslangValidator ${SOURCES})
set_property(TARGET glslangValidator PROPERTY FOLDER tools)
glslang_set_link_args(glslangValidator)
add_executable(glslang-standalone ${SOURCES})
set_property(TARGET glslang-standalone PROPERTY FOLDER tools)
set_property(TARGET glslang-standalone PROPERTY OUTPUT_NAME glslang)
glslang_set_link_args(glslang-standalone)
set(LIBRARIES
glslang
OSDependent
SPIRV
glslang-default-resource-limits)
if(ENABLE_SPVREMAPPER)
set(LIBRARIES ${LIBRARIES} SPVRemapper)
endif()
if(WIN32)
set(LIBRARIES ${LIBRARIES} psapi)
elseif(UNIX)
if(NOT ANDROID)
if(NOT ANDROID AND NOT QNX)
set(LIBRARIES ${LIBRARIES} pthread)
endif()
endif()
target_link_libraries(glslangValidator ${LIBRARIES})
target_include_directories(glslangValidator PUBLIC
target_link_libraries(glslang-standalone ${LIBRARIES})
target_include_directories(glslang-standalone PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
if(ENABLE_OPT)
target_include_directories(glslangValidator
target_include_directories(glslang-standalone
PRIVATE ${spirv-tools_SOURCE_DIR}/include
)
endif()
@ -96,7 +82,7 @@ if(ENABLE_SPVREMAPPER)
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})
target_link_libraries(spirv-remap SPVRemapper ${LIBRARIES})
endif()
if(WIN32)
@ -104,19 +90,35 @@ if(WIN32)
endif()
if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslangValidator EXPORT glslang-targets)
install(TARGETS glslang-standalone EXPORT glslang-targets)
# Backward compatibility
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslangValidatorTargets.cmake" "
message(WARNING \"Using `glslangValidatorTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-standaloneTargets.cmake" "
message(WARNING \"Using `glslang-standaloneTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::glslangValidator)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/glslang-targets.cmake\")
if (NOT TARGET glslang::glslang-standalone)
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(glslangValidator ALIAS glslang::glslangValidator)
add_library(glslang-standalone ALIAS glslang::glslang-standalone)
")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslangValidatorTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslang-standaloneTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
# Create a symbolic link to glslang named glslangValidator for backwards compatibility
set(legacy_glslang_name "glslangValidator${CMAKE_EXECUTABLE_SUFFIX}")
set(link_method create_symlink)
if (WIN32 OR MINGW)
set(link_method copy_if_different)
endif()
add_custom_command(TARGET glslang-standalone
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E ${link_method} $<TARGET_FILE_NAME:glslang-standalone> ${legacy_glslang_name}
WORKING_DIRECTORY $<TARGET_FILE_DIR:glslang-standalone>)
# Create the same symlink at install time
install(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E ${link_method} $<TARGET_FILE_NAME:glslang-standalone> ${legacy_glslang_name} \
WORKING_DIRECTORY \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})")
if(ENABLE_SPVREMAPPER)
install(TARGETS spirv-remap EXPORT glslang-targets)
@ -126,7 +128,7 @@ if(ENABLE_GLSLANG_INSTALL)
message(WARNING \"Using `spirv-remapTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::spirv-remap)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/glslang-targets.cmake\")
include(\"${CMAKE_INSTALL_FULL_LIBDIR}/cmake/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(spirv-remap ALIAS glslang::spirv-remap)
@ -134,18 +136,4 @@ if(ENABLE_GLSLANG_INSTALL)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/spirv-remapTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif()
install(TARGETS glslang-default-resource-limits EXPORT glslang-targets)
# Backward compatibility
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-default-resource-limitsTargets.cmake" "
message(WARNING \"Using `glslang-default-resource-limitsTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::glslang-default-resource-limits)
include(\"\${CMAKE_CURRENT_LIST_DIR}/../../${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/glslang-targets.cmake\")
endif()
add_library(glslang-default-resource-limits ALIAS glslang::glslang-default-resource-limits)
")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslang-default-resource-limitsTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif()

View File

@ -41,7 +41,7 @@
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "ResourceLimits.h"
#include "glslang/Public/ResourceLimits.h"
#include "Worklist.h"
#include "DirStackFileIncluder.h"
#include "./../glslang/Include/ShHandle.h"
@ -51,15 +51,16 @@
#include "../SPIRV/doc.h"
#include "../SPIRV/disassemble.h"
#include <cstring>
#include <cstdlib>
#include <array>
#include <atomic>
#include <cctype>
#include <cmath>
#include <array>
#include <cstdlib>
#include <cstring>
#include <map>
#include <memory>
#include <thread>
#include <set>
#include <thread>
#include "../glslang/OSDependent/osinclude.h"
@ -73,46 +74,49 @@ extern "C" {
}
// Command-line options
enum TOptions {
EOptionNone = 0,
EOptionIntermediate = (1 << 0),
EOptionSuppressInfolog = (1 << 1),
EOptionMemoryLeakMode = (1 << 2),
EOptionRelaxedErrors = (1 << 3),
EOptionGiveWarnings = (1 << 4),
EOptionLinkProgram = (1 << 5),
EOptionMultiThreaded = (1 << 6),
EOptionDumpConfig = (1 << 7),
EOptionDumpReflection = (1 << 8),
EOptionSuppressWarnings = (1 << 9),
EOptionDumpVersions = (1 << 10),
EOptionSpv = (1 << 11),
EOptionHumanReadableSpv = (1 << 12),
EOptionVulkanRules = (1 << 13),
EOptionDefaultDesktop = (1 << 14),
EOptionOutputPreprocessed = (1 << 15),
EOptionOutputHexadecimal = (1 << 16),
EOptionReadHlsl = (1 << 17),
EOptionCascadingErrors = (1 << 18),
EOptionAutoMapBindings = (1 << 19),
EOptionFlattenUniformArrays = (1 << 20),
EOptionNoStorageFormat = (1 << 21),
EOptionKeepUncalled = (1 << 22),
EOptionHlslOffsets = (1 << 23),
EOptionHlslIoMapping = (1 << 24),
EOptionAutoMapLocations = (1 << 25),
EOptionDebug = (1 << 26),
EOptionStdin = (1 << 27),
EOptionOptimizeDisable = (1 << 28),
EOptionOptimizeSize = (1 << 29),
EOptionInvertY = (1 << 30),
EOptionDumpBareVersion = (1 << 31),
enum TOptions : uint64_t {
EOptionNone = 0,
EOptionIntermediate = (1ull << 0),
EOptionSuppressInfolog = (1ull << 1),
EOptionMemoryLeakMode = (1ull << 2),
EOptionRelaxedErrors = (1ull << 3),
EOptionGiveWarnings = (1ull << 4),
EOptionLinkProgram = (1ull << 5),
EOptionMultiThreaded = (1ull << 6),
EOptionDumpConfig = (1ull << 7),
EOptionDumpReflection = (1ull << 8),
EOptionSuppressWarnings = (1ull << 9),
EOptionDumpVersions = (1ull << 10),
EOptionSpv = (1ull << 11),
EOptionHumanReadableSpv = (1ull << 12),
EOptionVulkanRules = (1ull << 13),
EOptionDefaultDesktop = (1ull << 14),
EOptionOutputPreprocessed = (1ull << 15),
EOptionOutputHexadecimal = (1ull << 16),
EOptionReadHlsl = (1ull << 17),
EOptionCascadingErrors = (1ull << 18),
EOptionAutoMapBindings = (1ull << 19),
EOptionFlattenUniformArrays = (1ull << 20),
EOptionNoStorageFormat = (1ull << 21),
EOptionKeepUncalled = (1ull << 22),
EOptionHlslOffsets = (1ull << 23),
EOptionHlslIoMapping = (1ull << 24),
EOptionAutoMapLocations = (1ull << 25),
EOptionDebug = (1ull << 26),
EOptionStdin = (1ull << 27),
EOptionOptimizeDisable = (1ull << 28),
EOptionOptimizeSize = (1ull << 29),
EOptionInvertY = (1ull << 30),
EOptionDumpBareVersion = (1ull << 31),
EOptionCompileOnly = (1ull << 32),
};
bool targetHlslFunctionality1 = false;
bool SpvToolsDisassembler = false;
bool SpvToolsValidate = false;
bool NaNClamp = false;
bool stripDebugInfo = false;
bool emitNonSemanticShaderDebugInfo = false;
bool emitNonSemanticShaderDebugSource = false;
bool beQuiet = false;
bool VulkanRulesRelaxed = false;
bool autoSampledTextures = false;
@ -141,13 +145,13 @@ void FreeFileData(char* data);
void InfoLogMsg(const char* msg, const char* name, const int num);
// Globally track if any compile or link failure.
bool CompileFailed = false;
bool LinkFailed = false;
std::atomic<int8_t> CompileFailed{0};
std::atomic<int8_t> LinkFailed{0};
std::atomic<int8_t> CompileOrLinkFailed{0};
// array of unique places to leave the shader names and infologs for the asynchronous compiles
std::vector<std::unique_ptr<glslang::TWorkItem>> WorkItems;
TBuiltInResource Resources;
std::string ConfigFile;
//
@ -156,18 +160,16 @@ std::string ConfigFile;
void ProcessConfigFile()
{
if (ConfigFile.size() == 0)
Resources = glslang::DefaultTBuiltInResource;
#ifndef GLSLANG_WEB
*GetResources() = *GetDefaultResources();
else {
char* configString = ReadFileData(ConfigFile.c_str());
glslang::DecodeResourceLimits(&Resources, configString);
DecodeResourceLimits(GetResources(), configString);
FreeFileData(configString);
}
#endif
}
int ReflectOptions = EShReflectionDefault;
int Options = 0;
std::underlying_type_t<TOptions> Options = EOptionNone;
const char* ExecutableName = nullptr;
const char* binaryFileName = nullptr;
const char* depencyFileName = nullptr;
@ -257,6 +259,17 @@ public:
text.append("\n");
}
void addText(std::string preambleText)
{
fixLine(preambleText);
Processes.push_back("preamble-text");
Processes.back().append(preambleText);
text.append(preambleText);
text.append("\n");
}
protected:
void fixLine(std::string& line)
{
@ -293,8 +306,8 @@ const char* GetBinaryName(EShLanguage stage)
case EShLangClosestHit: name = "rchit.spv"; break;
case EShLangMiss: name = "rmiss.spv"; break;
case EShLangCallable: name = "rcall.spv"; break;
case EShLangMeshNV: name = "mesh.spv"; break;
case EShLangTaskNV: name = "task.spv"; break;
case EShLangMesh : name = "mesh.spv"; break;
case EShLangTask : name = "task.spv"; break;
default: name = "unknown"; break;
}
} else
@ -503,7 +516,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi
if (set) {
errno = 0;
int setVal = ::strtol(argv[curArg], NULL, 10);
int setVal = ::strtol(argv[curArg], nullptr, 10);
if (errno || setVal < 0) {
printf("%s: invalid set\n", argv[curArg]);
usage();
@ -515,7 +528,7 @@ void ProcessGlobalBlockSettings(int& argc, char**& argv, std::string* name, unsi
if (binding) {
errno = 0;
int bindingVal = ::strtol(argv[curArg], NULL, 10);
int bindingVal = ::strtol(argv[curArg], nullptr, 10);
if (errno || bindingVal < 0) {
printf("%s: invalid binding\n", argv[curArg]);
usage();
@ -593,12 +606,12 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
const auto getUniformOverride = [getStringOperand]() {
const char *arg = getStringOperand("-u<name>:<location>");
const char *split = strchr(arg, ':');
if (split == NULL) {
if (split == nullptr) {
printf("%s: missing location\n", arg);
exit(EFailUsage);
}
errno = 0;
int location = ::strtol(split + 1, NULL, 10);
int location = ::strtol(split + 1, nullptr, 10);
if (errno) {
printf("%s: invalid location\n", arg);
exit(EFailUsage);
@ -625,7 +638,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
} else if (lowerword == "uniform-base") {
if (argc <= 1)
Error("no <base> provided", lowerword.c_str());
uniformBase = ::strtol(argv[1], NULL, 10);
uniformBase = ::strtol(argv[1], nullptr, 10);
bumpArg();
break;
} else if (lowerword == "client") {
@ -713,7 +726,7 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
HlslDxPositionW = true;
} else if (lowerword == "enhanced-msgs") {
EnhancedMsgs = true;
} else if (lowerword == "auto-sampled-textures") {
} else if (lowerword == "auto-sampled-textures") {
autoSampledTextures = true;
} else if (lowerword == "invert-y" || // synonyms
lowerword == "iy") {
@ -726,6 +739,13 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
} else if (lowerword == "no-storage-format" || // synonyms
lowerword == "nsf") {
Options |= EOptionNoStorageFormat;
} else if (lowerword == "preamble-text" ||
lowerword == "p") {
if (argc > 1)
UserPreamble.addText(argv[1]);
else
Error("expects <text>", argv[0]);
bumpArg();
} else if (lowerword == "relaxed-errors") {
Options |= EOptionRelaxedErrors;
} else if (lowerword == "reflect-strict-array-suffix") {
@ -872,6 +892,8 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
bumpArg();
} else if (lowerword == "version") {
Options |= EOptionDumpVersions;
} else if (lowerword == "no-link") {
Options |= EOptionCompileOnly;
} else if (lowerword == "help") {
usage();
break;
@ -925,6 +947,9 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
else
Error("unknown -O option");
break;
case 'P':
UserPreamble.addText(getStringOperand("-P<text>"));
break;
case 'R':
VulkanRulesRelaxed = true;
break;
@ -969,11 +994,21 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
case 'g':
// Override previous -g or -g0 argument
stripDebugInfo = false;
emitNonSemanticShaderDebugInfo = false;
Options &= ~EOptionDebug;
if (argv[0][2] == '0')
stripDebugInfo = true;
else
else {
Options |= EOptionDebug;
if (argv[0][2] == 'V') {
emitNonSemanticShaderDebugInfo = true;
if (argv[0][3] == 'S') {
emitNonSemanticShaderDebugSource = true;
} else {
emitNonSemanticShaderDebugSource = false;
}
}
}
break;
case 'h':
usage();
@ -1133,6 +1168,7 @@ void CompileShaders(glslang::TWorklist& worklist)
if (Options & EOptionDebug)
Error("cannot generate debug information unless linking to generate code");
// NOTE: TWorkList::remove is thread-safe
glslang::TWorkItem* workItem;
if (Options & EOptionStdin) {
if (worklist.remove(workItem)) {
@ -1150,7 +1186,7 @@ void CompileShaders(glslang::TWorklist& worklist)
} else {
while (worklist.remove(workItem)) {
ShHandle compiler = ShConstructCompiler(FindLanguage(workItem->name), Options);
if (compiler == 0)
if (compiler == nullptr)
return;
CompileFile(workItem->name.c_str(), compiler);
@ -1280,13 +1316,14 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
//
glslang::TProgram& program = *new glslang::TProgram;
const bool compileOnly = (Options & EOptionCompileOnly) != 0;
for (auto it = compUnits.cbegin(); it != compUnits.cend(); ++it) {
const auto &compUnit = *it;
for (int i = 0; i < compUnit.count; i++) {
sources.push_back(compUnit.fileNameList[i]);
}
glslang::TShader* shader = new glslang::TShader(compUnit.stage);
shader->setStringsWithLengthsAndNames(compUnit.text, NULL, compUnit.fileNameList, compUnit.count);
shader->setStringsWithLengthsAndNames(compUnit.text, nullptr, compUnit.fileNameList, compUnit.count);
if (entryPointName)
shader->setEntryPoint(entryPointName);
if (sourceEntryPointName) {
@ -1296,6 +1333,9 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
shader->setSourceEntryPoint(sourceEntryPointName);
}
if (compileOnly)
shader->setCompileOnly();
shader->setOverrideVersion(GlslVersion);
std::string intrinsicString = getIntrinsic(compUnit.text, compUnit.count);
@ -1310,7 +1350,6 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
shader->setPreamble(PreambleString.c_str());
shader->addProcesses(Processes);
#ifndef GLSLANG_WEB
// Set IO mapper binding shift values
for (int r = 0; r < glslang::EResCount; ++r) {
const glslang::TResourceType res = glslang::TResourceType(r);
@ -1342,7 +1381,6 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
}
shader->setUniformLocationBase(uniformBase);
#endif
if (VulkanRulesRelaxed) {
for (auto& storageOverride : blockStorageOverrides) {
@ -1379,6 +1417,9 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
if (EnhancedMsgs)
shader->setEnhancedMsgs();
if (emitNonSemanticShaderDebugInfo)
shader->setDebugInfo(true);
// Set up the environment, some subsettings take precedence over earlier
// ways of setting things.
if (Options & EOptionSpv) {
@ -1399,24 +1440,23 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
const int defaultVersion = Options & EOptionDefaultDesktop ? 110 : 100;
#ifndef GLSLANG_WEB
if (Options & EOptionOutputPreprocessed) {
std::string str;
if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false, messages, &str, includer)) {
if (shader->preprocess(GetResources(), defaultVersion, ENoProfile, false, false, messages, &str, includer)) {
PutsIfNonEmpty(str.c_str());
} else {
CompileFailed = true;
CompileFailed = 1;
}
StderrIfNonEmpty(shader->getInfoLog());
StderrIfNonEmpty(shader->getInfoDebugLog());
continue;
}
#endif
if (! shader->parse(&Resources, defaultVersion, false, messages, includer))
CompileFailed = true;
if (! shader->parse(GetResources(), defaultVersion, false, messages, includer))
CompileFailed = 1;
program.addShader(shader);
if (!compileOnly)
program.addShader(shader);
if (! (Options & EOptionSuppressInfolog) &&
! (Options & EOptionMemoryLeakMode)) {
@ -1431,77 +1471,98 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
// Program-level processing...
//
// Link
if (! (Options & EOptionOutputPreprocessed) && ! program.link(messages))
LinkFailed = true;
#ifndef GLSLANG_WEB
// Map IO
if (Options & EOptionSpv) {
if (!program.mapIO())
if (!compileOnly) {
// Link
if (!(Options & EOptionOutputPreprocessed) && !program.link(messages))
LinkFailed = true;
}
#endif
// Report
if (! (Options & EOptionSuppressInfolog) &&
! (Options & EOptionMemoryLeakMode)) {
PutsIfNonEmpty(program.getInfoLog());
PutsIfNonEmpty(program.getInfoDebugLog());
}
// Map IO
if (Options & EOptionSpv) {
if (!program.mapIO())
LinkFailed = true;
}
#ifndef GLSLANG_WEB
// Reflect
if (Options & EOptionDumpReflection) {
program.buildReflection(ReflectOptions);
program.dumpReflection();
// Report
if (!(Options & EOptionSuppressInfolog) && !(Options & EOptionMemoryLeakMode)) {
PutsIfNonEmpty(program.getInfoLog());
PutsIfNonEmpty(program.getInfoDebugLog());
}
// Reflect
if (Options & EOptionDumpReflection) {
program.buildReflection(ReflectOptions);
program.dumpReflection();
}
}
#endif
std::vector<std::string> outputFiles;
// Dump SPIR-V
if (Options & EOptionSpv) {
if (CompileFailed || LinkFailed)
CompileOrLinkFailed.fetch_or(CompileFailed);
CompileOrLinkFailed.fetch_or(LinkFailed);
if (static_cast<bool>(CompileOrLinkFailed.load()))
printf("SPIR-V is not generated for failed compile or link\n");
else {
for (int stage = 0; stage < EShLangCount; ++stage) {
if (program.getIntermediate((EShLanguage)stage)) {
std::vector<unsigned int> spirv;
spv::SpvBuildLogger logger;
glslang::SpvOptions spvOptions;
if (Options & EOptionDebug)
spvOptions.generateDebugInfo = true;
else if (stripDebugInfo)
spvOptions.stripDebugInfo = true;
spvOptions.disableOptimizer = (Options & EOptionOptimizeDisable) != 0;
spvOptions.optimizeSize = (Options & EOptionOptimizeSize) != 0;
spvOptions.disassemble = SpvToolsDisassembler;
spvOptions.validate = SpvToolsValidate;
glslang::GlslangToSpv(*program.getIntermediate((EShLanguage)stage), spirv, &logger, &spvOptions);
// Dump the spv to a file or stdout, etc., but only if not doing
// memory/perf testing, as it's not internal to programmatic use.
if (! (Options & EOptionMemoryLeakMode)) {
printf("%s", logger.getAllMessages().c_str());
if (Options & EOptionOutputHexadecimal) {
glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName);
} else {
glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage));
}
outputFiles.push_back(GetBinaryName((EShLanguage)stage));
#ifndef GLSLANG_WEB
if (!SpvToolsDisassembler && (Options & EOptionHumanReadableSpv))
spv::Disassemble(std::cout, spirv);
#endif
std::vector<glslang::TIntermediate*> intermediates;
if (!compileOnly) {
for (int stage = 0; stage < EShLangCount; ++stage) {
if (auto* i = program.getIntermediate((EShLanguage)stage)) {
intermediates.emplace_back(i);
}
}
} else {
for (const auto* shader : shaders) {
if (auto* i = shader->getIntermediate()) {
intermediates.emplace_back(i);
}
}
}
for (auto* intermediate : intermediates) {
std::vector<unsigned int> spirv;
spv::SpvBuildLogger logger;
glslang::SpvOptions spvOptions;
if (Options & EOptionDebug) {
spvOptions.generateDebugInfo = true;
if (emitNonSemanticShaderDebugInfo) {
spvOptions.emitNonSemanticShaderDebugInfo = true;
if (emitNonSemanticShaderDebugSource) {
spvOptions.emitNonSemanticShaderDebugSource = true;
}
}
} else if (stripDebugInfo)
spvOptions.stripDebugInfo = true;
spvOptions.disableOptimizer = (Options & EOptionOptimizeDisable) != 0;
spvOptions.optimizeSize = (Options & EOptionOptimizeSize) != 0;
spvOptions.disassemble = SpvToolsDisassembler;
spvOptions.validate = SpvToolsValidate;
spvOptions.compileOnly = compileOnly;
glslang::GlslangToSpv(*intermediate, spirv, &logger, &spvOptions);
// Dump the spv to a file or stdout, etc., but only if not doing
// memory/perf testing, as it's not internal to programmatic use.
if (!(Options & EOptionMemoryLeakMode)) {
printf("%s", logger.getAllMessages().c_str());
const auto filename = GetBinaryName(intermediate->getStage());
if (Options & EOptionOutputHexadecimal) {
if (!glslang::OutputSpvHex(spirv, filename, variableName))
exit(EFailUsage);
} else {
if (!glslang::OutputSpvBin(spirv, filename))
exit(EFailUsage);
}
outputFiles.push_back(filename);
if (!SpvToolsDisassembler && (Options & EOptionHumanReadableSpv))
spv::Disassemble(std::cout, spirv);
}
}
}
}
if (depencyFileName && !(CompileFailed || LinkFailed)) {
CompileOrLinkFailed.fetch_or(CompileFailed);
CompileOrLinkFailed.fetch_or(LinkFailed);
if (depencyFileName && !static_cast<bool>(CompileOrLinkFailed.load())) {
std::set<std::string> includedFiles = includer.getIncludedFiles();
sources.insert(sources.end(), includedFiles.begin(), includedFiles.end());
@ -1589,13 +1650,11 @@ int singleMain()
workList.add(item.get());
});
#ifndef GLSLANG_WEB
if (Options & EOptionDumpConfig) {
printf("%s", glslang::GetDefaultTBuiltInResourceString().c_str());
printf("%s", GetDefaultTBuiltInResourceString().c_str());
if (workList.empty())
return ESuccess;
}
#endif
if (Options & EOptionDumpBareVersion) {
printf("%d:%d.%d.%d%s\n", glslang::GetSpirvGeneratorVersion(), GLSLANG_VERSION_MAJOR, GLSLANG_VERSION_MINOR,
@ -1679,9 +1738,9 @@ int singleMain()
ShFinalize();
}
if (CompileFailed)
if (CompileFailed.load())
return EFailCompile;
if (LinkFailed)
if (LinkFailed.load())
return EFailLink;
return 0;
@ -1780,9 +1839,9 @@ EShLanguage FindLanguage(const std::string& name, bool parseStageName)
else if (stageName == "rcall")
return EShLangCallable;
else if (stageName == "mesh")
return EShLangMeshNV;
return EShLangMesh;
else if (stageName == "task")
return EShLangTaskNV;
return EShLangTask;
usage();
return EShLangVertex;
@ -1812,12 +1871,12 @@ void CompileFile(const char* fileName, ShHandle compiler)
SetMessageOptions(messages);
if (UserPreamble.isSet())
Error("-D and -U options require -l (linking)\n");
Error("-D, -U and -P options require -l (linking)\n");
for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) {
for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) {
// ret = ShCompile(compiler, shaderStrings, NumShaderStrings, lengths, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, GetResources(), Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
// const char* multi[12] = { "# ve", "rsion", " 300 e", "s", "\n#err",
// "or should be l", "ine 1", "string 5\n", "float glo", "bal",
// ";\n#error should be line 2\n void main() {", "global = 2.3;}" };
@ -1841,7 +1900,7 @@ void CompileFile(const char* fileName, ShHandle compiler)
//
void usage()
{
printf("Usage: glslangValidator [option]... [file]...\n"
printf("Usage: glslang [option]... [file]...\n"
"\n"
"'file' can end in .<stage> for auto-stage classification, where <stage> is:\n"
" .conf to provide a config file that replaces the default configuration\n"
@ -1882,6 +1941,9 @@ void usage()
" is searched first, followed by left-to-right order of -I\n"
" -Od disables optimization; may cause illegal SPIR-V for HLSL\n"
" -Os optimizes SPIR-V to minimize size\n"
" -P<text> | --preamble-text <text> | --P <text>\n"
" inject custom preamble text, which is treated as if it\n"
" appeared immediately after the version declaration (if any).\n"
" -R use relaxed verification rules for generating Vulkan SPIR-V,\n"
" allowing the use of default uniforms, atomic_uints, and\n"
" gl_VertexID and gl_InstanceID keywords.\n"
@ -1906,6 +1968,8 @@ void usage()
" SPV_GOOGLE_hlsl_functionality1 extension\n"
" -g generate debug information\n"
" -g0 strip debug information\n"
" -gV generate nonsemantic shader debug information\n"
" -gVS generate nonsemantic shader debug information with source\n"
" -h print this usage message\n"
" -i intermediate tree (glslang AST) is printed out\n"
" -l link all input files together to form a single module\n"
@ -1927,7 +1991,7 @@ void usage()
" without explicit bindings\n"
" --auto-map-locations | --aml automatically locate input/output lacking\n"
" 'location' (fragile, not cross stage)\n"
" --auto-sampled-textures Removes sampler variables and converts\n"
" --auto-sampled-textures Removes sampler variables and converts\n"
" existing textures to sampled textures\n"
" --client {vulkan<ver>|opengl<ver>} see -V and -G\n"
" --depfile <file> writes depfile for build systems\n"
@ -2042,7 +2106,9 @@ void usage()
" --vn <name> creates a C header file that contains a\n"
" uint32_t array named <name>\n"
" initialized with the shader binary code\n"
);
" --no-link Only compile shader; do not link (GLSL-only)\n"
" NOTE: this option will set the export linkage\n"
" attribute on all functions\n");
exit(EFailUsage);
}

View File

@ -37,7 +37,11 @@
#include <fstream>
#include <cstring>
#include <stdexcept>
#include <filesystem>
//
// Include remapper
//
#include "../SPIRV/SPVRemapper.h"
namespace {
@ -157,7 +161,7 @@ namespace {
}
// Print helpful usage message to stdout, and exit
void usage(const char* const name, const char* const msg = 0)
void usage(const char* const name, const char* const msg = nullptr)
{
if (msg)
std::cout << msg << std::endl << std::endl;
@ -172,7 +176,7 @@ namespace {
<< " [--strip-all | --strip all | -s]"
<< " [--strip-white-list]"
<< " [--do-everything]"
<< " --input | -i file1 [file2...] --output|-o DESTDIR"
<< " --input | -i file1 [file2...] --output|-o DESTDIR | destfile1 [destfile2...]"
<< std::endl;
std::cout << " " << basename(name) << " [--version | -V]" << std::endl;
@ -182,32 +186,45 @@ namespace {
}
// grind through each SPIR in turn
void execute(const std::vector<std::string>& inputFile, const std::string& outputDir,
const std::string& whiteListFile, int opts, int verbosity)
void execute(const std::vector<std::string>& inputFiles,
const std::vector<std::string>& outputDirOrFiles,
const bool isSingleOutputDir,
const std::string& whiteListFile,
int opts,
int verbosity)
{
std::vector<std::string> whiteListStrings;
if(!whiteListFile.empty())
if (!whiteListFile.empty())
read(whiteListStrings, whiteListFile, verbosity);
for (auto it = inputFile.cbegin(); it != inputFile.cend(); ++it) {
const std::string &filename = *it;
for (std::size_t ii=0; ii<inputFiles.size(); ii++) {
std::vector<SpvWord> spv;
read(spv, filename, verbosity);
read(spv, inputFiles[ii], verbosity);
spv::spirvbin_t(verbosity).remap(spv, whiteListStrings, opts);
const std::string outfile = outputDir + path_sep_char() + basename(filename);
write(spv, outfile, verbosity);
if (isSingleOutputDir) {
// write all outputs to same directory
const std::string outFile = outputDirOrFiles[0] + path_sep_char() + basename(inputFiles[ii]);
write(spv, outFile, verbosity);
} else {
// write each input to its associated output
write(spv, outputDirOrFiles[ii], verbosity);
}
}
if (verbosity > 0)
std::cout << "Done: " << inputFile.size() << " file(s) processed" << std::endl;
std::cout << "Done: " << inputFiles.size() << " file(s) processed" << std::endl;
}
// Parse command line options
void parseCmdLine(int argc, char** argv, std::vector<std::string>& inputFile,
std::string& outputDir,
std::string& stripWhiteListFile,
int& options,
int& verbosity)
void parseCmdLine(int argc,
char** argv,
std::vector<std::string>& inputFiles,
std::vector<std::string>& outputDirOrFiles,
std::string& stripWhiteListFile,
int& options,
int& verbosity)
{
if (argc < 2)
usage(argv[0]);
@ -222,18 +239,19 @@ namespace {
const std::string arg = argv[a];
if (arg == "--output" || arg == "-o") {
// Output directory
if (++a >= argc)
// Collect output dirs or files
for (++a; a < argc && argv[a][0] != '-'; ++a)
outputDirOrFiles.push_back(argv[a]);
if (outputDirOrFiles.size() == 0)
usage(argv[0], "--output requires an argument");
if (!outputDir.empty())
usage(argv[0], "--output can be provided only once");
outputDir = argv[a++];
// Remove trailing directory separator characters
while (!outputDir.empty() && outputDir.back() == path_sep_char())
outputDir.pop_back();
// Remove trailing directory separator characters from all paths
for (std::size_t ii=0; ii<outputDirOrFiles.size(); ii++) {
auto path = outputDirOrFiles[ii];
while (!path.empty() && path.back() == path_sep_char())
path.pop_back();
}
}
else if (arg == "-vv") { verbosity = 2; ++a; } // verbosity shortcuts
else if (arg == "-vvv") { verbosity = 3; ++a; } // ...
@ -245,7 +263,7 @@ namespace {
verbosity = 1;
if (a < argc) {
char* end_ptr = 0;
char* end_ptr = nullptr;
int verb = ::strtol(argv[a], &end_ptr, 10);
// If we have not read to the end of the string or
// the string contained no elements, then we do not want to
@ -262,7 +280,7 @@ namespace {
} else if (arg == "--input" || arg == "-i") {
// Collect input files
for (++a; a < argc && argv[a][0] != '-'; ++a)
inputFile.push_back(argv[a]);
inputFiles.push_back(argv[a]);
} else if (arg == "--do-everything") {
++a;
options = options | spv::spirvbin_t::DO_EVERYTHING;
@ -346,30 +364,39 @@ namespace {
int main(int argc, char** argv)
{
std::vector<std::string> inputFile;
std::string outputDir;
std::vector<std::string> inputFiles;
std::vector<std::string> outputDirOrFiles;
std::string whiteListFile;
int opts;
int verbosity;
#ifdef use_cpp11
// handle errors by exiting
spv::spirvbin_t::registerErrorHandler(errHandler);
// Log messages to std::cout
spv::spirvbin_t::registerLogHandler(logHandler);
#endif
if (argc < 2)
usage(argv[0]);
parseCmdLine(argc, argv, inputFile, outputDir, whiteListFile, opts, verbosity);
parseCmdLine(argc, argv, inputFiles, outputDirOrFiles, whiteListFile, opts, verbosity);
if (outputDir.empty())
usage(argv[0], "Output directory required");
if (outputDirOrFiles.empty())
usage(argv[0], "Output directory or file(s) required.");
const bool isMultiInput = inputFiles.size() > 1;
const bool isMultiOutput = outputDirOrFiles.size() > 1;
const bool isSingleOutputDir = !isMultiOutput && std::filesystem::is_directory(outputDirOrFiles[0]);
if (isMultiInput && !isMultiOutput && !isSingleOutputDir)
usage(argv[0], "Output is not a directory.");
if (isMultiInput && isMultiOutput && (outputDirOrFiles.size() != inputFiles.size()))
usage(argv[0], "Output must be either a single directory or one output file per input.");
// Main operations: read, remap, and write.
execute(inputFile, outputDir, whiteListFile, opts, verbosity);
execute(inputFiles, outputDirOrFiles, isSingleOutputDir, whiteListFile, opts, verbosity);
// If we get here, everything went OK! Nothing more to be done.
}

View File

@ -0,0 +1,50 @@
#version 460 compatibility
#extension GL_ARB_bindless_texture: require
#if !defined GL_ARB_bindless_texture
# error GL_ARB_bindless_texture is not defined
#elif GL_ARB_bindless_texture != 1
# error GL_ARB_bindless_texture is not equal to 1
#endif
// Valid usage cases
layout(bindless_sampler) uniform sampler2D s0; // case0: bindless layout
in sampler2D s1; // case1: sampler as an input
uniform uvec2 s2; // case2: uvec2 as sampler constructor
uniform ivec2 s3; // case3: ivec2 as sampler constructor
uniform int index;
in sampler2D s4[2][3]; // case4: sampler arrays of arrays
uniform BB {sampler2D s5;} bbs5[2]; // case5: uniform block member as a sampler
in samplerBuffer s6; // case6: samplerBuffer input
uniform UBO9 {samplerBuffer s7;}; // case7: samplerBuffer as an uniform block member
buffer SSBO10 {samplerBuffer s8;}; // case8: samplerBuffer as an ssbo member
layout(rgba8, bindless_image) in image2D i9; // case9: bindless image as an input
uniform vec2 coord; // bindless coord 2-D
uniform int icoord; // bindless coord 1-D
out vec4 color0;
out vec4 color1;
out vec4 color2;
out vec4 color3;
out vec4 color4;
out vec4 color5;
out vec4 color6;
out vec4 color7;
out vec4 color8;
out vec4 color9;
void main()
{
color0 = texture(s0, coord);
color1 = texture(s1, coord);
color2 = texture(sampler2D(s2), coord);
color3 = texture(sampler2D(s3), coord);
color4 = texture(s4[index][index], coord);
color5 = texture(bbs5[index].s5, coord);
color6 = texelFetch(s6, icoord);
color7 = texelFetch(s7, icoord);
color8 = texelFetch(s8, icoord);
color9 = imageLoad(i9, ivec2(0,0));
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
hlsl.intrinsics.evalfns.frag
// Module Version 10000
// Generated by (magic number): 8000a
// Generated by (magic number): 8000b
// Id's are bound by 274
Capability Shader

View File

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

View File

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

View File

@ -46,6 +46,7 @@ ERROR: 0:108: 'overloadE' : no matching overloaded function found
ERROR: 0:111: 'overloadE' : no matching overloaded function found
ERROR: 0:117: 'overloadF' : no matching overloaded function found
ERROR: 0:121: 'gl_TexCoord array size' : must be less than or equal to gl_MaxTextureCoords (32)
ERROR: 0:154: 'non-float shader input/output' : not supported for this version or the enabled extensions
ERROR: 0:165: 'switch' : Reserved word.
ERROR: 0:171: 'default' : Reserved word.
ERROR: 0:165: 'switch statements' : not supported for this version or the enabled extensions
@ -80,7 +81,7 @@ ERROR: 0:195: 'gl_ModelViewMatrix' : identifiers starting with "gl_" are reserve
ERROR: 0:200: 'token pasting (##)' : not supported for this version or the enabled extensions
ERROR: 0:203: 'token pasting (##)' : not supported for this version or the enabled extensions
ERROR: 0:205: '' : syntax error, unexpected IDENTIFIER
ERROR: 81 compilation errors. No code generated.
ERROR: 82 compilation errors. No code generated.
Shader version: 120

View File

@ -1,6 +1,6 @@
300layout.vert
ERROR: 0:7: 'vertex input arrays' : not supported with this profile: es
ERROR: 0:8: 'in' : cannot be a structure or array
ERROR: 0:8: 'in' : cannot be a structure
ERROR: 0:8: 's' : A structure containing an array is not allowed as input in ES
ERROR: 0:8: 'vertex input arrays' : not supported with this profile: es
ERROR: 0:8: 'location' : overlapping use of location 10

View File

@ -1,7 +1,7 @@
440.frag
ERROR: 0:11: 'location' : overlapping use of location 4
ERROR: 0:13: 'component' : type overflows the available 4 components
ERROR: 0:22: 'location' : fragment outputs sharing the same location must be the same basic type 30
ERROR: 0:22: 'location' : fragment outputs or tileImageEXTs sharing the same location 30 must be the same basic type
ERROR: 0:24: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type)
ERROR: 0:25: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type)
ERROR: 0:26: 'qualifier' : cannot use auxiliary, memory, interpolation, or precision qualifier in a default qualifier declaration (declaration with no type)
@ -43,11 +43,11 @@ ERROR: 0:62: 'layout' : offset/align can only be used on a uniform or buffer
ERROR: 0:63: 'layout' : offset/align can only be used on a uniform or buffer
ERROR: 0:84: 'align' : must be a power of 2
ERROR: 0:83: 'offset' : cannot lie in previous members
ERROR: 0:85: 'offset' : must be a multiple of the member's alignment
ERROR: 0:85: 'offset' : must be a multiple of the member's alignment (layout offset = 68 | member alignment = 8)
ERROR: 0:103: 'align' : must be a power of 2
ERROR: 0:105: 'align' : must be a power of 2
ERROR: 0:102: 'offset' : cannot lie in previous members
ERROR: 0:104: 'offset' : must be a multiple of the member's alignment
ERROR: 0:104: 'offset' : must be a multiple of the member's alignment (layout offset = 68 | member alignment = 8)
ERROR: 49 compilation errors. No code generated.

View File

@ -0,0 +1,205 @@
GL_ARB_bindless_texture.frag
Shader version: 460
Requested GL_ARB_bindless_texture
0:? Sequence
0:38 Function Definition: main( ( global void)
0:38 Function Parameters:
0:40 Sequence
0:40 move second child to first child ( temp 4-component vector of float)
0:40 'color0' ( out 4-component vector of float)
0:40 texture ( global 4-component vector of float)
0:40 's0' ( uniform sampler2D)
0:40 'coord' ( uniform 2-component vector of float)
0:41 move second child to first child ( temp 4-component vector of float)
0:41 'color1' ( out 4-component vector of float)
0:41 texture ( global 4-component vector of float)
0:41 's1' ( smooth in sampler2D)
0:41 'coord' ( uniform 2-component vector of float)
0:42 move second child to first child ( temp 4-component vector of float)
0:42 'color2' ( out 4-component vector of float)
0:42 texture ( global 4-component vector of float)
0:42 packUint2x32 ( temp sampler2D)
0:42 's2' ( uniform 2-component vector of uint)
0:42 'coord' ( uniform 2-component vector of float)
0:43 move second child to first child ( temp 4-component vector of float)
0:43 'color3' ( out 4-component vector of float)
0:43 texture ( global 4-component vector of float)
0:43 packUint2x32 ( temp sampler2D)
0:43 's3' ( uniform 2-component vector of int)
0:43 'coord' ( uniform 2-component vector of float)
0:44 move second child to first child ( temp 4-component vector of float)
0:44 'color4' ( out 4-component vector of float)
0:44 texture ( global 4-component vector of float)
0:44 indirect index ( smooth temp sampler2D)
0:44 indirect index ( smooth temp 3-element array of sampler2D)
0:44 's4' ( smooth in 2-element array of 3-element array of sampler2D)
0:44 'index' ( uniform int)
0:44 'index' ( uniform int)
0:44 'coord' ( uniform 2-component vector of float)
0:45 move second child to first child ( temp 4-component vector of float)
0:45 'color5' ( out 4-component vector of float)
0:45 texture ( global 4-component vector of float)
0:45 s5: direct index for structure (layout( column_major shared layoutBindlessSampler) uniform sampler2D)
0:45 indirect index (layout( column_major shared) temp block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5})
0:45 'bbs5' (layout( column_major shared) uniform 2-element array of block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5})
0:45 'index' ( uniform int)
0:45 Constant:
0:45 0 (const int)
0:45 'coord' ( uniform 2-component vector of float)
0:46 move second child to first child ( temp 4-component vector of float)
0:46 'color6' ( out 4-component vector of float)
0:46 textureFetch ( global 4-component vector of float)
0:46 's6' ( smooth in samplerBuffer)
0:46 'icoord' ( uniform int)
0:47 move second child to first child ( temp 4-component vector of float)
0:47 'color7' ( out 4-component vector of float)
0:47 textureFetch ( global 4-component vector of float)
0:47 s7: direct index for structure (layout( column_major shared layoutBindlessSampler) uniform samplerBuffer)
0:47 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared layoutBindlessSampler) uniform samplerBuffer s7})
0:47 Constant:
0:47 0 (const uint)
0:47 'icoord' ( uniform int)
0:48 move second child to first child ( temp 4-component vector of float)
0:48 'color8' ( out 4-component vector of float)
0:48 textureFetch ( global 4-component vector of float)
0:48 s8: direct index for structure (layout( column_major shared layoutBindlessSampler) buffer samplerBuffer)
0:48 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared layoutBindlessSampler) buffer samplerBuffer s8})
0:48 Constant:
0:48 0 (const uint)
0:48 'icoord' ( uniform int)
0:49 move second child to first child ( temp 4-component vector of float)
0:49 'color9' ( out 4-component vector of float)
0:49 imageLoad ( global 4-component vector of float)
0:49 'i9' (layout( rgba8 layoutBindlessImage) smooth in image2D)
0:49 Constant:
0:49 0 (const int)
0:49 0 (const int)
0:? Linker Objects
0:? 's0' ( uniform sampler2D)
0:? 's1' ( smooth in sampler2D)
0:? 's2' ( uniform 2-component vector of uint)
0:? 's3' ( uniform 2-component vector of int)
0:? 'index' ( uniform int)
0:? 's4' ( smooth in 2-element array of 3-element array of sampler2D)
0:? 'bbs5' (layout( column_major shared) uniform 2-element array of block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5})
0:? 's6' ( smooth in samplerBuffer)
0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared layoutBindlessSampler) uniform samplerBuffer s7})
0:? 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared layoutBindlessSampler) buffer samplerBuffer s8})
0:? 'i9' (layout( rgba8 layoutBindlessImage) smooth in image2D)
0:? 'coord' ( uniform 2-component vector of float)
0:? 'icoord' ( uniform int)
0:? 'color0' ( out 4-component vector of float)
0:? 'color1' ( out 4-component vector of float)
0:? 'color2' ( out 4-component vector of float)
0:? 'color3' ( out 4-component vector of float)
0:? 'color4' ( out 4-component vector of float)
0:? 'color5' ( out 4-component vector of float)
0:? 'color6' ( out 4-component vector of float)
0:? 'color7' ( out 4-component vector of float)
0:? 'color8' ( out 4-component vector of float)
0:? 'color9' ( out 4-component vector of float)
Linked fragment stage:
Shader version: 460
Requested GL_ARB_bindless_texture
0:? Sequence
0:38 Function Definition: main( ( global void)
0:38 Function Parameters:
0:40 Sequence
0:40 move second child to first child ( temp 4-component vector of float)
0:40 'color0' ( out 4-component vector of float)
0:40 texture ( global 4-component vector of float)
0:40 's0' ( uniform sampler2D)
0:40 'coord' ( uniform 2-component vector of float)
0:41 move second child to first child ( temp 4-component vector of float)
0:41 'color1' ( out 4-component vector of float)
0:41 texture ( global 4-component vector of float)
0:41 's1' ( smooth in sampler2D)
0:41 'coord' ( uniform 2-component vector of float)
0:42 move second child to first child ( temp 4-component vector of float)
0:42 'color2' ( out 4-component vector of float)
0:42 texture ( global 4-component vector of float)
0:42 packUint2x32 ( temp sampler2D)
0:42 's2' ( uniform 2-component vector of uint)
0:42 'coord' ( uniform 2-component vector of float)
0:43 move second child to first child ( temp 4-component vector of float)
0:43 'color3' ( out 4-component vector of float)
0:43 texture ( global 4-component vector of float)
0:43 packUint2x32 ( temp sampler2D)
0:43 's3' ( uniform 2-component vector of int)
0:43 'coord' ( uniform 2-component vector of float)
0:44 move second child to first child ( temp 4-component vector of float)
0:44 'color4' ( out 4-component vector of float)
0:44 texture ( global 4-component vector of float)
0:44 indirect index ( smooth temp sampler2D)
0:44 indirect index ( smooth temp 3-element array of sampler2D)
0:44 's4' ( smooth in 2-element array of 3-element array of sampler2D)
0:44 'index' ( uniform int)
0:44 'index' ( uniform int)
0:44 'coord' ( uniform 2-component vector of float)
0:45 move second child to first child ( temp 4-component vector of float)
0:45 'color5' ( out 4-component vector of float)
0:45 texture ( global 4-component vector of float)
0:45 s5: direct index for structure (layout( column_major shared layoutBindlessSampler) uniform sampler2D)
0:45 indirect index (layout( column_major shared) temp block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5})
0:45 'bbs5' (layout( column_major shared) uniform 2-element array of block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5})
0:45 'index' ( uniform int)
0:45 Constant:
0:45 0 (const int)
0:45 'coord' ( uniform 2-component vector of float)
0:46 move second child to first child ( temp 4-component vector of float)
0:46 'color6' ( out 4-component vector of float)
0:46 textureFetch ( global 4-component vector of float)
0:46 's6' ( smooth in samplerBuffer)
0:46 'icoord' ( uniform int)
0:47 move second child to first child ( temp 4-component vector of float)
0:47 'color7' ( out 4-component vector of float)
0:47 textureFetch ( global 4-component vector of float)
0:47 s7: direct index for structure (layout( column_major shared layoutBindlessSampler) uniform samplerBuffer)
0:47 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared layoutBindlessSampler) uniform samplerBuffer s7})
0:47 Constant:
0:47 0 (const uint)
0:47 'icoord' ( uniform int)
0:48 move second child to first child ( temp 4-component vector of float)
0:48 'color8' ( out 4-component vector of float)
0:48 textureFetch ( global 4-component vector of float)
0:48 s8: direct index for structure (layout( column_major shared layoutBindlessSampler) buffer samplerBuffer)
0:48 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared layoutBindlessSampler) buffer samplerBuffer s8})
0:48 Constant:
0:48 0 (const uint)
0:48 'icoord' ( uniform int)
0:49 move second child to first child ( temp 4-component vector of float)
0:49 'color9' ( out 4-component vector of float)
0:49 imageLoad ( global 4-component vector of float)
0:49 'i9' (layout( rgba8 layoutBindlessImage) smooth in image2D)
0:49 Constant:
0:49 0 (const int)
0:49 0 (const int)
0:? Linker Objects
0:? 's0' ( uniform sampler2D)
0:? 's1' ( smooth in sampler2D)
0:? 's2' ( uniform 2-component vector of uint)
0:? 's3' ( uniform 2-component vector of int)
0:? 'index' ( uniform int)
0:? 's4' ( smooth in 2-element array of 3-element array of sampler2D)
0:? 'bbs5' (layout( column_major shared) uniform 2-element array of block{layout( column_major shared layoutBindlessSampler) uniform sampler2D s5})
0:? 's6' ( smooth in samplerBuffer)
0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared layoutBindlessSampler) uniform samplerBuffer s7})
0:? 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared layoutBindlessSampler) buffer samplerBuffer s8})
0:? 'i9' (layout( rgba8 layoutBindlessImage) smooth in image2D)
0:? 'coord' ( uniform 2-component vector of float)
0:? 'icoord' ( uniform int)
0:? 'color0' ( out 4-component vector of float)
0:? 'color1' ( out 4-component vector of float)
0:? 'color2' ( out 4-component vector of float)
0:? 'color3' ( out 4-component vector of float)
0:? 'color4' ( out 4-component vector of float)
0:? 'color5' ( out 4-component vector of float)
0:? 'color6' ( out 4-component vector of float)
0:? 'color7' ( out 4-component vector of float)
0:? 'color8' ( out 4-component vector of float)
0:? 'color9' ( out 4-component vector of float)

View File

@ -1,5 +1,5 @@
atomicAdd.comp
ERROR: 0:18: 'atomicAdd' : Atomic memory function can only be used for shader storage block member or shared variable.
ERROR: 0:18: 'atomicAdd' : Only l-values corresponding to shader block storage or shared variables can be used with atomic memory functions.
ERROR: 1 compilation errors. No code generated.

View File

@ -1,45 +1,45 @@
compoundsuffix.frag.hlsl
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 22
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 20
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 11 "@main(vf4;"
Name 10 "fragColor"
Name 15 "fragColor"
Name 16 "param"
Name 20 "fragColor"
Decorate 20(fragColor) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypeFunction 2 8(ptr)
13: 6(float) Constant 1065353216
14: 7(fvec4) ConstantComposite 13 13 13 13
19: TypePointer Output 7(fvec4)
20(fragColor): 19(ptr) Variable Output
4(main): 2 Function None 3
5: Label
15(fragColor): 8(ptr) Variable Function
16(param): 8(ptr) Variable Function
17: 2 FunctionCall 11(@main(vf4;) 16(param)
18: 7(fvec4) Load 16(param)
Store 15(fragColor) 18
21: 7(fvec4) Load 15(fragColor)
Store 20(fragColor) 21
Return
FunctionEnd
11(@main(vf4;): 2 Function None 9
10(fragColor): 8(ptr) FunctionParameter
12: Label
Store 10(fragColor) 14
Return
FunctionEnd
compoundsuffix.frag.hlsl
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 22
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 20
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 11 "@main(vf4;"
Name 10 "fragColor"
Name 15 "fragColor"
Name 16 "param"
Name 20 "fragColor"
Decorate 20(fragColor) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Function 7(fvec4)
9: TypeFunction 2 8(ptr)
13: 6(float) Constant 1065353216
14: 7(fvec4) ConstantComposite 13 13 13 13
19: TypePointer Output 7(fvec4)
20(fragColor): 19(ptr) Variable Output
4(main): 2 Function None 3
5: Label
15(fragColor): 8(ptr) Variable Function
16(param): 8(ptr) Variable Function
17: 2 FunctionCall 11(@main(vf4;) 16(param)
18: 7(fvec4) Load 16(param)
Store 15(fragColor) 18
21: 7(fvec4) Load 15(fragColor)
Store 20(fragColor) 21
Return
FunctionEnd
11(@main(vf4;): 2 Function None 9
10(fragColor): 8(ptr) FunctionParameter
12: Label
Store 10(fragColor) 14
Return
FunctionEnd

View File

@ -1,15 +1,15 @@
compoundsuffix.vert.glsl
Shader version: 100
0:? Sequence
0:1 Function Definition: main( ( global void)
0:1 Function Parameters:
0:3 Sequence
0:3 move second child to first child ( temp highp 4-component vector of float)
0:3 'gl_Position' ( gl_Position highp 4-component vector of float Position)
0:3 Constant:
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:? Linker Objects
compoundsuffix.vert.glsl
Shader version: 100
0:? Sequence
0:1 Function Definition: main( ( global void)
0:1 Function Parameters:
0:3 Sequence
0:3 move second child to first child ( temp highp 4-component vector of float)
0:3 'gl_Position' ( gl_Position highp 4-component vector of float Position)
0:3 Constant:
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:? Linker Objects

View File

@ -0,0 +1,35 @@
glsl.-P.frag
Shader version: 450
0:? Sequence
0:5 Function Definition: main( ( global void)
0:5 Function Parameters:
0:19 Sequence
0:19 move second child to first child ( temp 4-component vector of float)
0:19 'color' (layout( location=0) out 4-component vector of float)
0:19 Constant:
0:19 1.000000
0:19 1.000000
0:19 1.000000
0:19 1.000000
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 450
0:? Sequence
0:5 Function Definition: main( ( global void)
0:5 Function Parameters:
0:19 Sequence
0:19 move second child to first child ( temp 4-component vector of float)
0:19 'color' (layout( location=0) out 4-component vector of float)
0:19 Constant:
0:19 1.000000
0:19 1.000000
0:19 1.000000
0:19 1.000000
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)

View File

@ -0,0 +1,45 @@
glsl.-P.function.frag
Shader version: 450
0:? Sequence
-1:1 Function Definition: getColor( ( global 4-component vector of float)
-1:1 Function Parameters:
-1:1 Sequence
-1:1 Branch: Return with expression
-1:1 Constant:
-1:1 1.000000
-1:1 1.000000
-1:1 1.000000
-1:1 1.000000
0:5 Function Definition: main( ( global void)
0:5 Function Parameters:
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'color' (layout( location=0) out 4-component vector of float)
0:7 Function Call: getColor( ( global 4-component vector of float)
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 450
0:? Sequence
-1:1 Function Definition: getColor( ( global 4-component vector of float)
-1:1 Function Parameters:
-1:1 Sequence
-1:1 Branch: Return with expression
-1:1 Constant:
-1:1 1.000000
-1:1 1.000000
-1:1 1.000000
-1:1 1.000000
0:5 Function Definition: main( ( global void)
0:5 Function Parameters:
0:7 Sequence
0:7 move second child to first child ( temp 4-component vector of float)
0:7 'color' (layout( location=0) out 4-component vector of float)
0:7 Function Call: getColor( ( global 4-component vector of float)
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)

View File

@ -0,0 +1,49 @@
glsl.-P.include.frag
Shader version: 450
Requested GL_GOOGLE_cpp_style_line_directive
Requested GL_GOOGLE_include_directive
0:? Sequence
0:1 Function Definition: getColor( ( global 4-component vector of float)
0:1 Function Parameters:
0:3 Sequence
0:3 Branch: Return with expression
0:3 Constant:
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:7 Function Definition: main( ( global void)
0:7 Function Parameters:
0:9 Sequence
0:9 move second child to first child ( temp 4-component vector of float)
0:9 'color' (layout( location=0) out 4-component vector of float)
0:9 Function Call: getColor( ( global 4-component vector of float)
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)
Linked fragment stage:
Shader version: 450
Requested GL_GOOGLE_cpp_style_line_directive
Requested GL_GOOGLE_include_directive
0:? Sequence
0:1 Function Definition: getColor( ( global 4-component vector of float)
0:1 Function Parameters:
0:3 Sequence
0:3 Branch: Return with expression
0:3 Constant:
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:3 1.000000
0:7 Function Definition: main( ( global void)
0:7 Function Parameters:
0:9 Sequence
0:9 move second child to first child ( temp 4-component vector of float)
0:9 'color' (layout( location=0) out 4-component vector of float)
0:9 Function Call: getColor( ( global 4-component vector of float)
0:? Linker Objects
0:? 'color' (layout( location=0) out 4-component vector of float)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,707 @@
glsl.460.subgroupEXT.task
ERROR: 0:6: 'gl_SubgroupSize' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:7: 'gl_SubgroupInvocationID' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:8: 'subgroupBarrier' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:9: 'subgroupMemoryBarrier' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:10: 'subgroupMemoryBarrierBuffer' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:11: 'subgroupMemoryBarrierImage' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:12: 'subgroupElect' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:13: 'gl_NumSubgroups' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:14: 'gl_SubgroupID' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:15: 'subgroupMemoryBarrierShared' : required extension not requested: GL_KHR_shader_subgroup_basic
ERROR: 0:17: 'subgroupAll' : required extension not requested: GL_KHR_shader_subgroup_vote
ERROR: 0:18: 'subgroupAny' : required extension not requested: GL_KHR_shader_subgroup_vote
ERROR: 0:19: 'subgroupAllEqual' : required extension not requested: GL_KHR_shader_subgroup_vote
ERROR: 0:21: 'gl_SubgroupEqMask' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:22: 'gl_SubgroupGeMask' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:23: 'gl_SubgroupGtMask' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:24: 'gl_SubgroupLeMask' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:25: 'gl_SubgroupLtMask' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:26: 'subgroupBroadcast' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:27: 'subgroupBroadcastFirst' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:28: 'subgroupBallot' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:29: 'subgroupInverseBallot' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:30: 'subgroupBallotBitExtract' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:31: 'subgroupBallotBitCount' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:32: 'subgroupBallotInclusiveBitCount' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:33: 'subgroupBallotExclusiveBitCount' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:34: 'subgroupBallotFindLSB' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:35: 'subgroupBallotFindMSB' : required extension not requested: GL_KHR_shader_subgroup_ballot
ERROR: 0:37: 'subgroupShuffle' : required extension not requested: GL_KHR_shader_subgroup_shuffle
ERROR: 0:38: 'subgroupShuffleXor' : required extension not requested: GL_KHR_shader_subgroup_shuffle
ERROR: 0:39: 'subgroupShuffleUp' : required extension not requested: GL_KHR_shader_subgroup_shuffle_relative
ERROR: 0:40: 'subgroupShuffleDown' : required extension not requested: GL_KHR_shader_subgroup_shuffle_relative
ERROR: 0:42: 'subgroupAdd' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:43: 'subgroupMul' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:44: 'subgroupMin' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:45: 'subgroupMax' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:46: 'subgroupAnd' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:47: 'subgroupOr' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:48: 'subgroupXor' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:49: 'subgroupInclusiveAdd' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:50: 'subgroupInclusiveMul' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:51: 'subgroupInclusiveMin' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:52: 'subgroupInclusiveMax' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:53: 'subgroupInclusiveAnd' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:54: 'subgroupInclusiveOr' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:55: 'subgroupInclusiveXor' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:56: 'subgroupExclusiveAdd' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:57: 'subgroupExclusiveMul' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:58: 'subgroupExclusiveMin' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:59: 'subgroupExclusiveMax' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:60: 'subgroupExclusiveAnd' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:61: 'subgroupExclusiveOr' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:62: 'subgroupExclusiveXor' : required extension not requested: GL_KHR_shader_subgroup_arithmetic
ERROR: 0:64: 'subgroupClusteredAdd' : required extension not requested: GL_KHR_shader_subgroup_clustered
ERROR: 0:65: 'subgroupClusteredMul' : required extension not requested: GL_KHR_shader_subgroup_clustered
ERROR: 0:66: 'subgroupClusteredMin' : required extension not requested: GL_KHR_shader_subgroup_clustered
ERROR: 0:67: 'subgroupClusteredMax' : required extension not requested: GL_KHR_shader_subgroup_clustered
ERROR: 0:68: 'subgroupClusteredAnd' : required extension not requested: GL_KHR_shader_subgroup_clustered
ERROR: 0:69: 'subgroupClusteredOr' : required extension not requested: GL_KHR_shader_subgroup_clustered
ERROR: 0:70: 'subgroupClusteredXor' : required extension not requested: GL_KHR_shader_subgroup_clustered
ERROR: 0:72: 'subgroupQuadBroadcast' : required extension not requested: GL_KHR_shader_subgroup_quad
ERROR: 0:73: 'subgroupQuadSwapHorizontal' : required extension not requested: GL_KHR_shader_subgroup_quad
ERROR: 0:74: 'subgroupQuadSwapVertical' : required extension not requested: GL_KHR_shader_subgroup_quad
ERROR: 0:75: 'subgroupQuadSwapDiagonal' : required extension not requested: GL_KHR_shader_subgroup_quad
ERROR: 64 compilation errors. No code generated.
Shader version: 460
Requested GL_EXT_mesh_shader
Requested GL_KHR_shader_subgroup_arithmetic
Requested GL_KHR_shader_subgroup_ballot
Requested GL_KHR_shader_subgroup_basic
Requested GL_KHR_shader_subgroup_clustered
Requested GL_KHR_shader_subgroup_quad
Requested GL_KHR_shader_subgroup_shuffle
Requested GL_KHR_shader_subgroup_shuffle_relative
Requested GL_KHR_shader_subgroup_vote
local_size = (32, 1, 1)
ERROR: node is still EOpNull!
0:3 Function Definition: undeclared_errors(vf4; ( global 4-component vector of float)
0:3 Function Parameters:
0:3 'f4' ( in 4-component vector of float)
0:? Sequence
0:6 'gl_SubgroupSize' ( in uint SubgroupSize)
0:7 'gl_SubgroupInvocationID' ( in uint SubgroupInvocationID)
0:8 subgroupBarrier ( global void)
0:9 subgroupMemoryBarrier ( global void)
0:10 subgroupMemoryBarrierBuffer ( global void)
0:11 subgroupMemoryBarrierImage ( global void)
0:12 subgroupElect ( global bool)
0:13 'gl_NumSubgroups' ( in uint NumSubgroups)
0:14 'gl_SubgroupID' ( in uint SubgroupID)
0:15 subgroupMemoryBarrierShared ( global void)
0:17 subgroupAll ( global bool)
0:17 Constant:
0:17 true (const bool)
0:18 subgroupAny ( global bool)
0:18 Constant:
0:18 false (const bool)
0:19 subgroupAllEqual ( global bool)
0:19 'f4' ( in 4-component vector of float)
0:21 'gl_SubgroupEqMask' ( in 4-component vector of uint SubgroupEqMask)
0:22 'gl_SubgroupGeMask' ( in 4-component vector of uint SubgroupGeMask)
0:23 'gl_SubgroupGtMask' ( in 4-component vector of uint SubgroupGtMask)
0:24 'gl_SubgroupLeMask' ( in 4-component vector of uint SubgroupLeMask)
0:25 'gl_SubgroupLtMask' ( in 4-component vector of uint SubgroupLtMask)
0:26 subgroupBroadcast ( global 4-component vector of float)
0:26 'f4' ( in 4-component vector of float)
0:26 Constant:
0:26 0 (const uint)
0:27 subgroupBroadcastFirst ( global 4-component vector of float)
0:27 'f4' ( in 4-component vector of float)
0:28 Sequence
0:28 move second child to first child ( temp 4-component vector of uint)
0:28 'ballot' ( temp 4-component vector of uint)
0:28 subgroupBallot ( global 4-component vector of uint)
0:28 Constant:
0:28 false (const bool)
0:29 subgroupInverseBallot ( global bool)
0:29 Constant:
0:29 1 (const uint)
0:29 1 (const uint)
0:29 1 (const uint)
0:29 1 (const uint)
0:30 subgroupBallotBitExtract ( global bool)
0:30 'ballot' ( temp 4-component vector of uint)
0:30 Constant:
0:30 0 (const uint)
0:31 subgroupBallotBitCount ( global uint)
0:31 'ballot' ( temp 4-component vector of uint)
0:32 subgroupBallotInclusiveBitCount ( global uint)
0:32 'ballot' ( temp 4-component vector of uint)
0:33 subgroupBallotExclusiveBitCount ( global uint)
0:33 'ballot' ( temp 4-component vector of uint)
0:34 subgroupBallotFindLSB ( global uint)
0:34 'ballot' ( temp 4-component vector of uint)
0:35 subgroupBallotFindMSB ( global uint)
0:35 'ballot' ( temp 4-component vector of uint)
0:37 subgroupShuffle ( global 4-component vector of float)
0:37 'f4' ( in 4-component vector of float)
0:37 Constant:
0:37 0 (const uint)
0:38 subgroupShuffleXor ( global 4-component vector of float)
0:38 'f4' ( in 4-component vector of float)
0:38 Constant:
0:38 1 (const uint)
0:39 subgroupShuffleUp ( global 4-component vector of float)
0:39 'f4' ( in 4-component vector of float)
0:39 Constant:
0:39 1 (const uint)
0:40 subgroupShuffleDown ( global 4-component vector of float)
0:40 'f4' ( in 4-component vector of float)
0:40 Constant:
0:40 1 (const uint)
0:42 move second child to first child ( temp 4-component vector of float)
0:42 'result' ( temp 4-component vector of float)
0:42 subgroupAdd ( global 4-component vector of float)
0:42 'f4' ( in 4-component vector of float)
0:43 subgroupMul ( global 4-component vector of float)
0:43 'f4' ( in 4-component vector of float)
0:44 subgroupMin ( global 4-component vector of float)
0:44 'f4' ( in 4-component vector of float)
0:45 subgroupMax ( global 4-component vector of float)
0:45 'f4' ( in 4-component vector of float)
0:46 subgroupAnd ( global 4-component vector of uint)
0:46 'ballot' ( temp 4-component vector of uint)
0:47 subgroupOr ( global 4-component vector of uint)
0:47 'ballot' ( temp 4-component vector of uint)
0:48 subgroupXor ( global 4-component vector of uint)
0:48 'ballot' ( temp 4-component vector of uint)
0:49 subgroupInclusiveAdd ( global 4-component vector of float)
0:49 'f4' ( in 4-component vector of float)
0:50 subgroupInclusiveMul ( global 4-component vector of float)
0:50 'f4' ( in 4-component vector of float)
0:51 subgroupInclusiveMin ( global 4-component vector of float)
0:51 'f4' ( in 4-component vector of float)
0:52 subgroupInclusiveMax ( global 4-component vector of float)
0:52 'f4' ( in 4-component vector of float)
0:53 subgroupInclusiveAnd ( global 4-component vector of uint)
0:53 'ballot' ( temp 4-component vector of uint)
0:54 subgroupInclusiveOr ( global 4-component vector of uint)
0:54 'ballot' ( temp 4-component vector of uint)
0:55 subgroupInclusiveXor ( global 4-component vector of uint)
0:55 'ballot' ( temp 4-component vector of uint)
0:56 subgroupExclusiveAdd ( global 4-component vector of float)
0:56 'f4' ( in 4-component vector of float)
0:57 subgroupExclusiveMul ( global 4-component vector of float)
0:57 'f4' ( in 4-component vector of float)
0:58 subgroupExclusiveMin ( global 4-component vector of float)
0:58 'f4' ( in 4-component vector of float)
0:59 subgroupExclusiveMax ( global 4-component vector of float)
0:59 'f4' ( in 4-component vector of float)
0:60 subgroupExclusiveAnd ( global 4-component vector of uint)
0:60 'ballot' ( temp 4-component vector of uint)
0:61 subgroupExclusiveOr ( global 4-component vector of uint)
0:61 'ballot' ( temp 4-component vector of uint)
0:62 subgroupExclusiveXor ( global 4-component vector of uint)
0:62 'ballot' ( temp 4-component vector of uint)
0:64 subgroupClusteredAdd ( global 4-component vector of float)
0:64 'f4' ( in 4-component vector of float)
0:64 Constant:
0:64 2 (const uint)
0:65 subgroupClusteredMul ( global 4-component vector of float)
0:65 'f4' ( in 4-component vector of float)
0:65 Constant:
0:65 2 (const uint)
0:66 subgroupClusteredMin ( global 4-component vector of float)
0:66 'f4' ( in 4-component vector of float)
0:66 Constant:
0:66 2 (const uint)
0:67 subgroupClusteredMax ( global 4-component vector of float)
0:67 'f4' ( in 4-component vector of float)
0:67 Constant:
0:67 2 (const uint)
0:68 subgroupClusteredAnd ( global 4-component vector of uint)
0:68 'ballot' ( temp 4-component vector of uint)
0:68 Constant:
0:68 2 (const uint)
0:69 subgroupClusteredOr ( global 4-component vector of uint)
0:69 'ballot' ( temp 4-component vector of uint)
0:69 Constant:
0:69 2 (const uint)
0:70 subgroupClusteredXor ( global 4-component vector of uint)
0:70 'ballot' ( temp 4-component vector of uint)
0:70 Constant:
0:70 2 (const uint)
0:72 subgroupQuadBroadcast ( global 4-component vector of float)
0:72 'f4' ( in 4-component vector of float)
0:72 Constant:
0:72 0 (const uint)
0:73 subgroupQuadSwapHorizontal ( global 4-component vector of float)
0:73 'f4' ( in 4-component vector of float)
0:74 subgroupQuadSwapVertical ( global 4-component vector of float)
0:74 'f4' ( in 4-component vector of float)
0:75 subgroupQuadSwapDiagonal ( global 4-component vector of float)
0:75 'f4' ( in 4-component vector of float)
0:77 Branch: Return with expression
0:77 'result' ( temp 4-component vector of float)
0:102 Function Definition: main( ( global void)
0:102 Function Parameters:
0:104 Sequence
0:104 Sequence
0:104 move second child to first child ( temp uint)
0:104 'iid' ( temp uint)
0:104 direct index ( temp uint)
0:104 'gl_LocalInvocationID' ( in 3-component vector of uint LocalInvocationID)
0:104 Constant:
0:104 0 (const int)
0:105 Sequence
0:105 move second child to first child ( temp uint)
0:105 'gid' ( temp uint)
0:105 direct index ( temp uint)
0:105 'gl_WorkGroupID' ( in 3-component vector of uint WorkGroupID)
0:105 Constant:
0:105 0 (const int)
0:108 Sequence
0:108 Sequence
0:108 move second child to first child ( temp uint)
0:108 'i' ( temp uint)
0:108 Constant:
0:108 0 (const uint)
0:108 Loop with condition tested first
0:108 Loop Condition
0:108 Compare Less Than ( temp bool)
0:108 'i' ( temp uint)
0:108 Constant:
0:108 10 (const uint)
0:108 Loop Body
0:109 Sequence
0:109 move second child to first child ( temp 4-component vector of float)
0:109 indirect index ( temp 4-component vector of float)
0:109 'mem' ( shared 10-element array of 4-component vector of float)
0:109 'i' ( temp uint)
0:109 Construct vec4 ( temp 4-component vector of float)
0:109 Convert uint to float ( temp float)
0:109 add ( temp uint)
0:109 'i' ( temp uint)
0:109 uni_value: direct index for structure (layout( column_major shared) uniform uint)
0:109 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform uint uni_value})
0:109 Constant:
0:109 0 (const uint)
0:108 Loop Terminal Expression
0:108 Pre-Increment ( temp uint)
0:108 'i' ( temp uint)
0:111 imageStore ( global void)
0:111 'uni_image' (layout( binding=0) writeonly uniform image2D)
0:111 Construct ivec2 ( temp 2-component vector of int)
0:111 Convert uint to int ( temp int)
0:111 'iid' ( temp uint)
0:111 indirect index ( temp 4-component vector of float)
0:111 'mem' ( shared 10-element array of 4-component vector of float)
0:111 'gid' ( temp uint)
0:112 imageStore ( global void)
0:112 'uni_image' (layout( binding=0) writeonly uniform image2D)
0:112 Construct ivec2 ( temp 2-component vector of int)
0:112 Convert uint to int ( temp int)
0:112 'iid' ( temp uint)
0:112 indirect index ( temp 4-component vector of float)
0:112 'mem' ( shared 10-element array of 4-component vector of float)
0:112 add ( temp uint)
0:112 'gid' ( temp uint)
0:112 Constant:
0:112 1 (const uint)
0:114 MemoryBarrierShared ( global void)
0:114 Barrier ( global void)
0:118 move second child to first child ( temp 2-component vector of float)
0:118 dummy: direct index for structure ( global 2-component vector of float)
0:118 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:118 Constant:
0:118 0 (const int)
0:118 Constant:
0:118 30.000000
0:118 31.000000
0:119 move second child to first child ( temp 2-component vector of float)
0:119 direct index ( temp 2-component vector of float)
0:119 submesh: direct index for structure ( global 3-element array of 2-component vector of float)
0:119 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:119 Constant:
0:119 1 (const int)
0:119 Constant:
0:119 0 (const int)
0:119 Constant:
0:119 32.000000
0:119 33.000000
0:120 move second child to first child ( temp 2-component vector of float)
0:120 direct index ( temp 2-component vector of float)
0:120 submesh: direct index for structure ( global 3-element array of 2-component vector of float)
0:120 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:120 Constant:
0:120 1 (const int)
0:120 Constant:
0:120 1 (const int)
0:120 Constant:
0:120 34.000000
0:120 35.000000
0:121 move second child to first child ( temp 2-component vector of float)
0:121 direct index ( temp 2-component vector of float)
0:121 submesh: direct index for structure ( global 3-element array of 2-component vector of float)
0:121 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:121 Constant:
0:121 1 (const int)
0:121 Constant:
0:121 2 (const int)
0:121 indirect index ( temp 2-component vector of float)
0:121 submesh: direct index for structure ( global 3-element array of 2-component vector of float)
0:121 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:121 Constant:
0:121 1 (const int)
0:121 mod ( temp uint)
0:121 'gid' ( temp uint)
0:121 Constant:
0:121 2 (const uint)
0:123 MemoryBarrierShared ( global void)
0:123 Barrier ( global void)
0:126 EmitMeshTasksEXT ( global void)
0:126 Constant:
0:126 3 (const uint)
0:126 Constant:
0:126 1 (const uint)
0:126 Constant:
0:126 1 (const uint)
0:130 Function Definition: basic_works( ( global void)
0:130 Function Parameters:
0:132 Sequence
0:132 'gl_SubgroupSize' ( in uint SubgroupSize)
0:133 'gl_SubgroupInvocationID' ( in uint SubgroupInvocationID)
0:134 subgroupBarrier ( global void)
0:135 subgroupMemoryBarrier ( global void)
0:136 subgroupMemoryBarrierBuffer ( global void)
0:137 subgroupMemoryBarrierImage ( global void)
0:138 subgroupElect ( global bool)
0:139 'gl_NumSubgroups' ( in uint NumSubgroups)
0:140 'gl_SubgroupID' ( in uint SubgroupID)
0:141 subgroupMemoryBarrierShared ( global void)
0:145 Function Definition: ballot_works(vf4; ( global void)
0:145 Function Parameters:
0:145 'f4' ( in 4-component vector of float)
0:146 Sequence
0:146 'gl_SubgroupEqMask' ( in 4-component vector of uint SubgroupEqMask)
0:147 'gl_SubgroupGeMask' ( in 4-component vector of uint SubgroupGeMask)
0:148 'gl_SubgroupGtMask' ( in 4-component vector of uint SubgroupGtMask)
0:149 'gl_SubgroupLeMask' ( in 4-component vector of uint SubgroupLeMask)
0:150 'gl_SubgroupLtMask' ( in 4-component vector of uint SubgroupLtMask)
0:151 subgroupBroadcast ( global 4-component vector of float)
0:151 'f4' ( in 4-component vector of float)
0:151 Constant:
0:151 0 (const uint)
0:152 subgroupBroadcastFirst ( global 4-component vector of float)
0:152 'f4' ( in 4-component vector of float)
0:153 Sequence
0:153 move second child to first child ( temp 4-component vector of uint)
0:153 'ballot' ( temp 4-component vector of uint)
0:153 subgroupBallot ( global 4-component vector of uint)
0:153 Constant:
0:153 false (const bool)
0:154 subgroupInverseBallot ( global bool)
0:154 Constant:
0:154 1 (const uint)
0:154 1 (const uint)
0:154 1 (const uint)
0:154 1 (const uint)
0:155 subgroupBallotBitExtract ( global bool)
0:155 'ballot' ( temp 4-component vector of uint)
0:155 Constant:
0:155 0 (const uint)
0:156 subgroupBallotBitCount ( global uint)
0:156 'ballot' ( temp 4-component vector of uint)
0:157 subgroupBallotInclusiveBitCount ( global uint)
0:157 'ballot' ( temp 4-component vector of uint)
0:158 subgroupBallotExclusiveBitCount ( global uint)
0:158 'ballot' ( temp 4-component vector of uint)
0:159 subgroupBallotFindLSB ( global uint)
0:159 'ballot' ( temp 4-component vector of uint)
0:160 subgroupBallotFindMSB ( global uint)
0:160 'ballot' ( temp 4-component vector of uint)
0:164 Function Definition: vote_works(vf4; ( global void)
0:164 Function Parameters:
0:164 'f4' ( in 4-component vector of float)
0:166 Sequence
0:166 subgroupAll ( global bool)
0:166 Constant:
0:166 true (const bool)
0:167 subgroupAny ( global bool)
0:167 Constant:
0:167 false (const bool)
0:168 subgroupAllEqual ( global bool)
0:168 'f4' ( in 4-component vector of float)
0:173 Function Definition: shuffle_works(vf4; ( global void)
0:173 Function Parameters:
0:173 'f4' ( in 4-component vector of float)
0:175 Sequence
0:175 subgroupShuffle ( global 4-component vector of float)
0:175 'f4' ( in 4-component vector of float)
0:175 Constant:
0:175 0 (const uint)
0:176 subgroupShuffleXor ( global 4-component vector of float)
0:176 'f4' ( in 4-component vector of float)
0:176 Constant:
0:176 1 (const uint)
0:177 subgroupShuffleUp ( global 4-component vector of float)
0:177 'f4' ( in 4-component vector of float)
0:177 Constant:
0:177 1 (const uint)
0:178 subgroupShuffleDown ( global 4-component vector of float)
0:178 'f4' ( in 4-component vector of float)
0:178 Constant:
0:178 1 (const uint)
0:182 Function Definition: arith_works(vf4; ( global void)
0:182 Function Parameters:
0:182 'f4' ( in 4-component vector of float)
0:? Sequence
0:185 subgroupAdd ( global 4-component vector of float)
0:185 'f4' ( in 4-component vector of float)
0:186 subgroupMul ( global 4-component vector of float)
0:186 'f4' ( in 4-component vector of float)
0:187 subgroupMin ( global 4-component vector of float)
0:187 'f4' ( in 4-component vector of float)
0:188 subgroupMax ( global 4-component vector of float)
0:188 'f4' ( in 4-component vector of float)
0:189 subgroupAnd ( global 4-component vector of uint)
0:189 'ballot' ( temp 4-component vector of uint)
0:190 subgroupOr ( global 4-component vector of uint)
0:190 'ballot' ( temp 4-component vector of uint)
0:191 subgroupXor ( global 4-component vector of uint)
0:191 'ballot' ( temp 4-component vector of uint)
0:192 subgroupInclusiveAdd ( global 4-component vector of float)
0:192 'f4' ( in 4-component vector of float)
0:193 subgroupInclusiveMul ( global 4-component vector of float)
0:193 'f4' ( in 4-component vector of float)
0:194 subgroupInclusiveMin ( global 4-component vector of float)
0:194 'f4' ( in 4-component vector of float)
0:195 subgroupInclusiveMax ( global 4-component vector of float)
0:195 'f4' ( in 4-component vector of float)
0:196 subgroupInclusiveAnd ( global 4-component vector of uint)
0:196 'ballot' ( temp 4-component vector of uint)
0:197 subgroupInclusiveOr ( global 4-component vector of uint)
0:197 'ballot' ( temp 4-component vector of uint)
0:198 subgroupInclusiveXor ( global 4-component vector of uint)
0:198 'ballot' ( temp 4-component vector of uint)
0:199 subgroupExclusiveAdd ( global 4-component vector of float)
0:199 'f4' ( in 4-component vector of float)
0:200 subgroupExclusiveMul ( global 4-component vector of float)
0:200 'f4' ( in 4-component vector of float)
0:201 subgroupExclusiveMin ( global 4-component vector of float)
0:201 'f4' ( in 4-component vector of float)
0:202 subgroupExclusiveMax ( global 4-component vector of float)
0:202 'f4' ( in 4-component vector of float)
0:203 subgroupExclusiveAnd ( global 4-component vector of uint)
0:203 'ballot' ( temp 4-component vector of uint)
0:204 subgroupExclusiveOr ( global 4-component vector of uint)
0:204 'ballot' ( temp 4-component vector of uint)
0:205 subgroupExclusiveXor ( global 4-component vector of uint)
0:205 'ballot' ( temp 4-component vector of uint)
0:209 Function Definition: clustered_works(vf4; ( global void)
0:209 Function Parameters:
0:209 'f4' ( in 4-component vector of float)
0:211 Sequence
0:211 Sequence
0:211 move second child to first child ( temp 4-component vector of uint)
0:211 'ballot' ( temp 4-component vector of uint)
0:211 Constant:
0:211 85 (const uint)
0:211 0 (const uint)
0:211 0 (const uint)
0:211 0 (const uint)
0:212 subgroupClusteredAdd ( global 4-component vector of float)
0:212 'f4' ( in 4-component vector of float)
0:212 Constant:
0:212 2 (const uint)
0:213 subgroupClusteredMul ( global 4-component vector of float)
0:213 'f4' ( in 4-component vector of float)
0:213 Constant:
0:213 2 (const uint)
0:214 subgroupClusteredMin ( global 4-component vector of float)
0:214 'f4' ( in 4-component vector of float)
0:214 Constant:
0:214 2 (const uint)
0:215 subgroupClusteredMax ( global 4-component vector of float)
0:215 'f4' ( in 4-component vector of float)
0:215 Constant:
0:215 2 (const uint)
0:216 subgroupClusteredAnd ( global 4-component vector of uint)
0:216 'ballot' ( temp 4-component vector of uint)
0:216 Constant:
0:216 2 (const uint)
0:217 subgroupClusteredOr ( global 4-component vector of uint)
0:217 'ballot' ( temp 4-component vector of uint)
0:217 Constant:
0:217 2 (const uint)
0:218 subgroupClusteredXor ( global 4-component vector of uint)
0:218 'ballot' ( temp 4-component vector of uint)
0:218 Constant:
0:218 2 (const uint)
0:222 Function Definition: quad_works(vf4; ( global void)
0:222 Function Parameters:
0:222 'f4' ( in 4-component vector of float)
0:224 Sequence
0:224 subgroupQuadBroadcast ( global 4-component vector of float)
0:224 'f4' ( in 4-component vector of float)
0:224 Constant:
0:224 0 (const uint)
0:225 subgroupQuadSwapHorizontal ( global 4-component vector of float)
0:225 'f4' ( in 4-component vector of float)
0:226 subgroupQuadSwapVertical ( global 4-component vector of float)
0:226 'f4' ( in 4-component vector of float)
0:227 subgroupQuadSwapDiagonal ( global 4-component vector of float)
0:227 'f4' ( in 4-component vector of float)
0:? Linker Objects
0:? 'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize)
0:? 32 (const uint)
0:? 1 (const uint)
0:? 1 (const uint)
0:? 'uni_image' (layout( binding=0) writeonly uniform image2D)
0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform uint uni_value})
0:? 'mem' ( shared 10-element array of 4-component vector of float)
0:? 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
Linked task stage:
Shader version: 460
Requested GL_EXT_mesh_shader
Requested GL_KHR_shader_subgroup_arithmetic
Requested GL_KHR_shader_subgroup_ballot
Requested GL_KHR_shader_subgroup_basic
Requested GL_KHR_shader_subgroup_clustered
Requested GL_KHR_shader_subgroup_quad
Requested GL_KHR_shader_subgroup_shuffle
Requested GL_KHR_shader_subgroup_shuffle_relative
Requested GL_KHR_shader_subgroup_vote
local_size = (32, 1, 1)
ERROR: node is still EOpNull!
0:102 Function Definition: main( ( global void)
0:102 Function Parameters:
0:104 Sequence
0:104 Sequence
0:104 move second child to first child ( temp uint)
0:104 'iid' ( temp uint)
0:104 direct index ( temp uint)
0:104 'gl_LocalInvocationID' ( in 3-component vector of uint LocalInvocationID)
0:104 Constant:
0:104 0 (const int)
0:105 Sequence
0:105 move second child to first child ( temp uint)
0:105 'gid' ( temp uint)
0:105 direct index ( temp uint)
0:105 'gl_WorkGroupID' ( in 3-component vector of uint WorkGroupID)
0:105 Constant:
0:105 0 (const int)
0:108 Sequence
0:108 Sequence
0:108 move second child to first child ( temp uint)
0:108 'i' ( temp uint)
0:108 Constant:
0:108 0 (const uint)
0:108 Loop with condition tested first
0:108 Loop Condition
0:108 Compare Less Than ( temp bool)
0:108 'i' ( temp uint)
0:108 Constant:
0:108 10 (const uint)
0:108 Loop Body
0:109 Sequence
0:109 move second child to first child ( temp 4-component vector of float)
0:109 indirect index ( temp 4-component vector of float)
0:109 'mem' ( shared 10-element array of 4-component vector of float)
0:109 'i' ( temp uint)
0:109 Construct vec4 ( temp 4-component vector of float)
0:109 Convert uint to float ( temp float)
0:109 add ( temp uint)
0:109 'i' ( temp uint)
0:109 uni_value: direct index for structure (layout( column_major shared) uniform uint)
0:109 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform uint uni_value})
0:109 Constant:
0:109 0 (const uint)
0:108 Loop Terminal Expression
0:108 Pre-Increment ( temp uint)
0:108 'i' ( temp uint)
0:111 imageStore ( global void)
0:111 'uni_image' (layout( binding=0) writeonly uniform image2D)
0:111 Construct ivec2 ( temp 2-component vector of int)
0:111 Convert uint to int ( temp int)
0:111 'iid' ( temp uint)
0:111 indirect index ( temp 4-component vector of float)
0:111 'mem' ( shared 10-element array of 4-component vector of float)
0:111 'gid' ( temp uint)
0:112 imageStore ( global void)
0:112 'uni_image' (layout( binding=0) writeonly uniform image2D)
0:112 Construct ivec2 ( temp 2-component vector of int)
0:112 Convert uint to int ( temp int)
0:112 'iid' ( temp uint)
0:112 indirect index ( temp 4-component vector of float)
0:112 'mem' ( shared 10-element array of 4-component vector of float)
0:112 add ( temp uint)
0:112 'gid' ( temp uint)
0:112 Constant:
0:112 1 (const uint)
0:114 MemoryBarrierShared ( global void)
0:114 Barrier ( global void)
0:118 move second child to first child ( temp 2-component vector of float)
0:118 dummy: direct index for structure ( global 2-component vector of float)
0:118 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:118 Constant:
0:118 0 (const int)
0:118 Constant:
0:118 30.000000
0:118 31.000000
0:119 move second child to first child ( temp 2-component vector of float)
0:119 direct index ( temp 2-component vector of float)
0:119 submesh: direct index for structure ( global 3-element array of 2-component vector of float)
0:119 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:119 Constant:
0:119 1 (const int)
0:119 Constant:
0:119 0 (const int)
0:119 Constant:
0:119 32.000000
0:119 33.000000
0:120 move second child to first child ( temp 2-component vector of float)
0:120 direct index ( temp 2-component vector of float)
0:120 submesh: direct index for structure ( global 3-element array of 2-component vector of float)
0:120 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:120 Constant:
0:120 1 (const int)
0:120 Constant:
0:120 1 (const int)
0:120 Constant:
0:120 34.000000
0:120 35.000000
0:121 move second child to first child ( temp 2-component vector of float)
0:121 direct index ( temp 2-component vector of float)
0:121 submesh: direct index for structure ( global 3-element array of 2-component vector of float)
0:121 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:121 Constant:
0:121 1 (const int)
0:121 Constant:
0:121 2 (const int)
0:121 indirect index ( temp 2-component vector of float)
0:121 submesh: direct index for structure ( global 3-element array of 2-component vector of float)
0:121 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})
0:121 Constant:
0:121 1 (const int)
0:121 mod ( temp uint)
0:121 'gid' ( temp uint)
0:121 Constant:
0:121 2 (const uint)
0:123 MemoryBarrierShared ( global void)
0:123 Barrier ( global void)
0:126 EmitMeshTasksEXT ( global void)
0:126 Constant:
0:126 3 (const uint)
0:126 Constant:
0:126 1 (const uint)
0:126 Constant:
0:126 1 (const uint)
0:? Linker Objects
0:? 'gl_WorkGroupSize' ( const 3-component vector of uint WorkGroupSize)
0:? 32 (const uint)
0:? 1 (const uint)
0:? 1 (const uint)
0:? 'uni_image' (layout( binding=0) writeonly uniform image2D)
0:? 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform uint uni_value})
0:? 'mem' ( shared 10-element array of 4-component vector of float)
0:? 'mytask' ( taskPayloadSharedEXT structure{ global 2-component vector of float dummy, global 3-element array of 2-component vector of float submesh})

View File

@ -1,6 +1,6 @@
glsl.autosampledtextures.frag
// Module Version 10000
// Generated by (magic number): 8000a
// Generated by (magic number): 8000b
// Id's are bound by 23
Capability Shader

View File

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

View File

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

View File

@ -0,0 +1,149 @@
glsl.es320.extTextureShadowLod.frag
Shader version: 320
Requested GL_EXT_texture_shadow_lod
0:? Sequence
0:12 Function Definition: main( ( global void)
0:12 Function Parameters:
0:14 Sequence
0:14 move second child to first child ( temp lowp float)
0:14 'c' ( out lowp float)
0:14 texture ( global lowp float)
0:14 's2da' ( uniform lowp sampler2DArrayShadow)
0:14 'tc' ( smooth in lowp 4-component vector of float)
0:14 Constant:
0:14 0.000000
0:15 move second child to first child ( temp lowp float)
0:15 'c' ( out lowp float)
0:15 texture ( global lowp float)
0:15 'sca' ( uniform lowp samplerCubeArrayShadow)
0:15 'tc' ( smooth in lowp 4-component vector of float)
0:15 Constant:
0:15 0.000000
0:15 Constant:
0:15 0.000000
0:16 move second child to first child ( temp lowp float)
0:16 'c' ( out lowp float)
0:16 textureOffset ( global lowp float)
0:16 's2da' ( uniform lowp sampler2DArrayShadow)
0:16 'tc' ( smooth in lowp 4-component vector of float)
0:16 Constant:
0:16 0 (const int)
0:16 0 (const int)
0:16 Constant:
0:16 0.000000
0:17 move second child to first child ( temp lowp float)
0:17 'c' ( out lowp float)
0:17 textureLod ( global lowp float)
0:17 's2da' ( uniform lowp sampler2DArrayShadow)
0:17 'tc' ( smooth in lowp 4-component vector of float)
0:17 Constant:
0:17 0.000000
0:18 move second child to first child ( temp lowp float)
0:18 'c' ( out lowp float)
0:18 textureLod ( global lowp float)
0:18 'sc' ( uniform lowp samplerCubeShadow)
0:18 'tc' ( smooth in lowp 4-component vector of float)
0:18 Constant:
0:18 0.000000
0:19 move second child to first child ( temp lowp float)
0:19 'c' ( out lowp float)
0:19 textureLod ( global lowp float)
0:19 'sca' ( uniform lowp samplerCubeArrayShadow)
0:19 'tc' ( smooth in lowp 4-component vector of float)
0:19 Constant:
0:19 0.000000
0:19 Constant:
0:19 0.000000
0:20 move second child to first child ( temp lowp float)
0:20 'c' ( out lowp float)
0:20 textureLodOffset ( global lowp float)
0:20 's2da' ( uniform lowp sampler2DArrayShadow)
0:20 'tc' ( smooth in lowp 4-component vector of float)
0:20 Constant:
0:20 0.000000
0:20 Constant:
0:20 0 (const int)
0:20 0 (const int)
0:? Linker Objects
0:? 's2da' ( uniform lowp sampler2DArrayShadow)
0:? 'sca' ( uniform lowp samplerCubeArrayShadow)
0:? 'sc' ( uniform lowp samplerCubeShadow)
0:? 'tc' ( smooth in lowp 4-component vector of float)
0:? 'c' ( out lowp float)
Linked fragment stage:
Shader version: 320
Requested GL_EXT_texture_shadow_lod
0:? Sequence
0:12 Function Definition: main( ( global void)
0:12 Function Parameters:
0:14 Sequence
0:14 move second child to first child ( temp lowp float)
0:14 'c' ( out lowp float)
0:14 texture ( global lowp float)
0:14 's2da' ( uniform lowp sampler2DArrayShadow)
0:14 'tc' ( smooth in lowp 4-component vector of float)
0:14 Constant:
0:14 0.000000
0:15 move second child to first child ( temp lowp float)
0:15 'c' ( out lowp float)
0:15 texture ( global lowp float)
0:15 'sca' ( uniform lowp samplerCubeArrayShadow)
0:15 'tc' ( smooth in lowp 4-component vector of float)
0:15 Constant:
0:15 0.000000
0:15 Constant:
0:15 0.000000
0:16 move second child to first child ( temp lowp float)
0:16 'c' ( out lowp float)
0:16 textureOffset ( global lowp float)
0:16 's2da' ( uniform lowp sampler2DArrayShadow)
0:16 'tc' ( smooth in lowp 4-component vector of float)
0:16 Constant:
0:16 0 (const int)
0:16 0 (const int)
0:16 Constant:
0:16 0.000000
0:17 move second child to first child ( temp lowp float)
0:17 'c' ( out lowp float)
0:17 textureLod ( global lowp float)
0:17 's2da' ( uniform lowp sampler2DArrayShadow)
0:17 'tc' ( smooth in lowp 4-component vector of float)
0:17 Constant:
0:17 0.000000
0:18 move second child to first child ( temp lowp float)
0:18 'c' ( out lowp float)
0:18 textureLod ( global lowp float)
0:18 'sc' ( uniform lowp samplerCubeShadow)
0:18 'tc' ( smooth in lowp 4-component vector of float)
0:18 Constant:
0:18 0.000000
0:19 move second child to first child ( temp lowp float)
0:19 'c' ( out lowp float)
0:19 textureLod ( global lowp float)
0:19 'sca' ( uniform lowp samplerCubeArrayShadow)
0:19 'tc' ( smooth in lowp 4-component vector of float)
0:19 Constant:
0:19 0.000000
0:19 Constant:
0:19 0.000000
0:20 move second child to first child ( temp lowp float)
0:20 'c' ( out lowp float)
0:20 textureLodOffset ( global lowp float)
0:20 's2da' ( uniform lowp sampler2DArrayShadow)
0:20 'tc' ( smooth in lowp 4-component vector of float)
0:20 Constant:
0:20 0.000000
0:20 Constant:
0:20 0 (const int)
0:20 0 (const int)
0:? Linker Objects
0:? 's2da' ( uniform lowp sampler2DArrayShadow)
0:? 'sca' ( uniform lowp samplerCubeArrayShadow)
0:? 'sc' ( uniform lowp samplerCubeShadow)
0:? 'tc' ( smooth in lowp 4-component vector of float)
0:? 'c' ( out lowp float)

View File

@ -0,0 +1,160 @@
glsl.ext.textureShadowLod.frag
ERROR: 0:24: 'texture(..., float bias)' : required extension not requested: GL_EXT_texture_shadow_lod
ERROR: 0:25: 'texture(..., float bias)' : required extension not requested: GL_EXT_texture_shadow_lod
ERROR: 0:26: 'textureOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
ERROR: 0:27: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
ERROR: 0:28: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
ERROR: 0:29: 'textureLod(..., float lod)' : required extension not requested: GL_EXT_texture_shadow_lod
ERROR: 0:30: 'textureLodOffset for sampler2DArrayShadow' : required extension not requested: GL_EXT_texture_shadow_lod
ERROR: 7 compilation errors. No code generated.
Shader version: 450
Requested GL_EXT_texture_shadow_lod
ERROR: node is still EOpNull!
0:11 Function Definition: pass( ( global void)
0:11 Function Parameters:
0:12 Sequence
0:12 move second child to first child ( temp float)
0:12 'c' ( out float)
0:12 texture ( global float)
0:12 's2da' ( uniform sampler2DArrayShadow)
0:12 'tc' ( smooth in 4-component vector of float)
0:12 Constant:
0:12 0.000000
0:13 move second child to first child ( temp float)
0:13 'c' ( out float)
0:13 texture ( global float)
0:13 'sca' ( uniform samplerCubeArrayShadow)
0:13 'tc' ( smooth in 4-component vector of float)
0:13 Constant:
0:13 0.000000
0:13 Constant:
0:13 0.000000
0:14 move second child to first child ( temp float)
0:14 'c' ( out float)
0:14 textureOffset ( global float)
0:14 's2da' ( uniform sampler2DArrayShadow)
0:14 'tc' ( smooth in 4-component vector of float)
0:14 Constant:
0:14 0 (const int)
0:14 0 (const int)
0:14 Constant:
0:14 0.000000
0:15 move second child to first child ( temp float)
0:15 'c' ( out float)
0:15 textureLod ( global float)
0:15 's2da' ( uniform sampler2DArrayShadow)
0:15 'tc' ( smooth in 4-component vector of float)
0:15 Constant:
0:15 0.000000
0:16 move second child to first child ( temp float)
0:16 'c' ( out float)
0:16 textureLod ( global float)
0:16 'sc' ( uniform samplerCubeShadow)
0:16 'tc' ( smooth in 4-component vector of float)
0:16 Constant:
0:16 0.000000
0:17 move second child to first child ( temp float)
0:17 'c' ( out float)
0:17 textureLod ( global float)
0:17 'sca' ( uniform samplerCubeArrayShadow)
0:17 'tc' ( smooth in 4-component vector of float)
0:17 Constant:
0:17 0.000000
0:17 Constant:
0:17 0.000000
0:18 move second child to first child ( temp float)
0:18 'c' ( out float)
0:18 textureLodOffset ( global float)
0:18 's2da' ( uniform sampler2DArrayShadow)
0:18 'tc' ( smooth in 4-component vector of float)
0:18 Constant:
0:18 0.000000
0:18 Constant:
0:18 0 (const int)
0:18 0 (const int)
0:22 Function Definition: fail( ( global void)
0:22 Function Parameters:
0:24 Sequence
0:24 move second child to first child ( temp float)
0:24 'c' ( out float)
0:24 texture ( global float)
0:24 's2da' ( uniform sampler2DArrayShadow)
0:24 'tc' ( smooth in 4-component vector of float)
0:24 Constant:
0:24 0.000000
0:25 move second child to first child ( temp float)
0:25 'c' ( out float)
0:25 texture ( global float)
0:25 'sca' ( uniform samplerCubeArrayShadow)
0:25 'tc' ( smooth in 4-component vector of float)
0:25 Constant:
0:25 0.000000
0:25 Constant:
0:25 0.000000
0:26 move second child to first child ( temp float)
0:26 'c' ( out float)
0:26 textureOffset ( global float)
0:26 's2da' ( uniform sampler2DArrayShadow)
0:26 'tc' ( smooth in 4-component vector of float)
0:26 Constant:
0:26 0 (const int)
0:26 0 (const int)
0:26 Constant:
0:26 0.000000
0:27 move second child to first child ( temp float)
0:27 'c' ( out float)
0:27 textureLod ( global float)
0:27 's2da' ( uniform sampler2DArrayShadow)
0:27 'tc' ( smooth in 4-component vector of float)
0:27 Constant:
0:27 0.000000
0:28 move second child to first child ( temp float)
0:28 'c' ( out float)
0:28 textureLod ( global float)
0:28 'sc' ( uniform samplerCubeShadow)
0:28 'tc' ( smooth in 4-component vector of float)
0:28 Constant:
0:28 0.000000
0:29 move second child to first child ( temp float)
0:29 'c' ( out float)
0:29 textureLod ( global float)
0:29 'sca' ( uniform samplerCubeArrayShadow)
0:29 'tc' ( smooth in 4-component vector of float)
0:29 Constant:
0:29 0.000000
0:29 Constant:
0:29 0.000000
0:30 move second child to first child ( temp float)
0:30 'c' ( out float)
0:30 textureLodOffset ( global float)
0:30 's2da' ( uniform sampler2DArrayShadow)
0:30 'tc' ( smooth in 4-component vector of float)
0:30 Constant:
0:30 0.000000
0:30 Constant:
0:30 0 (const int)
0:30 0 (const int)
0:? Linker Objects
0:? 's2da' ( uniform sampler2DArrayShadow)
0:? 'sca' ( uniform samplerCubeArrayShadow)
0:? 'sc' ( uniform samplerCubeShadow)
0:? 'c' ( out float)
0:? 'tc' ( smooth in 4-component vector of float)
Linked fragment stage:
ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point
Shader version: 450
Requested GL_EXT_texture_shadow_lod
ERROR: node is still EOpNull!
0:? Linker Objects
0:? 's2da' ( uniform sampler2DArrayShadow)
0:? 'sca' ( uniform samplerCubeArrayShadow)
0:? 'sc' ( uniform samplerCubeShadow)
0:? 'c' ( out float)
0:? 'tc' ( smooth in 4-component vector of float)

View File

@ -1,6 +1,6 @@
glspv.esversion.vert
// Module Version 10000
// Generated by (magic number): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// Id's are bound by 58
Capability Shader

View File

@ -64,7 +64,7 @@ local_size = (4, 6, 8)
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int bound})
// Module Version 10000
// Generated by (magic number): 8000a
// Generated by (magic number): 8000b
// Id's are bound by 30
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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// Id's are bound by 28
Capability Shader

View File

@ -1,6 +1,6 @@
hlsl.autosampledtextures.frag
// Module Version 10000
// Generated by (magic number): 8000a
// Generated by (magic number): 8000b
// Id's are bound by 45
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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// Id's are bound by 73
Capability Shader

View File

@ -0,0 +1,390 @@
hlsl.buffer_ref_parameter.comp
Shader version: 500
local_size = (64, 1, 1)
0:? Sequence
0:4 Function Definition: pull_position(block--u1[0]1;u1; ( temp 3-component vector of float)
0:4 Function Parameters:
0:4 'buffer_position' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:4 'vertex_id' ( in uint)
0:? Sequence
0:5 Branch: Return with expression
0:? intBitsToFloat ( temp 3-component vector of float)
0:? Sequence
0:5 move second child to first child ( temp int)
0:5 'byteAddrTemp' ( temp int)
0:5 right-shift ( temp int)
0:5 component-wise multiply ( temp uint)
0:5 component-wise multiply ( temp uint)
0:5 'vertex_id' ( in uint)
0:5 Constant:
0:5 3 (const uint)
0:5 Constant:
0:5 4 (const uint)
0:5 Constant:
0:5 2 (const int)
0:? Construct vec3 ( temp 3-component vector of uint)
0:5 indirect index ( temp uint)
0:5 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:5 'buffer_position' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:5 Constant:
0:5 0 (const uint)
0:5 'byteAddrTemp' ( temp int)
0:5 indirect index ( temp uint)
0:5 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:5 'buffer_position' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:5 Constant:
0:5 0 (const uint)
0:5 add ( temp int)
0:5 'byteAddrTemp' ( temp int)
0:5 Constant:
0:5 1 (const int)
0:5 indirect index ( temp uint)
0:5 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:5 'buffer_position' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:5 Constant:
0:5 0 (const uint)
0:5 add ( temp int)
0:5 'byteAddrTemp' ( temp int)
0:5 Constant:
0:5 2 (const int)
0:9 Function Definition: @main(u1; ( temp void)
0:9 Function Parameters:
0:9 'gi' ( in uint)
0:? Sequence
0:10 Sequence
0:10 move second child to first child ( temp 3-component vector of float)
0:10 'position_ms' ( temp 3-component vector of float)
0:10 Function Call: pull_position(block--u1[0]1;u1; ( temp 3-component vector of float)
0:10 'buffer_position_ms' (layout( set=0 binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:10 'gi' ( in uint)
0:? Sequence
0:12 move second child to first child ( temp int)
0:12 'byteAddrTemp' ( temp int)
0:12 right-shift ( temp int)
0:12 Constant:
0:12 0 (const int)
0:12 Constant:
0:12 2 (const int)
0:12 move second child to first child ( temp uint)
0:12 indirect index (layout( row_major std430) buffer uint)
0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:12 'r' (layout( set=0 binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:12 Constant:
0:12 0 (const uint)
0:12 'byteAddrTemp' ( temp int)
0:12 direct index ( temp uint)
0:12 floatBitsToUint ( temp 3-component vector of uint)
0:12 'position_ms' ( temp 3-component vector of float)
0:12 Constant:
0:12 0 (const int)
0:12 move second child to first child ( temp uint)
0:12 indirect index (layout( row_major std430) buffer uint)
0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:12 'r' (layout( set=0 binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:12 Constant:
0:12 0 (const uint)
0:12 add ( temp int)
0:12 'byteAddrTemp' ( temp int)
0:12 Constant:
0:12 1 (const int)
0:12 direct index ( temp uint)
0:12 floatBitsToUint ( temp 3-component vector of uint)
0:12 'position_ms' ( temp 3-component vector of float)
0:12 Constant:
0:12 1 (const int)
0:12 move second child to first child ( temp uint)
0:12 indirect index (layout( row_major std430) buffer uint)
0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:12 'r' (layout( set=0 binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:12 Constant:
0:12 0 (const uint)
0:12 add ( temp int)
0:12 'byteAddrTemp' ( temp int)
0:12 Constant:
0:12 2 (const int)
0:12 direct index ( temp uint)
0:12 floatBitsToUint ( temp 3-component vector of uint)
0:12 'position_ms' ( temp 3-component vector of float)
0:12 Constant:
0:12 2 (const int)
0:9 Function Definition: main( ( temp void)
0:9 Function Parameters:
0:? Sequence
0:9 move second child to first child ( temp uint)
0:? 'gi' ( temp uint)
0:? 'gi' ( in uint LocalInvocationIndex)
0:9 Function Call: @main(u1; ( temp void)
0:? 'gi' ( temp uint)
0:? Linker Objects
0:? 'buffer_position_ms' (layout( set=0 binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:? 'r' (layout( set=0 binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:? 'gi' ( in uint LocalInvocationIndex)
Linked compute stage:
Shader version: 500
local_size = (64, 1, 1)
0:? Sequence
0:4 Function Definition: pull_position(block--u1[0]1;u1; ( temp 3-component vector of float)
0:4 Function Parameters:
0:4 'buffer_position' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:4 'vertex_id' ( in uint)
0:? Sequence
0:5 Branch: Return with expression
0:? intBitsToFloat ( temp 3-component vector of float)
0:? Sequence
0:5 move second child to first child ( temp int)
0:5 'byteAddrTemp' ( temp int)
0:5 right-shift ( temp int)
0:5 component-wise multiply ( temp uint)
0:5 component-wise multiply ( temp uint)
0:5 'vertex_id' ( in uint)
0:5 Constant:
0:5 3 (const uint)
0:5 Constant:
0:5 4 (const uint)
0:5 Constant:
0:5 2 (const int)
0:? Construct vec3 ( temp 3-component vector of uint)
0:5 indirect index ( temp uint)
0:5 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:5 'buffer_position' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:5 Constant:
0:5 0 (const uint)
0:5 'byteAddrTemp' ( temp int)
0:5 indirect index ( temp uint)
0:5 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:5 'buffer_position' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:5 Constant:
0:5 0 (const uint)
0:5 add ( temp int)
0:5 'byteAddrTemp' ( temp int)
0:5 Constant:
0:5 1 (const int)
0:5 indirect index ( temp uint)
0:5 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:5 'buffer_position' (layout( row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:5 Constant:
0:5 0 (const uint)
0:5 add ( temp int)
0:5 'byteAddrTemp' ( temp int)
0:5 Constant:
0:5 2 (const int)
0:9 Function Definition: @main(u1; ( temp void)
0:9 Function Parameters:
0:9 'gi' ( in uint)
0:? Sequence
0:10 Sequence
0:10 move second child to first child ( temp 3-component vector of float)
0:10 'position_ms' ( temp 3-component vector of float)
0:10 Function Call: pull_position(block--u1[0]1;u1; ( temp 3-component vector of float)
0:10 'buffer_position_ms' (layout( set=0 binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:10 'gi' ( in uint)
0:? Sequence
0:12 move second child to first child ( temp int)
0:12 'byteAddrTemp' ( temp int)
0:12 right-shift ( temp int)
0:12 Constant:
0:12 0 (const int)
0:12 Constant:
0:12 2 (const int)
0:12 move second child to first child ( temp uint)
0:12 indirect index (layout( row_major std430) buffer uint)
0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:12 'r' (layout( set=0 binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:12 Constant:
0:12 0 (const uint)
0:12 'byteAddrTemp' ( temp int)
0:12 direct index ( temp uint)
0:12 floatBitsToUint ( temp 3-component vector of uint)
0:12 'position_ms' ( temp 3-component vector of float)
0:12 Constant:
0:12 0 (const int)
0:12 move second child to first child ( temp uint)
0:12 indirect index (layout( row_major std430) buffer uint)
0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:12 'r' (layout( set=0 binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:12 Constant:
0:12 0 (const uint)
0:12 add ( temp int)
0:12 'byteAddrTemp' ( temp int)
0:12 Constant:
0:12 1 (const int)
0:12 direct index ( temp uint)
0:12 floatBitsToUint ( temp 3-component vector of uint)
0:12 'position_ms' ( temp 3-component vector of float)
0:12 Constant:
0:12 1 (const int)
0:12 move second child to first child ( temp uint)
0:12 indirect index (layout( row_major std430) buffer uint)
0:12 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint)
0:12 'r' (layout( set=0 binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:12 Constant:
0:12 0 (const uint)
0:12 add ( temp int)
0:12 'byteAddrTemp' ( temp int)
0:12 Constant:
0:12 2 (const int)
0:12 direct index ( temp uint)
0:12 floatBitsToUint ( temp 3-component vector of uint)
0:12 'position_ms' ( temp 3-component vector of float)
0:12 Constant:
0:12 2 (const int)
0:9 Function Definition: main( ( temp void)
0:9 Function Parameters:
0:? Sequence
0:9 move second child to first child ( temp uint)
0:? 'gi' ( temp uint)
0:? 'gi' ( in uint LocalInvocationIndex)
0:9 Function Call: @main(u1; ( temp void)
0:? 'gi' ( temp uint)
0:? Linker Objects
0:? 'buffer_position_ms' (layout( set=0 binding=0 row_major std430) readonly buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:? 'r' (layout( set=0 binding=1 row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data})
0:? 'gi' ( in uint LocalInvocationIndex)
// Module Version 10400
// Generated by (magic number): 8000b
// Id's are bound by 90
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 53 62 85
ExecutionMode 4 LocalSize 64 1 1
Source HLSL 500
Name 4 "main"
Name 8 ""
MemberName 8 0 "@data"
Name 16 "pull_position(block--u1[0]1;u1;"
Name 14 "buffer_position"
Name 15 "vertex_id"
Name 20 "@main(u1;"
Name 19 "gi"
Name 24 "byteAddrTemp"
Name 52 "position_ms"
Name 53 "buffer_position_ms"
Name 54 "param"
Name 57 "byteAddrTemp"
Name 60 "r"
MemberName 60(r) 0 "@data"
Name 62 "r"
Name 83 "gi"
Name 85 "gi"
Name 87 "param"
Decorate 7 ArrayStride 4
MemberDecorate 8 0 NonWritable
MemberDecorate 8 0 Offset 0
Decorate 8 Block
Decorate 14(buffer_position) NonWritable
Decorate 53(buffer_position_ms) DescriptorSet 0
Decorate 53(buffer_position_ms) Binding 0
Decorate 59 ArrayStride 4
MemberDecorate 60(r) 0 Offset 0
Decorate 60(r) Block
Decorate 62(r) DescriptorSet 0
Decorate 62(r) Binding 1
Decorate 85(gi) BuiltIn LocalInvocationIndex
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypeRuntimeArray 6(int)
8: TypeStruct 7
9: TypePointer StorageBuffer 8(struct)
10: TypePointer Function 6(int)
11: TypeFloat 32
12: TypeVector 11(float) 3
13: TypeFunction 12(fvec3) 9(ptr) 10(ptr)
18: TypeFunction 2 10(ptr)
22: TypeInt 32 1
23: TypePointer Function 22(int)
26: 6(int) Constant 3
28: 6(int) Constant 4
30: 22(int) Constant 2
32: 22(int) Constant 0
34: TypePointer StorageBuffer 6(int)
38: 22(int) Constant 1
46: TypeVector 6(int) 3
51: TypePointer Function 12(fvec3)
53(buffer_position_ms): 9(ptr) Variable StorageBuffer
59: TypeRuntimeArray 6(int)
60(r): TypeStruct 59
61: TypePointer StorageBuffer 60(r)
62(r): 61(ptr) Variable StorageBuffer
66: 6(int) Constant 0
73: 6(int) Constant 1
80: 6(int) Constant 2
84: TypePointer Input 6(int)
85(gi): 84(ptr) Variable Input
4(main): 2 Function None 3
5: Label
83(gi): 10(ptr) Variable Function
87(param): 10(ptr) Variable Function
86: 6(int) Load 85(gi)
Store 83(gi) 86
88: 6(int) Load 83(gi)
Store 87(param) 88
89: 2 FunctionCall 20(@main(u1;) 87(param)
Return
FunctionEnd
16(pull_position(block--u1[0]1;u1;): 12(fvec3) Function None 13
14(buffer_position): 9(ptr) FunctionParameter
15(vertex_id): 10(ptr) FunctionParameter
17: Label
24(byteAddrTemp): 23(ptr) Variable Function
25: 6(int) Load 15(vertex_id)
27: 6(int) IMul 25 26
29: 6(int) IMul 27 28
31: 22(int) ShiftRightLogical 29 30
Store 24(byteAddrTemp) 31
33: 22(int) Load 24(byteAddrTemp)
35: 34(ptr) AccessChain 14(buffer_position) 32 33
36: 6(int) Load 35
37: 22(int) Load 24(byteAddrTemp)
39: 22(int) IAdd 37 38
40: 34(ptr) AccessChain 14(buffer_position) 32 39
41: 6(int) Load 40
42: 22(int) Load 24(byteAddrTemp)
43: 22(int) IAdd 42 30
44: 34(ptr) AccessChain 14(buffer_position) 32 43
45: 6(int) Load 44
47: 46(ivec3) CompositeConstruct 36 41 45
48: 12(fvec3) Bitcast 47
ReturnValue 48
FunctionEnd
20(@main(u1;): 2 Function None 18
19(gi): 10(ptr) FunctionParameter
21: Label
52(position_ms): 51(ptr) Variable Function
54(param): 10(ptr) Variable Function
57(byteAddrTemp): 23(ptr) Variable Function
55: 6(int) Load 19(gi)
Store 54(param) 55
56: 12(fvec3) FunctionCall 16(pull_position(block--u1[0]1;u1;) 53(buffer_position_ms) 54(param)
Store 52(position_ms) 56
58: 22(int) ShiftRightArithmetic 32 30
Store 57(byteAddrTemp) 58
63: 22(int) Load 57(byteAddrTemp)
64: 12(fvec3) Load 52(position_ms)
65: 46(ivec3) Bitcast 64
67: 6(int) CompositeExtract 65 0
68: 34(ptr) AccessChain 62(r) 32 63
Store 68 67
69: 22(int) Load 57(byteAddrTemp)
70: 22(int) IAdd 69 38
71: 12(fvec3) Load 52(position_ms)
72: 46(ivec3) Bitcast 71
74: 6(int) CompositeExtract 72 1
75: 34(ptr) AccessChain 62(r) 32 70
Store 75 74
76: 22(int) Load 57(byteAddrTemp)
77: 22(int) IAdd 76 30
78: 12(fvec3) Load 52(position_ms)
79: 46(ivec3) Bitcast 78
81: 6(int) CompositeExtract 79 2
82: 34(ptr) AccessChain 62(r) 32 77
Store 82 81
Return
FunctionEnd

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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// 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): 8000a
// Generated by (magic number): 8000b
// Id's are bound by 34
Capability Shader

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