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: workflow_dispatch:
push: push:
branches: 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: jobs:
linux: linux:
runs-on: ${{matrix.os.genus}} runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -32,8 +47,9 @@ jobs:
compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}] compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release] cmake_build_type: [Debug, Release]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@v2 - uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with: with:
python-version: '3.7' python-version: '3.7'
- name: Install Ubuntu Package Dependencies - name: Install Ubuntu Package Dependencies
@ -71,10 +87,11 @@ jobs:
- name: Zip - name: Zip
if: ${{ matrix.compiler.cc == 'clang' }} if: ${{ matrix.compiler.cc == 'clang' }}
env: env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
run: | run: |
cd build/install cd build/install
zip ${ARCHIVE} \ zip ${ARCHIVE} \
bin/glslang \
bin/glslangValidator \ bin/glslangValidator \
include/glslang/* \ include/glslang/* \
include/glslang/**/* \ include/glslang/**/* \
@ -92,8 +109,8 @@ jobs:
- name: Deploy - name: Deploy
if: ${{ matrix.compiler.cc == 'clang' }} if: ${{ matrix.compiler.cc == 'clang' }}
env: env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@v5 uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with: with:
script: | script: |
const script = require('.github/workflows/deploy.js') const script = require('.github/workflows/deploy.js')
@ -101,6 +118,8 @@ jobs:
macos: macos:
runs-on: ${{matrix.os.genus}} runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -108,8 +127,9 @@ jobs:
compiler: [{cc: clang, cxx: clang++}] compiler: [{cc: clang, cxx: clang++}]
cmake_build_type: [Debug, Release] cmake_build_type: [Debug, Release]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@v2 - uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with: with:
python-version: '3.7' python-version: '3.7'
- name: Install GoogleTest - name: Install GoogleTest
@ -142,10 +162,11 @@ jobs:
cd ../Test && ./runtests cd ../Test && ./runtests
- name: Zip - name: Zip
env: env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
run: | run: |
cd build/install cd build/install
zip ${ARCHIVE} \ zip ${ARCHIVE} \
bin/glslang \
bin/glslangValidator \ bin/glslangValidator \
include/glslang/* \ include/glslang/* \
include/glslang/**/* \ include/glslang/**/* \
@ -162,8 +183,100 @@ jobs:
lib/libSPIRV-Tools-opt.a lib/libSPIRV-Tools-opt.a
- name: Deploy - name: Deploy
env: env:
ARCHIVE: glslang-master-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip ARCHIVE: glslang-main-${{matrix.os.family}}-${{matrix.cmake_build_type}}.zip
uses: actions/github-script@v5 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: with:
script: | script: |
const script = require('.github/workflows/deploy.js') const script = require('.github/workflows/deploy.js')

View File

