mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
Remove SPIRV-Cross subtree.
This commit is contained in:
parent
048980e051
commit
6e5a7dd64a
167
deps/SPIRV-Cross/.clang-format
vendored
167
deps/SPIRV-Cross/.clang-format
vendored
@ -1,167 +0,0 @@
|
||||
# The style used for all options not specifically set in the configuration.
|
||||
BasedOnStyle: LLVM
|
||||
|
||||
# The extra indent or outdent of access modifiers, e.g. public:.
|
||||
AccessModifierOffset: -4
|
||||
|
||||
# If true, aligns escaped newlines as far left as possible. Otherwise puts them into the right-most column.
|
||||
AlignEscapedNewlinesLeft: true
|
||||
|
||||
# If true, aligns trailing comments.
|
||||
AlignTrailingComments: false
|
||||
|
||||
# Allow putting all parameters of a function declaration onto the next line even if BinPackParameters is false.
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
|
||||
# Allows contracting simple braced statements to a single line.
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
|
||||
# If true, short case labels will be contracted to a single line.
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
|
||||
# Dependent on the value, int f() { return 0; } can be put on a single line. Possible values: None, Inline, All.
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
|
||||
# If true, if (a) return; can be put on a single line.
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
|
||||
# If true, while (true) continue; can be put on a single line.
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
|
||||
# If true, always break after function definition return types.
|
||||
AlwaysBreakAfterDefinitionReturnType: false
|
||||
|
||||
# If true, always break before multiline string literals.
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
|
||||
# If true, always break after the template<...> of a template declaration.
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
|
||||
# If false, a function call's arguments will either be all on the same line or will have one line each.
|
||||
BinPackArguments: true
|
||||
|
||||
# If false, a function declaration's or function definition's parameters will either all be on the same line
|
||||
# or will have one line each.
|
||||
BinPackParameters: true
|
||||
|
||||
# The way to wrap binary operators. Possible values: None, NonAssignment, All.
|
||||
BreakBeforeBinaryOperators: None
|
||||
|
||||
# The brace breaking style to use. Possible values: Attach, Linux, Stroustrup, Allman, GNU.
|
||||
BreakBeforeBraces: Allman
|
||||
|
||||
# If true, ternary operators will be placed after line breaks.
|
||||
BreakBeforeTernaryOperators: false
|
||||
|
||||
# Always break constructor initializers before commas and align the commas with the colon.
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
|
||||
# The column limit. A column limit of 0 means that there is no column limit.
|
||||
ColumnLimit: 120
|
||||
|
||||
# A regular expression that describes comments with special meaning, which should not be split into lines or otherwise changed.
|
||||
CommentPragmas: '^ *'
|
||||
|
||||
# If the constructor initializers don't fit on a line, put each initializer on its own line.
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
|
||||
# The number of characters to use for indentation of constructor initializer lists.
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
|
||||
# Indent width for line continuations.
|
||||
ContinuationIndentWidth: 4
|
||||
|
||||
# If true, format braced lists as best suited for C++11 braced lists.
|
||||
Cpp11BracedListStyle: false
|
||||
|
||||
# Disables formatting at all.
|
||||
DisableFormat: false
|
||||
|
||||
# A vector of macros that should be interpreted as foreach loops instead of as function calls.
|
||||
#ForEachMacros: ''
|
||||
|
||||
# Indent case labels one level from the switch statement.
|
||||
# When false, use the same indentation level as for the switch statement.
|
||||
# Switch statement body is always indented one level more than case labels.
|
||||
IndentCaseLabels: false
|
||||
|
||||
# The number of columns to use for indentation.
|
||||
IndentWidth: 4
|
||||
|
||||
# Indent if a function definition or declaration is wrapped after the type.
|
||||
IndentWrappedFunctionNames: false
|
||||
|
||||
# If true, empty lines at the start of blocks are kept.
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
|
||||
# Language, this format style is targeted at. Possible values: None, Cpp, Java, JavaScript, Proto.
|
||||
Language: Cpp
|
||||
|
||||
# The maximum number of consecutive empty lines to keep.
|
||||
MaxEmptyLinesToKeep: 1
|
||||
|
||||
# The indentation used for namespaces. Possible values: None, Inner, All.
|
||||
NamespaceIndentation: None
|
||||
|
||||
# The penalty for breaking a function call after "call(".
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
|
||||
# The penalty for each line break introduced inside a comment.
|
||||
PenaltyBreakComment: 300
|
||||
|
||||
# The penalty for breaking before the first <<.
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
|
||||
# The penalty for each line break introduced inside a string literal.
|
||||
PenaltyBreakString: 1000
|
||||
|
||||
# The penalty for each character outside of the column limit.
|
||||
PenaltyExcessCharacter: 1000000
|
||||
|
||||
# Penalty for putting the return type of a function onto its own line.
|
||||
PenaltyReturnTypeOnItsOwnLine: 1000000000
|
||||
|
||||
# Pointer and reference alignment style. Possible values: Left, Right, Middle.
|
||||
PointerAlignment: Right
|
||||
|
||||
# If true, a space may be inserted after C style casts.
|
||||
SpaceAfterCStyleCast: false
|
||||
|
||||
# If false, spaces will be removed before assignment operators.
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
|
||||
# Defines in which cases to put a space before opening parentheses. Possible values: Never, ControlStatements, Always.
|
||||
SpaceBeforeParens: ControlStatements
|
||||
|
||||
# If true, spaces may be inserted into '()'.
|
||||
SpaceInEmptyParentheses: false
|
||||
|
||||
# The number of spaces before trailing line comments (// - comments).
|
||||
SpacesBeforeTrailingComments: 1
|
||||
|
||||
# If true, spaces will be inserted after '<' and before '>' in template argument lists.
|
||||
SpacesInAngles: false
|
||||
|
||||
# If true, spaces may be inserted into C style casts.
|
||||
SpacesInCStyleCastParentheses: false
|
||||
|
||||
# If true, spaces are inserted inside container literals (e.g. ObjC and Javascript array and dict literals).
|
||||
SpacesInContainerLiterals: false
|
||||
|
||||
# If true, spaces will be inserted after '(' and before ')'.
|
||||
SpacesInParentheses: false
|
||||
|
||||
# If true, spaces will be inserted after '[' and befor']'.
|
||||
SpacesInSquareBrackets: false
|
||||
|
||||
# Format compatible with this standard, e.g. use A<A<int> > instead of A<A<int>> for LS_Cpp03. Possible values: Cpp03, Cpp11, Auto.
|
||||
Standard: Cpp11
|
||||
|
||||
# The number of columns used for tab stops.
|
||||
TabWidth: 4
|
||||
|
||||
# The way to use tab characters in the resulting file. Possible values: Never, ForIndentation, Always.
|
||||
UseTab: ForIndentation
|
||||
|
||||
# Do not reflow comments
|
||||
ReflowComments: false
|
19
deps/SPIRV-Cross/.gitignore
vendored
19
deps/SPIRV-Cross/.gitignore
vendored
@ -1,19 +0,0 @@
|
||||
*.o
|
||||
*.d
|
||||
*.txt
|
||||
/test
|
||||
/spirv-cross
|
||||
*.spv
|
||||
/obj
|
||||
/msvc/x64
|
||||
/msvc/Debug
|
||||
/msvc/Release
|
||||
*.suo
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.shader
|
||||
*.a
|
||||
*.bc
|
||||
/external
|
||||
|
||||
!CMakeLists.txt
|
18
deps/SPIRV-Cross/.travis.yml
vendored
18
deps/SPIRV-Cross/.travis.yml
vendored
@ -1,18 +0,0 @@
|
||||
language: cpp
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
osx_image: xcode9.3beta
|
||||
|
||||
# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
before_script:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python3; fi
|
||||
- ./checkout_glslang_spirv_tools.sh
|
||||
|
||||
script:
|
||||
- ./build_glslang_spirv_tools.sh Debug 2
|
||||
- make -j2
|
||||
- ./test_shaders.sh
|
163
deps/SPIRV-Cross/CMakeLists.txt
vendored
163
deps/SPIRV-Cross/CMakeLists.txt
vendored
@ -1,163 +0,0 @@
|
||||
# Copyright 2016 Google Inc.
|
||||
#
|
||||
# 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.
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(SPIRV-Cross)
|
||||
enable_testing()
|
||||
|
||||
option(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS "Instead of throwing exceptions assert" OFF)
|
||||
|
||||
if(${CMAKE_GENERATOR} MATCHES "Makefile")
|
||||
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
|
||||
message(FATAL_ERROR "Build out of tree to avoid overwriting Makefile")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(spirv-compiler-options "")
|
||||
set(spirv-compiler-defines "")
|
||||
|
||||
if(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
|
||||
set(spirv-compiler-defines ${spirv-compiler-defines} SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
|
||||
endif()
|
||||
|
||||
# To specify special debug or optimization options, use
|
||||
# -DCMAKE_CXX_COMPILE_FLAGS
|
||||
# However, we require the C++11 dialect.
|
||||
if (NOT "${MSVC}")
|
||||
set(spirv-compiler-options ${spirv-compiler-options} -std=c++11 -Wall -Wextra -Werror -Wshadow)
|
||||
set(spirv-compiler-defines ${spirv-compiler-defines} __STDC_LIMIT_MACROS)
|
||||
|
||||
if(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
|
||||
set(spirv-compiler-options ${spirv-compiler-options} -fno-exceptions)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
macro(extract_headers out_abs file_list)
|
||||
set(${out_abs}) # absolute paths
|
||||
foreach(_a ${file_list})
|
||||
# get_filename_component only returns the longest extension, so use a regex
|
||||
string(REGEX REPLACE ".*\\.(h|hpp)" "\\1" ext ${_a})
|
||||
if(("${ext}" STREQUAL "h") OR ("${ext}" STREQUAL "hpp"))
|
||||
list(APPEND ${out_abs} "${_a}")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(spirv_cross_add_library name config_name)
|
||||
add_library(${name} ${ARGN})
|
||||
extract_headers(hdrs "${ARGN}")
|
||||
target_include_directories(${name} PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:include/spirv_cross>)
|
||||
set_target_properties(${name} PROPERTIES
|
||||
PUBLIC_HEADERS "${hdrs}")
|
||||
target_compile_options(${name} PRIVATE ${spirv-compiler-options})
|
||||
target_compile_definitions(${name} PRIVATE ${spirv-compiler-defines})
|
||||
install(TARGETS ${name}
|
||||
EXPORT ${config_name}Config
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include/spirv_cross)
|
||||
install(FILES ${hdrs} DESTINATION include/spirv_cross)
|
||||
install(EXPORT ${config_name}Config DESTINATION share/${config_name}/cmake)
|
||||
export(TARGETS ${targets} FILE ${config_name}Config.cmake)
|
||||
endmacro()
|
||||
|
||||
|
||||
spirv_cross_add_library(spirv-cross-core spirv_cross_core STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/GLSL.std.450.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_common.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.cpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-glsl spirv_cross_glsl STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.hpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-cpp spirv_cross_cpp STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.cpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-reflect spirv_cross_reflect STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.cpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-msl spirv_cross_msl STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.cpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-hlsl spirv_cross_hlsl STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_hlsl.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_hlsl.cpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-util spirv_cross_util STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.cpp)
|
||||
|
||||
add_executable(spirv-cross main.cpp)
|
||||
target_compile_options(spirv-cross PRIVATE ${spirv-compiler-options})
|
||||
target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines})
|
||||
|
||||
install(TARGETS spirv-cross RUNTIME DESTINATION bin)
|
||||
target_link_libraries(spirv-cross spirv-cross-glsl spirv-cross-hlsl spirv-cross-cpp spirv-cross-reflect spirv-cross-msl spirv-cross-util spirv-cross-core)
|
||||
target_link_libraries(spirv-cross-util spirv-cross-core)
|
||||
target_link_libraries(spirv-cross-glsl spirv-cross-core)
|
||||
target_link_libraries(spirv-cross-msl spirv-cross-glsl)
|
||||
target_link_libraries(spirv-cross-hlsl spirv-cross-glsl)
|
||||
target_link_libraries(spirv-cross-cpp spirv-cross-glsl)
|
||||
|
||||
# Set up tests, using only the simplest modes of the test_shaders
|
||||
# script. You have to invoke the script manually to:
|
||||
# - Update the reference files
|
||||
# - Get cycle counts from malisc
|
||||
# - Keep failing outputs
|
||||
find_package(PythonInterp)
|
||||
if (${PYTHONINTERP_FOUND})
|
||||
if (${PYTHON_VERSION_MAJOR} GREATER 2)
|
||||
add_test(NAME spirv-cross-test
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders)
|
||||
add_test(NAME spirv-cross-test-no-opt
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-no-opt)
|
||||
add_test(NAME spirv-cross-test-metal
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl)
|
||||
add_test(NAME spirv-cross-test-metal-no-opt
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl-no-opt)
|
||||
add_test(NAME spirv-cross-test-hlsl
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl)
|
||||
add_test(NAME spirv-cross-test-hlsl-no-opt
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl-no-opt)
|
||||
add_test(NAME spirv-cross-test-opt
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --opt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders)
|
||||
add_test(NAME spirv-cross-test-metal-opt
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal --opt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl)
|
||||
add_test(NAME spirv-cross-test-hlsl-opt
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl --opt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl)
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "Testing disabled. Could not find python3. If you have python3 installed try running "
|
||||
"cmake with -DPYTHON_EXECUTABLE:FILEPATH=/path/to/python3 to help it find the executable")
|
||||
endif()
|
131
deps/SPIRV-Cross/GLSL.std.450.h
vendored
131
deps/SPIRV-Cross/GLSL.std.450.h
vendored
@ -1,131 +0,0 @@
|
||||
/*
|
||||
** Copyright (c) 2014-2016 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 GLSLstd450_H
|
||||
#define GLSLstd450_H
|
||||
|
||||
static const int GLSLstd450Version = 100;
|
||||
static const int GLSLstd450Revision = 3;
|
||||
|
||||
enum GLSLstd450 {
|
||||
GLSLstd450Bad = 0, // Don't use
|
||||
|
||||
GLSLstd450Round = 1,
|
||||
GLSLstd450RoundEven = 2,
|
||||
GLSLstd450Trunc = 3,
|
||||
GLSLstd450FAbs = 4,
|
||||
GLSLstd450SAbs = 5,
|
||||
GLSLstd450FSign = 6,
|
||||
GLSLstd450SSign = 7,
|
||||
GLSLstd450Floor = 8,
|
||||
GLSLstd450Ceil = 9,
|
||||
GLSLstd450Fract = 10,
|
||||
|
||||
GLSLstd450Radians = 11,
|
||||
GLSLstd450Degrees = 12,
|
||||
GLSLstd450Sin = 13,
|
||||
GLSLstd450Cos = 14,
|
||||
GLSLstd450Tan = 15,
|
||||
GLSLstd450Asin = 16,
|
||||
GLSLstd450Acos = 17,
|
||||
GLSLstd450Atan = 18,
|
||||
GLSLstd450Sinh = 19,
|
||||
GLSLstd450Cosh = 20,
|
||||
GLSLstd450Tanh = 21,
|
||||
GLSLstd450Asinh = 22,
|
||||
GLSLstd450Acosh = 23,
|
||||
GLSLstd450Atanh = 24,
|
||||
GLSLstd450Atan2 = 25,
|
||||
|
||||
GLSLstd450Pow = 26,
|
||||
GLSLstd450Exp = 27,
|
||||
GLSLstd450Log = 28,
|
||||
GLSLstd450Exp2 = 29,
|
||||
GLSLstd450Log2 = 30,
|
||||
GLSLstd450Sqrt = 31,
|
||||
GLSLstd450InverseSqrt = 32,
|
||||
|
||||
GLSLstd450Determinant = 33,
|
||||
GLSLstd450MatrixInverse = 34,
|
||||
|
||||
GLSLstd450Modf = 35, // second operand needs an OpVariable to write to
|
||||
GLSLstd450ModfStruct = 36, // no OpVariable operand
|
||||
GLSLstd450FMin = 37,
|
||||
GLSLstd450UMin = 38,
|
||||
GLSLstd450SMin = 39,
|
||||
GLSLstd450FMax = 40,
|
||||
GLSLstd450UMax = 41,
|
||||
GLSLstd450SMax = 42,
|
||||
GLSLstd450FClamp = 43,
|
||||
GLSLstd450UClamp = 44,
|
||||
GLSLstd450SClamp = 45,
|
||||
GLSLstd450FMix = 46,
|
||||
GLSLstd450IMix = 47, // Reserved
|
||||
GLSLstd450Step = 48,
|
||||
GLSLstd450SmoothStep = 49,
|
||||
|
||||
GLSLstd450Fma = 50,
|
||||
GLSLstd450Frexp = 51, // second operand needs an OpVariable to write to
|
||||
GLSLstd450FrexpStruct = 52, // no OpVariable operand
|
||||
GLSLstd450Ldexp = 53,
|
||||
|
||||
GLSLstd450PackSnorm4x8 = 54,
|
||||
GLSLstd450PackUnorm4x8 = 55,
|
||||
GLSLstd450PackSnorm2x16 = 56,
|
||||
GLSLstd450PackUnorm2x16 = 57,
|
||||
GLSLstd450PackHalf2x16 = 58,
|
||||
GLSLstd450PackDouble2x32 = 59,
|
||||
GLSLstd450UnpackSnorm2x16 = 60,
|
||||
GLSLstd450UnpackUnorm2x16 = 61,
|
||||
GLSLstd450UnpackHalf2x16 = 62,
|
||||
GLSLstd450UnpackSnorm4x8 = 63,
|
||||
GLSLstd450UnpackUnorm4x8 = 64,
|
||||
GLSLstd450UnpackDouble2x32 = 65,
|
||||
|
||||
GLSLstd450Length = 66,
|
||||
GLSLstd450Distance = 67,
|
||||
GLSLstd450Cross = 68,
|
||||
GLSLstd450Normalize = 69,
|
||||
GLSLstd450FaceForward = 70,
|
||||
GLSLstd450Reflect = 71,
|
||||
GLSLstd450Refract = 72,
|
||||
|
||||
GLSLstd450FindILsb = 73,
|
||||
GLSLstd450FindSMsb = 74,
|
||||
GLSLstd450FindUMsb = 75,
|
||||
|
||||
GLSLstd450InterpolateAtCentroid = 76,
|
||||
GLSLstd450InterpolateAtSample = 77,
|
||||
GLSLstd450InterpolateAtOffset = 78,
|
||||
|
||||
GLSLstd450NMin = 79,
|
||||
GLSLstd450NMax = 80,
|
||||
GLSLstd450NClamp = 81,
|
||||
|
||||
GLSLstd450Count
|
||||
};
|
||||
|
||||
#endif // #ifndef GLSLstd450_H
|
202
deps/SPIRV-Cross/LICENSE
vendored
202
deps/SPIRV-Cross/LICENSE
vendored
@ -1,202 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
41
deps/SPIRV-Cross/Makefile
vendored
41
deps/SPIRV-Cross/Makefile
vendored
@ -1,41 +0,0 @@
|
||||
TARGET := spirv-cross
|
||||
|
||||
SOURCES := $(wildcard spirv_*.cpp)
|
||||
CLI_SOURCES := main.cpp
|
||||
|
||||
OBJECTS := $(SOURCES:.cpp=.o)
|
||||
CLI_OBJECTS := $(CLI_SOURCES:.cpp=.o)
|
||||
|
||||
STATIC_LIB := lib$(TARGET).a
|
||||
|
||||
DEPS := $(OBJECTS:.o=.d) $(CLI_OBJECTS:.o=.d)
|
||||
|
||||
CXXFLAGS += -std=c++11 -Wall -Wextra -Wshadow -D__STDC_LIMIT_MACROS
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
CXXFLAGS += -O0 -g
|
||||
else
|
||||
CXXFLAGS += -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
ifeq ($(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS), 1)
|
||||
CXXFLAGS += -DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS -fno-exceptions
|
||||
endif
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
-include $(DEPS)
|
||||
|
||||
$(TARGET): $(CLI_OBJECTS) $(STATIC_LIB)
|
||||
$(CXX) -o $@ $(CLI_OBJECTS) $(STATIC_LIB) $(LDFLAGS)
|
||||
|
||||
$(STATIC_LIB): $(OBJECTS)
|
||||
$(AR) rcs $@ $(OBJECTS)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c -o $@ $< $(CXXFLAGS) -MMD
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS)
|
||||
|
||||
.PHONY: clean
|
355
deps/SPIRV-Cross/README.md
vendored
355
deps/SPIRV-Cross/README.md
vendored
@ -1,355 +0,0 @@
|
||||
# SPIRV-Cross
|
||||
|
||||
SPIRV-Cross is a tool designed for parsing and converting SPIR-V to other shader languages.
|
||||
|
||||
[![Build Status](https://travis-ci.org/KhronosGroup/SPIRV-Cross.svg?branch=master)](https://travis-ci.org/KhronosGroup/SPIRV-Cross)
|
||||
[![Build Status](https://ci.appveyor.com/api/projects/status/github/KhronosGroup/SPIRV-Cross?svg=true&branch=master)](https://ci.appveyor.com/project/HansKristian-ARM/SPIRV-Cross)
|
||||
|
||||
## Features
|
||||
|
||||
- Convert SPIR-V to readable, usable and efficient GLSL
|
||||
- Convert SPIR-V to readable, usable and efficient Metal Shading Language (MSL)
|
||||
- Convert SPIR-V to readable, usable and efficient HLSL
|
||||
- Convert SPIR-V to debuggable C++ [EXPERIMENTAL]
|
||||
- Convert SPIR-V to a JSON reflection format [EXPERIMENTAL]
|
||||
- Reflection API to simplify the creation of Vulkan pipeline layouts
|
||||
- Reflection API to modify and tweak OpDecorations
|
||||
- Supports "all" of vertex, fragment, tessellation, geometry and compute shaders.
|
||||
|
||||
SPIRV-Cross tries hard to emit readable and clean output from the SPIR-V.
|
||||
The goal is to emit GLSL or MSL that looks like it was written by a human and not awkward IR/assembly-like code.
|
||||
|
||||
NOTE: Individual features are expected to be mostly complete, but it is possible that certain obscure GLSL features are not yet supported.
|
||||
However, most missing features are expected to be "trivial" improvements at this stage.
|
||||
|
||||
## Building
|
||||
|
||||
SPIRV-Cross has been tested on Linux, OSX and Windows.
|
||||
|
||||
The make and CMake build flavors offer the option to treat exceptions as assertions. To disable exceptions for make just append `SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS=1` to the command line. For CMake append `-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS=ON`. By default exceptions are enabled.
|
||||
|
||||
### Linux and macOS
|
||||
|
||||
Just run `make` on the command line. A recent GCC (4.8+) or Clang (3.x+) compiler is required as SPIRV-Cross uses C++11 extensively.
|
||||
|
||||
### Windows
|
||||
|
||||
MinGW-w64 based compilation works with `make`, and an MSVC 2013 solution is also included.
|
||||
|
||||
## Usage
|
||||
|
||||
### Using the C++ API
|
||||
|
||||
For more in-depth documentation than what's provided in this README, please have a look at the [Wiki](https://github.com/KhronosGroup/SPIRV-Cross/wiki).
|
||||
|
||||
To perform reflection and convert to other shader languages you can use the SPIRV-Cross API.
|
||||
For example:
|
||||
|
||||
```
|
||||
#include "spirv_glsl.hpp"
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
extern std::vector<uint32_t> load_spirv_file();
|
||||
|
||||
int main()
|
||||
{
|
||||
// Read SPIR-V from disk or similar.
|
||||
std::vector<uint32_t> spirv_binary = load_spirv_file();
|
||||
|
||||
spirv_cross::CompilerGLSL glsl(std::move(spirv_binary));
|
||||
|
||||
// The SPIR-V is now parsed, and we can perform reflection on it.
|
||||
spirv_cross::ShaderResources resources = glsl.get_shader_resources();
|
||||
|
||||
// Get all sampled images in the shader.
|
||||
for (auto &resource : resources.sampled_images)
|
||||
{
|
||||
unsigned set = glsl.get_decoration(resource.id, spv::DecorationDescriptorSet);
|
||||
unsigned binding = glsl.get_decoration(resource.id, spv::DecorationBinding);
|
||||
printf("Image %s at set = %u, binding = %u\n", resource.name.c_str(), set, binding);
|
||||
|
||||
// Modify the decoration to prepare it for GLSL.
|
||||
glsl.unset_decoration(resource.id, spv::DecorationDescriptorSet);
|
||||
|
||||
// Some arbitrary remapping if we want.
|
||||
glsl.set_decoration(resource.id, spv::DecorationBinding, set * 16 + binding);
|
||||
}
|
||||
|
||||
// Set some options.
|
||||
spirv_cross::CompilerGLSL::Options options;
|
||||
options.version = 310;
|
||||
options.es = true;
|
||||
glsl.set_options(options);
|
||||
|
||||
// Compile to GLSL, ready to give to GL driver.
|
||||
std::string source = glsl.compile();
|
||||
}
|
||||
```
|
||||
|
||||
#### Integrating SPIRV-Cross in a custom build system
|
||||
|
||||
To add SPIRV-Cross to your own codebase, just copy the source and header files from root directory
|
||||
and build the relevant .cpp files you need. Make sure to build with C++11 support, e.g. `-std=c++11` in GCC and Clang.
|
||||
Alternatively, the Makefile generates a libspirv-cross.a static library during build that can be linked in.
|
||||
|
||||
### Creating a SPIR-V file from GLSL with glslang
|
||||
|
||||
```
|
||||
glslangValidator -H -V -o test.spv test.frag
|
||||
```
|
||||
|
||||
### Converting a SPIR-V file to GLSL ES
|
||||
|
||||
```
|
||||
glslangValidator -H -V -o test.spv shaders/comp/basic.comp
|
||||
./spirv-cross --version 310 --es test.spv
|
||||
```
|
||||
|
||||
#### Converting to desktop GLSL
|
||||
|
||||
```
|
||||
glslangValidator -H -V -o test.spv shaders/comp/basic.comp
|
||||
./spirv-cross --version 330 test.spv --output test.comp
|
||||
```
|
||||
|
||||
#### Disable prettifying optimizations
|
||||
|
||||
```
|
||||
glslangValidator -H -V -o test.spv shaders/comp/basic.comp
|
||||
./spirv-cross --version 310 --es test.spv --output test.comp --force-temporary
|
||||
```
|
||||
|
||||
### Using shaders generated from C++ backend
|
||||
|
||||
Please see `samples/cpp` where some GLSL shaders are compiled to SPIR-V, decompiled to C++ and run with test data.
|
||||
Reading through the samples should explain how to use the C++ interface.
|
||||
A simple Makefile is included to build all shaders in the directory.
|
||||
|
||||
### Implementation notes
|
||||
|
||||
When using SPIR-V and SPIRV-Cross as an intermediate step for cross-compiling between high level languages there are some considerations to take into account,
|
||||
as not all features used by one high-level language are necessarily supported natively by the target shader language.
|
||||
SPIRV-Cross aims to provide the tools needed to handle these scenarios in a clean and robust way, but some manual action is required to maintain compatibility.
|
||||
|
||||
#### HLSL source to GLSL
|
||||
|
||||
##### HLSL entry points
|
||||
|
||||
When using SPIR-V shaders compiled from HLSL, there are some extra things you need to take care of.
|
||||
First make sure that the entry point is used correctly.
|
||||
If you forget to set the entry point correctly in glslangValidator (-e MyFancyEntryPoint),
|
||||
you will likely encounter this error message:
|
||||
|
||||
```
|
||||
Cannot end a function before ending the current block.
|
||||
Likely cause: If this SPIR-V was created from glslang HLSL, make sure the entry point is valid.
|
||||
```
|
||||
|
||||
##### Vertex/Fragment interface linking
|
||||
|
||||
HLSL relies on semantics in order to effectively link together shader stages. In the SPIR-V generated by glslang, the transformation from HLSL to GLSL ends up looking like
|
||||
|
||||
```
|
||||
struct VSOutput {
|
||||
// SV_Position is rerouted to gl_Position
|
||||
float4 position : SV_Position;
|
||||
float4 coord : TEXCOORD0;
|
||||
};
|
||||
|
||||
VSOutput main(...) {}
|
||||
```
|
||||
|
||||
```
|
||||
struct VSOutput {
|
||||
float4 coord;
|
||||
}
|
||||
layout(location = 0) out VSOutput _magicNameGeneratedByGlslang;
|
||||
```
|
||||
|
||||
While this works, be aware of the type of the struct which is used in the vertex stage and the fragment stage.
|
||||
There may be issues if the structure type name differs in vertex stage and fragment stage.
|
||||
|
||||
You can make use of the reflection interface to force the name of the struct type.
|
||||
|
||||
```
|
||||
// Something like this for both vertex outputs and fragment inputs.
|
||||
compiler.set_name(varying_resource.base_type_id, "VertexFragmentLinkage");
|
||||
```
|
||||
|
||||
Some platform may require identical variable name for both vertex outputs and fragment inputs. (for example MacOSX)
|
||||
to rename varaible base on location, please add
|
||||
```
|
||||
--rename-interface-variable <in|out> <location> <new_variable_name>
|
||||
```
|
||||
|
||||
#### HLSL source to legacy GLSL/ESSL
|
||||
|
||||
HLSL tends to emit varying struct types to pass data between vertex and fragment.
|
||||
This is not supported in legacy GL/GLES targets, so to support this, varying structs are flattened.
|
||||
This is done automatically, but the API user might need to be aware that this is happening in order to support all cases.
|
||||
|
||||
Modern GLES code like this:
|
||||
```
|
||||
struct Output {
|
||||
vec4 a;
|
||||
vec2 b;
|
||||
};
|
||||
out Output vout;
|
||||
```
|
||||
|
||||
Is transformed into:
|
||||
```
|
||||
struct Output {
|
||||
vec4 a;
|
||||
vec2 b;
|
||||
};
|
||||
varying vec4 Output_a;
|
||||
varying vec2 Output_b;
|
||||
```
|
||||
|
||||
Note that now, both the struct name and the member names will participate in the linking interface between vertex and fragment, so
|
||||
API users might want to ensure that both the struct names and member names match so that vertex outputs and fragment inputs can link properly.
|
||||
|
||||
|
||||
#### Separate image samplers (HLSL/Vulkan) for backends which do not support it (GLSL)
|
||||
|
||||
Another thing you need to remember is when using samplers and textures in HLSL these are separable, and not directly compatible with GLSL. If you need to use this with desktop GL/GLES, you need to call `Compiler::build_combined_image_samplers` first before calling `Compiler::compile`, or you will get an exception.
|
||||
|
||||
```
|
||||
// From main.cpp
|
||||
// Builds a mapping for all combinations of images and samplers.
|
||||
compiler->build_combined_image_samplers();
|
||||
|
||||
// Give the remapped combined samplers new names.
|
||||
// Here you can also set up decorations if you want (binding = #N).
|
||||
for (auto &remap : compiler->get_combined_image_samplers())
|
||||
{
|
||||
compiler->set_name(remap.combined_id, join("SPIRV_Cross_Combined", compiler->get_name(remap.image_id),
|
||||
compiler->get_name(remap.sampler_id)));
|
||||
}
|
||||
```
|
||||
|
||||
If your target is Vulkan GLSL, `--vulkan-semantics` will emit separate image samplers as you'd expect.
|
||||
The command line client calls `Compiler::build_combined_image_samplers` automatically, but if you're calling the library, you'll need to do this yourself.
|
||||
|
||||
#### Descriptor sets (Vulkan GLSL) for backends which do not support them (HLSL/GLSL/Metal)
|
||||
|
||||
Descriptor sets are unique to Vulkan, so make sure that descriptor set + binding is remapped to a flat binding scheme (set always 0), so that other APIs can make sense of the bindings.
|
||||
This can be done with `Compiler::set_decoration(id, spv::DecorationDescriptorSet)`.
|
||||
|
||||
#### Linking by name for targets which do not support explicit locations (legacy GLSL/ESSL)
|
||||
|
||||
Modern GLSL and HLSL sources (and SPIR-V) relies on explicit layout(location) qualifiers to guide the linking process between shader stages,
|
||||
but older GLSL relies on symbol names to perform the linking. When emitting shaders with older versions, these layout statements will be removed,
|
||||
so it is important that the API user ensures that the names of I/O variables are sanitized so that linking will work properly.
|
||||
The reflection API can rename variables, struct types and struct members to deal with these scenarios using `Compiler::set_name` and friends.
|
||||
|
||||
#### Clip-space conventions
|
||||
|
||||
SPIRV-Cross can perform some common clip space conversions on gl_Position/SV_Position by enabling `CompilerGLSL::Options.vertex.fixup_clipspace`.
|
||||
While this can be convenient, it is recommended to modify the projection matrices instead as that can achieve the same result.
|
||||
|
||||
For GLSL targets, enabling this will convert a shader which assumes `[0, w]` depth range (Vulkan / D3D / Metal) into `[-w, w]` range.
|
||||
For MSL and HLSL targets, enabling this will convert a shader in `[-w, w]` depth range (OpenGL) to `[0, w]` depth range.
|
||||
|
||||
By default, the CLI will not enable `fixup_clipspace`, but in the API you might want to set an explicit value using `CompilerGLSL::set_options()`.
|
||||
|
||||
Y-flipping of gl_Position and similar is also supported.
|
||||
The use of this is discouraged, because relying on vertex shader Y-flipping tends to get quite messy.
|
||||
To enable this, set `CompilerGLSL::Options.vertex.flip_vert_y` or `--flip-vert-y` in CLI.
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions to SPIRV-Cross are welcome. See Testing and Licensing sections for details.
|
||||
|
||||
### Testing
|
||||
|
||||
SPIRV-Cross maintains a test suite of shaders with reference output of how the output looks after going through a roundtrip through
|
||||
glslangValidator then back through SPIRV-Cross again. The reference files are stored inside the repository in order to be able to track regressions.
|
||||
|
||||
All pull requests should ensure that test output does not change unexpectedly. This can be tested with:
|
||||
|
||||
```
|
||||
./test_shaders.py shaders
|
||||
./test_shaders.py shaders --opt
|
||||
./test_shaders.py shaders-hlsl --hlsl
|
||||
./test_shaders.py shaders-hlsl --hlsl --opt
|
||||
./test_shaders.py shaders-msl --msl
|
||||
./test_shaders.py shaders-msl --msl --opt
|
||||
```
|
||||
|
||||
although there are a couple of convenience script for doing this:
|
||||
|
||||
```
|
||||
./checkout_glslang_spirv_tools.sh # Checks out glslang and SPIRV-Tools at a fixed revision which matches the reference output.
|
||||
./build_glslang_spirv_tools.sh # Builds glslang and SPIRV-Tools.
|
||||
./test_shaders.sh # Runs over all changes and makes sure that there are no deltas compared to reference files.
|
||||
```
|
||||
|
||||
However, when improving SPIRV-Cross there are of course legitimate cases where reference output should change.
|
||||
In these cases, run:
|
||||
|
||||
```
|
||||
./update_test_shaders.sh
|
||||
```
|
||||
|
||||
to update the reference files and include these changes as part of the pull request.
|
||||
Always make sure you are running the correct version of glslangValidator as well as SPIRV-Tools when updating reference files.
|
||||
See `checkout_glslang_spirv_tools.sh`.
|
||||
|
||||
In short, the master branch should always be able to run `./test_shaders.py shaders` and friends without failure.
|
||||
SPIRV-Cross uses Travis CI to test all pull requests, so it is not strictly needed to perform testing yourself if you have problems running it locally.
|
||||
A pull request which does not pass testing on Travis will not be accepted however.
|
||||
|
||||
When adding support for new features to SPIRV-Cross, a new shader and reference file should be added which covers usage of the new shader features in question.
|
||||
|
||||
### Licensing
|
||||
|
||||
Contributors of new files should add a copyright header at the top of every new source code file with their copyright
|
||||
along with the Apache 2.0 licensing stub.
|
||||
|
||||
### Formatting
|
||||
|
||||
SPIRV-Cross uses `clang-format` to automatically format code.
|
||||
Please use `clang-format` with the style sheet found in `.clang-format` to automatically format code before submitting a pull request.
|
||||
|
||||
To make things easy, the `format_all.sh` script can be used to format all
|
||||
source files in the library. In this directory, run the following from the
|
||||
command line:
|
||||
|
||||
./format_all.sh
|
||||
|
||||
## ABI concerns
|
||||
|
||||
### SPIR-V headers
|
||||
|
||||
The current repository uses the latest SPIR-V and GLSL.std.450 headers.
|
||||
SPIR-V files created from older headers could have ABI issues.
|
||||
|
||||
## Regression testing
|
||||
|
||||
In shaders/ a collection of shaders are maintained for purposes of regression testing.
|
||||
The current reference output is contained in reference/.
|
||||
`./test_shaders.py shaders` can be run to perform regression testing.
|
||||
|
||||
See `./test_shaders.py --help` for more.
|
||||
|
||||
### Metal backend
|
||||
|
||||
To test the roundtrip path GLSL -> SPIR-V -> MSL, `--msl` can be added, e.g. `./test_shaders.py --msl shaders-msl`.
|
||||
|
||||
### HLSL backend
|
||||
|
||||
To test the roundtrip path GLSL -> SPIR-V -> HLSL, `--hlsl` can be added, e.g. `./test_shaders.py --hlsl shaders-hlsl`.
|
||||
|
||||
### Updating regression tests
|
||||
|
||||
When legitimate changes are found, use `--update` flag to update regression files.
|
||||
Otherwise, `./test_shaders.py` will fail with error code.
|
||||
|
||||
### Mali Offline Compiler cycle counts
|
||||
|
||||
To obtain a CSV of static shader cycle counts before and after going through spirv-cross, add
|
||||
`--malisc` flag to `./test_shaders`. This requires the Mali Offline Compiler to be installed in PATH.
|
||||
|
31
deps/SPIRV-Cross/appveyor.yml
vendored
31
deps/SPIRV-Cross/appveyor.yml
vendored
@ -1,31 +0,0 @@
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- GENERATOR: "Visual Studio 12 2013 Win64"
|
||||
CONFIG: Debug
|
||||
|
||||
- GENERATOR: "Visual Studio 12 2013 Win64"
|
||||
CONFIG: Release
|
||||
|
||||
- GENERATOR: "Visual Studio 14 2015 Win64"
|
||||
CONFIG: Debug
|
||||
|
||||
- GENERATOR: "Visual Studio 14 2015 Win64"
|
||||
CONFIG: Release
|
||||
|
||||
- GENERATOR: "Visual Studio 12 2013"
|
||||
CONFIG: Debug
|
||||
|
||||
- GENERATOR: "Visual Studio 12 2013"
|
||||
CONFIG: Release
|
||||
|
||||
- GENERATOR: "Visual Studio 14 2015"
|
||||
CONFIG: Debug
|
||||
|
||||
- GENERATOR: "Visual Studio 14 2015"
|
||||
CONFIG: Release
|
||||
|
||||
build_script:
|
||||
- git submodule update --init
|
||||
- cmake "-G%GENERATOR%" -H. -B_builds
|
||||
- cmake --build _builds --config "%CONFIG%"
|
26
deps/SPIRV-Cross/build_glslang_spirv_tools.sh
vendored
26
deps/SPIRV-Cross/build_glslang_spirv_tools.sh
vendored
@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
PROFILE=Release
|
||||
if [ ! -z $1 ]; then
|
||||
PROFILE=$1
|
||||
fi
|
||||
|
||||
NPROC=$(nproc)
|
||||
if [ ! -z $2 ]; then
|
||||
NPROC=$2
|
||||
fi
|
||||
|
||||
echo "Building glslang."
|
||||
mkdir -p external/glslang-build
|
||||
cd external/glslang-build
|
||||
cmake ../glslang -DCMAKE_BUILD_TYPE=$PROFILE -G"Unix Makefiles"
|
||||
make -j$NPROC
|
||||
cd ../..
|
||||
|
||||
echo "Building SPIRV-Tools."
|
||||
mkdir -p external/spirv-tools-build
|
||||
cd external/spirv-tools-build
|
||||
cmake ../spirv-tools -DCMAKE_BUILD_TYPE=$PROFILE -G"Unix Makefiles" -DSPIRV_WERROR=OFF
|
||||
make -j$NPROC
|
||||
cd ../..
|
||||
|
44
deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh
vendored
44
deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh
vendored
@ -1,44 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
GLSLANG_REV=461ea09943e0e88ea854ab9e3b42d17d728af2ad
|
||||
SPIRV_TOOLS_REV=53bc1623ecd3cc304d0d6feed8385e70c7ab30d3
|
||||
|
||||
if [ -d external/glslang ]; then
|
||||
echo "Updating glslang to revision $GLSLANG_REV."
|
||||
cd external/glslang
|
||||
git fetch origin
|
||||
git checkout $GLSLANG_REV
|
||||
else
|
||||
echo "Cloning glslang revision $GLSLANG_REV."
|
||||
mkdir -p external
|
||||
cd external
|
||||
git clone git://github.com/KhronosGroup/glslang.git
|
||||
cd glslang
|
||||
git checkout $GLSLANG_REV
|
||||
fi
|
||||
cd ../..
|
||||
|
||||
if [ -d external/spirv-tools ]; then
|
||||
echo "Updating SPIRV-Tools to revision $SPIRV_TOOLS_REV."
|
||||
cd external/spirv-tools
|
||||
git fetch origin
|
||||
git checkout $SPIRV_TOOLS_REV
|
||||
else
|
||||
echo "Cloning SPIRV-Tools revision $SPIRV_TOOLS_REV."
|
||||
mkdir -p external
|
||||
cd external
|
||||
git clone git://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools
|
||||
cd spirv-tools
|
||||
git checkout $SPIRV_TOOLS_REV
|
||||
fi
|
||||
|
||||
if [ -d external/spirv-headers ]; then
|
||||
cd external/spirv-headers
|
||||
git pull origin master
|
||||
cd ../..
|
||||
else
|
||||
git clone git://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
|
||||
fi
|
||||
|
||||
cd ../..
|
||||
|
8
deps/SPIRV-Cross/format_all.sh
vendored
8
deps/SPIRV-Cross/format_all.sh
vendored
@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
#for file in spirv_*.{cpp,hpp} include/spirv_cross/*.{hpp,h} samples/cpp/*.cpp main.cpp
|
||||
for file in spirv_*.{cpp,hpp} main.cpp
|
||||
do
|
||||
echo "Formatting file: $file ..."
|
||||
clang-format -style=file -i $file
|
||||
done
|
79
deps/SPIRV-Cross/include/spirv_cross/barrier.hpp
vendored
79
deps/SPIRV-Cross/include/spirv_cross/barrier.hpp
vendored
@ -1,79 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef SPIRV_CROSS_BARRIER_HPP
|
||||
#define SPIRV_CROSS_BARRIER_HPP
|
||||
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
|
||||
namespace spirv_cross
|
||||
{
|
||||
class Barrier
|
||||
{
|
||||
public:
|
||||
Barrier()
|
||||
{
|
||||
count.store(0);
|
||||
iteration.store(0);
|
||||
}
|
||||
|
||||
void set_release_divisor(unsigned divisor)
|
||||
{
|
||||
this->divisor = divisor;
|
||||
}
|
||||
|
||||
static inline void memoryBarrier()
|
||||
{
|
||||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
||||
}
|
||||
|
||||
void reset_counter()
|
||||
{
|
||||
count.store(0);
|
||||
iteration.store(0);
|
||||
}
|
||||
|
||||
void wait()
|
||||
{
|
||||
unsigned target_iteration = iteration.load(std::memory_order_relaxed) + 1;
|
||||
// Overflows cleanly.
|
||||
unsigned target_count = divisor * target_iteration;
|
||||
|
||||
// Barriers don't enforce memory ordering.
|
||||
// Be as relaxed about the barrier as we possibly can!
|
||||
unsigned c = count.fetch_add(1u, std::memory_order_relaxed);
|
||||
|
||||
if (c + 1 == target_count)
|
||||
{
|
||||
iteration.store(target_iteration, std::memory_order_relaxed);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we have more threads than the CPU, don't hog the CPU for very long periods of time.
|
||||
while (iteration.load(std::memory_order_relaxed) != target_iteration)
|
||||
std::this_thread::yield();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned divisor = 1;
|
||||
std::atomic<unsigned> count;
|
||||
std::atomic<unsigned> iteration;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -1,126 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef SPIRV_CROSS_EXTERNAL_INTERFACE_H
|
||||
#define SPIRV_CROSS_EXTERNAL_INTERFACE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
typedef struct spirv_cross_shader spirv_cross_shader_t;
|
||||
|
||||
struct spirv_cross_interface
|
||||
{
|
||||
spirv_cross_shader_t *(*construct)(void);
|
||||
void (*destruct)(spirv_cross_shader_t *thiz);
|
||||
void (*invoke)(spirv_cross_shader_t *thiz);
|
||||
};
|
||||
|
||||
void spirv_cross_set_stage_input(spirv_cross_shader_t *thiz, unsigned location, void *data, size_t size);
|
||||
|
||||
void spirv_cross_set_stage_output(spirv_cross_shader_t *thiz, unsigned location, void *data, size_t size);
|
||||
|
||||
void spirv_cross_set_push_constant(spirv_cross_shader_t *thiz, void *data, size_t size);
|
||||
|
||||
void spirv_cross_set_uniform_constant(spirv_cross_shader_t *thiz, unsigned location, void *data, size_t size);
|
||||
|
||||
void spirv_cross_set_resource(spirv_cross_shader_t *thiz, unsigned set, unsigned binding, void **data, size_t size);
|
||||
|
||||
const struct spirv_cross_interface *spirv_cross_get_interface(void);
|
||||
|
||||
typedef enum spirv_cross_builtin {
|
||||
SPIRV_CROSS_BUILTIN_POSITION = 0,
|
||||
SPIRV_CROSS_BUILTIN_FRAG_COORD = 1,
|
||||
SPIRV_CROSS_BUILTIN_WORK_GROUP_ID = 2,
|
||||
SPIRV_CROSS_BUILTIN_NUM_WORK_GROUPS = 3,
|
||||
SPIRV_CROSS_NUM_BUILTINS
|
||||
} spirv_cross_builtin;
|
||||
|
||||
void spirv_cross_set_builtin(spirv_cross_shader_t *thiz, spirv_cross_builtin builtin, void *data, size_t size);
|
||||
|
||||
#define SPIRV_CROSS_NUM_DESCRIPTOR_SETS 4
|
||||
#define SPIRV_CROSS_NUM_DESCRIPTOR_BINDINGS 16
|
||||
#define SPIRV_CROSS_NUM_STAGE_INPUTS 16
|
||||
#define SPIRV_CROSS_NUM_STAGE_OUTPUTS 16
|
||||
#define SPIRV_CROSS_NUM_UNIFORM_CONSTANTS 32
|
||||
|
||||
enum spirv_cross_format
|
||||
{
|
||||
SPIRV_CROSS_FORMAT_R8_UNORM = 0,
|
||||
SPIRV_CROSS_FORMAT_R8G8_UNORM = 1,
|
||||
SPIRV_CROSS_FORMAT_R8G8B8_UNORM = 2,
|
||||
SPIRV_CROSS_FORMAT_R8G8B8A8_UNORM = 3,
|
||||
|
||||
SPIRV_CROSS_NUM_FORMATS
|
||||
};
|
||||
|
||||
enum spirv_cross_wrap
|
||||
{
|
||||
SPIRV_CROSS_WRAP_CLAMP_TO_EDGE = 0,
|
||||
SPIRV_CROSS_WRAP_REPEAT = 1,
|
||||
|
||||
SPIRV_CROSS_NUM_WRAP
|
||||
};
|
||||
|
||||
enum spirv_cross_filter
|
||||
{
|
||||
SPIRV_CROSS_FILTER_NEAREST = 0,
|
||||
SPIRV_CROSS_FILTER_LINEAR = 1,
|
||||
|
||||
SPIRV_CROSS_NUM_FILTER
|
||||
};
|
||||
|
||||
enum spirv_cross_mipfilter
|
||||
{
|
||||
SPIRV_CROSS_MIPFILTER_BASE = 0,
|
||||
SPIRV_CROSS_MIPFILTER_NEAREST = 1,
|
||||
SPIRV_CROSS_MIPFILTER_LINEAR = 2,
|
||||
|
||||
SPIRV_CROSS_NUM_MIPFILTER
|
||||
};
|
||||
|
||||
struct spirv_cross_miplevel
|
||||
{
|
||||
const void *data;
|
||||
unsigned width, height;
|
||||
size_t stride;
|
||||
};
|
||||
|
||||
struct spirv_cross_sampler_info
|
||||
{
|
||||
const struct spirv_cross_miplevel *mipmaps;
|
||||
unsigned num_mipmaps;
|
||||
|
||||
enum spirv_cross_format format;
|
||||
enum spirv_cross_wrap wrap_s;
|
||||
enum spirv_cross_wrap wrap_t;
|
||||
enum spirv_cross_filter min_filter;
|
||||
enum spirv_cross_filter mag_filter;
|
||||
enum spirv_cross_mipfilter mip_filter;
|
||||
};
|
||||
|
||||
typedef struct spirv_cross_sampler_2d spirv_cross_sampler_2d_t;
|
||||
spirv_cross_sampler_2d_t *spirv_cross_create_sampler_2d(const struct spirv_cross_sampler_info *info);
|
||||
void spirv_cross_destroy_sampler_2d(spirv_cross_sampler_2d_t *samp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
62
deps/SPIRV-Cross/include/spirv_cross/image.hpp
vendored
62
deps/SPIRV-Cross/include/spirv_cross/image.hpp
vendored
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef SPIRV_CROSS_IMAGE_HPP
|
||||
#define SPIRV_CROSS_IMAGE_HPP
|
||||
|
||||
#ifndef GLM_SWIZZLE
|
||||
#define GLM_SWIZZLE
|
||||
#endif
|
||||
|
||||
#ifndef GLM_FORCE_RADIANS
|
||||
#define GLM_FORCE_RADIANS
|
||||
#endif
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace spirv_cross
|
||||
{
|
||||
template <typename T>
|
||||
struct image2DBase
|
||||
{
|
||||
virtual ~image2DBase() = default;
|
||||
inline virtual T load(glm::ivec2 coord) const
|
||||
{
|
||||
return T(0, 0, 0, 1);
|
||||
}
|
||||
inline virtual void store(glm::ivec2 coord, const T &v)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
typedef image2DBase<glm::vec4> image2D;
|
||||
typedef image2DBase<glm::ivec4> iimage2D;
|
||||
typedef image2DBase<glm::uvec4> uimage2D;
|
||||
|
||||
template <typename T>
|
||||
inline T imageLoad(const image2DBase<T> &image, glm::ivec2 coord)
|
||||
{
|
||||
return image.load(coord);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void imageStore(image2DBase<T> &image, glm::ivec2 coord, const T &value)
|
||||
{
|
||||
image.store(coord, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,603 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef SPIRV_CROSS_INTERNAL_INTERFACE_HPP
|
||||
#define SPIRV_CROSS_INTERNAL_INTERFACE_HPP
|
||||
|
||||
// This file must only be included by the shader generated by spirv-cross!
|
||||
|
||||
#ifndef GLM_FORCE_SWIZZLE
|
||||
#define GLM_FORCE_SWIZZLE
|
||||
#endif
|
||||
|
||||
#ifndef GLM_FORCE_RADIANS
|
||||
#define GLM_FORCE_RADIANS
|
||||
#endif
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "barrier.hpp"
|
||||
#include "external_interface.h"
|
||||
#include "image.hpp"
|
||||
#include "sampler.hpp"
|
||||
#include "thread_group.hpp"
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace internal
|
||||
{
|
||||
// Adaptor helpers to adapt GLSL access chain syntax to C++.
|
||||
// Don't bother with arrays of arrays on uniforms ...
|
||||
// Would likely need horribly complex variadic template munging.
|
||||
|
||||
template <typename T>
|
||||
struct Interface
|
||||
{
|
||||
enum
|
||||
{
|
||||
ArraySize = 1,
|
||||
Size = sizeof(T)
|
||||
};
|
||||
|
||||
Interface()
|
||||
: ptr(0)
|
||||
{
|
||||
}
|
||||
T &get()
|
||||
{
|
||||
assert(ptr);
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
T *ptr;
|
||||
};
|
||||
|
||||
// For array types, return a pointer instead.
|
||||
template <typename T, unsigned U>
|
||||
struct Interface<T[U]>
|
||||
{
|
||||
enum
|
||||
{
|
||||
ArraySize = U,
|
||||
Size = U * sizeof(T)
|
||||
};
|
||||
|
||||
Interface()
|
||||
: ptr(0)
|
||||
{
|
||||
}
|
||||
T *get()
|
||||
{
|
||||
assert(ptr);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
T *ptr;
|
||||
};
|
||||
|
||||
// For case when array size is 1, avoid double dereference.
|
||||
template <typename T>
|
||||
struct PointerInterface
|
||||
{
|
||||
enum
|
||||
{
|
||||
ArraySize = 1,
|
||||
Size = sizeof(T *)
|
||||
};
|
||||
enum
|
||||
{
|
||||
PreDereference = true
|
||||
};
|
||||
|
||||
PointerInterface()
|
||||
: ptr(0)
|
||||
{
|
||||
}
|
||||
|
||||
T &get()
|
||||
{
|
||||
assert(ptr);
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
T *ptr;
|
||||
};
|
||||
|
||||
// Automatically converts a pointer down to reference to match GLSL syntax.
|
||||
template <typename T>
|
||||
struct DereferenceAdaptor
|
||||
{
|
||||
DereferenceAdaptor(T **ptr)
|
||||
: ptr(ptr)
|
||||
{
|
||||
}
|
||||
T &operator[](unsigned index) const
|
||||
{
|
||||
return *(ptr[index]);
|
||||
}
|
||||
T **ptr;
|
||||
};
|
||||
|
||||
// We can't have a linear array of T* since T* can be an abstract type in case of samplers.
|
||||
// We also need a list of pointers since we can have run-time length SSBOs.
|
||||
template <typename T, unsigned U>
|
||||
struct PointerInterface<T[U]>
|
||||
{
|
||||
enum
|
||||
{
|
||||
ArraySize = U,
|
||||
Size = sizeof(T *) * U
|
||||
};
|
||||
enum
|
||||
{
|
||||
PreDereference = false
|
||||
};
|
||||
PointerInterface()
|
||||
: ptr(0)
|
||||
{
|
||||
}
|
||||
|
||||
DereferenceAdaptor<T> get()
|
||||
{
|
||||
assert(ptr);
|
||||
return DereferenceAdaptor<T>(ptr);
|
||||
}
|
||||
|
||||
T **ptr;
|
||||
};
|
||||
|
||||
// Resources can be more abstract and be unsized,
|
||||
// so we need to have an array of pointers for those cases.
|
||||
template <typename T>
|
||||
struct Resource : PointerInterface<T>
|
||||
{
|
||||
};
|
||||
|
||||
// POD with no unknown sizes, so we can express these as flat arrays.
|
||||
template <typename T>
|
||||
struct UniformConstant : Interface<T>
|
||||
{
|
||||
};
|
||||
template <typename T>
|
||||
struct StageInput : Interface<T>
|
||||
{
|
||||
};
|
||||
template <typename T>
|
||||
struct StageOutput : Interface<T>
|
||||
{
|
||||
};
|
||||
template <typename T>
|
||||
struct PushConstant : Interface<T>
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
struct spirv_cross_shader
|
||||
{
|
||||
struct PPSize
|
||||
{
|
||||
PPSize()
|
||||
: ptr(0)
|
||||
, size(0)
|
||||
{
|
||||
}
|
||||
void **ptr;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct PPSizeResource
|
||||
{
|
||||
PPSizeResource()
|
||||
: ptr(0)
|
||||
, size(0)
|
||||
, pre_dereference(false)
|
||||
{
|
||||
}
|
||||
void **ptr;
|
||||
size_t size;
|
||||
bool pre_dereference;
|
||||
};
|
||||
|
||||
PPSizeResource resources[SPIRV_CROSS_NUM_DESCRIPTOR_SETS][SPIRV_CROSS_NUM_DESCRIPTOR_BINDINGS];
|
||||
PPSize stage_inputs[SPIRV_CROSS_NUM_STAGE_INPUTS];
|
||||
PPSize stage_outputs[SPIRV_CROSS_NUM_STAGE_OUTPUTS];
|
||||
PPSize uniform_constants[SPIRV_CROSS_NUM_UNIFORM_CONSTANTS];
|
||||
PPSize push_constant;
|
||||
PPSize builtins[SPIRV_CROSS_NUM_BUILTINS];
|
||||
|
||||
template <typename U>
|
||||
void register_builtin(spirv_cross_builtin builtin, const U &value)
|
||||
{
|
||||
assert(!builtins[builtin].ptr);
|
||||
|
||||
builtins[builtin].ptr = (void **)&value.ptr;
|
||||
builtins[builtin].size = sizeof(*value.ptr) * U::ArraySize;
|
||||
}
|
||||
|
||||
void set_builtin(spirv_cross_builtin builtin, void *data, size_t size)
|
||||
{
|
||||
assert(builtins[builtin].ptr);
|
||||
assert(size >= builtins[builtin].size);
|
||||
|
||||
*builtins[builtin].ptr = data;
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
void register_resource(const internal::Resource<U> &value, unsigned set, unsigned binding)
|
||||
{
|
||||
assert(set < SPIRV_CROSS_NUM_DESCRIPTOR_SETS);
|
||||
assert(binding < SPIRV_CROSS_NUM_DESCRIPTOR_BINDINGS);
|
||||
assert(!resources[set][binding].ptr);
|
||||
|
||||
resources[set][binding].ptr = (void **)&value.ptr;
|
||||
resources[set][binding].size = internal::Resource<U>::Size;
|
||||
resources[set][binding].pre_dereference = internal::Resource<U>::PreDereference;
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
void register_stage_input(const internal::StageInput<U> &value, unsigned location)
|
||||
{
|
||||
assert(location < SPIRV_CROSS_NUM_STAGE_INPUTS);
|
||||
assert(!stage_inputs[location].ptr);
|
||||
|
||||
stage_inputs[location].ptr = (void **)&value.ptr;
|
||||
stage_inputs[location].size = internal::StageInput<U>::Size;
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
void register_stage_output(const internal::StageOutput<U> &value, unsigned location)
|
||||
{
|
||||
assert(location < SPIRV_CROSS_NUM_STAGE_OUTPUTS);
|
||||
assert(!stage_outputs[location].ptr);
|
||||
|
||||
stage_outputs[location].ptr = (void **)&value.ptr;
|
||||
stage_outputs[location].size = internal::StageOutput<U>::Size;
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
void register_uniform_constant(const internal::UniformConstant<U> &value, unsigned location)
|
||||
{
|
||||
assert(location < SPIRV_CROSS_NUM_UNIFORM_CONSTANTS);
|
||||
assert(!uniform_constants[location].ptr);
|
||||
|
||||
uniform_constants[location].ptr = (void **)&value.ptr;
|
||||
uniform_constants[location].size = internal::UniformConstant<U>::Size;
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
void register_push_constant(const internal::PushConstant<U> &value)
|
||||
{
|
||||
assert(!push_constant.ptr);
|
||||
|
||||
push_constant.ptr = (void **)&value.ptr;
|
||||
push_constant.size = internal::PushConstant<U>::Size;
|
||||
}
|
||||
|
||||
void set_stage_input(unsigned location, void *data, size_t size)
|
||||
{
|
||||
assert(location < SPIRV_CROSS_NUM_STAGE_INPUTS);
|
||||
assert(stage_inputs[location].ptr);
|
||||
assert(size >= stage_inputs[location].size);
|
||||
|
||||
*stage_inputs[location].ptr = data;
|
||||
}
|
||||
|
||||
void set_stage_output(unsigned location, void *data, size_t size)
|
||||
{
|
||||
assert(location < SPIRV_CROSS_NUM_STAGE_OUTPUTS);
|
||||
assert(stage_outputs[location].ptr);
|
||||
assert(size >= stage_outputs[location].size);
|
||||
|
||||
*stage_outputs[location].ptr = data;
|
||||
}
|
||||
|
||||
void set_uniform_constant(unsigned location, void *data, size_t size)
|
||||
{
|
||||
assert(location < SPIRV_CROSS_NUM_UNIFORM_CONSTANTS);
|
||||
assert(uniform_constants[location].ptr);
|
||||
assert(size >= uniform_constants[location].size);
|
||||
|
||||
*uniform_constants[location].ptr = data;
|
||||
}
|
||||
|
||||
void set_push_constant(void *data, size_t size)
|
||||
{
|
||||
assert(push_constant.ptr);
|
||||
assert(size >= push_constant.size);
|
||||
|
||||
*push_constant.ptr = data;
|
||||
}
|
||||
|
||||
void set_resource(unsigned set, unsigned binding, void **data, size_t size)
|
||||
{
|
||||
assert(set < SPIRV_CROSS_NUM_DESCRIPTOR_SETS);
|
||||
assert(binding < SPIRV_CROSS_NUM_DESCRIPTOR_BINDINGS);
|
||||
assert(resources[set][binding].ptr);
|
||||
assert(size >= resources[set][binding].size);
|
||||
|
||||
// We're using the regular PointerInterface, dereference ahead of time.
|
||||
if (resources[set][binding].pre_dereference)
|
||||
*resources[set][binding].ptr = *data;
|
||||
else
|
||||
*resources[set][binding].ptr = data;
|
||||
}
|
||||
};
|
||||
|
||||
namespace spirv_cross
|
||||
{
|
||||
template <typename T>
|
||||
struct BaseShader : spirv_cross_shader
|
||||
{
|
||||
void invoke()
|
||||
{
|
||||
static_cast<T *>(this)->main();
|
||||
}
|
||||
};
|
||||
|
||||
struct FragmentResources
|
||||
{
|
||||
internal::StageOutput<glm::vec4> gl_FragCoord;
|
||||
void init(spirv_cross_shader &s)
|
||||
{
|
||||
s.register_builtin(SPIRV_CROSS_BUILTIN_FRAG_COORD, gl_FragCoord);
|
||||
}
|
||||
#define gl_FragCoord __res->gl_FragCoord.get()
|
||||
};
|
||||
|
||||
template <typename T, typename Res>
|
||||
struct FragmentShader : BaseShader<FragmentShader<T, Res>>
|
||||
{
|
||||
inline void main()
|
||||
{
|
||||
impl.main();
|
||||
}
|
||||
|
||||
FragmentShader()
|
||||
{
|
||||
resources.init(*this);
|
||||
impl.__res = &resources;
|
||||
}
|
||||
|
||||
T impl;
|
||||
Res resources;
|
||||
};
|
||||
|
||||
struct VertexResources
|
||||
{
|
||||
internal::StageOutput<glm::vec4> gl_Position;
|
||||
void init(spirv_cross_shader &s)
|
||||
{
|
||||
s.register_builtin(SPIRV_CROSS_BUILTIN_POSITION, gl_Position);
|
||||
}
|
||||
#define gl_Position __res->gl_Position.get()
|
||||
};
|
||||
|
||||
template <typename T, typename Res>
|
||||
struct VertexShader : BaseShader<VertexShader<T, Res>>
|
||||
{
|
||||
inline void main()
|
||||
{
|
||||
impl.main();
|
||||
}
|
||||
|
||||
VertexShader()
|
||||
{
|
||||
resources.init(*this);
|
||||
impl.__res = &resources;
|
||||
}
|
||||
|
||||
T impl;
|
||||
Res resources;
|
||||
};
|
||||
|
||||
struct TessEvaluationResources
|
||||
{
|
||||
inline void init(spirv_cross_shader &)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename Res>
|
||||
struct TessEvaluationShader : BaseShader<TessEvaluationShader<T, Res>>
|
||||
{
|
||||
inline void main()
|
||||
{
|
||||
impl.main();
|
||||
}
|
||||
|
||||
TessEvaluationShader()
|
||||
{
|
||||
resources.init(*this);
|
||||
impl.__res = &resources;
|
||||
}
|
||||
|
||||
T impl;
|
||||
Res resources;
|
||||
};
|
||||
|
||||
struct TessControlResources
|
||||
{
|
||||
inline void init(spirv_cross_shader &)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename Res>
|
||||
struct TessControlShader : BaseShader<TessControlShader<T, Res>>
|
||||
{
|
||||
inline void main()
|
||||
{
|
||||
impl.main();
|
||||
}
|
||||
|
||||
TessControlShader()
|
||||
{
|
||||
resources.init(*this);
|
||||
impl.__res = &resources;
|
||||
}
|
||||
|
||||
T impl;
|
||||
Res resources;
|
||||
};
|
||||
|
||||
struct GeometryResources
|
||||
{
|
||||
inline void init(spirv_cross_shader &)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename Res>
|
||||
struct GeometryShader : BaseShader<GeometryShader<T, Res>>
|
||||
{
|
||||
inline void main()
|
||||
{
|
||||
impl.main();
|
||||
}
|
||||
|
||||
GeometryShader()
|
||||
{
|
||||
resources.init(*this);
|
||||
impl.__res = &resources;
|
||||
}
|
||||
|
||||
T impl;
|
||||
Res resources;
|
||||
};
|
||||
|
||||
struct ComputeResources
|
||||
{
|
||||
internal::StageInput<glm::uvec3> gl_WorkGroupID__;
|
||||
internal::StageInput<glm::uvec3> gl_NumWorkGroups__;
|
||||
void init(spirv_cross_shader &s)
|
||||
{
|
||||
s.register_builtin(SPIRV_CROSS_BUILTIN_WORK_GROUP_ID, gl_WorkGroupID__);
|
||||
s.register_builtin(SPIRV_CROSS_BUILTIN_NUM_WORK_GROUPS, gl_NumWorkGroups__);
|
||||
}
|
||||
#define gl_WorkGroupID __res->gl_WorkGroupID__.get()
|
||||
#define gl_NumWorkGroups __res->gl_NumWorkGroups__.get()
|
||||
|
||||
Barrier barrier__;
|
||||
#define barrier() __res->barrier__.wait()
|
||||
};
|
||||
|
||||
struct ComputePrivateResources
|
||||
{
|
||||
uint32_t gl_LocalInvocationIndex__;
|
||||
#define gl_LocalInvocationIndex __priv_res.gl_LocalInvocationIndex__
|
||||
glm::uvec3 gl_LocalInvocationID__;
|
||||
#define gl_LocalInvocationID __priv_res.gl_LocalInvocationID__
|
||||
glm::uvec3 gl_GlobalInvocationID__;
|
||||
#define gl_GlobalInvocationID __priv_res.gl_GlobalInvocationID__
|
||||
};
|
||||
|
||||
template <typename T, typename Res, unsigned WorkGroupX, unsigned WorkGroupY, unsigned WorkGroupZ>
|
||||
struct ComputeShader : BaseShader<ComputeShader<T, Res, WorkGroupX, WorkGroupY, WorkGroupZ>>
|
||||
{
|
||||
inline void main()
|
||||
{
|
||||
resources.barrier__.reset_counter();
|
||||
|
||||
for (unsigned z = 0; z < WorkGroupZ; z++)
|
||||
for (unsigned y = 0; y < WorkGroupY; y++)
|
||||
for (unsigned x = 0; x < WorkGroupX; x++)
|
||||
impl[z][y][x].__priv_res.gl_GlobalInvocationID__ =
|
||||
glm::uvec3(WorkGroupX, WorkGroupY, WorkGroupZ) * resources.gl_WorkGroupID__.get() +
|
||||
glm::uvec3(x, y, z);
|
||||
|
||||
group.run();
|
||||
group.wait();
|
||||
}
|
||||
|
||||
ComputeShader()
|
||||
: group(&impl[0][0][0])
|
||||
{
|
||||
resources.init(*this);
|
||||
resources.barrier__.set_release_divisor(WorkGroupX * WorkGroupY * WorkGroupZ);
|
||||
|
||||
unsigned i = 0;
|
||||
for (unsigned z = 0; z < WorkGroupZ; z++)
|
||||
{
|
||||
for (unsigned y = 0; y < WorkGroupY; y++)
|
||||
{
|
||||
for (unsigned x = 0; x < WorkGroupX; x++)
|
||||
{
|
||||
impl[z][y][x].__priv_res.gl_LocalInvocationID__ = glm::uvec3(x, y, z);
|
||||
impl[z][y][x].__priv_res.gl_LocalInvocationIndex__ = i++;
|
||||
impl[z][y][x].__res = &resources;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
T impl[WorkGroupZ][WorkGroupY][WorkGroupX];
|
||||
ThreadGroup<T, WorkGroupX * WorkGroupY * WorkGroupZ> group;
|
||||
Res resources;
|
||||
};
|
||||
|
||||
inline void memoryBarrierShared()
|
||||
{
|
||||
Barrier::memoryBarrier();
|
||||
}
|
||||
inline void memoryBarrier()
|
||||
{
|
||||
Barrier::memoryBarrier();
|
||||
}
|
||||
// TODO: Rest of the barriers.
|
||||
|
||||
// Atomics
|
||||
template <typename T>
|
||||
inline T atomicAdd(T &v, T a)
|
||||
{
|
||||
static_assert(sizeof(std::atomic<T>) == sizeof(T), "Cannot cast properly to std::atomic<T>.");
|
||||
|
||||
// We need explicit memory barriers in GLSL to enfore any ordering.
|
||||
// FIXME: Can we really cast this? There is no other way I think ...
|
||||
return std::atomic_fetch_add_explicit(reinterpret_cast<std::atomic<T> *>(&v), a, std::memory_order_relaxed);
|
||||
}
|
||||
}
|
||||
|
||||
void spirv_cross_set_stage_input(spirv_cross_shader_t *shader, unsigned location, void *data, size_t size)
|
||||
{
|
||||
shader->set_stage_input(location, data, size);
|
||||
}
|
||||
|
||||
void spirv_cross_set_stage_output(spirv_cross_shader_t *shader, unsigned location, void *data, size_t size)
|
||||
{
|
||||
shader->set_stage_output(location, data, size);
|
||||
}
|
||||
|
||||
void spirv_cross_set_uniform_constant(spirv_cross_shader_t *shader, unsigned location, void *data, size_t size)
|
||||
{
|
||||
shader->set_uniform_constant(location, data, size);
|
||||
}
|
||||
|
||||
void spirv_cross_set_resource(spirv_cross_shader_t *shader, unsigned set, unsigned binding, void **data, size_t size)
|
||||
{
|
||||
shader->set_resource(set, binding, data, size);
|
||||
}
|
||||
|
||||
void spirv_cross_set_push_constant(spirv_cross_shader_t *shader, void *data, size_t size)
|
||||
{
|
||||
shader->set_push_constant(data, size);
|
||||
}
|
||||
|
||||
void spirv_cross_set_builtin(spirv_cross_shader_t *shader, spirv_cross_builtin builtin, void *data, size_t size)
|
||||
{
|
||||
shader->set_builtin(builtin, data, size);
|
||||
}
|
||||
|
||||
#endif
|
105
deps/SPIRV-Cross/include/spirv_cross/sampler.hpp
vendored
105
deps/SPIRV-Cross/include/spirv_cross/sampler.hpp
vendored
@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef SPIRV_CROSS_SAMPLER_HPP
|
||||
#define SPIRV_CROSS_SAMPLER_HPP
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace spirv_cross
|
||||
{
|
||||
struct spirv_cross_sampler_2d
|
||||
{
|
||||
inline virtual ~spirv_cross_sampler_2d()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct sampler2DBase : spirv_cross_sampler_2d
|
||||
{
|
||||
sampler2DBase(const spirv_cross_sampler_info *info)
|
||||
{
|
||||
mips.insert(mips.end(), info->mipmaps, info->mipmaps + info->num_mipmaps);
|
||||
format = info->format;
|
||||
wrap_s = info->wrap_s;
|
||||
wrap_t = info->wrap_t;
|
||||
min_filter = info->min_filter;
|
||||
mag_filter = info->mag_filter;
|
||||
mip_filter = info->mip_filter;
|
||||
}
|
||||
|
||||
inline virtual T sample(glm::vec2 uv, float bias)
|
||||
{
|
||||
return sampleLod(uv, bias);
|
||||
}
|
||||
|
||||
inline virtual T sampleLod(glm::vec2 uv, float lod)
|
||||
{
|
||||
if (mag_filter == SPIRV_CROSS_FILTER_NEAREST)
|
||||
{
|
||||
uv.x = wrap(uv.x, wrap_s, mips[0].width);
|
||||
uv.y = wrap(uv.y, wrap_t, mips[0].height);
|
||||
glm::vec2 uv_full = uv * glm::vec2(mips[0].width, mips[0].height);
|
||||
|
||||
int x = int(uv_full.x);
|
||||
int y = int(uv_full.y);
|
||||
return sample(x, y, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return T(0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
inline float wrap(float v, spirv_cross_wrap wrap, unsigned size)
|
||||
{
|
||||
switch (wrap)
|
||||
{
|
||||
case SPIRV_CROSS_WRAP_REPEAT:
|
||||
return v - glm::floor(v);
|
||||
case SPIRV_CROSS_WRAP_CLAMP_TO_EDGE:
|
||||
{
|
||||
float half = 0.5f / size;
|
||||
return glm::clamp(v, half, 1.0f - half);
|
||||
}
|
||||
|
||||
default:
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<spirv_cross_miplevel> mips;
|
||||
spirv_cross_format format;
|
||||
spirv_cross_wrap wrap_s;
|
||||
spirv_cross_format wrap_t;
|
||||
spirv_cross_filter min_filter;
|
||||
spirv_cross_filter mag_filter;
|
||||
spirv_cross_mipfilter mip_filter;
|
||||
};
|
||||
|
||||
typedef sampler2DBase<glm::vec4> sampler2D;
|
||||
typedef sampler2DBase<glm::ivec4> isampler2D;
|
||||
typedef sampler2DBase<glm::uvec4> usampler2D;
|
||||
|
||||
template <typename T>
|
||||
inline T texture(const sampler2DBase<T> &samp, const glm::vec2 &uv, float bias = 0.0f)
|
||||
{
|
||||
return samp.sample(uv, bias);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -1,113 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef SPIRV_CROSS_THREAD_GROUP_HPP
|
||||
#define SPIRV_CROSS_THREAD_GROUP_HPP
|
||||
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
namespace spirv_cross
|
||||
{
|
||||
template <typename T, unsigned Size>
|
||||
class ThreadGroup
|
||||
{
|
||||
public:
|
||||
ThreadGroup(T *impl)
|
||||
{
|
||||
for (unsigned i = 0; i < Size; i++)
|
||||
workers[i].start(&impl[i]);
|
||||
}
|
||||
|
||||
void run()
|
||||
{
|
||||
for (auto &worker : workers)
|
||||
worker.run();
|
||||
}
|
||||
|
||||
void wait()
|
||||
{
|
||||
for (auto &worker : workers)
|
||||
worker.wait();
|
||||
}
|
||||
|
||||
private:
|
||||
struct Thread
|
||||
{
|
||||
enum State
|
||||
{
|
||||
Idle,
|
||||
Running,
|
||||
Dying
|
||||
};
|
||||
State state = Idle;
|
||||
|
||||
void start(T *impl)
|
||||
{
|
||||
worker = std::thread([impl, this] {
|
||||
for (;;)
|
||||
{
|
||||
{
|
||||
std::unique_lock<std::mutex> l{ lock };
|
||||
cond.wait(l, [this] { return state != Idle; });
|
||||
if (state == Dying)
|
||||
break;
|
||||
}
|
||||
|
||||
impl->main();
|
||||
|
||||
std::lock_guard<std::mutex> l{ lock };
|
||||
state = Idle;
|
||||
cond.notify_one();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void wait()
|
||||
{
|
||||
std::unique_lock<std::mutex> l{ lock };
|
||||
cond.wait(l, [this] { return state == Idle; });
|
||||
}
|
||||
|
||||
void run()
|
||||
{
|
||||
std::lock_guard<std::mutex> l{ lock };
|
||||
state = Running;
|
||||
cond.notify_one();
|
||||
}
|
||||
|
||||
~Thread()
|
||||
{
|
||||
if (worker.joinable())
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> l{ lock };
|
||||
state = Dying;
|
||||
cond.notify_one();
|
||||
}
|
||||
worker.join();
|
||||
}
|
||||
}
|
||||
std::thread worker;
|
||||
std::condition_variable cond;
|
||||
std::mutex lock;
|
||||
};
|
||||
Thread workers[Size];
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
12
deps/SPIRV-Cross/jni/Android.mk
vendored
12
deps/SPIRV-Cross/jni/Android.mk
vendored
@ -1,12 +0,0 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_CFLAGS += -std=c++11 -Wall -Wextra
|
||||
LOCAL_MODULE := spirv-cross
|
||||
LOCAL_SRC_FILES := ../spirv_cfg.cpp ../spirv_cross.cpp ../spirv_cross_util.cpp ../spirv_glsl.cpp ../spirv_hlsl.cpp ../spirv_msl.cpp ../spirv_cpp.cpp
|
||||
LOCAL_CPP_FEATURES := exceptions
|
||||
LOCAL_ARM_MODE := arm
|
||||
LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
2
deps/SPIRV-Cross/jni/Application.mk
vendored
2
deps/SPIRV-Cross/jni/Application.mk
vendored
@ -1,2 +0,0 @@
|
||||
APP_STL := c++_static
|
||||
APP_ABI := armeabi-v7a
|
1089
deps/SPIRV-Cross/main.cpp
vendored
1089
deps/SPIRV-Cross/main.cpp
vendored
File diff suppressed because it is too large
Load Diff
28
deps/SPIRV-Cross/msvc/SPIRV-Cross.sln
vendored
28
deps/SPIRV-Cross/msvc/SPIRV-Cross.sln
vendored
@ -1,28 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Express 2013 for Windows Desktop
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SPIRV-Cross", "SPIRV-Cross.vcxproj", "{977E3701-1A21-4425-B7E5-6BDF5EA062CD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Debug|x64.Build.0 = Debug|x64
|
||||
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Release|Win32.Build.0 = Release|Win32
|
||||
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Release|x64.ActiveCfg = Release|x64
|
||||
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
152
deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj
vendored
152
deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj
vendored
@ -1,152 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{977E3701-1A21-4425-B7E5-6BDF5EA062CD}</ProjectGuid>
|
||||
<RootNamespace>SPIRV-Cross</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\main.cpp" />
|
||||
<ClCompile Include="..\spirv_cpp.cpp" />
|
||||
<ClCompile Include="..\spirv_cross.cpp" />
|
||||
<ClCompile Include="..\spirv_glsl.cpp" />
|
||||
<ClCompile Include="..\spirv_reflect.cpp" />
|
||||
<ClCompile Include="..\spirv_hlsl.cpp" />
|
||||
<ClCompile Include="..\spirv_msl.cpp" />
|
||||
<ClCompile Include="..\spirv_cfg.cpp" />
|
||||
<ClCompile Include="..\spirv_cross_util.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\GLSL.std.450.h" />
|
||||
<ClInclude Include="..\spirv_common.hpp" />
|
||||
<ClInclude Include="..\spirv_cpp.hpp" />
|
||||
<ClInclude Include="..\spirv_cross.hpp" />
|
||||
<ClInclude Include="..\spirv_glsl.hpp" />
|
||||
<ClInclude Include="..\spirv_reflect.hpp" />
|
||||
<ClInclude Include="..\spirv.hpp" />
|
||||
<ClInclude Include="..\spirv_hlsl.hpp" />
|
||||
<ClInclude Include="..\spirv_msl.hpp" />
|
||||
<ClInclude Include="..\spirv_cfg.hpp" />
|
||||
<ClInclude Include="..\spirv_cross_util.hpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -1,81 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spirv_cross.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spirv_glsl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spirv_reflect.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spirv_cpp.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spirv_msl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spirv_cfg.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spirv_hlsl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spirv_cross_util.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\GLSL.std.450.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_cross.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_glsl.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_reflect.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_common.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_cpp.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_msl.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_cfg.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_hlsl.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_cross_util.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,32 +0,0 @@
|
||||
RWByteAddressBuffer bar : register(u0);
|
||||
RWByteAddressBuffer foo : register(u1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
[unroll]
|
||||
for (int _135 = 0; _135 < 16; )
|
||||
{
|
||||
bar.Store4(_135 * 16 + 0, asuint(asfloat(foo.Load4(_135 * 16 + 0))));
|
||||
_135++;
|
||||
continue;
|
||||
}
|
||||
[loop]
|
||||
for (int _136 = 0; _136 < 16; )
|
||||
{
|
||||
bar.Store4((15 - _136) * 16 + 0, asuint(asfloat(foo.Load4(_136 * 16 + 0))));
|
||||
_136++;
|
||||
continue;
|
||||
}
|
||||
[branch]
|
||||
if (asfloat(bar.Load(160)) > 10.0f)
|
||||
{
|
||||
foo.Store4(320, asuint(5.0f.xxxx));
|
||||
}
|
||||
foo.Store4(320, asuint(20.0f.xxxx));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
static const uint _3 = 1u;
|
||||
static const uint _4 = 3u;
|
||||
static const uint3 gl_WorkGroupSize = uint3(_3, 2u, _4);
|
||||
|
||||
RWByteAddressBuffer _8 : register(u0);
|
||||
RWByteAddressBuffer _9 : register(u1);
|
||||
|
||||
static uint3 gl_WorkGroupID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_WorkGroupID : SV_GroupID;
|
||||
};
|
||||
|
||||
static uint3 _22 = gl_WorkGroupSize;
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_8.Store(gl_WorkGroupID.x * 4 + 0, asuint(asfloat(_9.Load(gl_WorkGroupID.x * 4 + 0)) + asfloat(_8.Load(gl_WorkGroupID.x * 4 + 0))));
|
||||
}
|
||||
|
||||
[numthreads(1, 2, 3)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_WorkGroupID = stage_input.gl_WorkGroupID;
|
||||
comp_main();
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
cbuffer _5 : register(b0)
|
||||
{
|
||||
column_major float2x4 _5_m0 : packoffset(c0);
|
||||
float4 _5_m1 : packoffset(c4);
|
||||
};
|
||||
|
||||
static float2 _3;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 _3 : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
_3 = mul(_5_m0, _5_m1);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output._3 = _3;
|
||||
return stage_output;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
Texture2D<float4> uTex : register(t1);
|
||||
SamplerState uSampler : register(s0);
|
||||
|
||||
static float4 FragColor;
|
||||
static float2 vUV;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 vUV : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uTex.Sample(uSampler, vUV);
|
||||
FragColor += uTex.Sample(uSampler, vUV, int2(1, 1));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vUV = stage_input.vUV;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
static float4 FragColor;
|
||||
static float4 vA;
|
||||
static float4 vB;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vA : TEXCOORD0;
|
||||
float4 vB : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = fmod(vA, vB);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vA = stage_input.vA;
|
||||
vB = stage_input.vB;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = 10.0f.xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
Texture2D<float4> uTexture : register(t0);
|
||||
SamplerState _uTexture_sampler : register(s0);
|
||||
|
||||
static int2 Size;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
int2 Size : SV_Target0;
|
||||
};
|
||||
|
||||
uint2 SPIRV_Cross_textureSize(Texture2D<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint2 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
uint _19_dummy_parameter;
|
||||
uint _20_dummy_parameter;
|
||||
Size = int2(SPIRV_Cross_textureSize(uTexture, uint(0), _19_dummy_parameter)) + int2(SPIRV_Cross_textureSize(uTexture, uint(1), _20_dummy_parameter));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.Size = Size;
|
||||
return stage_output;
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
Texture2D<float4> uImage : register(t0);
|
||||
SamplerState _uImage_sampler : register(s0);
|
||||
|
||||
static float4 v0;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 v0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float phi;
|
||||
float4 _36;
|
||||
int _51;
|
||||
_51 = 0;
|
||||
phi = 1.0f;
|
||||
_36 = float4(1.0f, 2.0f, 1.0f, 2.0f);
|
||||
for (;;)
|
||||
{
|
||||
FragColor = _36;
|
||||
if (_51 < 4)
|
||||
{
|
||||
if (v0[_51] > 0.0f)
|
||||
{
|
||||
float2 _48 = phi.xx;
|
||||
_51++;
|
||||
phi += 2.0f;
|
||||
_36 = uImage.SampleLevel(_uImage_sampler, _48, 0.0f);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
v0 = stage_input.v0;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
static const float _46[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f };
|
||||
static const float4 _76[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx };
|
||||
static const float4 _90[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx };
|
||||
|
||||
static float FragColor;
|
||||
static int index;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int index : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 foobar[4] = _76;
|
||||
float4 baz[4] = _76;
|
||||
FragColor = _46[index];
|
||||
if (index < 10)
|
||||
{
|
||||
FragColor += _46[index ^ 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor += _46[index & 1];
|
||||
}
|
||||
bool _99 = index > 30;
|
||||
if (_99)
|
||||
{
|
||||
FragColor += _76[index & 3].y;
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor += _76[index & 1].x;
|
||||
}
|
||||
if (_99)
|
||||
{
|
||||
foobar[1].z = 20.0f;
|
||||
}
|
||||
int _37 = index & 3;
|
||||
FragColor += foobar[_37].z;
|
||||
baz = _90;
|
||||
FragColor += baz[_37].z;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
index = stage_input.index;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
static float4 FragColor;
|
||||
static int4 vA;
|
||||
static int4 vB;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int4 vA : TEXCOORD0;
|
||||
nointerpolation int4 vB : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float4(vA - vB * (vA / vB));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vA = stage_input.vA;
|
||||
vB = stage_input.vB;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
Texture2D<float4> uTexture : register(t0);
|
||||
SamplerState _uTexture_sampler : register(s0);
|
||||
|
||||
static float4 gl_FragCoord;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uTexture.Load(int3(int2(gl_FragCoord.xy), 0));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
Texture2D<float4> uShadow : register(t0);
|
||||
SamplerComparisonState _uShadow_sampler : register(s0);
|
||||
Texture2D<float4> uTexture : register(t1);
|
||||
SamplerComparisonState uSampler : register(s2);
|
||||
|
||||
static float3 vUV;
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float3 vUV : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uShadow.SampleCmp(_uShadow_sampler, vUV.xy, vUV.z) + uTexture.SampleCmp(uSampler, vUV.xy, vUV.z);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vUV = stage_input.vUV;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
static int counter;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int counter : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
bool _29;
|
||||
for (;;)
|
||||
{
|
||||
_29 = counter == 10;
|
||||
if (_29)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
bool4 _35 = _29.xxxx;
|
||||
FragColor = float4(_35.x ? 10.0f.xxxx.x : 30.0f.xxxx.x, _35.y ? 10.0f.xxxx.y : 30.0f.xxxx.y, _35.z ? 10.0f.xxxx.z : 30.0f.xxxx.z, _35.w ? 10.0f.xxxx.w : 30.0f.xxxx.w);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
counter = stage_input.counter;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
static const int _7 = -10;
|
||||
static const uint _8 = 100u;
|
||||
static const int _20 = (_7 + 2);
|
||||
static const uint _25 = (_8 % 5u);
|
||||
static const int4 _30 = int4(20, 30, _20, _20);
|
||||
static const int2 _32 = int2(_30.y, _30.x);
|
||||
static const int _33 = _30.y;
|
||||
|
||||
static float4 gl_Position;
|
||||
static int _4;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
nointerpolation int _4 : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
float4 _64 = 0.0f.xxxx;
|
||||
_64.y = float(_20);
|
||||
float4 _68 = _64;
|
||||
_68.z = float(_25);
|
||||
float4 _52 = _68 + float4(_30);
|
||||
float2 _56 = _52.xy + float2(_32);
|
||||
gl_Position = float4(_56.x, _56.y, _52.z, _52.w);
|
||||
_4 = _33;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output._4 = _4;
|
||||
return stage_output;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
static float4 gl_Position;
|
||||
static int gl_VertexIndex;
|
||||
static int gl_InstanceIndex;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint gl_VertexIndex : SV_VertexID;
|
||||
uint gl_InstanceIndex : SV_InstanceID;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = float(uint(gl_VertexIndex) + uint(gl_InstanceIndex)).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_VertexIndex = int(stage_input.gl_VertexIndex);
|
||||
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
static float4 gl_Position;
|
||||
static int gl_VertexID;
|
||||
static int gl_InstanceID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint gl_VertexID : SV_VertexID;
|
||||
uint gl_InstanceID : SV_InstanceID;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = float(gl_VertexID + gl_InstanceID).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_VertexID = int(stage_input.gl_VertexID);
|
||||
gl_InstanceID = int(stage_input.gl_InstanceID);
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
RWByteAddressBuffer wo : register(u1);
|
||||
ByteAddressBuffer ro : register(t0);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
wo.Store4(gl_GlobalInvocationID.x * 64 + 272, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 64 + 160))));
|
||||
wo.Store4(gl_GlobalInvocationID.x * 16 + 480, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 16 + 480))));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
RWByteAddressBuffer WriteOnly : register(u2);
|
||||
ByteAddressBuffer ReadOnly : register(t0);
|
||||
RWByteAddressBuffer ReadWrite : register(u1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
WriteOnly.Store4(0, asuint(asfloat(ReadOnly.Load4(0))));
|
||||
ReadWrite.Store4(0, asuint(asfloat(ReadWrite.Load4(0)) + 10.0f.xxxx));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,89 +0,0 @@
|
||||
RWByteAddressBuffer ssbo : register(u2);
|
||||
RWTexture2D<uint> uImage : register(u0);
|
||||
RWTexture2D<int> iImage : register(u1);
|
||||
|
||||
groupshared int int_atomic;
|
||||
groupshared uint uint_atomic;
|
||||
groupshared int int_atomic_array[1];
|
||||
groupshared uint uint_atomic_array[1];
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uint _19;
|
||||
InterlockedAdd(uImage[int2(1, 5)], 1u, _19);
|
||||
uint _27;
|
||||
InterlockedAdd(uImage[int2(1, 5)], 1u, _27);
|
||||
iImage[int2(1, 6)] = int(_27).x;
|
||||
uint _32;
|
||||
InterlockedOr(uImage[int2(1, 5)], 1u, _32);
|
||||
uint _34;
|
||||
InterlockedXor(uImage[int2(1, 5)], 1u, _34);
|
||||
uint _36;
|
||||
InterlockedAnd(uImage[int2(1, 5)], 1u, _36);
|
||||
uint _38;
|
||||
InterlockedMin(uImage[int2(1, 5)], 1u, _38);
|
||||
uint _40;
|
||||
InterlockedMax(uImage[int2(1, 5)], 1u, _40);
|
||||
uint _44;
|
||||
InterlockedCompareExchange(uImage[int2(1, 5)], 10u, 2u, _44);
|
||||
int _47;
|
||||
InterlockedAdd(iImage[int2(1, 6)], 1, _47);
|
||||
int _49;
|
||||
InterlockedOr(iImage[int2(1, 6)], 1, _49);
|
||||
int _51;
|
||||
InterlockedXor(iImage[int2(1, 6)], 1, _51);
|
||||
int _53;
|
||||
InterlockedAnd(iImage[int2(1, 6)], 1, _53);
|
||||
int _55;
|
||||
InterlockedMin(iImage[int2(1, 6)], 1, _55);
|
||||
int _57;
|
||||
InterlockedMax(iImage[int2(1, 6)], 1, _57);
|
||||
int _61;
|
||||
InterlockedCompareExchange(iImage[int2(1, 5)], 10, 2, _61);
|
||||
uint _68;
|
||||
ssbo.InterlockedAdd(0, 1u, _68);
|
||||
uint _70;
|
||||
ssbo.InterlockedOr(0, 1u, _70);
|
||||
uint _72;
|
||||
ssbo.InterlockedXor(0, 1u, _72);
|
||||
uint _74;
|
||||
ssbo.InterlockedAnd(0, 1u, _74);
|
||||
uint _76;
|
||||
ssbo.InterlockedMin(0, 1u, _76);
|
||||
uint _78;
|
||||
ssbo.InterlockedMax(0, 1u, _78);
|
||||
uint _80;
|
||||
ssbo.InterlockedExchange(0, 1u, _80);
|
||||
uint _82;
|
||||
ssbo.InterlockedCompareExchange(0, 10u, 2u, _82);
|
||||
int _85;
|
||||
ssbo.InterlockedAdd(4, 1, _85);
|
||||
int _87;
|
||||
ssbo.InterlockedOr(4, 1, _87);
|
||||
int _89;
|
||||
ssbo.InterlockedXor(4, 1, _89);
|
||||
int _91;
|
||||
ssbo.InterlockedAnd(4, 1, _91);
|
||||
int _93;
|
||||
ssbo.InterlockedMin(4, 1, _93);
|
||||
int _95;
|
||||
ssbo.InterlockedMax(4, 1, _95);
|
||||
int _97;
|
||||
ssbo.InterlockedExchange(4, 1, _97);
|
||||
int _99;
|
||||
ssbo.InterlockedCompareExchange(4, 10, 2, _99);
|
||||
int _102;
|
||||
InterlockedAdd(int_atomic, 10, _102);
|
||||
uint _105;
|
||||
InterlockedAdd(uint_atomic, 10u, _105);
|
||||
int _110;
|
||||
InterlockedAdd(int_atomic_array[0], 10, _110);
|
||||
uint _115;
|
||||
InterlockedAdd(uint_atomic_array[0], 10u, _115);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
GroupMemoryBarrier();
|
||||
AllMemoryBarrier();
|
||||
DeviceMemoryBarrier();
|
||||
DeviceMemoryBarrier();
|
||||
AllMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
AllMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
DeviceMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
DeviceMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
AllMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
}
|
||||
|
||||
[numthreads(4, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(8u, 4u, 2u);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
}
|
||||
|
||||
[numthreads(8, 4, 2)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
globallycoherent RWByteAddressBuffer _29 : register(u3);
|
||||
ByteAddressBuffer _33 : register(t2);
|
||||
RWTexture2D<float> uImageIn : register(u0);
|
||||
globallycoherent RWTexture2D<float> uImageOut : register(u1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uImageOut[int2(9, 7)] = uImageIn[int2(9, 7)].x;
|
||||
_29.Store(0, asuint(asfloat(_33.Load(0))));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
RWTexture2D<float> uImageInF : register(u0);
|
||||
RWTexture2D<float> uImageOutF : register(u1);
|
||||
RWTexture2D<int> uImageInI : register(u2);
|
||||
RWTexture2D<int> uImageOutI : register(u3);
|
||||
RWTexture2D<uint> uImageInU : register(u4);
|
||||
RWTexture2D<uint> uImageOutU : register(u5);
|
||||
RWBuffer<float> uImageInBuffer : register(u6);
|
||||
RWBuffer<float> uImageOutBuffer : register(u7);
|
||||
RWTexture2D<float2> uImageInF2 : register(u8);
|
||||
RWTexture2D<float2> uImageOutF2 : register(u9);
|
||||
RWTexture2D<int2> uImageInI2 : register(u10);
|
||||
RWTexture2D<int2> uImageOutI2 : register(u11);
|
||||
RWTexture2D<uint2> uImageInU2 : register(u12);
|
||||
RWTexture2D<uint2> uImageOutU2 : register(u13);
|
||||
RWBuffer<float2> uImageInBuffer2 : register(u14);
|
||||
RWBuffer<float2> uImageOutBuffer2 : register(u15);
|
||||
RWTexture2D<float4> uImageInF4 : register(u16);
|
||||
RWTexture2D<float4> uImageOutF4 : register(u17);
|
||||
RWTexture2D<int4> uImageInI4 : register(u18);
|
||||
RWTexture2D<int4> uImageOutI4 : register(u19);
|
||||
RWTexture2D<uint4> uImageInU4 : register(u20);
|
||||
RWTexture2D<uint4> uImageOutU4 : register(u21);
|
||||
RWBuffer<float4> uImageInBuffer4 : register(u22);
|
||||
RWBuffer<float4> uImageOutBuffer4 : register(u23);
|
||||
RWTexture2D<float4> uImageNoFmtF : register(u24);
|
||||
RWTexture2D<uint4> uImageNoFmtU : register(u25);
|
||||
RWTexture2D<int4> uImageNoFmtI : register(u26);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
int2 _23 = int2(gl_GlobalInvocationID.xy);
|
||||
uImageOutF[_23] = uImageInF[_23].x;
|
||||
uImageOutI[_23] = uImageInI[_23].x;
|
||||
uImageOutU[_23] = uImageInU[_23].x;
|
||||
int _74 = int(gl_GlobalInvocationID.x);
|
||||
uImageOutBuffer[_74] = uImageInBuffer[_74].x;
|
||||
uImageOutF2[_23] = uImageInF2[_23].xy;
|
||||
uImageOutI2[_23] = uImageInI2[_23].xy;
|
||||
uImageOutU2[_23] = uImageInU2[_23].xy;
|
||||
float4 _135 = uImageInBuffer2[_74].xyyy;
|
||||
uImageOutBuffer2[_74] = _135.xy;
|
||||
uImageOutF4[_23] = uImageInF4[_23];
|
||||
int4 _165 = uImageInI4[_23];
|
||||
uImageOutI4[_23] = _165;
|
||||
uint4 _180 = uImageInU4[_23];
|
||||
uImageOutU4[_23] = _180;
|
||||
uImageOutBuffer4[_74] = uImageInBuffer4[_74];
|
||||
uImageNoFmtF[_23] = _135;
|
||||
uImageNoFmtU[_23] = _180;
|
||||
uImageNoFmtI[_23] = _165;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
@ -1,122 +0,0 @@
|
||||
RWByteAddressBuffer _15 : register(u0);
|
||||
ByteAddressBuffer _20 : register(t1);
|
||||
|
||||
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
|
||||
// adjoint and dividing by the determinant. The contents of the matrix are changed.
|
||||
float2x2 SPIRV_Cross_Inverse(float2x2 m)
|
||||
{
|
||||
float2x2 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
// Create the transpose of the cofactors, as the classical adjoint of the matrix.
|
||||
adj[0][0] = m[1][1];
|
||||
adj[0][1] = -m[0][1];
|
||||
|
||||
adj[1][0] = -m[1][0];
|
||||
adj[1][1] = m[0][0];
|
||||
|
||||
// Calculate the determinant as a combination of the cofactors of the first row.
|
||||
float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]);
|
||||
|
||||
// Divide the classical adjoint matrix by the determinant.
|
||||
// If determinant is zero, matrix is not invertable, so leave it unchanged.
|
||||
return (det != 0.0f) ? (adj * (1.0f / det)) : m;
|
||||
}
|
||||
|
||||
// Returns the determinant of a 2x2 matrix.
|
||||
float SPIRV_Cross_Det2x2(float a1, float a2, float b1, float b2)
|
||||
{
|
||||
return a1 * b2 - b1 * a2;
|
||||
}
|
||||
|
||||
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
|
||||
// adjoint and dividing by the determinant. The contents of the matrix are changed.
|
||||
float3x3 SPIRV_Cross_Inverse(float3x3 m)
|
||||
{
|
||||
float3x3 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
// Create the transpose of the cofactors, as the classical adjoint of the matrix.
|
||||
adj[0][0] = SPIRV_Cross_Det2x2(m[1][1], m[1][2], m[2][1], m[2][2]);
|
||||
adj[0][1] = -SPIRV_Cross_Det2x2(m[0][1], m[0][2], m[2][1], m[2][2]);
|
||||
adj[0][2] = SPIRV_Cross_Det2x2(m[0][1], m[0][2], m[1][1], m[1][2]);
|
||||
|
||||
adj[1][0] = -SPIRV_Cross_Det2x2(m[1][0], m[1][2], m[2][0], m[2][2]);
|
||||
adj[1][1] = SPIRV_Cross_Det2x2(m[0][0], m[0][2], m[2][0], m[2][2]);
|
||||
adj[1][2] = -SPIRV_Cross_Det2x2(m[0][0], m[0][2], m[1][0], m[1][2]);
|
||||
|
||||
adj[2][0] = SPIRV_Cross_Det2x2(m[1][0], m[1][1], m[2][0], m[2][1]);
|
||||
adj[2][1] = -SPIRV_Cross_Det2x2(m[0][0], m[0][1], m[2][0], m[2][1]);
|
||||
adj[2][2] = SPIRV_Cross_Det2x2(m[0][0], m[0][1], m[1][0], m[1][1]);
|
||||
|
||||
// Calculate the determinant as a combination of the cofactors of the first row.
|
||||
float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]);
|
||||
|
||||
// Divide the classical adjoint matrix by the determinant.
|
||||
// If determinant is zero, matrix is not invertable, so leave it unchanged.
|
||||
return (det != 0.0f) ? (adj * (1.0f / det)) : m;
|
||||
}
|
||||
|
||||
// Returns the determinant of a 3x3 matrix.
|
||||
float SPIRV_Cross_Det3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3)
|
||||
{
|
||||
return a1 * SPIRV_Cross_Det2x2(b2, b3, c2, c3) - b1 * SPIRV_Cross_Det2x2(a2, a3, c2, c3) + c1 * SPIRV_Cross_Det2x2(a2, a3, b2, b3);
|
||||
}
|
||||
|
||||
// Returns the inverse of a matrix, by using the algorithm of calculating the classical
|
||||
// adjoint and dividing by the determinant. The contents of the matrix are changed.
|
||||
float4x4 SPIRV_Cross_Inverse(float4x4 m)
|
||||
{
|
||||
float4x4 adj; // The adjoint matrix (inverse after dividing by determinant)
|
||||
|
||||
// Create the transpose of the cofactors, as the classical adjoint of the matrix.
|
||||
adj[0][0] = SPIRV_Cross_Det3x3(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3]);
|
||||
adj[0][1] = -SPIRV_Cross_Det3x3(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3]);
|
||||
adj[0][2] = SPIRV_Cross_Det3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], m[3][3]);
|
||||
adj[0][3] = -SPIRV_Cross_Det3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3]);
|
||||
|
||||
adj[1][0] = -SPIRV_Cross_Det3x3(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3]);
|
||||
adj[1][1] = SPIRV_Cross_Det3x3(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3]);
|
||||
adj[1][2] = -SPIRV_Cross_Det3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], m[3][3]);
|
||||
adj[1][3] = SPIRV_Cross_Det3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3]);
|
||||
|
||||
adj[2][0] = SPIRV_Cross_Det3x3(m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3]);
|
||||
adj[2][1] = -SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3]);
|
||||
adj[2][2] = SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], m[3][3]);
|
||||
adj[2][3] = -SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3]);
|
||||
|
||||
adj[3][0] = -SPIRV_Cross_Det3x3(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2]);
|
||||
adj[3][1] = SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2]);
|
||||
adj[3][2] = -SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], m[3][2]);
|
||||
adj[3][3] = SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2]);
|
||||
|
||||
// Calculate the determinant as a combination of the cofactors of the first row.
|
||||
float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]) + (adj[0][3] * m[3][0]);
|
||||
|
||||
// Divide the classical adjoint matrix by the determinant.
|
||||
// If determinant is zero, matrix is not invertable, so leave it unchanged.
|
||||
return (det != 0.0f) ? (adj * (1.0f / det)) : m;
|
||||
}
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
float2x2 _23 = asfloat(uint2x2(_20.Load2(0), _20.Load2(8)));
|
||||
float2x2 _24 = SPIRV_Cross_Inverse(_23);
|
||||
_15.Store2(0, asuint(_24[0]));
|
||||
_15.Store2(8, asuint(_24[1]));
|
||||
float3x3 _29 = asfloat(uint3x3(_20.Load3(16), _20.Load3(32), _20.Load3(48)));
|
||||
float3x3 _30 = SPIRV_Cross_Inverse(_29);
|
||||
_15.Store3(16, asuint(_30[0]));
|
||||
_15.Store3(32, asuint(_30[1]));
|
||||
_15.Store3(48, asuint(_30[2]));
|
||||
float4x4 _35 = asfloat(uint4x4(_20.Load4(64), _20.Load4(80), _20.Load4(96), _20.Load4(112)));
|
||||
float4x4 _36 = SPIRV_Cross_Inverse(_35);
|
||||
_15.Store4(64, asuint(_36[0]));
|
||||
_15.Store4(80, asuint(_36[1]));
|
||||
_15.Store4(96, asuint(_36[2]));
|
||||
_15.Store4(112, asuint(_36[3]));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
RWByteAddressBuffer _10 : register(u0);
|
||||
cbuffer SPIRV_Cross_NumWorkgroups : register(b0)
|
||||
{
|
||||
uint3 SPIRV_Cross_NumWorkgroups_count : packoffset(c0);
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_10.Store3(0, SPIRV_Cross_NumWorkgroups_count);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
RWByteAddressBuffer _10 : register(u0);
|
||||
cbuffer SPIRV_Cross_NumWorkgroups : register(b0)
|
||||
{
|
||||
uint3 SPIRV_Cross_NumWorkgroups_count : packoffset(c0);
|
||||
};
|
||||
|
||||
static uint3 gl_WorkGroupID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_WorkGroupID : SV_GroupID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_10.Store3(0, SPIRV_Cross_NumWorkgroups_count + gl_WorkGroupID);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_WorkGroupID = stage_input.gl_WorkGroupID;
|
||||
comp_main();
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
RWByteAddressBuffer _11 : register(u0);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_11.Store(0, asuint(asfloat(_11.Load(0)) * asfloat(_11.Load(96))));
|
||||
_11.Store4(16, asuint(asfloat(_11.Load4(16)) * asfloat(_11.Load4(112))));
|
||||
float4x4 _35 = asfloat(uint4x4(_11.Load4(128), _11.Load4(144), _11.Load4(160), _11.Load4(176)));
|
||||
float4x4 _37 = asfloat(uint4x4(_11.Load4(32), _11.Load4(48), _11.Load4(64), _11.Load4(80)));
|
||||
float4x4 _38 = mul(_35, _37);
|
||||
_11.Store4(32, asuint(_38[0]));
|
||||
_11.Store4(48, asuint(_38[1]));
|
||||
_11.Store4(64, asuint(_38[2]));
|
||||
_11.Store4(80, asuint(_38[3]));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
RWByteAddressBuffer _28 : register(u0);
|
||||
cbuffer _68 : register(b1)
|
||||
{
|
||||
int _68_index0 : packoffset(c0);
|
||||
int _68_index1 : packoffset(c0.y);
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
float4x4 _253 = asfloat(uint4x4(_28.Load(64), _28.Load(80), _28.Load(96), _28.Load(112), _28.Load(68), _28.Load(84), _28.Load(100), _28.Load(116), _28.Load(72), _28.Load(88), _28.Load(104), _28.Load(120), _28.Load(76), _28.Load(92), _28.Load(108), _28.Load(124)));
|
||||
_28.Store4(0, asuint(_253[0]));
|
||||
_28.Store4(16, asuint(_253[1]));
|
||||
_28.Store4(32, asuint(_253[2]));
|
||||
_28.Store4(48, asuint(_253[3]));
|
||||
float2x2 _256 = asfloat(uint2x2(_28.Load(144), _28.Load(152), _28.Load(148), _28.Load(156)));
|
||||
_28.Store2(128, asuint(_256[0]));
|
||||
_28.Store2(136, asuint(_256[1]));
|
||||
float2x3 _259 = asfloat(uint2x3(_28.Load(192), _28.Load(200), _28.Load(208), _28.Load(196), _28.Load(204), _28.Load(212)));
|
||||
_28.Store3(160, asuint(_259[0]));
|
||||
_28.Store3(176, asuint(_259[1]));
|
||||
float3x2 _262 = asfloat(uint3x2(_28.Load(240), _28.Load(256), _28.Load(244), _28.Load(260), _28.Load(248), _28.Load(264)));
|
||||
_28.Store2(216, asuint(_262[0]));
|
||||
_28.Store2(224, asuint(_262[1]));
|
||||
_28.Store2(232, asuint(_262[2]));
|
||||
float4x4 _265 = asfloat(uint4x4(_28.Load4(0), _28.Load4(16), _28.Load4(32), _28.Load4(48)));
|
||||
_28.Store(64, asuint(_265[0].x));
|
||||
_28.Store(68, asuint(_265[1].x));
|
||||
_28.Store(72, asuint(_265[2].x));
|
||||
_28.Store(76, asuint(_265[3].x));
|
||||
_28.Store(80, asuint(_265[0].y));
|
||||
_28.Store(84, asuint(_265[1].y));
|
||||
_28.Store(88, asuint(_265[2].y));
|
||||
_28.Store(92, asuint(_265[3].y));
|
||||
_28.Store(96, asuint(_265[0].z));
|
||||
_28.Store(100, asuint(_265[1].z));
|
||||
_28.Store(104, asuint(_265[2].z));
|
||||
_28.Store(108, asuint(_265[3].z));
|
||||
_28.Store(112, asuint(_265[0].w));
|
||||
_28.Store(116, asuint(_265[1].w));
|
||||
_28.Store(120, asuint(_265[2].w));
|
||||
_28.Store(124, asuint(_265[3].w));
|
||||
float2x2 _268 = asfloat(uint2x2(_28.Load2(128), _28.Load2(136)));
|
||||
_28.Store(144, asuint(_268[0].x));
|
||||
_28.Store(148, asuint(_268[1].x));
|
||||
_28.Store(152, asuint(_268[0].y));
|
||||
_28.Store(156, asuint(_268[1].y));
|
||||
float2x3 _271 = asfloat(uint2x3(_28.Load3(160), _28.Load3(176)));
|
||||
_28.Store(192, asuint(_271[0].x));
|
||||
_28.Store(196, asuint(_271[1].x));
|
||||
_28.Store(200, asuint(_271[0].y));
|
||||
_28.Store(204, asuint(_271[1].y));
|
||||
_28.Store(208, asuint(_271[0].z));
|
||||
_28.Store(212, asuint(_271[1].z));
|
||||
float3x2 _274 = asfloat(uint3x2(_28.Load2(216), _28.Load2(224), _28.Load2(232)));
|
||||
_28.Store(240, asuint(_274[0].x));
|
||||
_28.Store(244, asuint(_274[1].x));
|
||||
_28.Store(248, asuint(_274[2].x));
|
||||
_28.Store(256, asuint(_274[0].y));
|
||||
_28.Store(260, asuint(_274[1].y));
|
||||
_28.Store(264, asuint(_274[2].y));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 16 + 64, asuint(1.0f));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 8 + 144, asuint(2.0f));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 8 + 192, asuint(3.0f));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 16 + 240, asuint(4.0f));
|
||||
_28.Store(_68_index0 * 4 + 64, asuint(1.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 80, asuint(1.0f.xxxx.y));
|
||||
_28.Store(_68_index0 * 4 + 96, asuint(1.0f.xxxx.z));
|
||||
_28.Store(_68_index0 * 4 + 112, asuint(1.0f.xxxx.w));
|
||||
_28.Store(_68_index0 * 4 + 144, asuint(2.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 152, asuint(2.0f.xx.y));
|
||||
_28.Store(_68_index0 * 4 + 192, asuint(3.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 200, asuint(3.0f.xxx.y));
|
||||
_28.Store(_68_index0 * 4 + 208, asuint(3.0f.xxx.z));
|
||||
_28.Store(_68_index0 * 4 + 240, asuint(4.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 256, asuint(4.0f.xx.y));
|
||||
_28.Store(_68_index0 * 16 + _68_index1 * 4 + 0, asuint(1.0f));
|
||||
_28.Store(_68_index0 * 8 + _68_index1 * 4 + 128, asuint(2.0f));
|
||||
_28.Store(_68_index0 * 16 + _68_index1 * 4 + 160, asuint(3.0f));
|
||||
_28.Store(_68_index0 * 8 + _68_index1 * 4 + 216, asuint(4.0f));
|
||||
_28.Store4(_68_index0 * 16 + 0, asuint(1.0f.xxxx));
|
||||
_28.Store2(_68_index0 * 8 + 128, asuint(2.0f.xx));
|
||||
_28.Store3(_68_index0 * 16 + 160, asuint(3.0f.xxx));
|
||||
_28.Store2(_68_index0 * 8 + 216, asuint(4.0f.xx));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u);
|
||||
|
||||
ByteAddressBuffer _22 : register(t0);
|
||||
RWByteAddressBuffer _44 : register(u1);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
static uint gl_LocalInvocationIndex;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
uint gl_LocalInvocationIndex : SV_GroupIndex;
|
||||
};
|
||||
|
||||
groupshared float sShared[4];
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
sShared[gl_LocalInvocationIndex] = asfloat(_22.Load(gl_GlobalInvocationID.x * 4 + 0));
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
_44.Store(gl_GlobalInvocationID.x * 4 + 0, asuint(sShared[3u - gl_LocalInvocationIndex]));
|
||||
}
|
||||
|
||||
[numthreads(4, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
gl_LocalInvocationIndex = stage_input.gl_LocalInvocationIndex;
|
||||
comp_main();
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
void comp_main()
|
||||
{
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
RWByteAddressBuffer _9 : register(u0, space0);
|
||||
|
||||
static uint4 gl_SubgroupEqMask;
|
||||
static uint4 gl_SubgroupGeMask;
|
||||
static uint4 gl_SubgroupGtMask;
|
||||
static uint4 gl_SubgroupLeMask;
|
||||
static uint4 gl_SubgroupLtMask;
|
||||
void comp_main()
|
||||
{
|
||||
_9.Store(0, asuint(float(WaveGetLaneCount())));
|
||||
_9.Store(0, asuint(float(WaveGetLaneIndex())));
|
||||
_9.Store(0, asuint(float4(gl_SubgroupEqMask).x));
|
||||
_9.Store(0, asuint(float4(gl_SubgroupGeMask).x));
|
||||
_9.Store(0, asuint(float4(gl_SubgroupGtMask).x));
|
||||
_9.Store(0, asuint(float4(gl_SubgroupLeMask).x));
|
||||
_9.Store(0, asuint(float4(gl_SubgroupLtMask).x));
|
||||
uint4 _75 = WaveActiveBallot(true);
|
||||
float4 _88 = WaveActiveSum(20.0f.xxxx);
|
||||
int4 _94 = WaveActiveSum(int4(20, 20, 20, 20));
|
||||
float4 _96 = WaveActiveProduct(20.0f.xxxx);
|
||||
int4 _98 = WaveActiveProduct(int4(20, 20, 20, 20));
|
||||
float4 _127 = WavePrefixProduct(_96) * _96;
|
||||
int4 _129 = WavePrefixProduct(_98) * _98;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
gl_SubgroupEqMask = 1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96));
|
||||
if (WaveGetLaneIndex() >= 32) gl_SubgroupEqMask.x = 0;
|
||||
if (WaveGetLaneIndex() >= 64 || WaveGetLaneIndex() < 32) gl_SubgroupEqMask.y = 0;
|
||||
if (WaveGetLaneIndex() >= 96 || WaveGetLaneIndex() < 64) gl_SubgroupEqMask.z = 0;
|
||||
if (WaveGetLaneIndex() < 96) gl_SubgroupEqMask.w = 0;
|
||||
gl_SubgroupGeMask = ~((1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u);
|
||||
if (WaveGetLaneIndex() >= 32) gl_SubgroupGeMask.x = 0u;
|
||||
if (WaveGetLaneIndex() >= 64) gl_SubgroupGeMask.y = 0u;
|
||||
if (WaveGetLaneIndex() >= 96) gl_SubgroupGeMask.z = 0u;
|
||||
if (WaveGetLaneIndex() < 32) gl_SubgroupGeMask.y = ~0u;
|
||||
if (WaveGetLaneIndex() < 64) gl_SubgroupGeMask.z = ~0u;
|
||||
if (WaveGetLaneIndex() < 96) gl_SubgroupGeMask.w = ~0u;
|
||||
uint gt_lane_index = WaveGetLaneIndex() + 1;
|
||||
gl_SubgroupGtMask = ~((1u << (gt_lane_index - uint4(0, 32, 64, 96))) - 1u);
|
||||
if (gt_lane_index >= 32) gl_SubgroupGtMask.x = 0u;
|
||||
if (gt_lane_index >= 64) gl_SubgroupGtMask.y = 0u;
|
||||
if (gt_lane_index >= 96) gl_SubgroupGtMask.z = 0u;
|
||||
if (gt_lane_index >= 128) gl_SubgroupGtMask.w = 0u;
|
||||
if (gt_lane_index < 32) gl_SubgroupGtMask.y = ~0u;
|
||||
if (gt_lane_index < 64) gl_SubgroupGtMask.z = ~0u;
|
||||
if (gt_lane_index < 96) gl_SubgroupGtMask.w = ~0u;
|
||||
uint le_lane_index = WaveGetLaneIndex() + 1;
|
||||
gl_SubgroupLeMask = (1u << (le_lane_index - uint4(0, 32, 64, 96))) - 1u;
|
||||
if (le_lane_index >= 32) gl_SubgroupLeMask.x = ~0u;
|
||||
if (le_lane_index >= 64) gl_SubgroupLeMask.y = ~0u;
|
||||
if (le_lane_index >= 96) gl_SubgroupLeMask.z = ~0u;
|
||||
if (le_lane_index >= 128) gl_SubgroupLeMask.w = ~0u;
|
||||
if (le_lane_index < 32) gl_SubgroupLeMask.y = 0u;
|
||||
if (le_lane_index < 64) gl_SubgroupLeMask.z = 0u;
|
||||
if (le_lane_index < 96) gl_SubgroupLeMask.w = 0u;
|
||||
gl_SubgroupLtMask = (1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u;
|
||||
if (WaveGetLaneIndex() >= 32) gl_SubgroupLtMask.x = ~0u;
|
||||
if (WaveGetLaneIndex() >= 64) gl_SubgroupLtMask.y = ~0u;
|
||||
if (WaveGetLaneIndex() >= 96) gl_SubgroupLtMask.z = ~0u;
|
||||
if (WaveGetLaneIndex() < 32) gl_SubgroupLtMask.y = 0u;
|
||||
if (WaveGetLaneIndex() < 64) gl_SubgroupLtMask.z = 0u;
|
||||
if (WaveGetLaneIndex() < 96) gl_SubgroupLtMask.w = 0u;
|
||||
comp_main();
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
static const float _17[5] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f };
|
||||
|
||||
static float4 FragColor;
|
||||
static float4 v0;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 v0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
for (int _46 = 0; _46 < 4; )
|
||||
{
|
||||
int _33 = _46 + 1;
|
||||
FragColor += _17[_33].xxxx;
|
||||
_46 = _33;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
v0 = stage_input.v0;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
Texture2D<float4> uTex : register(t0);
|
||||
SamplerState _uTex_sampler : register(s0);
|
||||
|
||||
static float4 FragColor;
|
||||
static float4 vColor;
|
||||
static float2 vTex;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
float2 vTex : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = vColor * uTex.Sample(_uTex_sampler, vTex);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vColor = stage_input.vColor;
|
||||
vTex = stage_input.vTex;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
static float2 value;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 value : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float4(1.0f, 0.0f, asfloat(asint(value.x)), 1.0f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
value = stage_input.value;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
static float2 FragColor;
|
||||
static float2 x0;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 x0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
bool2 _27 = (x0.x > x0.y).xx;
|
||||
FragColor = float2(_27.x ? float2(1.0f, 0.0f).x : float2(0.0f, 1.0f).x, _27.y ? float2(1.0f, 0.0f).y : float2(0.0f, 1.0f).y);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
x0 = stage_input.x0;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
static float4 gl_FragCoord;
|
||||
static float gl_FragDepth;
|
||||
static float4 FragColor;
|
||||
static float4 vColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
float gl_FragDepth : SV_Depth;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = gl_FragCoord + vColor;
|
||||
gl_FragDepth = 0.5f;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
vColor = stage_input.vColor;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_FragDepth = gl_FragDepth;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
static float2 value;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 value : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
bool2 _25 = bool2(value.x == 0.0f, value.y == 0.0f);
|
||||
FragColor = float4(1.0f, 0.0f, float(bool2(!_25.x, !_25.y).x), float(bool2(value.x <= float2(1.5f, 0.5f).x, value.y <= float2(1.5f, 0.5f).y).x));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
value = stage_input.value;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
static float gl_ClipDistance[2];
|
||||
static float gl_CullDistance[1];
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 gl_ClipDistance0 : SV_ClipDistance0;
|
||||
float gl_CullDistance0 : SV_CullDistance0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (gl_ClipDistance[0] + gl_CullDistance[0]) + gl_ClipDistance[1];
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_ClipDistance[0] = stage_input.gl_ClipDistance0.x;
|
||||
gl_ClipDistance[1] = stage_input.gl_ClipDistance0.y;
|
||||
gl_CullDistance[0] = stage_input.gl_CullDistance0.x;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
Texture2D<float4> uSampler : register(t0);
|
||||
SamplerState _uSampler_sampler : register(s0);
|
||||
Texture2D<float4> uSamplerShadow : register(t1);
|
||||
SamplerComparisonState _uSamplerShadow_sampler : register(s1);
|
||||
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (uSampler.Sample(_uSampler_sampler, 1.0f.xx) + uSampler.Load(int3(int2(10, 10), 0))).x + uSamplerShadow.SampleCmp(_uSamplerShadow_sampler, 1.0f.xxx.xy, 1.0f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
Texture2D<float4> uDepth : register(t2);
|
||||
SamplerComparisonState uSampler : register(s0);
|
||||
SamplerState uSampler1 : register(s1);
|
||||
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uDepth.SampleCmp(uSampler, 1.0f.xxx.xy, 1.0f) + uDepth.Sample(uSampler1, 1.0f.xx).x;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
struct CBO_1
|
||||
{
|
||||
float4 a;
|
||||
float4 b;
|
||||
float4 c;
|
||||
float4 d;
|
||||
};
|
||||
|
||||
ConstantBuffer<CBO_1> cbo[2][4] : register(b4, space0);
|
||||
cbuffer push
|
||||
{
|
||||
float4 push_a : packoffset(c0);
|
||||
float4 push_b : packoffset(c1);
|
||||
float4 push_c : packoffset(c2);
|
||||
float4 push_d : packoffset(c3);
|
||||
};
|
||||
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = cbo[1][2].a;
|
||||
FragColor += cbo[1][2].b;
|
||||
FragColor += cbo[1][2].c;
|
||||
FragColor += cbo[1][2].d;
|
||||
FragColor += push_a;
|
||||
FragColor += push_b;
|
||||
FragColor += push_c;
|
||||
FragColor += push_d;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
struct Foo
|
||||
{
|
||||
float a;
|
||||
float b;
|
||||
};
|
||||
|
||||
static const float _16[4] = { 1.0f, 4.0f, 3.0f, 2.0f };
|
||||
static const Foo _24 = { 10.0f, 20.0f };
|
||||
static const Foo _27 = { 30.0f, 40.0f };
|
||||
static const Foo _28[2] = { { 10.0f, 20.0f }, { 30.0f, 40.0f } };
|
||||
|
||||
static float4 FragColor;
|
||||
static int _line;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int _line : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
static float lut[4];
|
||||
static Foo foos[2];
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
lut = _16;
|
||||
foos = _28;
|
||||
FragColor = lut[_line].xxxx;
|
||||
FragColor += (foos[_line].a * foos[1 - _line].a).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
_line = stage_input._line;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
Texture2D<float4> uSampler : register(t0);
|
||||
SamplerState _uSampler_sampler : register(s0);
|
||||
|
||||
static float4 FragColor;
|
||||
static float4 vInput;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vInput : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = vInput;
|
||||
float4 _23 = uSampler.Sample(_uSampler_sampler, vInput.xy);
|
||||
float4 _26 = ddx(vInput);
|
||||
float4 _29 = ddy(vInput);
|
||||
float4 _32 = fwidth(vInput);
|
||||
float4 _35 = ddx_coarse(vInput);
|
||||
float4 _38 = ddy_coarse(vInput);
|
||||
float4 _41 = fwidth(vInput);
|
||||
float4 _44 = ddx_fine(vInput);
|
||||
float4 _47 = ddy_fine(vInput);
|
||||
float4 _50 = fwidth(vInput);
|
||||
float _56_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vInput.zw);
|
||||
if (vInput.y > 10.0f)
|
||||
{
|
||||
FragColor += _23;
|
||||
FragColor += _26;
|
||||
FragColor += _29;
|
||||
FragColor += _32;
|
||||
FragColor += _35;
|
||||
FragColor += _38;
|
||||
FragColor += _41;
|
||||
FragColor += _44;
|
||||
FragColor += _47;
|
||||
FragColor += _50;
|
||||
FragColor += float2(_56_tmp, _56_tmp).xyxy;
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vInput = stage_input.vInput;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
[earlydepthstencil]
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
static float2 FP32Out;
|
||||
static uint FP16;
|
||||
static uint FP16Out;
|
||||
static float2 FP32;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation uint FP16 : TEXCOORD0;
|
||||
nointerpolation float2 FP32 : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 FP32Out : SV_Target0;
|
||||
uint FP16Out : SV_Target1;
|
||||
};
|
||||
|
||||
uint SPIRV_Cross_packHalf2x16(float2 value)
|
||||
{
|
||||
uint2 Packed = f32tof16(value);
|
||||
return Packed.x | (Packed.y << 16);
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_unpackHalf2x16(uint value)
|
||||
{
|
||||
return f16tof32(uint2(value & 0xffff, value >> 16));
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FP32Out = SPIRV_Cross_unpackHalf2x16(FP16);
|
||||
FP16Out = SPIRV_Cross_packHalf2x16(FP32);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
FP16 = stage_input.FP16;
|
||||
FP32 = stage_input.FP32;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FP32Out = FP32Out;
|
||||
stage_output.FP16Out = FP16Out;
|
||||
return stage_output;
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
static min16float4 v4;
|
||||
static min16float3 v3;
|
||||
static min16float v1;
|
||||
static min16float2 v2;
|
||||
static float o1;
|
||||
static float2 o2;
|
||||
static float3 o3;
|
||||
static float4 o4;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
min16float v1 : TEXCOORD0;
|
||||
min16float2 v2 : TEXCOORD1;
|
||||
min16float3 v3 : TEXCOORD2;
|
||||
min16float4 v4 : TEXCOORD3;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float o1 : SV_Target0;
|
||||
float2 o2 : SV_Target1;
|
||||
float3 o3 : SV_Target2;
|
||||
float4 o4 : SV_Target3;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
min16float4 _324;
|
||||
min16float4 _387 = modf(v4, _324);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
v4 = stage_input.v4;
|
||||
v3 = stage_input.v3;
|
||||
v1 = stage_input.v1;
|
||||
v2 = stage_input.v2;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.o1 = o1;
|
||||
stage_output.o2 = o2;
|
||||
stage_output.o3 = o3;
|
||||
stage_output.o4 = o4;
|
||||
return stage_output;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
static bool gl_FrontFacing;
|
||||
static float4 FragColor;
|
||||
static float4 vA;
|
||||
static float4 vB;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vA : TEXCOORD0;
|
||||
float4 vB : TEXCOORD1;
|
||||
bool gl_FrontFacing : SV_IsFrontFace;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
if (gl_FrontFacing)
|
||||
{
|
||||
FragColor = vA;
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor = vB;
|
||||
}
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FrontFacing = stage_input.gl_FrontFacing;
|
||||
vA = stage_input.vA;
|
||||
vB = stage_input.vB;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,130 +0,0 @@
|
||||
Texture1D<uint4> uSampler1DUint : register(t0);
|
||||
SamplerState _uSampler1DUint_sampler : register(s0);
|
||||
Texture1D<int4> uSampler1DInt : register(t0);
|
||||
SamplerState _uSampler1DInt_sampler : register(s0);
|
||||
Texture1D<float4> uSampler1DFloat : register(t0);
|
||||
SamplerState _uSampler1DFloat_sampler : register(s0);
|
||||
Texture2DArray<int4> uSampler2DArray : register(t2);
|
||||
SamplerState _uSampler2DArray_sampler : register(s2);
|
||||
Texture3D<float4> uSampler3D : register(t3);
|
||||
SamplerState _uSampler3D_sampler : register(s3);
|
||||
TextureCube<float4> uSamplerCube : register(t4);
|
||||
SamplerState _uSamplerCube_sampler : register(s4);
|
||||
TextureCubeArray<uint4> uSamplerCubeArray : register(t5);
|
||||
SamplerState _uSamplerCubeArray_sampler : register(s5);
|
||||
Buffer<float4> uSamplerBuffer : register(t6);
|
||||
Texture2DMS<int4> uSamplerMS : register(t7);
|
||||
SamplerState _uSamplerMS_sampler : register(s7);
|
||||
Texture2DMSArray<float4> uSamplerMSArray : register(t8);
|
||||
SamplerState _uSamplerMSArray_sampler : register(s8);
|
||||
Texture2D<float4> uSampler2D : register(t1);
|
||||
SamplerState _uSampler2D_sampler : register(s1);
|
||||
|
||||
uint SPIRV_Cross_textureSize(Texture1D<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint ret;
|
||||
Tex.GetDimensions(Level, ret.x, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_textureSize(Texture1D<int4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint ret;
|
||||
Tex.GetDimensions(Level, ret.x, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_textureSize(Texture1D<uint4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint ret;
|
||||
Tex.GetDimensions(Level, ret.x, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_textureSize(Texture2D<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint2 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_textureSize(Texture2DArray<int4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint3 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_textureSize(Texture3D<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint3 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_textureSize(Buffer<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint ret;
|
||||
Tex.GetDimensions(ret.x);
|
||||
Param = 0u;
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_textureSize(TextureCube<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint2 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_textureSize(TextureCubeArray<uint4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint3 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_textureSize(Texture2DMS<int4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint2 ret;
|
||||
Tex.GetDimensions(ret.x, ret.y, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_textureSize(Texture2DMSArray<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint3 ret;
|
||||
Tex.GetDimensions(ret.x, ret.y, ret.z, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
uint _17_dummy_parameter;
|
||||
uint _24_dummy_parameter;
|
||||
uint _32_dummy_parameter;
|
||||
uint _42_dummy_parameter;
|
||||
uint _50_dummy_parameter;
|
||||
uint _60_dummy_parameter;
|
||||
uint _68_dummy_parameter;
|
||||
uint _76_dummy_parameter;
|
||||
uint _84_dummy_parameter;
|
||||
uint _92_dummy_parameter;
|
||||
int _100;
|
||||
SPIRV_Cross_textureSize(uSampler2D, 0u, _100);
|
||||
int _104;
|
||||
SPIRV_Cross_textureSize(uSampler2DArray, 0u, _104);
|
||||
int _108;
|
||||
SPIRV_Cross_textureSize(uSampler3D, 0u, _108);
|
||||
int _112;
|
||||
SPIRV_Cross_textureSize(uSamplerCube, 0u, _112);
|
||||
int _116;
|
||||
SPIRV_Cross_textureSize(uSamplerMS, 0u, _116);
|
||||
int _120;
|
||||
SPIRV_Cross_textureSize(uSamplerMSArray, 0u, _120);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
@ -1,115 +0,0 @@
|
||||
Texture1D<float4> uSampler1D : register(t0);
|
||||
SamplerState _uSampler1D_sampler : register(s0);
|
||||
Texture2D<float4> uSampler2D : register(t1);
|
||||
SamplerState _uSampler2D_sampler : register(s1);
|
||||
Texture2DArray<float4> uSampler2DArray : register(t2);
|
||||
SamplerState _uSampler2DArray_sampler : register(s2);
|
||||
Texture3D<float4> uSampler3D : register(t3);
|
||||
SamplerState _uSampler3D_sampler : register(s3);
|
||||
TextureCube<float4> uSamplerCube : register(t4);
|
||||
SamplerState _uSamplerCube_sampler : register(s4);
|
||||
TextureCubeArray<float4> uSamplerCubeArray : register(t5);
|
||||
SamplerState _uSamplerCubeArray_sampler : register(s5);
|
||||
Buffer<float4> uSamplerBuffer : register(t6);
|
||||
Texture2DMS<float4> uSamplerMS : register(t7);
|
||||
SamplerState _uSamplerMS_sampler : register(s7);
|
||||
Texture2DMSArray<float4> uSamplerMSArray : register(t8);
|
||||
SamplerState _uSamplerMSArray_sampler : register(s8);
|
||||
|
||||
uint SPIRV_Cross_textureSize(Texture1D<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint ret;
|
||||
Tex.GetDimensions(Level, ret.x, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_textureSize(Texture2D<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint2 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_textureSize(Texture2DArray<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint3 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_textureSize(Texture3D<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint3 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_textureSize(Buffer<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint ret;
|
||||
Tex.GetDimensions(ret.x);
|
||||
Param = 0u;
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_textureSize(TextureCube<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint2 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_textureSize(TextureCubeArray<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint3 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_textureSize(Texture2DMS<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint2 ret;
|
||||
Tex.GetDimensions(ret.x, ret.y, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_textureSize(Texture2DMSArray<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint3 ret;
|
||||
Tex.GetDimensions(ret.x, ret.y, ret.z, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
uint _17_dummy_parameter;
|
||||
uint _27_dummy_parameter;
|
||||
uint _37_dummy_parameter;
|
||||
uint _45_dummy_parameter;
|
||||
uint _53_dummy_parameter;
|
||||
uint _61_dummy_parameter;
|
||||
uint _69_dummy_parameter;
|
||||
uint _77_dummy_parameter;
|
||||
uint _85_dummy_parameter;
|
||||
int _89;
|
||||
SPIRV_Cross_textureSize(uSampler1D, 0u, _89);
|
||||
int _93;
|
||||
SPIRV_Cross_textureSize(uSampler2D, 0u, _93);
|
||||
int _97;
|
||||
SPIRV_Cross_textureSize(uSampler2DArray, 0u, _97);
|
||||
int _101;
|
||||
SPIRV_Cross_textureSize(uSampler3D, 0u, _101);
|
||||
int _105;
|
||||
SPIRV_Cross_textureSize(uSamplerCube, 0u, _105);
|
||||
int _109;
|
||||
SPIRV_Cross_textureSize(uSamplerCubeArray, 0u, _109);
|
||||
int _113;
|
||||
SPIRV_Cross_textureSize(uSamplerMS, 0u, _113);
|
||||
int _117;
|
||||
SPIRV_Cross_textureSize(uSamplerMSArray, 0u, _117);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
static float3 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float3 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float3(asfloat(0x7f800000u), asfloat(0xff800000u), asfloat(0xffc00000u));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
Texture2DMS<float4> uSubpass0 : register(t0);
|
||||
Texture2DMS<float4> uSubpass1 : register(t1);
|
||||
|
||||
static float4 gl_FragCoord;
|
||||
static int gl_SampleID;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
uint gl_SampleID : SV_SampleIndex;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (uSubpass0.Load(int2(gl_FragCoord.xy), 1) + uSubpass1.Load(int2(gl_FragCoord.xy), 2)) + uSubpass0.Load(int2(gl_FragCoord.xy), gl_SampleID);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
gl_SampleID = stage_input.gl_SampleID;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
Texture2D<float4> uSubpass0 : register(t0);
|
||||
Texture2D<float4> uSubpass1 : register(t1);
|
||||
|
||||
static float4 gl_FragCoord;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uSubpass0.Load(int3(int2(gl_FragCoord.xy), 0)) + uSubpass1.Load(int3(int2(gl_FragCoord.xy), 0));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
static float4 FragColor;
|
||||
|
||||
struct VertexOut
|
||||
{
|
||||
float4 a : TEXCOORD1;
|
||||
float4 b : TEXCOORD2;
|
||||
};
|
||||
|
||||
static VertexOut _12;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = _12.a + _12.b;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(in VertexOut stage_input_12)
|
||||
{
|
||||
_12 = stage_input_12;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
static const float _16[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f };
|
||||
static const float4 _60[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx };
|
||||
static const float4 _104[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx };
|
||||
|
||||
static float FragColor;
|
||||
static int index;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int index : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = _16[index];
|
||||
if (index < 10)
|
||||
{
|
||||
FragColor += _16[index ^ 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor += _16[index & 1];
|
||||
}
|
||||
bool _63 = index > 30;
|
||||
if (_63)
|
||||
{
|
||||
FragColor += _60[index & 3].y;
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor += _60[index & 1].x;
|
||||
}
|
||||
float4 foobar[4] = _60;
|
||||
if (_63)
|
||||
{
|
||||
foobar[1].z = 20.0f;
|
||||
}
|
||||
int _91 = index & 3;
|
||||
FragColor += foobar[_91].z;
|
||||
float4 baz[4] = _60;
|
||||
baz = _104;
|
||||
FragColor += baz[_91].z;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
index = stage_input.index;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
static float4 FragColor;
|
||||
static float4x4 m;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4x4 m : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = ((m[0] + m[1]) + m[2]) + m[3];
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
m = stage_input.m;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
static float4 a4;
|
||||
static float4 b4;
|
||||
static float3 a3;
|
||||
static float3 b3;
|
||||
static float2 a2;
|
||||
static float2 b2;
|
||||
static float a1;
|
||||
static float b1;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 a4 : TEXCOORD0;
|
||||
float3 a3 : TEXCOORD1;
|
||||
float2 a2 : TEXCOORD2;
|
||||
float a1 : TEXCOORD3;
|
||||
float4 b4 : TEXCOORD4;
|
||||
float3 b3 : TEXCOORD5;
|
||||
float2 b2 : TEXCOORD6;
|
||||
float b1 : TEXCOORD7;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float mod(float x, float y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float2 mod(float2 x, float2 y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float3 mod(float3 x, float3 y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float4 mod(float4 x, float4 y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = ((mod(a4, b4) + mod(a3, b3).xyzx) + mod(a2, b2).xyxy) + mod(a1, b1).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
a4 = stage_input.a4;
|
||||
b4 = stage_input.b4;
|
||||
a3 = stage_input.a3;
|
||||
b3 = stage_input.b3;
|
||||
a2 = stage_input.a2;
|
||||
b2 = stage_input.b2;
|
||||
a1 = stage_input.a1;
|
||||
b1 = stage_input.b1;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
static float4 RT0;
|
||||
static float4 RT1;
|
||||
static float4 RT2;
|
||||
static float4 RT3;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 RT0 : SV_Target0;
|
||||
float4 RT1 : SV_Target1;
|
||||
float4 RT2 : SV_Target2;
|
||||
float4 RT3 : SV_Target3;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
RT0 = 1.0f.xxxx;
|
||||
RT1 = 2.0f.xxxx;
|
||||
RT2 = 3.0f.xxxx;
|
||||
RT3 = 4.0f.xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.RT0 = RT0;
|
||||
stage_output.RT1 = RT1;
|
||||
stage_output.RT2 = RT2;
|
||||
stage_output.RT3 = RT3;
|
||||
return stage_output;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
static float4 vColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vColor = stage_input.vColor;
|
||||
frag_main();
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
static float2 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float2(0.5f, 0.5f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
Texture2D<float4> uSampler : register(t0);
|
||||
SamplerState _uSampler_sampler : register(s0);
|
||||
|
||||
static float4 FragColor;
|
||||
static float2 vTexCoord;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 vTexCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float _19_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vTexCoord);
|
||||
FragColor = float2(_19_tmp, _19_tmp).xyxy;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vTexCoord = stage_input.vTexCoord;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
cbuffer cbuf : register(b3)
|
||||
{
|
||||
float4 cbuf_a : packoffset(c0);
|
||||
};
|
||||
cbuffer registers
|
||||
{
|
||||
float4 registers_a : packoffset(c0);
|
||||
};
|
||||
Texture2D<float4> uSampledImage : register(t4);
|
||||
SamplerState _uSampledImage_sampler : register(s4);
|
||||
Texture2D<float4> uTexture : register(t5);
|
||||
SamplerState uSampler : register(s6);
|
||||
|
||||
static float2 vTex;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 vTex : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (uSampledImage.Sample(_uSampledImage_sampler, vTex) + uTexture.Sample(uSampler, vTex)) + (cbuf_a + registers_a);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vTex = stage_input.vTex;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
struct Foo
|
||||
{
|
||||
row_major float4x4 v;
|
||||
row_major float4x4 w;
|
||||
};
|
||||
|
||||
cbuffer _17 : register(b0)
|
||||
{
|
||||
Foo _17_foo : packoffset(c0);
|
||||
};
|
||||
|
||||
static float4 FragColor;
|
||||
static float4 vUV;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vUV : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = mul(mul(vUV, _17_foo.w), _17_foo.v);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vUV = stage_input.vUV;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
Texture2D<float4> uSampler2D : register(t0);
|
||||
SamplerComparisonState _uSampler2D_sampler : register(s0);
|
||||
Texture2DArray<float4> uSampler2DArray : register(t1);
|
||||
SamplerComparisonState _uSampler2DArray_sampler : register(s1);
|
||||
TextureCube<float4> uSamplerCube : register(t2);
|
||||
SamplerComparisonState _uSamplerCube_sampler : register(s2);
|
||||
TextureCubeArray<float4> uSamplerCubeArray : register(t3);
|
||||
SamplerComparisonState _uSamplerCubeArray_sampler : register(s3);
|
||||
|
||||
static float3 vUVRef;
|
||||
static float4 vDirRef;
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float3 vUVRef : TEXCOORD0;
|
||||
float4 vDirRef : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float SPIRV_Cross_projectTextureCoordinate(float2 coord)
|
||||
{
|
||||
return coord.x / coord.y;
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_projectTextureCoordinate(float3 coord)
|
||||
{
|
||||
return float2(coord.x, coord.y) / coord.z;
|
||||
}
|
||||
|
||||
float3 SPIRV_Cross_projectTextureCoordinate(float4 coord)
|
||||
{
|
||||
return float3(coord.x, coord.y, coord.z) / coord.w;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _80 = vDirRef;
|
||||
_80.z = vDirRef.w;
|
||||
FragColor = (((((((uSampler2D.SampleCmp(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1)) + uSampler2DArray.SampleCmp(_uSampler2DArray_sampler, vDirRef.xyz, vDirRef.w, int2(-1, -1))) + uSamplerCube.SampleCmp(_uSamplerCube_sampler, vDirRef.xyz, vDirRef.w)) + uSamplerCubeArray.SampleCmp(_uSamplerCubeArray_sampler, vDirRef, 0.5f)) + uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1))) + uSampler2DArray.SampleCmpLevelZero(_uSampler2DArray_sampler, vDirRef.xyz, vDirRef.w, int2(-1, -1))) + uSamplerCube.SampleCmpLevelZero(_uSamplerCube_sampler, vDirRef.xyz, vDirRef.w)) + uSampler2D.SampleCmp(_uSampler2D_sampler, SPIRV_Cross_projectTextureCoordinate(_80.xyz), vDirRef.z, int2(1, 1))) + uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, SPIRV_Cross_projectTextureCoordinate(_80.xyz), vDirRef.z, int2(1, 1));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vUVRef = stage_input.vUVRef;
|
||||
vDirRef = stage_input.vDirRef;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
Texture2D<float4> uCombined[4] : register(t0);
|
||||
SamplerState _uCombined_sampler[4] : register(s0);
|
||||
Texture2D<float4> uTex[4] : register(t4);
|
||||
SamplerState uSampler[4] : register(s8);
|
||||
RWTexture2D<float4> uImage[8] : register(u12);
|
||||
|
||||
static float4 gl_FragCoord;
|
||||
static float2 vTex;
|
||||
static int vIndex;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 vTex : TEXCOORD0;
|
||||
nointerpolation int vIndex : TEXCOORD1;
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
int _72 = vIndex + 1;
|
||||
uImage[vIndex][int2(gl_FragCoord.xy)] = ((uCombined[vIndex].Sample(_uCombined_sampler[vIndex], vTex) + uTex[vIndex].Sample(uSampler[vIndex], vTex)) + uCombined[_72].Sample(_uCombined_sampler[_72], vTex)) + uTex[_72].Sample(uSampler[_72], vTex);
|
||||
}
|
||||
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
vTex = stage_input.vTex;
|
||||
vIndex = stage_input.vIndex;
|
||||
frag_main();
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
Texture2D<float4> uSampler[4] : register(t0);
|
||||
SamplerState _uSampler_sampler[4] : register(s0);
|
||||
Texture2D<float4> uTextures[4] : register(t8);
|
||||
SamplerState uSamplers[4] : register(s4);
|
||||
|
||||
static int vIndex;
|
||||
static float2 vTex;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation float2 vTex : TEXCOORD0;
|
||||
nointerpolation int vIndex : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = 0.0f.xxxx;
|
||||
FragColor += uTextures[2].Sample(uSamplers[1], vTex);
|
||||
FragColor += uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex);
|
||||
FragColor += uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex + 0.100000001490116119384765625f.xx);
|
||||
FragColor += uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex + 0.20000000298023223876953125f.xx);
|
||||
FragColor += uSampler[3].Sample(_uSampler_sampler[3], vTex + 0.300000011920928955078125f.xx);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vIndex = stage_input.vIndex;
|
||||
vTex = stage_input.vTex;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
static const int Value = 2;
|
||||
|
||||
cbuffer _15 : register(b0)
|
||||
{
|
||||
float4 _15_samples[Value] : packoffset(c0);
|
||||
};
|
||||
|
||||
static float4 FragColor;
|
||||
static int Index;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int Index : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = _15_samples[Index];
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
Index = stage_input.Index;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
static const uint s = 10u;
|
||||
static const bool _13 = (s > 20u);
|
||||
static const uint _16 = _13 ? 30u : 50u;
|
||||
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float(_16);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
static float4 Float;
|
||||
static float vFloat;
|
||||
static int4 Int;
|
||||
static int vInt;
|
||||
static float4 Float2;
|
||||
static int4 Int2;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation float vFloat : TEXCOORD0;
|
||||
nointerpolation int vInt : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 Float : SV_Target0;
|
||||
int4 Int : SV_Target1;
|
||||
float4 Float2 : SV_Target2;
|
||||
int4 Int2 : SV_Target3;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
Float = vFloat.xxxx * 2.0f;
|
||||
Int = vInt.xxxx * int4(2, 2, 2, 2);
|
||||
Float2 = 10.0f.xxxx;
|
||||
Int2 = int4(10, 10, 10, 10);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vFloat = stage_input.vFloat;
|
||||
vInt = stage_input.vInt;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.Float = Float;
|
||||
stage_output.Int = Int;
|
||||
stage_output.Float2 = Float2;
|
||||
stage_output.Int2 = Int2;
|
||||
return stage_output;
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
Texture2DMS<float4> uTex : register(t0);
|
||||
SamplerState _uTex_sampler : register(s0);
|
||||
|
||||
static float4 gl_FragCoord;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
int2 _22 = int2(gl_FragCoord.xy);
|
||||
FragColor = uTex.Load(_22, 0);
|
||||
FragColor += uTex.Load(_22, 1);
|
||||
FragColor += uTex.Load(_22, 2);
|
||||
FragColor += uTex.Load(_22, 3);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
Texture1D<float4> tex1d : register(t0);
|
||||
SamplerState _tex1d_sampler : register(s0);
|
||||
Texture2D<float4> tex2d : register(t1);
|
||||
SamplerState _tex2d_sampler : register(s1);
|
||||
Texture3D<float4> tex3d : register(t2);
|
||||
SamplerState _tex3d_sampler : register(s2);
|
||||
TextureCube<float4> texCube : register(t3);
|
||||
SamplerState _texCube_sampler : register(s3);
|
||||
Texture1D<float4> tex1dShadow : register(t4);
|
||||
SamplerComparisonState _tex1dShadow_sampler : register(s4);
|
||||
Texture2D<float4> tex2dShadow : register(t5);
|
||||
SamplerComparisonState _tex2dShadow_sampler : register(s5);
|
||||
TextureCube<float4> texCubeShadow : register(t6);
|
||||
SamplerComparisonState _texCubeShadow_sampler : register(s6);
|
||||
Texture1DArray<float4> tex1dArray : register(t7);
|
||||
SamplerState _tex1dArray_sampler : register(s7);
|
||||
Texture2DArray<float4> tex2dArray : register(t8);
|
||||
SamplerState _tex2dArray_sampler : register(s8);
|
||||
TextureCubeArray<float4> texCubeArray : register(t9);
|
||||
SamplerState _texCubeArray_sampler : register(s9);
|
||||
Texture2D<float4> separateTex2d : register(t12);
|
||||
SamplerState samplerNonDepth : register(s11);
|
||||
Texture2D<float4> separateTex2dDepth : register(t13);
|
||||
SamplerComparisonState samplerDepth : register(s10);
|
||||
|
||||
static float texCoord1d;
|
||||
static float2 texCoord2d;
|
||||
static float3 texCoord3d;
|
||||
static float4 texCoord4d;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float texCoord1d : TEXCOORD0;
|
||||
float2 texCoord2d : TEXCOORD1;
|
||||
float3 texCoord3d : TEXCOORD2;
|
||||
float4 texCoord4d : TEXCOORD3;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float SPIRV_Cross_projectTextureCoordinate(float2 coord)
|
||||
{
|
||||
return coord.x / coord.y;
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_projectTextureCoordinate(float3 coord)
|
||||
{
|
||||
return float2(coord.x, coord.y) / coord.z;
|
||||
}
|
||||
|
||||
float3 SPIRV_Cross_projectTextureCoordinate(float4 coord)
|
||||
{
|
||||
return float3(coord.x, coord.y, coord.z) / coord.w;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _162 = (((((((((((((((((((tex1d.Sample(_tex1d_sampler, texCoord1d) + tex1d.Sample(_tex1d_sampler, texCoord1d, 1)) + tex1d.SampleLevel(_tex1d_sampler, texCoord1d, 2.0f)) + tex1d.SampleGrad(_tex1d_sampler, texCoord1d, 1.0f, 2.0f)) + tex1d.Sample(_tex1d_sampler, SPIRV_Cross_projectTextureCoordinate(float2(texCoord1d, 2.0f)))) + tex1d.SampleBias(_tex1d_sampler, texCoord1d, 1.0f)) + tex2d.Sample(_tex2d_sampler, texCoord2d)) + tex2d.Sample(_tex2d_sampler, texCoord2d, int2(1, 2))) + tex2d.SampleLevel(_tex2d_sampler, texCoord2d, 2.0f)) + tex2d.SampleGrad(_tex2d_sampler, texCoord2d, float2(1.0f, 2.0f), float2(3.0f, 4.0f))) + tex2d.Sample(_tex2d_sampler, SPIRV_Cross_projectTextureCoordinate(float3(texCoord2d, 2.0f)))) + tex2d.SampleBias(_tex2d_sampler, texCoord2d, 1.0f)) + tex3d.Sample(_tex3d_sampler, texCoord3d)) + tex3d.Sample(_tex3d_sampler, texCoord3d, int3(1, 2, 3))) + tex3d.SampleLevel(_tex3d_sampler, texCoord3d, 2.0f)) + tex3d.SampleGrad(_tex3d_sampler, texCoord3d, float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f))) + tex3d.Sample(_tex3d_sampler, SPIRV_Cross_projectTextureCoordinate(float4(texCoord3d, 2.0f)))) + tex3d.SampleBias(_tex3d_sampler, texCoord3d, 1.0f)) + texCube.Sample(_texCube_sampler, texCoord3d)) + texCube.SampleLevel(_texCube_sampler, texCoord3d, 2.0f)) + texCube.SampleBias(_texCube_sampler, texCoord3d, 1.0f);
|
||||
float4 _335 = _162;
|
||||
_335.w = ((_162.w + tex1dShadow.SampleCmp(_tex1dShadow_sampler, float3(texCoord1d, 0.0f, 0.0f).x, 0.0f)) + tex2dShadow.SampleCmp(_tex2dShadow_sampler, float3(texCoord2d, 0.0f).xy, 0.0f)) + texCubeShadow.SampleCmp(_texCubeShadow_sampler, float4(texCoord3d, 0.0f).xyz, 0.0f);
|
||||
float4 _308 = ((((((((((((((_335 + tex1dArray.Sample(_tex1dArray_sampler, texCoord2d)) + tex2dArray.Sample(_tex2dArray_sampler, texCoord3d)) + texCubeArray.Sample(_texCubeArray_sampler, texCoord4d)) + tex2d.GatherRed(_tex2d_sampler, texCoord2d)) + tex2d.GatherRed(_tex2d_sampler, texCoord2d)) + tex2d.GatherGreen(_tex2d_sampler, texCoord2d)) + tex2d.GatherBlue(_tex2d_sampler, texCoord2d)) + tex2d.GatherAlpha(_tex2d_sampler, texCoord2d)) + tex2d.GatherRed(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherRed(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherGreen(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherBlue(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherAlpha(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.Load(int3(int2(1, 2), 0))) + separateTex2d.Sample(samplerNonDepth, texCoord2d);
|
||||
float4 _339 = _308;
|
||||
_339.w = _308.w + separateTex2dDepth.SampleCmp(samplerDepth, texCoord3d.xy, texCoord3d.z);
|
||||
FragColor = _339;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
texCoord1d = stage_input.texCoord1d;
|
||||
texCoord2d = stage_input.texCoord2d;
|
||||
texCoord3d = stage_input.texCoord3d;
|
||||
texCoord4d = stage_input.texCoord4d;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
Texture1D<float4> uShadow1D : register(t0);
|
||||
SamplerComparisonState _uShadow1D_sampler : register(s0);
|
||||
Texture2D<float4> uShadow2D : register(t1);
|
||||
SamplerComparisonState _uShadow2D_sampler : register(s1);
|
||||
Texture1D<float4> uSampler1D : register(t2);
|
||||
SamplerState _uSampler1D_sampler : register(s2);
|
||||
Texture2D<float4> uSampler2D : register(t3);
|
||||
SamplerState _uSampler2D_sampler : register(s3);
|
||||
Texture3D<float4> uSampler3D : register(t4);
|
||||
SamplerState _uSampler3D_sampler : register(s4);
|
||||
|
||||
static float FragColor;
|
||||
static float4 vClip4;
|
||||
static float2 vClip2;
|
||||
static float3 vClip3;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float3 vClip3 : TEXCOORD0;
|
||||
float4 vClip4 : TEXCOORD1;
|
||||
float2 vClip2 : TEXCOORD2;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float SPIRV_Cross_projectTextureCoordinate(float2 coord)
|
||||
{
|
||||
return coord.x / coord.y;
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_projectTextureCoordinate(float3 coord)
|
||||
{
|
||||
return float2(coord.x, coord.y) / coord.z;
|
||||
}
|
||||
|
||||
float3 SPIRV_Cross_projectTextureCoordinate(float4 coord)
|
||||
{
|
||||
return float3(coord.x, coord.y, coord.z) / coord.w;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _20 = vClip4;
|
||||
_20.y = vClip4.w;
|
||||
FragColor = uShadow1D.SampleCmp(_uShadow1D_sampler, SPIRV_Cross_projectTextureCoordinate(_20.xy), vClip4.z);
|
||||
float4 _30 = vClip4;
|
||||
_30.z = vClip4.w;
|
||||
FragColor = uShadow2D.SampleCmp(_uShadow2D_sampler, SPIRV_Cross_projectTextureCoordinate(_30.xyz), vClip4.z);
|
||||
FragColor = uSampler1D.Sample(_uSampler1D_sampler, SPIRV_Cross_projectTextureCoordinate(vClip2)).x;
|
||||
FragColor = uSampler2D.Sample(_uSampler2D_sampler, SPIRV_Cross_projectTextureCoordinate(vClip3)).x;
|
||||
FragColor = uSampler3D.Sample(_uSampler3D_sampler, SPIRV_Cross_projectTextureCoordinate(vClip4)).x;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vClip4 = stage_input.vClip4;
|
||||
vClip2 = stage_input.vClip2;
|
||||
vClip3 = stage_input.vClip3;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
Texture2D<float4> uTex : register(t0);
|
||||
SamplerState uSampler : register(s1);
|
||||
|
||||
static int2 FooOut;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
int2 FooOut : SV_Target0;
|
||||
};
|
||||
|
||||
uint2 SPIRV_Cross_textureSize(Texture2D<float4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint2 ret;
|
||||
Tex.GetDimensions(Level, ret.x, ret.y, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
uint _23_dummy_parameter;
|
||||
FooOut = int2(SPIRV_Cross_textureSize(uTex, uint(0), _23_dummy_parameter));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FooOut = FooOut;
|
||||
return stage_output;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
static float4 FragColor;
|
||||
static float4 vIn;
|
||||
static int4 vIn1;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vIn : TEXCOORD0;
|
||||
nointerpolation int4 vIn1 : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = vIn;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vIn = stage_input.vIn;
|
||||
vIn1 = stage_input.vIn1;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user