@ -10,26 +10,28 @@ on:
workflow_dispatch: workflow_dispatch:
pull_request: pull_request:
branches: branches:
- master - main
permissions: read-all
jobs: jobs:
linux: linux:
runs-on: ${{matrix.os}} runs-on: ubuntu-22.04
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-20.04]
compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}] compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release] cmake_build_type: [Debug, Release]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@v2 - uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with: with:
python-version: '3.7' python-version: '3.7'
- name: Install Ubuntu Package Dependencies - name: Setup ccache
run: | uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
sudo apt-get -qq update with:
sudo apt-get install -y clang-6.0 key: ubuntu-22-${{ matrix.cmake_build_type }}-${{ matrix.compiler.cc }}-${{matrix.compiler.cxx}}
- name: Install GoogleTest - name: Install GoogleTest
run: | run: |
# check out pre-breakage version of googletest; can be deleted when # check out pre-breakage version of googletest; can be deleted when
@ -43,35 +45,137 @@ jobs:
git reset --hard FETCH_HEAD git reset --hard FETCH_HEAD
cd ../.. cd ../..
- name: Update Glslang Sources - name: Update Glslang Sources
run: | run: ./update_glslang_sources.py
./update_glslang_sources.py - name: Configure
- name: Build run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
env: env:
CC: ${{matrix.compiler.cc}} CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}} CXX: ${{matrix.compiler.cxx}}
run: | CMAKE_GENERATOR: Ninja
mkdir build && cd build CMAKE_C_COMPILER_LAUNCHER: ccache
cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install .. CMAKE_CXX_COMPILER_LAUNCHER: ccache
make -j4 install - name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test - name: Test
run: | run: |
cd build cd build
ctest --output-on-failure && ctest --output-on-failure &&
cd ../Test && ./runtests 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: macos:
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [macos-11] os: [macos-11, macos-12]
compiler: [{cc: clang, cxx: clang++}] compiler: [{cc: clang, cxx: clang++}, {cc: gcc, cxx: g++}]
cmake_build_type: [Debug, Release] cmake_build_type: [Debug, Release]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@v2 - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with: with:
python-version: '3.7' python-version: '3.7'
- uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- name: Install GoogleTest - name: Install GoogleTest
run: | run: |
# check out pre-breakage version of googletest; can be deleted when # check out pre-breakage version of googletest; can be deleted when
@ -85,49 +189,37 @@ jobs:
git reset --hard FETCH_HEAD git reset --hard FETCH_HEAD
cd ../.. cd ../..
- name: Update Glslang Sources - name: Update Glslang Sources
run: | run: ./update_glslang_sources.py
./update_glslang_sources.py - name: Configure
- name: Build run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -G "Ninja"
env: env:
CC: ${{matrix.compiler.cc}} CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}} CXX: ${{matrix.compiler.cxx}}
run: | - name: Build
mkdir build && cd build run: cmake --build build
cmake -DCMAKE_BUILD_TYPE=${{matrix.cmake_build_type}} -DCMAKE_INSTALL_PREFIX=`pwd`/install .. - name: Install
make -j4 install run: cmake --install build --prefix build/install
- name: Test - name: Test
run: | run: |
cd build cd build
ctest --output-on-failure && ctest --output-on-failure &&
cd ../Test && ./runtests cd ../Test && ./runtests
android: windows:
runs-on: ${{matrix.os}} runs-on: ${{matrix.os.genus}}
permissions:
contents: write
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-20.04] os: [{genus: windows-2019, family: windows}]
compiler: [{cc: clang, cxx: clang++}] cmake_build_type: [Debug, Release]
cmake_build_type: [Release]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@v2 - uses: lukka/get-cmake@8be6cca406b575906541e8e3b885d46f416bba39 # v3.27.7
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with: with:
python-version: '3.7' 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 - name: Install GoogleTest
run: | run: |
# check out pre-breakage version of googletest; can be deleted when # check out pre-breakage version of googletest; can be deleted when
@ -142,16 +234,74 @@ jobs:
cd ../.. cd ../..
- name: Update Glslang Sources - name: Update Glslang Sources
run: | run: |
./update_glslang_sources.py python update_glslang_sources.py
- name: Build - name: Build
env:
CC: ${{matrix.compiler.cc}}
CXX: ${{matrix.compiler.cxx}}
run: | run: |
export ANDROID_NDK=$HOME/android-ndk cmake -S. -Bbuild -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install"
export TOOLCHAIN_PATH=$ANDROID_NDK/build/cmake/android.toolchain.cmake cmake --build build --config ${{matrix.cmake_build_type}} --target install
echo $ANDROID_NDK - name: Test
echo $TOOLCHAIN_PATH run: |
mkdir build && cd 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 .. ctest -C ${{matrix.cmake_build_type}} --output-on-failure
make -j4 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({ await github.rest.git.updateRef({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
ref: 'tags/master-tot', ref: 'tags/main-tot',
sha: context.sha sha: context.sha
}) })
} catch (error) { } catch (error) {
core.setFailed(`upload master-tot tag; ${error.name}; ${error.message}`) core.setFailed(`upload main-tot tag; ${error.name}; ${error.message}`)
} }
let release let release
@ -15,10 +15,10 @@ module.exports = async ({github, context, core}) => {
release = await github.rest.repos.getReleaseByTag({ release = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
tag: 'master-tot' tag: 'main-tot'
}) })
} catch (error) { } catch (error) {
core.setFailed(`get the master release; ${error.name}; ${error.message}`) core.setFailed(`get the main release; ${error.name}; ${error.message}`)
} }
try { try {
@ -28,7 +28,7 @@ module.exports = async ({github, context, core}) => {
release_id: release.data.id release_id: release.data.id
}) })
} catch (error) { } 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 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/googletest
External/spirv-tools External/spirv-tools
out/ out/
CMakeUserPresets.json
# GN generated files # GN generated files
.cipd/ .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. # All rights reserved.
# #
@ -53,11 +53,11 @@ $(eval $(call gen_glslang_build_info_h))
GLSLANG_OS_FLAGS := -DGLSLANG_OSINCLUDE_UNIX GLSLANG_OS_FLAGS := -DGLSLANG_OSINCLUDE_UNIX
# AMD and NV extensions are turned on by default in upstream Glslang. # 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) include $(CLEAR_VARS)
LOCAL_MODULE:=OSDependent 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_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:=glslang/OSDependent/Unix/ossource.cpp LOCAL_SRC_FILES:=glslang/OSDependent/Unix/ossource.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/OSDependent/Unix/ LOCAL_C_INCLUDES:=$(LOCAL_PATH) $(LOCAL_PATH)/glslang/OSDependent/Unix/
@ -66,7 +66,7 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE:=OGLCompiler 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_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:=OGLCompilersDLL/InitializeDll.cpp LOCAL_SRC_FILES:=OGLCompilersDLL/InitializeDll.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH)/OGLCompiler LOCAL_C_INCLUDES:=$(LOCAL_PATH)/OGLCompiler
@ -78,7 +78,7 @@ include $(BUILD_STATIC_LIBRARY)
# instead. # instead.
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE:=HLSL 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:= \ LOCAL_SRC_FILES:= \
hlsl/stub.cpp hlsl/stub.cpp
LOCAL_C_INCLUDES:=$(LOCAL_PATH) \ LOCAL_C_INCLUDES:=$(LOCAL_PATH) \
@ -93,7 +93,7 @@ $(LOCAL_PATH)/glslang/MachineIndependent/ShaderLang.cpp: \
$(GLSLANG_BUILD_INFO_H) $(GLSLANG_BUILD_INFO_H)
LOCAL_MODULE:=glslang 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_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
LOCAL_SRC_FILES:= \ LOCAL_SRC_FILES:= \
glslang/CInterface/glslang_c_interface.cpp \ glslang/CInterface/glslang_c_interface.cpp \
@ -148,7 +148,7 @@ $(LOCAL_PATH)/SPIRV/GlslangToSpv.cpp: \
$(GLSLANG_BUILD_INFO_H) $(GLSLANG_BUILD_INFO_H)
LOCAL_MODULE:=SPIRV 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:= \ LOCAL_SRC_FILES:= \
SPIRV/CInterface/spirv_c_interface.cpp \ SPIRV/CInterface/spirv_c_interface.cpp \
SPIRV/GlslangToSpv.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 spirv_tools_dir = glslang_spirv_tools_dir
if (!defined(glslang_angle)) {
glslang_angle = false
}
config("glslang_public") { config("glslang_public") {
include_dirs = [ "." ] include_dirs = [ "." ]
@ -126,6 +123,8 @@ template("glslang_sources_common") {
"SPIRV/GLSL.ext.EXT.h", "SPIRV/GLSL.ext.EXT.h",
"SPIRV/GLSL.ext.KHR.h", "SPIRV/GLSL.ext.KHR.h",
"SPIRV/GLSL.ext.NV.h", "SPIRV/GLSL.ext.NV.h",
"SPIRV/GLSL.ext.ARM.h",
"SPIRV/GLSL.ext.QCOM.h",
"SPIRV/GLSL.std.450.h", "SPIRV/GLSL.std.450.h",
"SPIRV/GlslangToSpv.cpp", "SPIRV/GlslangToSpv.cpp",
"SPIRV/GlslangToSpv.h", "SPIRV/GlslangToSpv.h",
@ -133,6 +132,7 @@ template("glslang_sources_common") {
"SPIRV/Logger.cpp", "SPIRV/Logger.cpp",
"SPIRV/Logger.h", "SPIRV/Logger.h",
"SPIRV/NonSemanticDebugPrintf.h", "SPIRV/NonSemanticDebugPrintf.h",
"SPIRV/NonSemanticShaderDebugInfo100.h",
"SPIRV/SPVRemapper.cpp", "SPIRV/SPVRemapper.cpp",
"SPIRV/SPVRemapper.h", "SPIRV/SPVRemapper.h",
"SPIRV/SpvBuilder.cpp", "SPIRV/SpvBuilder.cpp",
@ -241,9 +241,6 @@ template("glslang_sources_common") {
sources += [ "SPIRV/SpvTools.cpp" ] sources += [ "SPIRV/SpvTools.cpp" ]
defines += [ "ENABLE_OPT=1" ] defines += [ "ENABLE_OPT=1" ]
} }
if (invoker.is_angle) {
defines += [ "GLSLANG_ANGLE" ]
}
if (is_win) { if (is_win) {
sources += [ "glslang/OSDependent/Windows/ossource.cpp" ] sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
@ -292,21 +289,19 @@ template("glslang_sources_common") {
} }
glslang_sources_common("glslang_lib_sources") { glslang_sources_common("glslang_lib_sources") {
enable_opt = !glslang_angle enable_opt = true
enable_hlsl = !glslang_angle enable_hlsl = true
is_angle = glslang_angle
} }
glslang_sources_common("glslang_sources") { glslang_sources_common("glslang_sources") {
enable_opt = true enable_opt = true
enable_hlsl = true enable_hlsl = true
is_angle = false
} }
source_set("glslang_default_resource_limits_sources") { source_set("glslang_default_resource_limits_sources") {
sources = [ sources = [
"StandAlone/ResourceLimits.cpp", "glslang/ResourceLimits/ResourceLimits.cpp",
"StandAlone/ResourceLimits.h", "glslang/Public/ResourceLimits.h",
"glslang/Include/ResourceLimits.h", "glslang/Include/ResourceLimits.h",
] ]
public_configs = [ ":glslang_public" ] public_configs = [ ":glslang_public" ]

View File

@ -3,6 +3,109 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/). 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 ## 11.11.0 2022-08-11
### Other changes ### 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. # All rights reserved.
# #
@ -30,24 +30,11 @@
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE. # POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required(VERSION 3.17.2)
# increase to 3.1 once all major distributions project(glslang)
# 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)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Enable compile commands database
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Adhere to GNU filesystem layout conventions # Adhere to GNU filesystem layout conventions
include(GNUInstallDirs) include(GNUInstallDirs)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
@ -78,18 +65,10 @@ if(NOT ${SKIP_GLSLANG_INSTALL})
endif() endif()
option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON) 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 option(ENABLE_GLSLANG_JS
"If using Emscripten, build glslang.js. Otherwise, builds a sample executable for binary-size testing." OFF) "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 CMAKE_DEPENDENT_OPTION(ENABLE_EMSCRIPTEN_SINGLE_FILE
"If using Emscripten, enables SINGLE_FILE build" "If using Emscripten, enables SINGLE_FILE build"
OFF "ENABLE_GLSLANG_JS AND EMSCRIPTEN" OFF "ENABLE_GLSLANG_JS AND EMSCRIPTEN"
@ -99,11 +78,7 @@ CMAKE_DEPENDENT_OPTION(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE
OFF "ENABLE_GLSLANG_JS AND EMSCRIPTEN" OFF "ENABLE_GLSLANG_JS AND EMSCRIPTEN"
OFF) OFF)
CMAKE_DEPENDENT_OPTION(ENABLE_HLSL option(ENABLE_HLSL "Enables HLSL input support" ON)
"Enables HLSL input support"
ON "NOT ENABLE_GLSLANG_WEBMIN"
OFF)
option(ENABLE_RTTI "Enables RTTI" OFF) option(ENABLE_RTTI "Enables RTTI" OFF)
option(ENABLE_EXCEPTIONS "Enables Exceptions" OFF) option(ENABLE_EXCEPTIONS "Enables Exceptions" OFF)
option(ENABLE_OPT "Enables spirv-opt capability if present" ON) option(ENABLE_OPT "Enables spirv-opt capability if present" ON)
@ -117,18 +92,6 @@ else()
endif() endif()
option(ENABLE_CTEST "Enables testing" ON) 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) if(ENABLE_CTEST)
include(CTest) include(CTest)
endif() endif()
@ -137,13 +100,6 @@ if(ENABLE_HLSL)
add_definitions(-DENABLE_HLSL) add_definitions(-DENABLE_HLSL)
endif() endif()
if(ENABLE_GLSLANG_WEBMIN)
add_definitions(-DGLSLANG_WEB)
if(ENABLE_GLSLANG_WEBMIN_DEVEL)
add_definitions(-DGLSLANG_WEB_DEVEL)
endif()
endif()
if(WIN32) if(WIN32)
set(CMAKE_DEBUG_POSTFIX "d") set(CMAKE_DEBUG_POSTFIX "d")
option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON) option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON)
@ -151,7 +107,7 @@ if(WIN32)
include(ChooseMSVCCRT.cmake) include(ChooseMSVCCRT.cmake)
endif() endif()
add_definitions(-DGLSLANG_OSINCLUDE_WIN32) add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
elseif(UNIX) elseif(UNIX OR ANDROID)
add_definitions(-DGLSLANG_OSINCLUDE_UNIX) add_definitions(-DGLSLANG_OSINCLUDE_UNIX)
else() else()
message("unknown platform") message("unknown platform")
@ -160,7 +116,6 @@ endif()
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs 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) -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) if(NOT ENABLE_RTTI)
add_compile_options(-fno-rtti) add_compile_options(-fno-rtti)
endif() endif()
@ -171,16 +126,13 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
add_compile_options(-Werror=deprecated-copy) add_compile_options(-Werror=deprecated-copy)
endif() 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. # 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") add_link_options("-Wl,--no-undefined")
endif() endif()
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC) elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC)
add_compile_options(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs add_compile_options(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs
-Wunused-parameter -Wunused-value -Wunused-variable) -Wunused-parameter -Wunused-value -Wunused-variable)
add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over.
if(NOT ENABLE_RTTI) if(NOT ENABLE_RTTI)
add_compile_options(-fno-rtti) add_compile_options(-fno-rtti)
endif() endif()
@ -188,14 +140,12 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC)
add_compile_options(-fno-exceptions) add_compile_options(-fno-exceptions)
endif() endif()
if(NOT CMAKE_VERSION VERSION_LESS "3.13") 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. # Error if there's symbols that are not found at link time. Some linkers do not support this flag.
# add_link_options() was added in CMake 3.13 - if using an earlier if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
# version don't set this - it should be caught by presubmits anyway.
if (WIN32)
add_link_options("-Wl,--no-undefined")
else()
add_link_options("-Wl,-undefined,error") add_link_options("-Wl,-undefined,error")
elseif(NOT APPLE)
add_link_options("-Wl,--no-undefined")
endif() endif()
endif() endif()
elseif(MSVC) elseif(MSVC)
@ -227,21 +177,16 @@ if(ENABLE_GLSLANG_JS)
endif() endif()
endif() endif()
# Request C++11 # Request C++17
if(${CMAKE_VERSION} VERSION_LESS 3.1) set(CMAKE_CXX_STANDARD 17)
# CMake versions before 3.1 do not understand CMAKE_CXX_STANDARD set(CMAKE_CXX_STANDARD_REQUIRED ON)
# remove this block once CMake >=3.1 has fixated in the ecosystem set(CMAKE_CXX_EXTENSIONS OFF)
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()
function(glslang_set_link_args TARGET) function(glslang_set_link_args TARGET)
# For MinGW compiles, statically link against the GCC and C++ runtimes. # For MinGW compiles, statically link against the GCC and C++ runtimes.
# This avoids the need to ship those runtimes as DLLs. # 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 set_target_properties(${TARGET} PROPERTIES
LINK_FLAGS "-static -static-libgcc -static-libstdc++") LINK_FLAGS "-static -static-libgcc -static-libstdc++")
endif() endif()
@ -289,10 +234,9 @@ endfunction()
function(glslang_only_export_explicit_symbols target) function(glslang_only_export_explicit_symbols target)
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
target_compile_definitions(${target} PUBLIC "GLSLANG_IS_SHARED_LIBRARY=1") target_compile_definitions(${target} PUBLIC "GLSLANG_IS_SHARED_LIBRARY=1")
set_target_properties(${target} PROPERTIES CMAKE_CXX_VISIBILITY_PRESET hidden)
if(WIN32) if(WIN32)
target_compile_definitions(${target} PRIVATE "GLSLANG_EXPORTING=1") target_compile_definitions(${target} PRIVATE "GLSLANG_EXPORTING=1")
else()
target_compile_options(${target} PRIVATE "-fvisibility=hidden")
endif() endif()
endif() endif()
endfunction() endfunction()
@ -313,14 +257,30 @@ else()
endif() endif()
if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External) 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. # We depend on these for later projects, so they should come first.
add_subdirectory(External) add_subdirectory(External)
endif() endif()
option(ALLOW_EXTERNAL_SPIRV_TOOLS "Allows to build against installed SPIRV-Tools-opt" OFF)
if(NOT TARGET SPIRV-Tools-opt) 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() endif()
if(ENABLE_OPT) if(ENABLE_OPT)
@ -355,12 +315,12 @@ if(ENABLE_CTEST AND BUILD_TESTING)
endif() endif()
if (CMAKE_CONFIGURATION_TYPES) if (CMAKE_CONFIGURATION_TYPES)
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/localResults) set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/localResults)
set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/glslangValidator) set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/glslang)
set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/spirv-remap) set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIG>/spirv-remap)
else() else()
set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults) 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) set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
endif() endif()
@ -372,34 +332,42 @@ endif()
if(ENABLE_GLSLANG_INSTALL) if(ENABLE_GLSLANG_INSTALL)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake.in" [=[ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake.in" [=[
@PACKAGE_INIT@ @PACKAGE_INIT@
@INSTALL_CONFIG_UNIX@
include("@PACKAGE_PATH_EXPORT_TARGETS@") 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( configure_package_config_file(
"${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake"
PATH_VARS PATH_VARS
PATH_EXPORT_TARGETS 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" write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/glslang-config-version.cmake"
VERSION ${GLSLANG_VERSION} VERSION ${GLSLANG_VERSION}
COMPATIBILITY SameMajorVersion COMPATIBILITY SameMajorVersion
) )
install( install(
EXPORT glslang-targets EXPORT glslang-targets
NAMESPACE "glslang::" NAMESPACE "glslang::"
DESTINATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
) )
install( install(
FILES FILES
"${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/glslang-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/glslang-config-version.cmake" "${CMAKE_CURRENT_BINARY_DIR}/glslang-config-version.cmake"
DESTINATION 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}) source_group("Source" FILES ${SOURCES})
endif(WIN32) endif(WIN32)
if(ENABLE_GLSLANG_INSTALL) if(ENABLE_GLSLANG_INSTALL AND NOT BUILD_SHARED_LIBS)
install(TARGETS OGLCompiler EXPORT glslang-targets) install(TARGETS OGLCompiler EXPORT glslang-targets)
# Backward compatibility # 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.\") message(WARNING \"Using `OGLCompilerTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::OGLCompiler) 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() endif()
add_library(OGLCompiler ALIAS glslang::OGLCompiler) add_library(OGLCompiler ALIAS glslang::OGLCompiler)
") ")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/OGLCompilerTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) 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. // 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 { 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 } // end namespace glslang

View File

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

View File

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

View File

@ -1,26 +1,19 @@
# News # 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), ```sh
Microsoft Visual Studio 2013 is no longer officially supported. \ git branch -m master main
Please upgrade to at least Visual Studio 2015. 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: ![Continuous Integration](https://github.com/KhronosGroup/glslang/actions/workflows/continuous_integration.yml/badge.svg)
**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 Deployment](https://github.com/KhronosGroup/glslang/actions/workflows/continuous_deployment.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 # Glslang Components and Status
@ -55,7 +48,7 @@ An API for getting reflection information from the AST, reflection types/variabl
### Standalone Wrapper ### Standalone Wrapper
`glslangValidator` is command-line tool for accessing the functionality above. `glslang` is command-line tool for accessing the functionality above.
Status: Complete. Status: Complete.
@ -73,7 +66,7 @@ The above page, while not kept up to date, includes additional information regar
## Execution of Standalone Wrapper ## 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, 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. and it will print out warnings/errors and optionally an AST.
@ -99,15 +92,15 @@ There is also a non-shader extension:
## Building (CMake) ## Building (CMake)
Instead of building manually, you can also download the binaries for your 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 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. branch.
### Dependencies ### Dependencies
* A C++11 compiler. * A C++17 compiler.
(For MSVS: use 2015 or later.) (For MSVS: use 2019 or later.)
* [CMake][cmake]: for generating compilation targets. * [CMake][cmake]: for generating compilation targets.
* make: _Linux_, ninja is an alternative, if configured. * 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.) * [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: The command to rebuild is:
```bash ```bash
m4 -P MachineIndependent/glslang.m4 > MachineIndependent/glslang.y
bison --defines=MachineIndependent/glslang_tab.cpp.h bison --defines=MachineIndependent/glslang_tab.cpp.h
-t MachineIndependent/glslang.y -t MachineIndependent/glslang.y
-o MachineIndependent/glslang_tab.cpp -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. 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 to WASM for the Web and Node
### Building a standalone JS/WASM library 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: Bash-like environments:
+ [Instructions located here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install) + [Instructions located here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install)
* Wrap cmake call: `emcmake cmake` * 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. * Set `-DENABLE_HLSL=OFF` if HLSL is not needed.
* For a standalone JS/WASM library, turn on `-DENABLE_GLSLANG_JS=ON`. * 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 * To get a fully minimized build, make sure to use `brotli` to compress the .js
and .wasm files and .wasm files
@ -277,7 +261,7 @@ Example:
```sh ```sh
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON \ 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 ## 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. 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 ```c
std::vector<uint32_t> compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const char* shaderSource, const char* fileName) #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 = { const glslang_input_t input = {
.language = GLSLANG_SOURCE_GLSL, .language = GLSLANG_SOURCE_GLSL,
.stage = stage, .stage = stage,
@ -449,18 +442,22 @@ std::vector<uint32_t> compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const c
.force_default_version_and_profile = false, .force_default_version_and_profile = false,
.forward_compatible = false, .forward_compatible = false,
.messages = GLSLANG_MSG_DEFAULT_BIT, .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); glslang_shader_t* shader = glslang_shader_create(&input);
SpirVBinary bin = {
.words = NULL,
.size = 0,
};
if (!glslang_shader_preprocess(shader, &input)) { if (!glslang_shader_preprocess(shader, &input)) {
printf("GLSL preprocessing failed %s\n", fileName); printf("GLSL preprocessing failed %s\n", fileName);
printf("%s\n", glslang_shader_get_info_log(shader)); printf("%s\n", glslang_shader_get_info_log(shader));
printf("%s\n", glslang_shader_get_info_debug_log(shader)); printf("%s\n", glslang_shader_get_info_debug_log(shader));
printf("%s\n", input.code); printf("%s\n", input.code);
glslang_shader_delete(shader); glslang_shader_delete(shader);
return std::vector<uint32_t>(); return bin;
} }
if (!glslang_shader_parse(shader, &input)) { 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_info_debug_log(shader));
printf("%s\n", glslang_shader_get_preprocessed_code(shader)); printf("%s\n", glslang_shader_get_preprocessed_code(shader));
glslang_shader_delete(shader); glslang_shader_delete(shader);
return std::vector<uint32_t>(); return bin;
} }
glslang_program_t* program = glslang_program_create(); 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)); printf("%s\n", glslang_program_get_info_debug_log(program));
glslang_program_delete(program); glslang_program_delete(program);
glslang_shader_delete(shader); glslang_shader_delete(shader);
return std::vector<uint32_t>(); return bin;
} }
glslang_program_SPIRV_generate(program, stage); glslang_program_SPIRV_generate(program, stage);
std::vector<uint32_t> outShaderModule(glslang_program_SPIRV_get_size(program)); bin.size = glslang_program_SPIRV_get_size(program);
glslang_program_SPIRV_get(program, outShaderModule.data()); 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); const char* spirv_messages = glslang_program_SPIRV_get_messages(program);
if (spirv_messages) if (spirv_messages)
@ -496,7 +494,7 @@ std::vector<uint32_t> compileShaderToSPIRV_Vulkan(glslang_stage_t stage, const c
glslang_program_delete(program); glslang_program_delete(program);
glslang_shader_delete(shader); 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/ [bison]: https://www.gnu.org/software/bison/
[googletest]: https://github.com/google/googletest [googletest]: https://github.com/google/googletest
[bison-gnu-win32]: http://gnuwin32.sourceforge.net/packages/bison.htm [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; return EShLangFragment;
case GLSLANG_STAGE_COMPUTE: case GLSLANG_STAGE_COMPUTE:
return EShLangCompute; return EShLangCompute;
case GLSLANG_STAGE_RAYGEN_NV: case GLSLANG_STAGE_RAYGEN:
return EShLangRayGen; return EShLangRayGen;
case GLSLANG_STAGE_INTERSECT_NV: case GLSLANG_STAGE_INTERSECT:
return EShLangIntersect; return EShLangIntersect;
case GLSLANG_STAGE_ANYHIT_NV: case GLSLANG_STAGE_ANYHIT:
return EShLangAnyHit; return EShLangAnyHit;
case GLSLANG_STAGE_CLOSESTHIT_NV: case GLSLANG_STAGE_CLOSESTHIT:
return EShLangClosestHit; return EShLangClosestHit;
case GLSLANG_STAGE_MISS_NV: case GLSLANG_STAGE_MISS:
return EShLangMiss; return EShLangMiss;
case GLSLANG_STAGE_CALLABLE_NV: case GLSLANG_STAGE_CALLABLE:
return EShLangCallable; return EShLangCallable;
case GLSLANG_STAGE_TASK_NV: case GLSLANG_STAGE_TASK:
return EShLangTaskNV; return EShLangTask;
case GLSLANG_STAGE_MESH_NV: case GLSLANG_STAGE_MESH:
return EShLangMeshNV; return EShLangMesh;
default: default:
break; break;
} }
@ -86,10 +86,13 @@ GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, g
glslang_spv_options_t spv_options; glslang_spv_options_t spv_options;
spv_options.generate_debug_info = false; spv_options.generate_debug_info = false;
spv_options.strip_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.disable_optimizer = true;
spv_options.optimize_size = false; spv_options.optimize_size = false;
spv_options.disassemble = false; spv_options.disassemble = false;
spv_options.validate = true; spv_options.validate = true;
spv_options.compile_only = false;
glslang_program_SPIRV_generate_with_options(program, stage, &spv_options); glslang_program_SPIRV_generate_with_options(program, stage, &spv_options);
} }

View File

@ -62,15 +62,20 @@ set(HEADERS
disassemble.h disassemble.h
GLSL.ext.AMD.h GLSL.ext.AMD.h
GLSL.ext.NV.h GLSL.ext.NV.h
NonSemanticDebugPrintf.h) GLSL.ext.ARM.h
NonSemanticDebugPrintf.h
NonSemanticShaderDebugInfo100.h)
set(SPVREMAP_HEADERS set(SPVREMAP_HEADERS
SPVRemapper.h SPVRemapper.h
doc.h) doc.h)
add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS}) add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
set_property(TARGET SPIRV PROPERTY FOLDER glslang) set_target_properties(SPIRV PROPERTIES
set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) FOLDER glslang
POSITION_INDEPENDENT_CODE ON
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}")
target_include_directories(SPIRV PUBLIC target_include_directories(SPIRV PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
@ -79,8 +84,11 @@ glslang_add_build_info_dependency(SPIRV)
if (ENABLE_SPVREMAPPER) if (ENABLE_SPVREMAPPER)
add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) set_target_properties(SPVRemapper PROPERTIES
set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON) FOLDER glslang
POSITION_INDEPENDENT_CODE ON
VERSION "${GLSLANG_VERSION}"
SOVERSION "${GLSLANG_VERSION_MAJOR}")
endif() endif()
if(WIN32 AND BUILD_SHARED_LIBS) 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.\") message(WARNING \"Using `SPVRemapperTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::SPVRemapper) 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() endif()
add_library(SPVRemapper ALIAS glslang::SPVRemapper) 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.\") message(WARNING \"Using `SPIRVTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::SPIRV) 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() endif()
add_library(SPIRV ALIAS glslang::SPIRV) 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_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_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_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 #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_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_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_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 #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 //SPV_NV_shader_sm_builtins
const char* const E_SPV_NV_shader_sm_builtins = "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 #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 ** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND ** 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 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** 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); SpvOptions* options = nullptr);
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv, void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger* logger, SpvOptions* options = nullptr); spv::SpvBuildLogger* logger, SpvOptions* options = nullptr);
void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName); bool 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 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 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
#ifndef GLSLANG_WEB
#include "Logger.h" #include "Logger.h"
#include <algorithm> #include <algorithm>
@ -68,5 +66,3 @@ std::string SpvBuildLogger::getAllMessages() const {
} }
} // end spv namespace } // end spv namespace
#endif

View File

@ -46,14 +46,6 @@ class SpvBuildLogger {
public: public:
SpvBuildLogger() {} 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. // Registers a TBD functionality.
void tbdFunctionality(const std::string& f); void tbdFunctionality(const std::string& f);
// Registers a missing functionality. // Registers a missing functionality.
@ -67,7 +59,6 @@ public:
// Returns all messages accumulated in the order of: // Returns all messages accumulated in the order of:
// TBD functionalities, missing functionalities, warnings, errors. // TBD functionalities, missing functionalities, warnings, errors.
std::string getAllMessages() const; std::string getAllMessages() const;
#endif
private: private:
SpvBuildLogger(const SpvBuildLogger&); SpvBuildLogger(const SpvBuildLogger&);

View File

@ -1,5 +1,5 @@
// Copyright (c) 2020 The Khronos Group Inc. // Copyright (c) 2020 The Khronos Group Inc.
// //
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the // copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including // "Materials"), to deal in the Materials without restriction, including
@ -7,15 +7,15 @@
// distribute, sublicense, and/or sell copies of the Materials, and to // distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to // permit persons to whom the Materials are furnished to do so, subject to
// the following conditions: // the following conditions:
// //
// The above copyright notice and this permission notice shall be included // The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials. // in all copies or substantial portions of the Materials.
// //
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS // MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS // KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT // SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
// https://www.khronos.org/registry/ // https://www.khronos.org/registry/
// //
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@ -23,7 +23,7 @@
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
// //
#ifndef SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_ #ifndef SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_
#define 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 "SPVRemapper.h"
#include "doc.h" #include "doc.h"
#if !defined (use_cpp11)
// ... not supported before C++11
#else // defined (use_cpp11)
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include "../glslang/Include/Common.h" #include "../glslang/Include/Common.h"
@ -684,6 +680,7 @@ namespace spv {
case spv::OperandKernelEnqueueFlags: case spv::OperandKernelEnqueueFlags:
case spv::OperandKernelProfilingInfo: case spv::OperandKernelProfilingInfo:
case spv::OperandCapability: case spv::OperandCapability:
case spv::OperandCooperativeMatrixOperands:
++word; ++word;
break; break;
@ -1528,5 +1525,3 @@ namespace spv {
} // namespace SPV } // namespace SPV
#endif // defined (use_cpp11)

View File

@ -43,12 +43,6 @@
namespace spv { 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 class spirvbin_base_t
{ {
public: public:
@ -74,27 +68,6 @@ public:
} // namespace SPV } // 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 <functional>
#include <cstdint> #include <cstdint>
#include <unordered_map> #include <unordered_map>
@ -308,5 +281,4 @@ private:
} // namespace SPV } // namespace SPV
#endif // defined (use_cpp11)
#endif // SPIRVREMAPPER_H #endif // SPIRVREMAPPER_H

File diff suppressed because it is too large Load Diff

View File

@ -50,6 +50,10 @@
#include "Logger.h" #include "Logger.h"
#include "spirv.hpp" #include "spirv.hpp"
#include "spvIR.h" #include "spvIR.h"
namespace spv {
#include "GLSL.ext.KHR.h"
#include "NonSemanticShaderDebugInfo100.h"
}
#include <algorithm> #include <algorithm>
#include <map> #include <map>
@ -82,7 +86,7 @@ public:
void setSource(spv::SourceLanguage lang, int version) void setSource(spv::SourceLanguage lang, int version)
{ {
source = lang; sourceLang = lang;
sourceVersion = version; sourceVersion = version;
} }
spv::Id getStringId(const std::string& str) spv::Id getStringId(const std::string& str)
@ -99,18 +103,32 @@ public:
stringIds[file_c_str] = strId; stringIds[file_c_str] = strId;
return strId; return strId;
} }
spv::Id getSourceFile() const spv::Id getSourceFile() const
{ {
return sourceFileStringId; return sourceFileStringId;
} }
void setSourceFile(const std::string& file) void setSourceFile(const std::string& file)
{ {
sourceFileStringId = getStringId(file); sourceFileStringId = getStringId(file);
currentFileId = sourceFileStringId;
} }
void setSourceText(const std::string& text) { sourceText = text; } void setSourceText(const std::string& text) { sourceText = text; }
void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); } void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); }
void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); } void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
void setEmitOpLines() { emitOpLines = true; } 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 addExtension(const char* ext) { extensions.insert(ext); }
void removeExtension(const char* ext) void removeExtension(const char* ext)
{ {
@ -163,10 +181,11 @@ public:
void setLine(int line, const char* filename); void setLine(int line, const char* filename);
// Low-level OpLine. See setLine() for a layered helper. // Low-level OpLine. See setLine() for a layered helper.
void addLine(Id fileName, int line, int column); 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). // For creating new types (will return old type if the requested one was already made).
Id makeVoidType(); Id makeVoidType();
Id makeBoolType(); Id makeBoolType(bool const compilerGenerated = true);
Id makePointer(StorageClass, Id pointee); Id makePointer(StorageClass, Id pointee);
Id makeForwardPointer(StorageClass); Id makeForwardPointer(StorageClass);
Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee); Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee);
@ -174,7 +193,7 @@ public:
Id makeIntType(int width) { return makeIntegerType(width, true); } Id makeIntType(int width) { return makeIntegerType(width, true); }
Id makeUintType(int width) { return makeIntegerType(width, false); } Id makeUintType(int width) { return makeIntegerType(width, false); }
Id makeFloatType(int width); 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 makeStructResultType(Id type0, Id type1);
Id makeVectorType(Id component, int size); Id makeVectorType(Id component, int size);
Id makeMatrixType(Id component, int cols, int rows); 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 makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format);
Id makeSamplerType(); Id makeSamplerType();
Id makeSampledImageType(Id imageType); 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); 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 // accelerationStructureNV type
Id makeAccelerationStructureType(); Id makeAccelerationStructureType();
// rayQueryEXT type // rayQueryEXT type
Id makeRayQueryType(); Id makeRayQueryType();
// hitObjectNV type
Id makeHitObjectNVType();
// For querying about types. // For querying about types.
Id getTypeId(Id resultId) const { return module.getTypeId(resultId); } Id getTypeId(Id resultId) const { return module.getTypeId(resultId); }
@ -208,6 +261,7 @@ public:
ImageFormat getImageTypeFormat(Id typeId) const ImageFormat getImageTypeFormat(Id typeId) const
{ return (ImageFormat)module.getInstruction(typeId)->getImmediateOperand(6); } { return (ImageFormat)module.getInstruction(typeId)->getImmediateOperand(6); }
Id getResultingAccessChainType() const; 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 isPointer(Id resultId) const { return isPointerType(getTypeId(resultId)); }
bool isScalar(Id resultId) const { return isScalarType(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 isMatrixType(Id typeId) const { return getTypeClass(typeId) == OpTypeMatrix; }
bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; } bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; }
bool isArrayType(Id typeId) const { return getTypeClass(typeId) == OpTypeArray; } bool isArrayType(Id typeId) const { return getTypeClass(typeId) == OpTypeArray; }
#ifdef GLSLANG_WEB bool isCooperativeMatrixType(Id typeId)const
bool isCooperativeMatrixType(Id typeId)const { return false; } {
#else return getTypeClass(typeId) == OpTypeCooperativeMatrixKHR || getTypeClass(typeId) == OpTypeCooperativeMatrixNV;
bool isCooperativeMatrixType(Id typeId)const { return getTypeClass(typeId) == OpTypeCooperativeMatrixNV; } }
#endif
bool isAggregateType(Id typeId) const bool isAggregateType(Id typeId) const
{ return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); } { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; } 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. // See if a resultId is valid for use as an initializer.
bool isValidInitializer(Id resultId) const { return isConstant(resultId) || isGlobalVariable(resultId); } bool isValidInitializer(Id resultId) const { return isConstant(resultId) || isGlobalVariable(resultId); }
bool isRayTracingOpCode(Op opcode) const;
int getScalarTypeWidth(Id typeId) const int getScalarTypeWidth(Id typeId) const
{ {
Id scalarTypeId = getScalarTypeId(typeId); Id scalarTypeId = getScalarTypeId(typeId);
@ -322,6 +377,8 @@ public:
Id makeFloat16Constant(float f16, bool specConstant = false); Id makeFloat16Constant(float f16, bool specConstant = false);
Id makeFpConstant(Id type, double d, 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. // 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); 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 char*);
void addDecoration(Id, Decoration, const std::vector<unsigned>& literals); void addDecoration(Id, Decoration, const std::vector<unsigned>& literals);
void addDecoration(Id, Decoration, const std::vector<const char*>& strings); 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, Id idDecoration);
void addDecorationId(Id id, Decoration, const std::vector<Id>& operandIds); void addDecorationId(Id id, Decoration, const std::vector<Id>& operandIds);
void addMemberDecoration(Id, unsigned int member, Decoration, int num = -1); 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); 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? // 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; } Block* getBuildPoint() const { return buildPoint; }
// Make the entry-point function. The returned pointer is only valid // Make the entry-point function. The returned pointer is only valid
@ -355,12 +418,23 @@ public:
// Return the function, pass back the entry. // Return the function, pass back the entry.
// The returned pointer is only valid for the lifetime of this builder. // The returned pointer is only valid for the lifetime of this builder.
Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, 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 // 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. // code. In the case of an implicit return, no post-return block is inserted.
void makeReturn(bool implicit, Id retVal = 0); 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. // Generate all the code needed to finish up a function.
void leaveFunction(); void leaveFunction();
@ -368,9 +442,13 @@ public:
// discard, terminate-invocation, terminateRayEXT, or ignoreIntersectionEXT // discard, terminate-invocation, terminateRayEXT, or ignoreIntersectionEXT
void makeStatementTerminator(spv::Op opcode, const char *name); 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. // Create a global or function local or IO variable.
Id createVariable(Decoration precision, StorageClass, Id type, const char* name = nullptr, Id createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name = nullptr,
Id initializer = NoResult); Id initializer = NoResult, bool const compilerGenerated = true);
// Create an intermediate with an undefined value. // Create an intermediate with an undefined value.
Id createUndefined(Id type); Id createUndefined(Id type);
@ -390,8 +468,10 @@ public:
// Create an OpArrayLength instruction // Create an OpArrayLength instruction
Id createArrayLength(Id base, unsigned int member); Id createArrayLength(Id base, unsigned int member);
// Create an OpCooperativeMatrixLengthKHR instruction
Id createCooperativeMatrixLengthKHR(Id type);
// Create an OpCooperativeMatrixLengthNV instruction // Create an OpCooperativeMatrixLengthNV instruction
Id createCooperativeMatrixLength(Id type); Id createCooperativeMatrixLengthNV(Id type);
// Create an OpCompositeExtract instruction // Create an OpCompositeExtract instruction
Id createCompositeExtract(Id composite, Id typeId, unsigned index); Id createCompositeExtract(Id composite, Id typeId, unsigned index);
@ -626,11 +706,6 @@ public:
// Accumulate whether anything in the chain of structures has coherent decorations. // Accumulate whether anything in the chain of structures has coherent decorations.
struct CoherentFlags { struct CoherentFlags {
CoherentFlags() { clear(); } 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 isVolatile() const { return volatil; }
bool isNonUniform() const { return nonUniform; } bool isNonUniform() const { return nonUniform; }
bool anyCoherent() const { bool anyCoherent() const {
@ -675,7 +750,6 @@ public:
nonUniform |= other.nonUniform; nonUniform |= other.nonUniform;
return *this; return *this;
} }
#endif
}; };
CoherentFlags coherentFlags; CoherentFlags coherentFlags;
}; };
@ -756,19 +830,17 @@ public:
// Add capabilities, extensions, remove unneeded decorations, etc., // Add capabilities, extensions, remove unneeded decorations, etc.,
// based on the resulting SPIR-V. // based on the resulting SPIR-V.
void postProcess(); void postProcess(bool compileOnly);
// Prune unreachable blocks in the CFG and remove unneeded decorations. // Prune unreachable blocks in the CFG and remove unneeded decorations.
void postProcessCFG(); void postProcessCFG();
#ifndef GLSLANG_WEB
// Add capabilities, extensions based on instructions in the module. // Add capabilities, extensions based on instructions in the module.
void postProcessFeatures(); void postProcessFeatures();
// Hook to visit each instruction in a block in a function // Hook to visit each instruction in a block in a function
void postProcess(Instruction&); void postProcess(Instruction&);
// Hook to visit each non-32-bit sized float/int operation in a block. // Hook to visit each non-32-bit sized float/int operation in a block.
void postProcessType(const Instruction&, spv::Id typeId); void postProcessType(const Instruction&, spv::Id typeId);
#endif
void dump(std::vector<unsigned int>&) const; void dump(std::vector<unsigned int>&) const;
@ -805,13 +877,23 @@ public:
const; const;
unsigned int spvVersion; // the version of SPIR-V to emit in the header unsigned int spvVersion; // the version of SPIR-V to emit in the header
SourceLanguage source; SourceLanguage sourceLang;
int sourceVersion; int sourceVersion;
spv::Id sourceFileStringId; 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; std::string sourceText;
int currentLine; int currentLine;
const char* currentFile; const char* currentFile;
spv::Id currentFileId;
std::stack<spv::Id> currentDebugScopeId;
spv::Id lastDebugScopeId;
bool emitOpLines; bool emitOpLines;
bool emitNonSemanticShaderDebugInfo;
bool restoreNonSemanticShaderDebugInfo;
bool emitNonSemanticShaderDebugSource;
std::set<std::string> extensions; std::set<std::string> extensions;
std::vector<const char*> sourceExtensions; std::vector<const char*> sourceExtensions;
std::vector<const char*> moduleProcesses; std::vector<const char*> moduleProcesses;
@ -845,6 +927,8 @@ public:
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedStructConstants; std::unordered_map<unsigned int, std::vector<Instruction*>> groupedStructConstants;
// map type opcodes to type instructions // map type opcodes to type instructions
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedTypes; 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 // list of OpConstantNull instructions
std::vector<Instruction*> nullConstants; std::vector<Instruction*> nullConstants;
@ -860,6 +944,12 @@ public:
// map from include file name ids to their contents // map from include file name ids to their contents
std::map<spv::Id, const std::string*> includeFiles; 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. // The stream for outputting warnings and errors.
SpvBuildLogger* logger; SpvBuildLogger* logger;
}; // end Builder class }; // end Builder class

View File

@ -52,11 +52,12 @@ namespace spv {
#include "GLSL.ext.EXT.h" #include "GLSL.ext.EXT.h"
#include "GLSL.ext.AMD.h" #include "GLSL.ext.AMD.h"
#include "GLSL.ext.NV.h" #include "GLSL.ext.NV.h"
#include "GLSL.ext.ARM.h"
#include "GLSL.ext.QCOM.h"
} }
namespace spv { namespace spv {
#ifndef GLSLANG_WEB
// Hook to visit each operand type and result type of an instruction. // Hook to visit each operand type and result type of an instruction.
// Will be called multiple times for one instruction, once for each typed // Will be called multiple times for one instruction, once for each typed
// operand and the result. // operand and the result.
@ -333,7 +334,6 @@ void Builder::postProcess(Instruction& inst)
} }
} }
} }
#endif
// comment in header // comment in header
void Builder::postProcessCFG() void Builder::postProcessCFG()
@ -394,7 +394,6 @@ void Builder::postProcessCFG()
decorations.end()); decorations.end());
} }
#ifndef GLSLANG_WEB
// comment in header // comment in header
void Builder::postProcessFeatures() { void Builder::postProcessFeatures() {
// Add per-instruction capabilities, extensions, etc., // Add per-instruction capabilities, extensions, etc.,
@ -482,14 +481,15 @@ void Builder::postProcessFeatures() {
} }
} }
} }
#endif
// comment in header // comment in header
void Builder::postProcess() { void Builder::postProcess(bool compileOnly)
postProcessCFG(); {
#ifndef GLSLANG_WEB // postProcessCFG needs an entrypoint to determine what is reachable, but if we are not creating an "executable" shader, we don't have an entrypoint
postProcessFeatures(); if (!compileOnly)
#endif postProcessCFG();
postProcessFeatures();
} }
}; // end spv namespace }; // end spv namespace

View File

@ -212,7 +212,7 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
optimizer.RegisterPass(spvtools::CreateInterpolateFixupPass()); optimizer.RegisterPass(spvtools::CreateInterpolateFixupPass());
if (options->optimizeSize) { if (options->optimizeSize) {
optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass()); optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsPass()); optimizer.RegisterPass(spvtools::CreateEliminateDeadInputComponentsSafePass());
} }
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass()); optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
@ -223,6 +223,56 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); 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 // 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 // SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if
// optimization is disabled. // optimization is disabled.

View File

@ -53,18 +53,22 @@
namespace glslang { namespace glslang {
struct SpvOptions { struct SpvOptions {
SpvOptions() : generateDebugInfo(false), stripDebugInfo(false), disableOptimizer(true), bool generateDebugInfo {false};
optimizeSize(false), disassemble(false), validate(false) { } bool stripDebugInfo {false};
bool generateDebugInfo; bool disableOptimizer {true};
bool stripDebugInfo; bool optimizeSize {false};
bool disableOptimizer; bool disassemble {false};
bool optimizeSize; bool validate {false};
bool disassemble; bool emitNonSemanticShaderDebugInfo {false};
bool validate; bool emitNonSemanticShaderDebugSource{ false };
bool compileOnly{false};
}; };
#if ENABLE_OPT #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. // 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); 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, void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
spv::SpvBuildLogger*, const SpvOptions*); 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 // 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 // SpirvToolsTransform if spvOptions->stripDebugInfo is set, but can be called separately if
// optimization is disabled. // optimization is disabled.

View File

@ -54,6 +54,9 @@ namespace spv {
#include "GLSL.std.450.h" #include "GLSL.std.450.h"
#include "GLSL.ext.AMD.h" #include "GLSL.ext.AMD.h"
#include "GLSL.ext.NV.h" #include "GLSL.ext.NV.h"
#include "GLSL.ext.ARM.h"
#include "NonSemanticShaderDebugInfo100.h"
#include "GLSL.ext.QCOM.h"
} }
} }
const char* GlslStd450DebugNames[spv::GLSLstd450Count]; const char* GlslStd450DebugNames[spv::GLSLstd450Count];
@ -62,6 +65,7 @@ namespace spv {
static const char* GLSLextAMDGetDebugNames(const char*, unsigned); static const char* GLSLextAMDGetDebugNames(const char*, unsigned);
static const char* GLSLextNVGetDebugNames(const char*, unsigned); static const char* GLSLextNVGetDebugNames(const char*, unsigned);
static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned);
static void Kill(std::ostream& out, const char* message) static void Kill(std::ostream& out, const char* message)
{ {
@ -76,6 +80,7 @@ enum ExtInstSet {
GLSLextNVInst, GLSLextNVInst,
OpenCLExtInst, OpenCLExtInst,
NonSemanticDebugPrintfExtInst, NonSemanticDebugPrintfExtInst,
NonSemanticShaderDebugInfo100
}; };
// Container class for a single instance of a SPIR-V stream, with methods for disassembly. // 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; extInstSet = OpenCLExtInst;
} else if (strcmp("NonSemantic.DebugPrintf", name) == 0) { } else if (strcmp("NonSemantic.DebugPrintf", name) == 0) {
extInstSet = NonSemanticDebugPrintfExtInst; extInstSet = NonSemanticDebugPrintfExtInst;
} else if (strcmp("NonSemantic.Shader.DebugInfo.100", name) == 0) {
extInstSet = NonSemanticShaderDebugInfo100;
} else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 || } 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_trinary_minmax, name) == 0 ||
strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, 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 || } 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_geometry_shader_passthrough, name) == 0 ||
strcmp(spv::E_SPV_NV_viewport_array2, 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_fragment_shader_barycentric, name) == 0 ||
strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) { strcmp(spv::E_SPV_NV_mesh_shader, name) == 0) {
extInstSet = GLSLextNVInst; extInstSet = GLSLextNVInst;
@ -526,6 +533,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")"; out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")";
} else if (extInstSet == NonSemanticDebugPrintfExtInst) { } else if (extInstSet == NonSemanticDebugPrintfExtInst) {
out << "(DebugPrintf)"; out << "(DebugPrintf)";
} else if (extInstSet == NonSemanticShaderDebugInfo100) {
out << "(" << NonSemanticShaderDebugInfo100GetDebugNames(entrypoint) << ")";
} }
} }
break; break;
@ -749,6 +758,59 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint)
return "Bad"; 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) void Disassemble(std::ostream& out, const std::vector<unsigned int>& stream)
{ {
SpirvStream SpirvStream(out, 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, OperandKernelEnqueueFlags,
OperandKernelProfilingInfo, OperandKernelProfilingInfo,
OperandCapability, OperandCapability,
OperandCooperativeMatrixOperands,
OperandOpcode, OperandOpcode,
@ -190,15 +191,15 @@ protected:
// Parameterize an enumerant // Parameterize an enumerant
class EnumParameters { class EnumParameters {
public: public:
EnumParameters() : desc(0) { } EnumParameters() : desc(nullptr) { }
const char* desc; const char* desc;
}; };
// Parameterize a set of enumerants that form an enum // Parameterize a set of enumerants that form an enum
class EnumDefinition : public EnumParameters { class EnumDefinition : public EnumParameters {
public: public:
EnumDefinition() : EnumDefinition() :
ceiling(0), bitmask(false), getName(0), enumParams(0), operandParams(0) { } ceiling(0), bitmask(false), getName(nullptr), enumParams(nullptr), operandParams(nullptr) { }
void set(int ceil, const char* (*name)(int), EnumParameters* ep, bool mask = false) void set(int ceil, const char* (*name)(int), EnumParameters* ep, bool mask = false)
{ {
ceiling = ceil; ceiling = ceil;

View File

@ -23,19 +23,6 @@
#include <limits> #include <limits>
#include <sstream> #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" #include "bitutils.h"
namespace spvutils { 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) { } explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { }
virtual ~Instruction() {} virtual ~Instruction() {}
void addIdOperand(Id id) { void addIdOperand(Id id) {
// ids can't be 0
assert(id);
operands.push_back(id); operands.push_back(id);
idOperand.push_back(true); idOperand.push_back(true);
} }
@ -321,7 +323,7 @@ void inReadableOrder(Block* root, std::function<void(Block*, ReachReason, Block*
class Function { class Function {
public: 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() virtual ~Function()
{ {
for (int i = 0; i < (int)parameterInstructions.size(); ++i) for (int i = 0; i < (int)parameterInstructions.size(); ++i)
@ -349,6 +351,7 @@ public:
const std::vector<Block*>& getBlocks() const { return blocks; } const std::vector<Block*>& getBlocks() const { return blocks; }
void addLocalVariable(std::unique_ptr<Instruction> inst); void addLocalVariable(std::unique_ptr<Instruction> inst);
Id getReturnType() const { return functionInstruction.getTypeId(); } Id getReturnType() const { return functionInstruction.getTypeId(); }
Id getFuncId() const { return functionInstruction.getResultId(); }
void setReturnPrecision(Decoration precision) void setReturnPrecision(Decoration precision)
{ {
if (precision == DecorationRelaxedPrecision) if (precision == DecorationRelaxedPrecision)
@ -385,7 +388,7 @@ public:
if (lineInstruction != nullptr) { if (lineInstruction != nullptr) {
lineInstruction->dump(out); lineInstruction->dump(out);
} }
// OpFunction // OpFunction
functionInstruction.dump(out); functionInstruction.dump(out);
@ -399,6 +402,9 @@ public:
end.dump(out); end.dump(out);
} }
LinkageType getLinkType() const { return linkType; }
const char* getExportName() const { return exportName.c_str(); }
protected: protected:
Function(const Function&); Function(const Function&);
Function& operator=(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 implicitThis; // true if this is a member function expecting to be passed a 'this' as the first argument
bool reducedPrecisionReturn; bool reducedPrecisionReturn;
std::set<int> reducedPrecisionParams; // list of parameter indexes that need a relaxed precision arg 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 // Add both
// - the OpFunction instruction // - the OpFunction instruction
// - all the OpFunctionParameter instructions // - 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), : parent(parent), lineInstruction(nullptr),
functionInstruction(id, resultType, OpFunction), implicitThis(false), functionInstruction(id, resultType, OpFunction), implicitThis(false),
reducedPrecisionReturn(false) reducedPrecisionReturn(false),
linkType(linkage)
{ {
// OpFunction // OpFunction
functionInstruction.addImmediateOperand(FunctionControlMaskNone); functionInstruction.addImmediateOperand(FunctionControlMaskNone);
@ -489,6 +498,11 @@ __inline Function::Function(Id id, Id resultType, Id functionType, Id firstParam
parent.mapInstruction(param); parent.mapInstruction(param);
parameterInstructions.push_back(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) __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. # All rights reserved.
# #
@ -31,7 +31,7 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE. # 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_H "${GLSLANG_GENERATED_INCLUDEDIR}/glslang/glsl_intrinsic_header.h")
set(GLSLANG_INTRINSIC_PY "${CMAKE_CURRENT_SOURCE_DIR}/../gen_extension_headers.py") 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( add_custom_command(
OUTPUT ${GLSLANG_INTRINSIC_H} OUTPUT ${GLSLANG_INTRINSIC_H}
COMMAND ${PYTHON_EXECUTABLE} "${GLSLANG_INTRINSIC_PY}" COMMAND Python3::Interpreter "${GLSLANG_INTRINSIC_PY}"
"-i" ${GLSLANG_INTRINSIC_HEADER_DIR} "-i" ${GLSLANG_INTRINSIC_HEADER_DIR}
"-o" ${GLSLANG_INTRINSIC_H} "-o" ${GLSLANG_INTRINSIC_H}
DEPENDS ${GLSLANG_INTRINSIC_PY} DEPENDS ${GLSLANG_INTRINSIC_PY}
COMMENT "Generating ${GLSLANG_INTRINSIC_H}") 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}) set(SOURCES StandAlone.cpp DirStackFileIncluder.h ${GLSLANG_INTRINSIC_H})
add_executable(glslangValidator ${SOURCES}) add_executable(glslang-standalone ${SOURCES})
set_property(TARGET glslangValidator PROPERTY FOLDER tools) set_property(TARGET glslang-standalone PROPERTY FOLDER tools)
glslang_set_link_args(glslangValidator) set_property(TARGET glslang-standalone PROPERTY OUTPUT_NAME glslang)
glslang_set_link_args(glslang-standalone)
set(LIBRARIES set(LIBRARIES
glslang glslang
OSDependent
SPIRV SPIRV
glslang-default-resource-limits) glslang-default-resource-limits)
if(ENABLE_SPVREMAPPER)
set(LIBRARIES ${LIBRARIES} SPVRemapper)
endif()
if(WIN32) if(WIN32)
set(LIBRARIES ${LIBRARIES} psapi) set(LIBRARIES ${LIBRARIES} psapi)
elseif(UNIX) elseif(UNIX)
if(NOT ANDROID) if(NOT ANDROID AND NOT QNX)
set(LIBRARIES ${LIBRARIES} pthread) set(LIBRARIES ${LIBRARIES} pthread)
endif() endif()
endif() endif()
target_link_libraries(glslangValidator ${LIBRARIES}) target_link_libraries(glslang-standalone ${LIBRARIES})
target_include_directories(glslangValidator PUBLIC target_include_directories(glslang-standalone PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>) $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
if(ENABLE_OPT) if(ENABLE_OPT)
target_include_directories(glslangValidator target_include_directories(glslang-standalone
PRIVATE ${spirv-tools_SOURCE_DIR}/include PRIVATE ${spirv-tools_SOURCE_DIR}/include
) )
endif() endif()
@ -96,7 +82,7 @@ if(ENABLE_SPVREMAPPER)
add_executable(spirv-remap ${REMAPPER_SOURCES}) add_executable(spirv-remap ${REMAPPER_SOURCES})
set_property(TARGET spirv-remap PROPERTY FOLDER tools) set_property(TARGET spirv-remap PROPERTY FOLDER tools)
glslang_set_link_args(spirv-remap) glslang_set_link_args(spirv-remap)
target_link_libraries(spirv-remap ${LIBRARIES}) target_link_libraries(spirv-remap SPVRemapper ${LIBRARIES})
endif() endif()
if(WIN32) if(WIN32)
@ -104,19 +90,35 @@ if(WIN32)
endif() endif()
if(ENABLE_GLSLANG_INSTALL) if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslangValidator EXPORT glslang-targets) install(TARGETS glslang-standalone EXPORT glslang-targets)
# Backward compatibility # Backward compatibility
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslangValidatorTargets.cmake" " file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/glslang-standaloneTargets.cmake" "
message(WARNING \"Using `glslangValidatorTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\") message(WARNING \"Using `glslang-standaloneTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::glslangValidator) if (NOT TARGET glslang::glslang-standalone)
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() 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) if(ENABLE_SPVREMAPPER)
install(TARGETS spirv-remap EXPORT glslang-targets) 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.\") message(WARNING \"Using `spirv-remapTargets.cmake` is deprecated: use `find_package(glslang)` to find glslang CMake targets.\")
if (NOT TARGET glslang::spirv-remap) 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() endif()
add_library(spirv-remap ALIAS glslang::spirv-remap) 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) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/spirv-remapTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif() 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() endif()

View File

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

View File

@ -37,7 +37,11 @@
#include <fstream> #include <fstream>
#include <cstring> #include <cstring>
#include <stdexcept> #include <stdexcept>
#include <filesystem>
//
// Include remapper
//
#include "../SPIRV/SPVRemapper.h" #include "../SPIRV/SPVRemapper.h"
namespace { namespace {
@ -157,7 +161,7 @@ namespace {
} }
// Print helpful usage message to stdout, and exit // 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) if (msg)
std::cout << msg << std::endl << std::endl; std::cout << msg << std::endl << std::endl;
@ -172,7 +176,7 @@ namespace {
<< " [--strip-all | --strip all | -s]" << " [--strip-all | --strip all | -s]"
<< " [--strip-white-list]" << " [--strip-white-list]"
<< " [--do-everything]" << " [--do-everything]"
<< " --input | -i file1 [file2...] --output|-o DESTDIR" << " --input | -i file1 [file2...] --output|-o DESTDIR | destfile1 [destfile2...]"
<< std::endl; << std::endl;
std::cout << " " << basename(name) << " [--version | -V]" << std::endl; std::cout << " " << basename(name) << " [--version | -V]" << std::endl;
@ -182,32 +186,45 @@ namespace {
} }
// grind through each SPIR in turn // grind through each SPIR in turn
void execute(const std::vector<std::string>& inputFile, const std::string& outputDir, void execute(const std::vector<std::string>& inputFiles,
const std::string& whiteListFile, int opts, int verbosity) const std::vector<std::string>& outputDirOrFiles,
const bool isSingleOutputDir,
const std::string& whiteListFile,
int opts,
int verbosity)
{ {
std::vector<std::string> whiteListStrings; std::vector<std::string> whiteListStrings;
if(!whiteListFile.empty()) if (!whiteListFile.empty())
read(whiteListStrings, whiteListFile, verbosity); read(whiteListStrings, whiteListFile, verbosity);
for (auto it = inputFile.cbegin(); it != inputFile.cend(); ++it) { for (std::size_t ii=0; ii<inputFiles.size(); ii++) {
const std::string &filename = *it;
std::vector<SpvWord> spv; std::vector<SpvWord> spv;
read(spv, filename, verbosity); read(spv, inputFiles[ii], verbosity);
spv::spirvbin_t(verbosity).remap(spv, whiteListStrings, opts); 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) 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 // Parse command line options
void parseCmdLine(int argc, char** argv, std::vector<std::string>& inputFile, void parseCmdLine(int argc,
std::string& outputDir, char** argv,
std::string& stripWhiteListFile, std::vector<std::string>& inputFiles,
int& options, std::vector<std::string>& outputDirOrFiles,
int& verbosity) std::string& stripWhiteListFile,
int& options,
int& verbosity)
{ {
if (argc < 2) if (argc < 2)
usage(argv[0]); usage(argv[0]);
@ -222,18 +239,19 @@ namespace {
const std::string arg = argv[a]; const std::string arg = argv[a];
if (arg == "--output" || arg == "-o") { if (arg == "--output" || arg == "-o") {
// Output directory // Collect output dirs or files
if (++a >= argc) for (++a; a < argc && argv[a][0] != '-'; ++a)
outputDirOrFiles.push_back(argv[a]);
if (outputDirOrFiles.size() == 0)
usage(argv[0], "--output requires an argument"); 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 == "-vv") { verbosity = 2; ++a; } // verbosity shortcuts
else if (arg == "-vvv") { verbosity = 3; ++a; } // ... else if (arg == "-vvv") { verbosity = 3; ++a; } // ...
@ -245,7 +263,7 @@ namespace {
verbosity = 1; verbosity = 1;
if (a < argc) { if (a < argc) {
char* end_ptr = 0; char* end_ptr = nullptr;
int verb = ::strtol(argv[a], &end_ptr, 10); int verb = ::strtol(argv[a], &end_ptr, 10);
// If we have not read to the end of the string or // If we have not read to the end of the string or
// the string contained no elements, then we do not want to // the string contained no elements, then we do not want to
@ -262,7 +280,7 @@ namespace {
} else if (arg == "--input" || arg == "-i") { } else if (arg == "--input" || arg == "-i") {
// Collect input files // Collect input files
for (++a; a < argc && argv[a][0] != '-'; ++a) for (++a; a < argc && argv[a][0] != '-'; ++a)
inputFile.push_back(argv[a]); inputFiles.push_back(argv[a]);
} else if (arg == "--do-everything") { } else if (arg == "--do-everything") {
++a; ++a;
options = options | spv::spirvbin_t::DO_EVERYTHING; options = options | spv::spirvbin_t::DO_EVERYTHING;
@ -346,30 +364,39 @@ namespace {
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
std::vector<std::string> inputFile; std::vector<std::string> inputFiles;
std::string outputDir; std::vector<std::string> outputDirOrFiles;
std::string whiteListFile; std::string whiteListFile;
int opts; int opts;
int verbosity; int verbosity;
#ifdef use_cpp11
// handle errors by exiting // handle errors by exiting
spv::spirvbin_t::registerErrorHandler(errHandler); spv::spirvbin_t::registerErrorHandler(errHandler);
// Log messages to std::cout // Log messages to std::cout
spv::spirvbin_t::registerLogHandler(logHandler); spv::spirvbin_t::registerLogHandler(logHandler);
#endif
if (argc < 2) if (argc < 2)
usage(argv[0]); usage(argv[0]);
parseCmdLine(argc, argv, inputFile, outputDir, whiteListFile, opts, verbosity); parseCmdLine(argc, argv, inputFiles, outputDirOrFiles, whiteListFile, opts, verbosity);
if (outputDir.empty()) if (outputDirOrFiles.empty())
usage(argv[0], "Output directory required"); 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. // 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. // 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 hlsl.aliasOpaque.frag
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 89 // Id's are bound by 89
Capability Shader Capability Shader

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
hlsl.partialFlattenMixed.vert hlsl.partialFlattenMixed.vert
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 36 // Id's are bound by 36
Capability Shader 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:111: 'overloadE' : no matching overloaded function found
ERROR: 0:117: 'overloadF' : 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: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:165: 'switch' : Reserved word.
ERROR: 0:171: 'default' : Reserved word. ERROR: 0:171: 'default' : Reserved word.
ERROR: 0:165: 'switch statements' : not supported for this version or the enabled extensions 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: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:203: 'token pasting (##)' : not supported for this version or the enabled extensions
ERROR: 0:205: '' : syntax error, unexpected IDENTIFIER ERROR: 0:205: '' : syntax error, unexpected IDENTIFIER
ERROR: 81 compilation errors. No code generated. ERROR: 82 compilation errors. No code generated.
Shader version: 120 Shader version: 120

View File

@ -1,6 +1,6 @@
300layout.vert 300layout.vert
ERROR: 0:7: 'vertex input arrays' : not supported with this profile: es 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: '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: 'vertex input arrays' : not supported with this profile: es
ERROR: 0:8: 'location' : overlapping use of location 10 ERROR: 0:8: 'location' : overlapping use of location 10

View File

@ -1,7 +1,7 @@
440.frag 440.frag
ERROR: 0:11: 'location' : overlapping use of location 4 ERROR: 0:11: 'location' : overlapping use of location 4
ERROR: 0:13: 'component' : type overflows the available 4 components 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: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: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) 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: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:84: 'align' : must be a power of 2
ERROR: 0:83: 'offset' : cannot lie in previous members 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:103: 'align' : must be a power of 2
ERROR: 0:105: '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: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. 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 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. ERROR: 1 compilation errors. No code generated.

View File

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

View File

@ -1,15 +1,15 @@
compoundsuffix.vert.glsl compoundsuffix.vert.glsl
Shader version: 100 Shader version: 100
0:? Sequence 0:? Sequence
0:1 Function Definition: main( ( global void) 0:1 Function Definition: main( ( global void)
0:1 Function Parameters: 0:1 Function Parameters:
0:3 Sequence 0:3 Sequence
0:3 move second child to first child ( temp highp 4-component vector of float) 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 'gl_Position' ( gl_Position highp 4-component vector of float Position)
0:3 Constant: 0:3 Constant:
0:3 1.000000 0:3 1.000000
0:3 1.000000 0:3 1.000000
0:3 1.000000 0:3 1.000000
0:3 1.000000 0:3 1.000000
0:? Linker Objects 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 glsl.autosampledtextures.frag
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 23 // Id's are bound by 23
Capability Shader Capability Shader

View File

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

View File

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

View File

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

View File

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

View File

@ -38,7 +38,7 @@ Shader version: 500
0:? '@entryPointOutput' ( out float PointSize) 0:? '@entryPointOutput' ( out float PointSize)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 16 // Id's are bound by 16
Capability Shader 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) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 64 // Id's are bound by 64
Capability Shader Capability Shader

View File

@ -160,7 +160,7 @@ gl_FragCoord origin is upper left
0:? 'm' ( global 4-component vector of float) 0:? 'm' ( global 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 57 // Id's are bound by 57
Capability Shader 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) 0:? 'ps_output.color' (layout( location=0) out 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 143 // Id's are bound by 143
Capability Shader 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) 0:? 'input' (layout( location=1) in 3-element array of 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 126 // Id's are bound by 126
Capability Shader 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}) 0:? 'g_mystruct' ( global 2-element array of structure{ temp int i, temp float f})
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 72 // Id's are bound by 72
Capability Shader 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) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 57 // Id's are bound by 57
Capability Shader 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) 0:? 'a5' (layout( location=4) in 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 58 // Id's are bound by 58
Capability Shader 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}) 0:? 'anon@0' (layout( row_major std140) uniform block{ uniform int bound})
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 30 // Id's are bound by 30
Capability Shader 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) 0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 24 // Id's are bound by 24
Capability Shader Capability Shader

View File

@ -95,7 +95,7 @@ gl_FragCoord origin is upper left
Validation failed Validation failed
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 51 // Id's are bound by 51
Capability Shader 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) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 28 // Id's are bound by 28
Capability Shader Capability Shader

View File

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

View File

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

View File

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

View File

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

View File

@ -147,7 +147,7 @@ gl_FragCoord origin is upper left
Validation failed Validation failed
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 73 // Id's are bound by 73
Capability Shader 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) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 148 // Id's are bound by 148
Capability Shader Capability Shader

View File

@ -358,7 +358,7 @@ using depth_any
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 148 // Id's are bound by 148
Capability Shader 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) 0:? 'input' (layout( location=0) in 4-component vector of float)
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 8000a // Generated by (magic number): 8000b
// Id's are bound by 34 // Id's are bound by 34
Capability Shader Capability Shader

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