mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 19:21:03 +00:00
Merge commit '032829847454432a4b149452d6354c13c5888239'
This commit is contained in:
commit
4fb79dfffe
23
deps/SPIRV-Cross/.travis.yml
vendored
23
deps/SPIRV-Cross/.travis.yml
vendored
@ -2,32 +2,17 @@ language: cpp
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
osx_image: xcode8.3
|
||||
osx_image: xcode9.3beta
|
||||
|
||||
# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
# We check out glslang and SPIRV-Tools at specific revisions to avoid test output mismatches
|
||||
env:
|
||||
- GLSLANG_REV=9c6f8cc29ba303b43ccf36deea6bb38a304f9b92 SPIRV_TOOLS_REV=e28edd458b729da7bbfd51e375feb33103709e6f
|
||||
|
||||
before_script:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python3; fi
|
||||
- git clone https://github.com/KhronosGroup/glslang.git glslang
|
||||
- git clone https://github.com/KhronosGroup/SPIRV-Tools SPIRV-Tools
|
||||
- git clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Tools/external/spirv-headers
|
||||
- ./checkout_glslang_spirv_tools.sh
|
||||
|
||||
script:
|
||||
- git -C glslang checkout $GLSLANG_REV
|
||||
- git -C SPIRV-Tools checkout $SPIRV_TOOLS_REV
|
||||
- cd glslang && cmake . && make -j2 && cd ..
|
||||
- cd SPIRV-Tools && cmake . && make -j2 && cd ..
|
||||
- ./build_glslang_spirv_tools.sh Debug 2
|
||||
- make -j2
|
||||
- PATH=./glslang/StandAlone:./SPIRV-Tools/tools:$PATH
|
||||
- ./test_shaders.py shaders
|
||||
- ./test_shaders.py --msl shaders-msl
|
||||
- ./test_shaders.py --hlsl shaders-hlsl
|
||||
- ./test_shaders.py shaders --opt
|
||||
- ./test_shaders.py --msl shaders-msl --opt
|
||||
- ./test_shaders.py --hlsl shaders-hlsl --opt
|
||||
- ./test_shaders.sh
|
||||
|
9
deps/SPIRV-Cross/CMakeLists.txt
vendored
9
deps/SPIRV-Cross/CMakeLists.txt
vendored
@ -128,12 +128,21 @@ if (${PYTHONINTERP_FOUND})
|
||||
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)
|
||||
|
6
deps/SPIRV-Cross/README.md
vendored
6
deps/SPIRV-Cross/README.md
vendored
@ -3,6 +3,7 @@
|
||||
SPIRV-Cross is a tool designed for parsing and converting SPIR-V to other shader languages.
|
||||
|
||||
[](https://travis-ci.org/KhronosGroup/SPIRV-Cross)
|
||||
[](https://ci.appveyor.com/project/HansKristian-ARM/SPIRV-Cross)
|
||||
|
||||
## Features
|
||||
|
||||
@ -24,7 +25,7 @@ However, most missing features are expected to be "trivial" improvements at this
|
||||
|
||||
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.
|
||||
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
|
||||
|
||||
@ -38,6 +39,8 @@ MinGW-w64 based compilation works with `make`, and an MSVC 2013 solution is also
|
||||
|
||||
### 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:
|
||||
|
||||
@ -279,6 +282,7 @@ 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.
|
||||
```
|
||||
|
||||
|
31
deps/SPIRV-Cross/appveyor.yml
vendored
Normal file
31
deps/SPIRV-Cross/appveyor.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
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
Executable file
26
deps/SPIRV-Cross/build_glslang_spirv_tools.sh
vendored
Executable file
@ -0,0 +1,26 @@
|
||||
#!/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 ../..
|
||||
|
35
deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh
vendored
35
deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh
vendored
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
GLSLANG_REV=9c6f8cc29ba303b43ccf36deea6bb38a304f9b92
|
||||
SPIRV_TOOLS_REV=e28edd458b729da7bbfd51e375feb33103709e6f
|
||||
GLSLANG_REV=461ea09943e0e88ea854ab9e3b42d17d728af2ad
|
||||
SPIRV_TOOLS_REV=53bc1623ecd3cc304d0d6feed8385e70c7ab30d3
|
||||
|
||||
if [ -d external/glslang ]; then
|
||||
echo "Updating glslang to revision $GLSLANG_REV."
|
||||
@ -18,13 +18,6 @@ else
|
||||
fi
|
||||
cd ../..
|
||||
|
||||
echo "Building glslang."
|
||||
mkdir -p external/glslang-build
|
||||
cd external/glslang-build
|
||||
cmake ../glslang -DCMAKE_BUILD_TYPE=Release -G"Unix Makefiles"
|
||||
make -j$(nproc)
|
||||
cd ../..
|
||||
|
||||
if [ -d external/spirv-tools ]; then
|
||||
echo "Updating SPIRV-Tools to revision $SPIRV_TOOLS_REV."
|
||||
cd external/spirv-tools
|
||||
@ -37,21 +30,15 @@ else
|
||||
git clone git://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools
|
||||
cd spirv-tools
|
||||
git checkout $SPIRV_TOOLS_REV
|
||||
|
||||
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
|
||||
fi
|
||||
cd ../..
|
||||
|
||||
echo "Building SPIRV-Tools."
|
||||
mkdir -p external/spirv-tools-build
|
||||
cd external/spirv-tools-build
|
||||
cmake ../spirv-tools -DCMAKE_BUILD_TYPE=Release -G"Unix Makefiles"
|
||||
make -j$(nproc)
|
||||
|
||||
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 ../..
|
||||
|
||||
|
3
deps/SPIRV-Cross/format_all.sh
vendored
3
deps/SPIRV-Cross/format_all.sh
vendored
@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
for file in spirv_*.{cpp,hpp} include/spirv_cross/*.{hpp,h} samples/cpp/*.cpp main.cpp
|
||||
#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
|
||||
|
118
deps/SPIRV-Cross/main.cpp
vendored
118
deps/SPIRV-Cross/main.cpp
vendored
@ -122,7 +122,7 @@ struct CLIParser
|
||||
THROW("Tried to parse uint, but nothing left in arguments");
|
||||
}
|
||||
|
||||
uint32_t val = stoul(*argv);
|
||||
uint64_t val = stoul(*argv);
|
||||
if (val > numeric_limits<uint32_t>::max())
|
||||
{
|
||||
THROW("next_uint() out of range");
|
||||
@ -131,7 +131,7 @@ struct CLIParser
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
return val;
|
||||
return uint32_t(val);
|
||||
}
|
||||
|
||||
double next_double()
|
||||
@ -212,7 +212,6 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
|
||||
for (auto &res : resources)
|
||||
{
|
||||
auto &type = compiler.get_type(res.type_id);
|
||||
auto mask = compiler.get_decoration_mask(res.id);
|
||||
|
||||
if (print_ssbo && compiler.buffer_is_hlsl_counter_buffer(res.id))
|
||||
continue;
|
||||
@ -221,8 +220,8 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
|
||||
// for SSBOs and UBOs since those are the only meaningful names to use externally.
|
||||
// Push constant blocks are still accessed by name and not block name, even though they are technically Blocks.
|
||||
bool is_push_constant = compiler.get_storage_class(res.id) == StorageClassPushConstant;
|
||||
bool is_block = (compiler.get_decoration_mask(type.self) &
|
||||
((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) != 0;
|
||||
bool is_block = compiler.get_decoration_bitset(type.self).get(DecorationBlock) ||
|
||||
compiler.get_decoration_bitset(type.self).get(DecorationBufferBlock);
|
||||
bool is_sized_block = is_block && (compiler.get_storage_class(res.id) == StorageClassUniform ||
|
||||
compiler.get_storage_class(res.id) == StorageClassUniformConstant);
|
||||
uint32_t fallback_id = !is_push_constant && is_block ? res.base_type_id : res.id;
|
||||
@ -231,6 +230,12 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
|
||||
if (is_sized_block)
|
||||
block_size = uint32_t(compiler.get_declared_struct_size(compiler.get_type(res.base_type_id)));
|
||||
|
||||
Bitset mask;
|
||||
if (print_ssbo)
|
||||
mask = compiler.get_buffer_block_flags(res.id);
|
||||
else
|
||||
mask = compiler.get_decoration_bitset(res.id);
|
||||
|
||||
string array;
|
||||
for (auto arr : type.array)
|
||||
array = join("[", arr ? convert_to_string(arr) : "", "]") + array;
|
||||
@ -238,17 +243,17 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
|
||||
fprintf(stderr, " ID %03u : %s%s", res.id,
|
||||
!res.name.empty() ? res.name.c_str() : compiler.get_fallback_name(fallback_id).c_str(), array.c_str());
|
||||
|
||||
if (mask & (1ull << DecorationLocation))
|
||||
if (mask.get(DecorationLocation))
|
||||
fprintf(stderr, " (Location : %u)", compiler.get_decoration(res.id, DecorationLocation));
|
||||
if (mask & (1ull << DecorationDescriptorSet))
|
||||
if (mask.get(DecorationDescriptorSet))
|
||||
fprintf(stderr, " (Set : %u)", compiler.get_decoration(res.id, DecorationDescriptorSet));
|
||||
if (mask & (1ull << DecorationBinding))
|
||||
if (mask.get(DecorationBinding))
|
||||
fprintf(stderr, " (Binding : %u)", compiler.get_decoration(res.id, DecorationBinding));
|
||||
if (mask & (1ull << DecorationInputAttachmentIndex))
|
||||
if (mask.get(DecorationInputAttachmentIndex))
|
||||
fprintf(stderr, " (Attachment : %u)", compiler.get_decoration(res.id, DecorationInputAttachmentIndex));
|
||||
if (mask & (1ull << DecorationNonReadable))
|
||||
if (mask.get(DecorationNonReadable))
|
||||
fprintf(stderr, " writeonly");
|
||||
if (mask & (1ull << DecorationNonWritable))
|
||||
if (mask.get(DecorationNonWritable))
|
||||
fprintf(stderr, " readonly");
|
||||
if (is_sized_block)
|
||||
fprintf(stderr, " (BlockSize : %u bytes)", block_size);
|
||||
@ -284,7 +289,7 @@ static const char *execution_model_to_str(spv::ExecutionModel model)
|
||||
|
||||
static void print_resources(const Compiler &compiler, const ShaderResources &res)
|
||||
{
|
||||
uint64_t modes = compiler.get_execution_mode_mask();
|
||||
auto &modes = compiler.get_execution_mode_bitset();
|
||||
|
||||
fprintf(stderr, "Entry points:\n");
|
||||
auto entry_points = compiler.get_entry_points_and_stages();
|
||||
@ -293,11 +298,7 @@ static void print_resources(const Compiler &compiler, const ShaderResources &res
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
fprintf(stderr, "Execution modes:\n");
|
||||
for (unsigned i = 0; i < 64; i++)
|
||||
{
|
||||
if (!(modes & (1ull << i)))
|
||||
continue;
|
||||
|
||||
modes.for_each_bit([&](uint32_t i) {
|
||||
auto mode = static_cast<ExecutionMode>(i);
|
||||
uint32_t arg0 = compiler.get_execution_mode_argument(mode, 0);
|
||||
uint32_t arg1 = compiler.get_execution_mode_argument(mode, 1);
|
||||
@ -353,7 +354,7 @@ static void print_resources(const Compiler &compiler, const ShaderResources &res
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
print_resources(compiler, "subpass inputs", res.subpass_inputs);
|
||||
@ -487,25 +488,47 @@ struct CLIArguments
|
||||
bool flatten_multidimensional_arrays = false;
|
||||
bool use_420pack_extension = true;
|
||||
bool remove_unused = false;
|
||||
bool combined_samplers_inherit_bindings = false;
|
||||
};
|
||||
|
||||
static void print_help()
|
||||
{
|
||||
fprintf(stderr, "Usage: spirv-cross [--output <output path>] [SPIR-V file] [--es] [--no-es] "
|
||||
"[--version <GLSL version>] [--dump-resources] [--help] [--force-temporary] "
|
||||
"[--vulkan-semantics] [--flatten-ubo] [--fixup-clipspace] [--flip-vert-y] [--iterations iter] "
|
||||
"[--cpp] [--cpp-interface-name <name>] "
|
||||
"[--msl] [--msl-version <MMmmpp>]"
|
||||
"[--hlsl] [--shader-model] [--hlsl-enable-compat] "
|
||||
"[--separate-shader-objects]"
|
||||
"[--pls-in format input-name] [--pls-out format output-name] [--remap source_name target_name "
|
||||
"components] [--extension ext] [--entry name] [--stage <stage (vert, frag, geom, tesc, tese, "
|
||||
"comp)>] [--remove-unused-variables] "
|
||||
"[--flatten-multidimensional-arrays] [--no-420pack-extension] "
|
||||
"[--remap-variable-type <variable_name> <new_variable_type>] "
|
||||
"[--rename-interface-variable <in|out> <location> <new_variable_name>] "
|
||||
"[--set-hlsl-vertex-input-semantic <location> <semantic>] "
|
||||
"[--rename-entry-point <old> <new> <stage>] "
|
||||
fprintf(stderr, "Usage: spirv-cross\n"
|
||||
"\t[--output <output path>]\n"
|
||||
"\t[SPIR-V file]\n"
|
||||
"\t[--es]\n"
|
||||
"\t[--no-es]\n"
|
||||
"\t[--version <GLSL version>]\n"
|
||||
"\t[--dump-resources]\n"
|
||||
"\t[--help]\n"
|
||||
"\t[--force-temporary]\n"
|
||||
"\t[--vulkan-semantics]\n"
|
||||
"\t[--flatten-ubo]\n"
|
||||
"\t[--fixup-clipspace]\n"
|
||||
"\t[--flip-vert-y]\n"
|
||||
"\t[--iterations iter]\n"
|
||||
"\t[--cpp]\n"
|
||||
"\t[--cpp-interface-name <name>]\n"
|
||||
"\t[--msl]\n"
|
||||
"\t[--msl-version <MMmmpp>]\n"
|
||||
"\t[--hlsl]\n"
|
||||
"\t[--shader-model]\n"
|
||||
"\t[--hlsl-enable-compat]\n"
|
||||
"\t[--separate-shader-objects]\n"
|
||||
"\t[--pls-in format input-name]\n"
|
||||
"\t[--pls-out format output-name]\n"
|
||||
"\t[--remap source_name target_name components]\n"
|
||||
"\t[--extension ext]\n"
|
||||
"\t[--entry name]\n"
|
||||
"\t[--stage <stage (vert, frag, geom, tesc, tese comp)>]\n"
|
||||
"\t[--remove-unused-variables]\n"
|
||||
"\t[--flatten-multidimensional-arrays]\n"
|
||||
"\t[--no-420pack-extension]\n"
|
||||
"\t[--remap-variable-type <variable_name> <new_variable_type>]\n"
|
||||
"\t[--rename-interface-variable <in|out> <location> <new_variable_name>]\n"
|
||||
"\t[--set-hlsl-vertex-input-semantic <location> <semantic>]\n"
|
||||
"\t[--rename-entry-point <old> <new> <stage>]\n"
|
||||
"\t[--combined-samplers-inherit-bindings]"
|
||||
"\n");
|
||||
}
|
||||
|
||||
@ -711,6 +734,8 @@ static int main_inner(int argc, char *argv[])
|
||||
});
|
||||
|
||||
cbs.add("--remove-unused-variables", [&args](CLIParser &) { args.remove_unused = true; });
|
||||
cbs.add("--combined-samplers-inherit-bindings",
|
||||
[&args](CLIParser &) { args.combined_samplers_inherit_bindings = true; });
|
||||
|
||||
cbs.default_handler = [&args](const char *value) { args.input = value; };
|
||||
cbs.error_handler = [] { print_help(); };
|
||||
@ -748,10 +773,10 @@ static int main_inner(int argc, char *argv[])
|
||||
compiler = unique_ptr<CompilerMSL>(new CompilerMSL(read_spirv_file(args.input)));
|
||||
|
||||
auto *msl_comp = static_cast<CompilerMSL *>(compiler.get());
|
||||
auto msl_opts = msl_comp->get_options();
|
||||
auto msl_opts = msl_comp->get_msl_options();
|
||||
if (args.set_msl_version)
|
||||
msl_opts.msl_version = args.msl_version;
|
||||
msl_comp->set_options(msl_opts);
|
||||
msl_comp->set_msl_options(msl_opts);
|
||||
}
|
||||
else if (args.hlsl)
|
||||
compiler = unique_ptr<CompilerHLSL>(new CompilerHLSL(read_spirv_file(args.input)));
|
||||
@ -851,14 +876,14 @@ static int main_inner(int argc, char *argv[])
|
||||
if (!entry_point.empty())
|
||||
compiler->set_entry_point(entry_point, model);
|
||||
|
||||
if (!args.set_version && !compiler->get_options().version)
|
||||
if (!args.set_version && !compiler->get_common_options().version)
|
||||
{
|
||||
fprintf(stderr, "Didn't specify GLSL version and SPIR-V did not specify language.\n");
|
||||
print_help();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
CompilerGLSL::Options opts = compiler->get_options();
|
||||
CompilerGLSL::Options opts = compiler->get_common_options();
|
||||
if (args.set_version)
|
||||
opts.version = args.version;
|
||||
if (args.set_es)
|
||||
@ -870,13 +895,13 @@ static int main_inner(int argc, char *argv[])
|
||||
opts.vulkan_semantics = args.vulkan_semantics;
|
||||
opts.vertex.fixup_clipspace = args.fixup;
|
||||
opts.vertex.flip_vert_y = args.yflip;
|
||||
compiler->set_options(opts);
|
||||
compiler->set_common_options(opts);
|
||||
|
||||
// Set HLSL specific options.
|
||||
if (args.hlsl)
|
||||
{
|
||||
auto *hlsl = static_cast<CompilerHLSL *>(compiler.get());
|
||||
auto hlsl_opts = hlsl->get_options();
|
||||
auto hlsl_opts = hlsl->get_hlsl_options();
|
||||
if (args.set_shader_model)
|
||||
{
|
||||
if (args.shader_model < 30)
|
||||
@ -894,11 +919,19 @@ static int main_inner(int argc, char *argv[])
|
||||
hlsl_opts.point_size_compat = true;
|
||||
hlsl_opts.point_coord_compat = true;
|
||||
}
|
||||
hlsl->set_options(hlsl_opts);
|
||||
hlsl->set_hlsl_options(hlsl_opts);
|
||||
}
|
||||
|
||||
if (build_dummy_sampler)
|
||||
compiler->build_dummy_sampler_for_combined_images();
|
||||
{
|
||||
uint32_t sampler = compiler->build_dummy_sampler_for_combined_images();
|
||||
if (sampler != 0)
|
||||
{
|
||||
// Set some defaults to make validation happy.
|
||||
compiler->set_decoration(sampler, DecorationDescriptorSet, 0);
|
||||
compiler->set_decoration(sampler, DecorationBinding, 0);
|
||||
}
|
||||
}
|
||||
|
||||
ShaderResources res;
|
||||
if (args.remove_unused)
|
||||
@ -961,6 +994,9 @@ static int main_inner(int argc, char *argv[])
|
||||
if (combined_image_samplers)
|
||||
{
|
||||
compiler->build_combined_image_samplers();
|
||||
if (args.combined_samplers_inherit_bindings)
|
||||
spirv_cross_util::inherit_combined_sampler_bindings(*compiler);
|
||||
|
||||
// Give the remapped combined samplers new names.
|
||||
for (auto &remap : compiler->get_combined_image_samplers())
|
||||
{
|
||||
|
30
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag
vendored
Normal file
30
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
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;
|
||||
}
|
8
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/empty-struct.asm.frag
vendored
Normal file
8
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/empty-struct.asm.frag
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
@ -7,7 +7,7 @@ struct SPIRV_Cross_Output
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (((1.0f.xxxx + 1.0f.xxxx) + (1.0f.xxx.xyzz + 1.0f.xxxx)) + (1.0f.xxxx + 2.0f.xxxx)) + (1.0f.xx.xyxy + 2.0f.xxxx);
|
||||
FragColor = 10.0f.xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
|
31
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag
vendored
Normal file
31
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
57
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag
vendored
Normal file
57
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
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;
|
||||
}
|
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/srem.asm.frag
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/srem.asm.frag
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
@ -11,25 +11,23 @@ struct SPIRV_Cross_Output
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float4 _21;
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _33;
|
||||
do
|
||||
bool _29;
|
||||
for (;;)
|
||||
{
|
||||
if (counter == 10)
|
||||
_29 = counter == 10;
|
||||
if (_29)
|
||||
{
|
||||
_33 = 10.0f.xxxx;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
_33 = 30.0f.xxxx;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
FragColor = _33;
|
||||
}
|
||||
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)
|
||||
|
@ -1,8 +0,0 @@
|
||||
void vert_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vert_main();
|
||||
}
|
37
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert
vendored
Normal file
37
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
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,3 +1,5 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(8u, 4u, 2u);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
}
|
||||
|
@ -34,24 +34,26 @@ struct SPIRV_Cross_Input
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uImageOutF[int2(gl_GlobalInvocationID.xy)] = uImageInF[int2(gl_GlobalInvocationID.xy)].x;
|
||||
uImageOutI[int2(gl_GlobalInvocationID.xy)] = uImageInI[int2(gl_GlobalInvocationID.xy)].x;
|
||||
uImageOutU[int2(gl_GlobalInvocationID.xy)] = uImageInU[int2(gl_GlobalInvocationID.xy)].x;
|
||||
uImageOutBuffer[int(gl_GlobalInvocationID.x)] = uImageInBuffer[int(gl_GlobalInvocationID.x)].x;
|
||||
uImageOutF2[int2(gl_GlobalInvocationID.xy)] = uImageInF2[int2(gl_GlobalInvocationID.xy)].xy;
|
||||
uImageOutI2[int2(gl_GlobalInvocationID.xy)] = uImageInI2[int2(gl_GlobalInvocationID.xy)].xy;
|
||||
uImageOutU2[int2(gl_GlobalInvocationID.xy)] = uImageInU2[int2(gl_GlobalInvocationID.xy)].xy;
|
||||
float4 _135 = uImageInBuffer2[int(gl_GlobalInvocationID.x)].xyyy;
|
||||
uImageOutBuffer2[int(gl_GlobalInvocationID.x)] = _135.xy;
|
||||
uImageOutF4[int2(gl_GlobalInvocationID.xy)] = uImageInF4[int2(gl_GlobalInvocationID.xy)];
|
||||
int4 _165 = uImageInI4[int2(gl_GlobalInvocationID.xy)];
|
||||
uImageOutI4[int2(gl_GlobalInvocationID.xy)] = _165;
|
||||
uint4 _180 = uImageInU4[int2(gl_GlobalInvocationID.xy)];
|
||||
uImageOutU4[int2(gl_GlobalInvocationID.xy)] = _180;
|
||||
uImageOutBuffer4[int(gl_GlobalInvocationID.x)] = uImageInBuffer4[int(gl_GlobalInvocationID.x)];
|
||||
uImageNoFmtF[int2(gl_GlobalInvocationID.xy)] = _135;
|
||||
uImageNoFmtU[int2(gl_GlobalInvocationID.xy)] = _180;
|
||||
uImageNoFmtI[int2(gl_GlobalInvocationID.xy)] = _165;
|
||||
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)]
|
||||
|
20
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/rmw-matrix.comp
vendored
Normal file
20
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/rmw-matrix.comp
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
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();
|
||||
}
|
@ -17,7 +17,7 @@ void comp_main()
|
||||
{
|
||||
sShared[gl_LocalInvocationIndex] = asfloat(_22.Load(gl_GlobalInvocationID.x * 4 + 0));
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
_44.Store(gl_GlobalInvocationID.x * 4 + 0, asuint(sShared[(4u - gl_LocalInvocationIndex) - 1u]));
|
||||
_44.Store(gl_GlobalInvocationID.x * 4 + 0, asuint(sShared[3u - gl_LocalInvocationIndex]));
|
||||
}
|
||||
|
||||
[numthreads(4, 1, 1)]
|
||||
|
67
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp
vendored
Normal file
67
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
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();
|
||||
}
|
35
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/array-lut-no-loop-variable.frag
vendored
Normal file
35
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/array-lut-no-loop-variable.frag
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
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()
|
||||
{
|
||||
float lut[5] = _17;
|
||||
for (int _46 = 0; _46 < 4; )
|
||||
{
|
||||
int _33 = _46 + 1;
|
||||
FragColor += lut[_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;
|
||||
}
|
54
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag
vendored
Normal file
54
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
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;
|
||||
}
|
45
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/fp16.desktop.frag
vendored
Normal file
45
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/fp16.desktop.frag
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
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;
|
||||
}
|
@ -2,6 +2,30 @@ 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)
|
||||
{
|
||||
@ -17,10 +41,87 @@ uint SPIRV_Cross_textureSize(Texture1D<uint4> Tex, uint Level, out uint 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()
|
||||
|
@ -1,5 +1,112 @@
|
||||
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()
|
||||
|
@ -1,9 +1,3 @@
|
||||
struct B
|
||||
{
|
||||
float a;
|
||||
float b;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ cbuffer cbuf : register(b3)
|
||||
};
|
||||
cbuffer registers
|
||||
{
|
||||
float4 registers_d : packoffset(c0);
|
||||
float4 registers_a : packoffset(c0);
|
||||
};
|
||||
Texture2D<float4> uSampledImage : register(t4);
|
||||
SamplerState _uSampledImage_sampler : register(s4);
|
||||
@ -26,7 +26,7 @@ struct SPIRV_Cross_Output
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (uSampledImage.Sample(_uSampledImage_sampler, vTex) + uTexture.Sample(uSampler, vTex)) + (cbuf_a + registers_d);
|
||||
FragColor = (uSampledImage.Sample(_uSampledImage_sampler, vTex) + uTexture.Sample(uSampler, vTex)) + (cbuf_a + registers_a);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
|
37
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/row-major-layout-in-struct.frag
vendored
Normal file
37
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/row-major-layout-in-struct.frag
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
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;
|
||||
}
|
@ -41,9 +41,7 @@ void frag_main()
|
||||
{
|
||||
float4 _80 = vDirRef;
|
||||
_80.z = vDirRef.w;
|
||||
float4 _87 = vDirRef;
|
||||
_87.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(_87.xyz), vDirRef.z, int2(1, 1));
|
||||
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)
|
||||
|
@ -17,7 +17,8 @@ struct SPIRV_Cross_Input
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
uImage[vIndex][int2(gl_FragCoord.xy)] = ((uCombined[vIndex].Sample(_uCombined_sampler[vIndex], vTex) + uTex[vIndex].Sample(uSampler[vIndex], vTex)) + (uCombined[vIndex + 1].Sample(_uCombined_sampler[vIndex + 1], vTex))) + (uTex[vIndex + 1].Sample(uSampler[vIndex + 1], vTex));
|
||||
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)
|
||||
|
39
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-image-arrays.frag
vendored
Normal file
39
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-image-arrays.frag
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
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 float a = 1.0f;
|
||||
static const float b = 2.0f;
|
||||
static const int c = 3;
|
||||
static const int d = 4;
|
||||
|
||||
struct Foo
|
||||
{
|
||||
float elems[(d + 2)];
|
||||
};
|
||||
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float vec0[(c + 3)][8];
|
||||
vec0[0][0] = 10.0f;
|
||||
Foo foo;
|
||||
foo.elems[c] = 10.0f;
|
||||
FragColor = (((a + b).xxxx + vec0[0][0].xxxx) + 20.0f.xxxx) + foo.elems[c].xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
33
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling-ms.frag
vendored
Normal file
33
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling-ms.frag
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
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,27 +1,27 @@
|
||||
Texture1D<float4> tex1d;
|
||||
SamplerState _tex1d_sampler;
|
||||
Texture2D<float4> tex2d;
|
||||
SamplerState _tex2d_sampler;
|
||||
Texture3D<float4> tex3d;
|
||||
SamplerState _tex3d_sampler;
|
||||
TextureCube<float4> texCube;
|
||||
SamplerState _texCube_sampler;
|
||||
Texture1D<float4> tex1dShadow;
|
||||
SamplerComparisonState _tex1dShadow_sampler;
|
||||
Texture2D<float4> tex2dShadow;
|
||||
SamplerComparisonState _tex2dShadow_sampler;
|
||||
TextureCube<float4> texCubeShadow;
|
||||
SamplerComparisonState _texCubeShadow_sampler;
|
||||
Texture1DArray<float4> tex1dArray;
|
||||
SamplerState _tex1dArray_sampler;
|
||||
Texture2DArray<float4> tex2dArray;
|
||||
SamplerState _tex2dArray_sampler;
|
||||
TextureCubeArray<float4> texCubeArray;
|
||||
SamplerState _texCubeArray_sampler;
|
||||
Texture2D<float4> separateTex2d;
|
||||
SamplerState samplerNonDepth;
|
||||
Texture2D<float4> separateTex2dDepth;
|
||||
SamplerComparisonState samplerDepth;
|
||||
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;
|
||||
@ -60,14 +60,8 @@ float3 SPIRV_Cross_projectTextureCoordinate(float4 coord)
|
||||
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);
|
||||
float _178 = _162.w + tex1dShadow.SampleCmp(_tex1dShadow_sampler, float3(texCoord1d, 0.0f, 0.0f).x, 0.0f);
|
||||
float4 _327 = _162;
|
||||
_327.w = _178;
|
||||
float _193 = _178 + tex2dShadow.SampleCmp(_tex2dShadow_sampler, float3(texCoord2d, 0.0f).xy, 0.0f);
|
||||
float4 _331 = _327;
|
||||
_331.w = _193;
|
||||
float4 _335 = _331;
|
||||
_335.w = _193 + texCubeShadow.SampleCmp(_texCubeShadow_sampler, float4(texCoord3d, 0.0f).xyz, 0.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);
|
||||
|
@ -15,7 +15,7 @@ struct SPIRV_Cross_Output
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = -(-vIn);
|
||||
FragColor = vIn;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
|
@ -5,6 +5,8 @@ struct Foo
|
||||
float3 c;
|
||||
};
|
||||
|
||||
static const Foo _71 = { 1.0f.xxx, 1.0f.xxx, 1.0f.xxx };
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 Input2;
|
||||
static float4 Input4;
|
||||
@ -40,8 +42,6 @@ struct SPIRV_Cross_Output
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
Foo _70;
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = ((1.0f.xxxx + Input2) + Input4) + Input0;
|
||||
@ -49,13 +49,7 @@ void vert_main()
|
||||
vLocation1 = 1.0f;
|
||||
vLocation2[0] = 2.0f;
|
||||
vLocation2[1] = 2.0f;
|
||||
Foo _65 = _70;
|
||||
_65.a = 1.0f.xxx;
|
||||
Foo _67 = _65;
|
||||
_67.b = 1.0f.xxx;
|
||||
Foo _69 = _67;
|
||||
_69.c = 1.0f.xxx;
|
||||
vLocation4 = _69;
|
||||
vLocation4 = _71;
|
||||
vLocation9 = 9.0f;
|
||||
vout.color = 2.0f.xxx;
|
||||
vout.foo = 4.0f.xxx;
|
||||
|
35
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/read-from-row-major-array.vert
vendored
Normal file
35
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/read-from-row-major-array.vert
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
cbuffer _104 : register(b0)
|
||||
{
|
||||
column_major float2x3 _104_var[3][4] : packoffset(c0);
|
||||
};
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 a_position;
|
||||
static float v_vtxResult;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 a_position : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float v_vtxResult : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = a_position;
|
||||
v_vtxResult = ((float(abs(_104_var[0][0][0].x - 2.0f) < 0.0500000007450580596923828125f) * float(abs(_104_var[0][0][0].y - 6.0f) < 0.0500000007450580596923828125f)) * float(abs(_104_var[0][0][0].z - (-6.0f)) < 0.0500000007450580596923828125f)) * ((float(abs(_104_var[0][0][1].x) < 0.0500000007450580596923828125f) * float(abs(_104_var[0][0][1].y - 5.0f) < 0.0500000007450580596923828125f)) * float(abs(_104_var[0][0][1].z - 5.0f) < 0.0500000007450580596923828125f));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
a_position = stage_input.a_position;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.v_vtxResult = v_vtxResult;
|
||||
return stage_output;
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
static const float4 _20[2] = { 10.0f.xxxx, 20.0f.xxxx };
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 vInput0;
|
||||
static float4 vInput1;
|
||||
|
@ -17,13 +17,15 @@ struct _4
|
||||
|
||||
kernel void main0(device _3& _5 [[buffer(0)]], device _4& _6 [[buffer(1)]])
|
||||
{
|
||||
_6._m0 = uint4(int4(_5._m1) >> _5._m0);
|
||||
_6._m0 = uint4(_5._m0 >> int4(_5._m1));
|
||||
_6._m0 = uint4(int4(_5._m1) >> int4(_5._m1));
|
||||
_6._m0 = uint4(_5._m0 >> _5._m0);
|
||||
_6._m1 = int4(_5._m1) >> int4(_5._m1);
|
||||
_6._m1 = _5._m0 >> _5._m0;
|
||||
_6._m1 = int4(_5._m1) >> _5._m0;
|
||||
_6._m1 = _5._m0 >> int4(_5._m1);
|
||||
int4 _22 = _5._m0;
|
||||
uint4 _23 = _5._m1;
|
||||
_6._m0 = uint4(int4(_23) >> _22);
|
||||
_6._m0 = uint4(_22 >> int4(_23));
|
||||
_6._m0 = uint4(int4(_23) >> int4(_23));
|
||||
_6._m0 = uint4(_22 >> _22);
|
||||
_6._m1 = int4(_23) >> int4(_23);
|
||||
_6._m1 = _22 >> _22;
|
||||
_6._m1 = int4(_23) >> _22;
|
||||
_6._m1 = _22 >> int4(_23);
|
||||
}
|
||||
|
||||
|
@ -17,13 +17,15 @@ struct _4
|
||||
|
||||
kernel void main0(device _3& _5 [[buffer(0)]], device _4& _6 [[buffer(1)]])
|
||||
{
|
||||
_6._m0 = uint4(int4(_5._m1) / _5._m0);
|
||||
_6._m0 = uint4(_5._m0 / int4(_5._m1));
|
||||
_6._m0 = uint4(int4(_5._m1) / int4(_5._m1));
|
||||
_6._m0 = uint4(_5._m0 / _5._m0);
|
||||
_6._m1 = int4(_5._m1) / int4(_5._m1);
|
||||
_6._m1 = _5._m0 / _5._m0;
|
||||
_6._m1 = int4(_5._m1) / _5._m0;
|
||||
_6._m1 = _5._m0 / int4(_5._m1);
|
||||
int4 _22 = _5._m0;
|
||||
uint4 _23 = _5._m1;
|
||||
_6._m0 = uint4(int4(_23) / _22);
|
||||
_6._m0 = uint4(_22 / int4(_23));
|
||||
_6._m0 = uint4(int4(_23) / int4(_23));
|
||||
_6._m0 = uint4(_22 / _22);
|
||||
_6._m1 = int4(_23) / int4(_23);
|
||||
_6._m1 = _22 / _22;
|
||||
_6._m1 = int4(_23) / _22;
|
||||
_6._m1 = _22 / int4(_23);
|
||||
}
|
||||
|
||||
|
@ -17,13 +17,15 @@ struct _4
|
||||
|
||||
kernel void main0(device _3& _5 [[buffer(0)]], device _4& _6 [[buffer(1)]])
|
||||
{
|
||||
_6._m0 = _5._m1 >> uint4(_5._m0);
|
||||
_6._m0 = uint4(_5._m0) >> _5._m1;
|
||||
_6._m0 = _5._m1 >> _5._m1;
|
||||
_6._m0 = uint4(_5._m0) >> uint4(_5._m0);
|
||||
_6._m1 = int4(_5._m1 >> _5._m1);
|
||||
_6._m1 = int4(uint4(_5._m0) >> uint4(_5._m0));
|
||||
_6._m1 = int4(_5._m1 >> uint4(_5._m0));
|
||||
_6._m1 = int4(uint4(_5._m0) >> _5._m1);
|
||||
int4 _22 = _5._m0;
|
||||
uint4 _23 = _5._m1;
|
||||
_6._m0 = _23 >> uint4(_22);
|
||||
_6._m0 = uint4(_22) >> _23;
|
||||
_6._m0 = _23 >> _23;
|
||||
_6._m0 = uint4(_22) >> uint4(_22);
|
||||
_6._m1 = int4(_23 >> _23);
|
||||
_6._m1 = int4(uint4(_22) >> uint4(_22));
|
||||
_6._m1 = int4(_23 >> uint4(_22));
|
||||
_6._m1 = int4(uint4(_22) >> _23);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ struct _6
|
||||
|
||||
kernel void main0(device _6& _8 [[buffer(0)]], device _6& _9 [[buffer(1)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]])
|
||||
{
|
||||
uint3 _23 = gl_WorkGroupSize;
|
||||
_8._m0[gl_WorkGroupID.x] = _9._m0[gl_WorkGroupID.x] + _8._m0[gl_WorkGroupID.x];
|
||||
uint3 _23 = gl_WorkGroupSize;
|
||||
}
|
||||
|
23
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag
vendored
Normal file
23
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float2 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uTex [[texture(1)]], sampler uSampler [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uTex.sample(uSampler, in.vUV);
|
||||
out.FragColor += uTex.sample(uSampler, in.vUV, int2(1));
|
||||
return out;
|
||||
}
|
||||
|
@ -3,29 +3,7 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct _9
|
||||
{
|
||||
float _m0;
|
||||
};
|
||||
|
||||
struct _10
|
||||
{
|
||||
float _m0;
|
||||
float _m1;
|
||||
float _m2;
|
||||
float _m3;
|
||||
float _m4;
|
||||
float _m5;
|
||||
float _m6;
|
||||
float _m7;
|
||||
float _m8;
|
||||
float _m9;
|
||||
float _m10;
|
||||
float _m11;
|
||||
_9 _m12;
|
||||
};
|
||||
|
||||
constant _10 _51 = {};
|
||||
constant float _57 = {};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
@ -35,7 +13,7 @@ struct main0_out
|
||||
fragment main0_out main0()
|
||||
{
|
||||
main0_out out = {};
|
||||
out.m_3 = float4(_51._m0, _51._m1, _51._m2, _51._m3);
|
||||
out.m_3 = float4(_57);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
vertex void main0()
|
||||
fragment void main0()
|
||||
{
|
||||
}
|
||||
|
@ -3,17 +3,17 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 vB [[user(locn1)]];
|
||||
float4 vA [[user(locn0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 vA [[user(locn0)]];
|
||||
float4 vB [[user(locn1)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
{
|
||||
main0_out out = {};
|
||||
|
@ -11,7 +11,7 @@ struct main0_out
|
||||
fragment main0_out main0()
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = (((float4(1.0) + float4(1.0)) + (float3(1.0).xyzz + float4(1.0))) + (float4(1.0) + float4(2.0))) + (float2(1.0).xyxy + float4(2.0));
|
||||
out.FragColor = float4(10.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
17
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/image-extract-reuse.asm.frag
vendored
Normal file
17
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/image-extract-reuse.asm.frag
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
int2 Size [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(texture2d<float> uTexture [[texture(0)]], sampler uTextureSmplr [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.Size = int2(uTexture.get_width(), uTexture.get_height()) + int2(uTexture.get_width(1), uTexture.get_height(1));
|
||||
return out;
|
||||
}
|
||||
|
50
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag
vendored
Normal file
50
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 v0 [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uImage [[texture(0)]], sampler uImageSmplr [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float phi;
|
||||
float4 _36;
|
||||
int _51;
|
||||
_51 = 0;
|
||||
phi = 1.0;
|
||||
_36 = float4(1.0, 2.0, 1.0, 2.0);
|
||||
for (;;)
|
||||
{
|
||||
out.FragColor = _36;
|
||||
if (_51 < 4)
|
||||
{
|
||||
if (in.v0[_51] > 0.0)
|
||||
{
|
||||
float2 _48 = float2(phi);
|
||||
_51++;
|
||||
phi += 2.0;
|
||||
_36 = uImage.sample(uImageSmplr, _48, level(0.0));
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
@ -3,12 +3,6 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct D
|
||||
{
|
||||
float4 a;
|
||||
float b;
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float FragColor [[color(0)]];
|
||||
|
@ -5,8 +5,5 @@ using namespace metal;
|
||||
|
||||
fragment void main0()
|
||||
{
|
||||
for (int _22 = 35; _22 >= 0; _22--)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,28 +3,21 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct VOUT
|
||||
{
|
||||
float4 a;
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 VOUT_a [[user(locn0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
int4 vA [[user(locn0)]];
|
||||
int4 vB [[user(locn1)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
{
|
||||
main0_out out = {};
|
||||
VOUT tmp;
|
||||
tmp.a = in.VOUT_a;
|
||||
tmp.a += float4(1.0);
|
||||
out.FragColor = tmp.a;
|
||||
out.FragColor = float4(in.vA - in.vB * (in.vA / in.vB));
|
||||
return out;
|
||||
}
|
||||
|
17
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag
vendored
Normal file
17
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(texture2d<float> uTexture [[texture(0)]], sampler uTextureSmplr [[sampler(0)]], float4 gl_FragCoord [[position]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uTexture.read(uint2(int2(gl_FragCoord.xy)), 0);
|
||||
return out;
|
||||
}
|
||||
|
@ -3,9 +3,6 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant float4 _38 = {};
|
||||
constant float4 _50 = {};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 _entryPointOutput [[color(0)]];
|
||||
@ -14,25 +11,7 @@ struct main0_out
|
||||
fragment main0_out main0()
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _51;
|
||||
_51 = _50;
|
||||
float4 _52;
|
||||
for (;;)
|
||||
{
|
||||
if (0.0 != 0.0)
|
||||
{
|
||||
_52 = float4(1.0, 0.0, 0.0, 1.0);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
_52 = float4(1.0, 1.0, 0.0, 1.0);
|
||||
break;
|
||||
}
|
||||
_52 = _38;
|
||||
break;
|
||||
}
|
||||
out._entryPointOutput = _52;
|
||||
out._entryPointOutput = float4(1.0, 1.0, 0.0, 1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -3,36 +3,34 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant float4 _21 = {};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
int counter [[user(locn0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
int counter [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _33;
|
||||
do
|
||||
bool _29;
|
||||
for (;;)
|
||||
{
|
||||
if (in.counter == 10)
|
||||
_29 = in.counter == 10;
|
||||
if (_29)
|
||||
{
|
||||
_33 = float4(10.0);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
_33 = float4(30.0);
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
out.FragColor = _33;
|
||||
}
|
||||
bool4 _35 = bool4(_29);
|
||||
out.FragColor = float4(_35.x ? float4(10.0).x : float4(30.0).x, _35.y ? float4(10.0).y : float4(30.0).y, _35.z ? float4(10.0).z : float4(30.0).z, _35.w ? float4(10.0).w : float4(30.0).w);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -95,212 +95,212 @@ struct main0_out
|
||||
float4 m_5 [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buffer(1)]], constant _18& _19 [[buffer(2)]], texture2d<float> _8 [[texture(0)]], texture2d<float> _12 [[texture(1)]], texture2d<float> _14 [[texture(2)]], sampler _9 [[sampler(0)]], sampler _13 [[sampler(1)]], sampler _15 [[sampler(2)]], float4 gl_FragCoord [[position]])
|
||||
fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _18& _19 [[buffer(1)]], constant _10& _11 [[buffer(2)]], texture2d<float> _14 [[texture(4)]], texture2d<float> _12 [[texture(13)]], texture2d<float> _8 [[texture(14)]], sampler _15 [[sampler(3)]], sampler _13 [[sampler(5)]], sampler _9 [[sampler(6)]], float4 gl_FragCoord [[position]])
|
||||
{
|
||||
main0_out out = {};
|
||||
_28 _77 = _74;
|
||||
_77._m0 = float4(0.0);
|
||||
float2 _82 = gl_FragCoord.xy * _19._m23.xy;
|
||||
float4 _88 = _7._m2 * _7._m0.xyxy;
|
||||
float2 _97 = clamp(_82 + (float3(0.0, -2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _109 = _11._m5 * clamp(_8.sample(_9, _97, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _95 = _88.xy;
|
||||
float2 _96 = _88.zw;
|
||||
float2 _97 = clamp(_82 + (float2(0.0, -2.0) * _7._m0.xy), _95, _96);
|
||||
float3 _109 = float3(_11._m5) * clamp(_8.sample(_9, _97, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _113 = _12.sample(_13, _97, level(0.0));
|
||||
float _114 = _113.y;
|
||||
float3 _129;
|
||||
if (_113.y > 0.0)
|
||||
if (_114 > 0.0)
|
||||
{
|
||||
_129 = _109 + (_14.sample(_15, _97, level(0.0)).xyz * clamp(_113.y * _113.z, 0.0, 1.0));
|
||||
_129 = _109 + (_14.sample(_15, _97, level(0.0)).xyz * clamp(_114 * _113.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_129 = _109;
|
||||
}
|
||||
float3 _133 = float4(0.0).xyz + (_129 * 0.5);
|
||||
float4 _134 = float4(_133.x, _133.y, _133.z, float4(0.0).w);
|
||||
_28 _135 = _77;
|
||||
_135._m0 = _134;
|
||||
float2 _144 = clamp(_82 + (float3(-1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _156 = _11._m5 * clamp(_8.sample(_9, _144, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float3 _130 = _129 * 0.5;
|
||||
float4 _134 = float4(_130.x, _130.y, _130.z, float4(0.0).w);
|
||||
float2 _144 = clamp(_82 + (float2(-1.0) * _7._m0.xy), _95, _96);
|
||||
float3 _156 = float3(_11._m5) * clamp(_8.sample(_9, _144, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _160 = _12.sample(_13, _144, level(0.0));
|
||||
float _161 = _160.y;
|
||||
float3 _176;
|
||||
if (_160.y > 0.0)
|
||||
if (_161 > 0.0)
|
||||
{
|
||||
_176 = _156 + (_14.sample(_15, _144, level(0.0)).xyz * clamp(_160.y * _160.z, 0.0, 1.0));
|
||||
_176 = _156 + (_14.sample(_15, _144, level(0.0)).xyz * clamp(_161 * _160.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_176 = _156;
|
||||
}
|
||||
float3 _180 = _134.xyz + (_176 * 0.5);
|
||||
float3 _177 = _176 * 0.5;
|
||||
float3 _180 = _134.xyz + _177;
|
||||
float4 _181 = float4(_180.x, _180.y, _180.z, _134.w);
|
||||
_28 _182 = _135;
|
||||
_182._m0 = _181;
|
||||
float2 _191 = clamp(_82 + (float3(0.0, -1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _203 = _11._m5 * clamp(_8.sample(_9, _191, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _191 = clamp(_82 + (float2(0.0, -1.0) * _7._m0.xy), _95, _96);
|
||||
float3 _203 = float3(_11._m5) * clamp(_8.sample(_9, _191, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _207 = _12.sample(_13, _191, level(0.0));
|
||||
float _208 = _207.y;
|
||||
float3 _223;
|
||||
if (_207.y > 0.0)
|
||||
if (_208 > 0.0)
|
||||
{
|
||||
_223 = _203 + (_14.sample(_15, _191, level(0.0)).xyz * clamp(_207.y * _207.z, 0.0, 1.0));
|
||||
_223 = _203 + (_14.sample(_15, _191, level(0.0)).xyz * clamp(_208 * _207.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_223 = _203;
|
||||
}
|
||||
float3 _227 = _181.xyz + (_223 * 0.75);
|
||||
float3 _224 = _223 * 0.75;
|
||||
float3 _227 = _181.xyz + _224;
|
||||
float4 _228 = float4(_227.x, _227.y, _227.z, _181.w);
|
||||
_28 _229 = _182;
|
||||
_229._m0 = _228;
|
||||
float2 _238 = clamp(_82 + (float3(1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _250 = _11._m5 * clamp(_8.sample(_9, _238, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _238 = clamp(_82 + (float2(1.0, -1.0) * _7._m0.xy), _95, _96);
|
||||
float3 _250 = float3(_11._m5) * clamp(_8.sample(_9, _238, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _254 = _12.sample(_13, _238, level(0.0));
|
||||
float _255 = _254.y;
|
||||
float3 _270;
|
||||
if (_254.y > 0.0)
|
||||
if (_255 > 0.0)
|
||||
{
|
||||
_270 = _250 + (_14.sample(_15, _238, level(0.0)).xyz * clamp(_254.y * _254.z, 0.0, 1.0));
|
||||
_270 = _250 + (_14.sample(_15, _238, level(0.0)).xyz * clamp(_255 * _254.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_270 = _250;
|
||||
}
|
||||
float3 _274 = _228.xyz + (_270 * 0.5);
|
||||
float3 _271 = _270 * 0.5;
|
||||
float3 _274 = _228.xyz + _271;
|
||||
float4 _275 = float4(_274.x, _274.y, _274.z, _228.w);
|
||||
_28 _276 = _229;
|
||||
_276._m0 = _275;
|
||||
float2 _285 = clamp(_82 + (float3(-2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _297 = _11._m5 * clamp(_8.sample(_9, _285, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _285 = clamp(_82 + (float2(-2.0, 0.0) * _7._m0.xy), _95, _96);
|
||||
float3 _297 = float3(_11._m5) * clamp(_8.sample(_9, _285, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _301 = _12.sample(_13, _285, level(0.0));
|
||||
float _302 = _301.y;
|
||||
float3 _317;
|
||||
if (_301.y > 0.0)
|
||||
if (_302 > 0.0)
|
||||
{
|
||||
_317 = _297 + (_14.sample(_15, _285, level(0.0)).xyz * clamp(_301.y * _301.z, 0.0, 1.0));
|
||||
_317 = _297 + (_14.sample(_15, _285, level(0.0)).xyz * clamp(_302 * _301.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_317 = _297;
|
||||
}
|
||||
float3 _321 = _275.xyz + (_317 * 0.5);
|
||||
float3 _318 = _317 * 0.5;
|
||||
float3 _321 = _275.xyz + _318;
|
||||
float4 _322 = float4(_321.x, _321.y, _321.z, _275.w);
|
||||
_28 _323 = _276;
|
||||
_323._m0 = _322;
|
||||
float2 _332 = clamp(_82 + (float3(-1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _344 = _11._m5 * clamp(_8.sample(_9, _332, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _332 = clamp(_82 + (float2(-1.0, 0.0) * _7._m0.xy), _95, _96);
|
||||
float3 _344 = float3(_11._m5) * clamp(_8.sample(_9, _332, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _348 = _12.sample(_13, _332, level(0.0));
|
||||
float _349 = _348.y;
|
||||
float3 _364;
|
||||
if (_348.y > 0.0)
|
||||
if (_349 > 0.0)
|
||||
{
|
||||
_364 = _344 + (_14.sample(_15, _332, level(0.0)).xyz * clamp(_348.y * _348.z, 0.0, 1.0));
|
||||
_364 = _344 + (_14.sample(_15, _332, level(0.0)).xyz * clamp(_349 * _348.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_364 = _344;
|
||||
}
|
||||
float3 _368 = _322.xyz + (_364 * 0.75);
|
||||
float3 _365 = _364 * 0.75;
|
||||
float3 _368 = _322.xyz + _365;
|
||||
float4 _369 = float4(_368.x, _368.y, _368.z, _322.w);
|
||||
_28 _370 = _323;
|
||||
_370._m0 = _369;
|
||||
float2 _379 = clamp(_82 + (float3(0.0, 0.0, 1.0).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _391 = _11._m5 * clamp(_8.sample(_9, _379, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _379 = clamp(_82, _95, _96);
|
||||
float3 _391 = float3(_11._m5) * clamp(_8.sample(_9, _379, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _395 = _12.sample(_13, _379, level(0.0));
|
||||
float _396 = _395.y;
|
||||
float3 _411;
|
||||
if (_395.y > 0.0)
|
||||
if (_396 > 0.0)
|
||||
{
|
||||
_411 = _391 + (_14.sample(_15, _379, level(0.0)).xyz * clamp(_395.y * _395.z, 0.0, 1.0));
|
||||
_411 = _391 + (_14.sample(_15, _379, level(0.0)).xyz * clamp(_396 * _395.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_411 = _391;
|
||||
}
|
||||
float3 _415 = _369.xyz + (_411 * 1.0);
|
||||
float3 _412 = _411 * 1.0;
|
||||
float3 _415 = _369.xyz + _412;
|
||||
float4 _416 = float4(_415.x, _415.y, _415.z, _369.w);
|
||||
_28 _417 = _370;
|
||||
_417._m0 = _416;
|
||||
float2 _426 = clamp(_82 + (float3(1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _438 = _11._m5 * clamp(_8.sample(_9, _426, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _426 = clamp(_82 + (float2(1.0, 0.0) * _7._m0.xy), _95, _96);
|
||||
float3 _438 = float3(_11._m5) * clamp(_8.sample(_9, _426, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _442 = _12.sample(_13, _426, level(0.0));
|
||||
float _443 = _442.y;
|
||||
float3 _458;
|
||||
if (_442.y > 0.0)
|
||||
if (_443 > 0.0)
|
||||
{
|
||||
_458 = _438 + (_14.sample(_15, _426, level(0.0)).xyz * clamp(_442.y * _442.z, 0.0, 1.0));
|
||||
_458 = _438 + (_14.sample(_15, _426, level(0.0)).xyz * clamp(_443 * _442.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_458 = _438;
|
||||
}
|
||||
float3 _462 = _416.xyz + (_458 * 0.75);
|
||||
float3 _459 = _458 * 0.75;
|
||||
float3 _462 = _416.xyz + _459;
|
||||
float4 _463 = float4(_462.x, _462.y, _462.z, _416.w);
|
||||
_28 _464 = _417;
|
||||
_464._m0 = _463;
|
||||
float2 _473 = clamp(_82 + (float3(2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _485 = _11._m5 * clamp(_8.sample(_9, _473, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _473 = clamp(_82 + (float2(2.0, 0.0) * _7._m0.xy), _95, _96);
|
||||
float3 _485 = float3(_11._m5) * clamp(_8.sample(_9, _473, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _489 = _12.sample(_13, _473, level(0.0));
|
||||
float _490 = _489.y;
|
||||
float3 _505;
|
||||
if (_489.y > 0.0)
|
||||
if (_490 > 0.0)
|
||||
{
|
||||
_505 = _485 + (_14.sample(_15, _473, level(0.0)).xyz * clamp(_489.y * _489.z, 0.0, 1.0));
|
||||
_505 = _485 + (_14.sample(_15, _473, level(0.0)).xyz * clamp(_490 * _489.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_505 = _485;
|
||||
}
|
||||
float3 _509 = _463.xyz + (_505 * 0.5);
|
||||
float3 _506 = _505 * 0.5;
|
||||
float3 _509 = _463.xyz + _506;
|
||||
float4 _510 = float4(_509.x, _509.y, _509.z, _463.w);
|
||||
_28 _511 = _464;
|
||||
_511._m0 = _510;
|
||||
float2 _520 = clamp(_82 + (float3(-1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _532 = _11._m5 * clamp(_8.sample(_9, _520, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _520 = clamp(_82 + (float2(-1.0, 1.0) * _7._m0.xy), _95, _96);
|
||||
float3 _532 = float3(_11._m5) * clamp(_8.sample(_9, _520, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _536 = _12.sample(_13, _520, level(0.0));
|
||||
float _537 = _536.y;
|
||||
float3 _552;
|
||||
if (_536.y > 0.0)
|
||||
if (_537 > 0.0)
|
||||
{
|
||||
_552 = _532 + (_14.sample(_15, _520, level(0.0)).xyz * clamp(_536.y * _536.z, 0.0, 1.0));
|
||||
_552 = _532 + (_14.sample(_15, _520, level(0.0)).xyz * clamp(_537 * _536.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_552 = _532;
|
||||
}
|
||||
float3 _556 = _510.xyz + (_552 * 0.5);
|
||||
float3 _553 = _552 * 0.5;
|
||||
float3 _556 = _510.xyz + _553;
|
||||
float4 _557 = float4(_556.x, _556.y, _556.z, _510.w);
|
||||
_28 _558 = _511;
|
||||
_558._m0 = _557;
|
||||
float2 _567 = clamp(_82 + (float3(0.0, 1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _579 = _11._m5 * clamp(_8.sample(_9, _567, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _567 = clamp(_82 + (float2(0.0, 1.0) * _7._m0.xy), _95, _96);
|
||||
float3 _579 = float3(_11._m5) * clamp(_8.sample(_9, _567, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _583 = _12.sample(_13, _567, level(0.0));
|
||||
float _584 = _583.y;
|
||||
float3 _599;
|
||||
if (_583.y > 0.0)
|
||||
if (_584 > 0.0)
|
||||
{
|
||||
_599 = _579 + (_14.sample(_15, _567, level(0.0)).xyz * clamp(_583.y * _583.z, 0.0, 1.0));
|
||||
_599 = _579 + (_14.sample(_15, _567, level(0.0)).xyz * clamp(_584 * _583.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_599 = _579;
|
||||
}
|
||||
float3 _603 = _557.xyz + (_599 * 0.75);
|
||||
float3 _600 = _599 * 0.75;
|
||||
float3 _603 = _557.xyz + _600;
|
||||
float4 _604 = float4(_603.x, _603.y, _603.z, _557.w);
|
||||
_28 _605 = _558;
|
||||
_605._m0 = _604;
|
||||
float2 _614 = clamp(_82 + (float3(1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _626 = _11._m5 * clamp(_8.sample(_9, _614, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _614 = clamp(_82 + _7._m0.xy, _95, _96);
|
||||
float3 _626 = float3(_11._m5) * clamp(_8.sample(_9, _614, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _630 = _12.sample(_13, _614, level(0.0));
|
||||
float _631 = _630.y;
|
||||
float3 _646;
|
||||
if (_630.y > 0.0)
|
||||
if (_631 > 0.0)
|
||||
{
|
||||
_646 = _626 + (_14.sample(_15, _614, level(0.0)).xyz * clamp(_630.y * _630.z, 0.0, 1.0));
|
||||
_646 = _626 + (_14.sample(_15, _614, level(0.0)).xyz * clamp(_631 * _630.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_646 = _626;
|
||||
}
|
||||
float3 _650 = _604.xyz + (_646 * 0.5);
|
||||
float3 _647 = _646 * 0.5;
|
||||
float3 _650 = _604.xyz + _647;
|
||||
float4 _651 = float4(_650.x, _650.y, _650.z, _604.w);
|
||||
_28 _652 = _605;
|
||||
_652._m0 = _651;
|
||||
float2 _661 = clamp(_82 + (float3(0.0, 2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
|
||||
float3 _673 = _11._m5 * clamp(_8.sample(_9, _661, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float2 _661 = clamp(_82 + (float2(0.0, 2.0) * _7._m0.xy), _95, _96);
|
||||
float3 _673 = float3(_11._m5) * clamp(_8.sample(_9, _661, level(0.0)).w * _7._m1, 0.0, 1.0);
|
||||
float4 _677 = _12.sample(_13, _661, level(0.0));
|
||||
float _678 = _677.y;
|
||||
float3 _693;
|
||||
if (_677.y > 0.0)
|
||||
if (_678 > 0.0)
|
||||
{
|
||||
_693 = _673 + (_14.sample(_15, _661, level(0.0)).xyz * clamp(_677.y * _677.z, 0.0, 1.0));
|
||||
_693 = _673 + (_14.sample(_15, _661, level(0.0)).xyz * clamp(_678 * _677.z, 0.0, 1.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -308,10 +308,8 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
|
||||
}
|
||||
float3 _697 = _651.xyz + (_693 * 0.5);
|
||||
float4 _698 = float4(_697.x, _697.y, _697.z, _651.w);
|
||||
_28 _699 = _652;
|
||||
_699._m0 = _698;
|
||||
float3 _702 = _698.xyz / float3(((((((((((((0.0 + 0.5) + 0.5) + 0.75) + 0.5) + 0.5) + 0.75) + 1.0) + 0.75) + 0.5) + 0.5) + 0.75) + 0.5) + 0.5);
|
||||
_28 _704 = _699;
|
||||
float3 _702 = _698.xyz * float3(0.125);
|
||||
_28 _704 = _74;
|
||||
_704._m0 = float4(_702.x, _702.y, _702.z, _698.w);
|
||||
_28 _705 = _704;
|
||||
_705._m0.w = 1.0;
|
||||
|
35
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert
vendored
Normal file
35
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant int _7_tmp [[function_constant(201)]];
|
||||
constant int _7 = is_function_constant_defined(_7_tmp) ? _7_tmp : -10;
|
||||
constant uint _8_tmp [[function_constant(202)]];
|
||||
constant uint _8 = is_function_constant_defined(_8_tmp) ? _8_tmp : 100u;
|
||||
constant int _20 = (_7 + 2);
|
||||
constant uint _25 = (_8 % 5u);
|
||||
constant int4 _30 = int4(20, 30, _20, _20);
|
||||
constant int2 _32 = int2(_30.y, _30.x);
|
||||
constant int _33 = _30.y;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
int m_4 [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
vertex main0_out main0()
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _64 = float4(0.0);
|
||||
_64.y = float(_20);
|
||||
float4 _68 = _64;
|
||||
_68.z = float(_25);
|
||||
float4 _52 = _68 + float4(_30);
|
||||
float2 _56 = _52.xy + float2(_32);
|
||||
out.gl_Position = float4(_56.x, _56.y, _52.z, _52.w);
|
||||
out.m_4 = _33;
|
||||
return out;
|
||||
}
|
||||
|
18
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/access-private-workgroup-in-function.comp
vendored
Normal file
18
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/access-private-workgroup-in-function.comp
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
kernel void main0(uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
{
|
||||
threadgroup int u;
|
||||
u = 50;
|
||||
if (gl_LocalInvocationIndex == 0u)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
u = 20;
|
||||
}
|
||||
}
|
||||
|
@ -12,25 +12,59 @@ struct SSBO
|
||||
int i32;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& ssbo [[buffer(0)]])
|
||||
kernel void main0(device SSBO& ssbo [[buffer(2)]])
|
||||
{
|
||||
uint _16 = atomic_fetch_add_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed);
|
||||
uint _18 = atomic_fetch_or_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed);
|
||||
uint _20 = atomic_fetch_xor_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed);
|
||||
uint _22 = atomic_fetch_and_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed);
|
||||
uint _24 = atomic_fetch_min_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed);
|
||||
uint _26 = atomic_fetch_max_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed);
|
||||
uint _28 = atomic_exchange_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed);
|
||||
uint _30 = 10u;
|
||||
uint _32 = atomic_compare_exchange_weak_explicit((volatile device atomic_uint*)&(ssbo.u32), &(_30), 2u, memory_order_relaxed, memory_order_relaxed);
|
||||
int _36 = atomic_fetch_add_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed);
|
||||
int _38 = atomic_fetch_or_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed);
|
||||
int _40 = atomic_fetch_xor_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed);
|
||||
int _42 = atomic_fetch_and_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed);
|
||||
int _44 = atomic_fetch_min_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed);
|
||||
int _46 = atomic_fetch_max_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed);
|
||||
int _48 = atomic_exchange_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed);
|
||||
int _50 = 10;
|
||||
int _52 = atomic_compare_exchange_weak_explicit((volatile device atomic_int*)&(ssbo.i32), &(_50), 2, memory_order_relaxed, memory_order_relaxed);
|
||||
threadgroup uint shared_u32;
|
||||
threadgroup int shared_i32;
|
||||
uint _16 = atomic_fetch_add_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed);
|
||||
uint _18 = atomic_fetch_or_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed);
|
||||
uint _20 = atomic_fetch_xor_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed);
|
||||
uint _22 = atomic_fetch_and_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed);
|
||||
uint _24 = atomic_fetch_min_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed);
|
||||
uint _26 = atomic_fetch_max_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed);
|
||||
uint _28 = atomic_exchange_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed);
|
||||
uint _32;
|
||||
do
|
||||
{
|
||||
_32 = 10u;
|
||||
} while (!atomic_compare_exchange_weak_explicit((volatile device atomic_uint*)&ssbo.u32, &_32, 2u, memory_order_relaxed, memory_order_relaxed));
|
||||
int _36 = atomic_fetch_add_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed);
|
||||
int _38 = atomic_fetch_or_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed);
|
||||
int _40 = atomic_fetch_xor_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed);
|
||||
int _42 = atomic_fetch_and_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed);
|
||||
int _44 = atomic_fetch_min_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed);
|
||||
int _46 = atomic_fetch_max_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed);
|
||||
int _48 = atomic_exchange_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed);
|
||||
int _52;
|
||||
do
|
||||
{
|
||||
_52 = 10;
|
||||
} while (!atomic_compare_exchange_weak_explicit((volatile device atomic_int*)&ssbo.i32, &_52, 2, memory_order_relaxed, memory_order_relaxed));
|
||||
shared_u32 = 10u;
|
||||
shared_i32 = 10;
|
||||
uint _57 = atomic_fetch_add_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed);
|
||||
uint _58 = atomic_fetch_or_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed);
|
||||
uint _59 = atomic_fetch_xor_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed);
|
||||
uint _60 = atomic_fetch_and_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed);
|
||||
uint _61 = atomic_fetch_min_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed);
|
||||
uint _62 = atomic_fetch_max_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed);
|
||||
uint _63 = atomic_exchange_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed);
|
||||
uint _64;
|
||||
do
|
||||
{
|
||||
_64 = 10u;
|
||||
} while (!atomic_compare_exchange_weak_explicit((volatile threadgroup atomic_uint*)&shared_u32, &_64, 2u, memory_order_relaxed, memory_order_relaxed));
|
||||
int _65 = atomic_fetch_add_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed);
|
||||
int _66 = atomic_fetch_or_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed);
|
||||
int _67 = atomic_fetch_xor_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed);
|
||||
int _68 = atomic_fetch_and_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed);
|
||||
int _69 = atomic_fetch_min_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed);
|
||||
int _70 = atomic_fetch_max_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed);
|
||||
int _71 = atomic_exchange_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed);
|
||||
int _72;
|
||||
do
|
||||
{
|
||||
_72 = 10;
|
||||
} while (!atomic_compare_exchange_weak_explicit((volatile threadgroup atomic_int*)&shared_i32, &_72, 2, memory_order_relaxed, memory_order_relaxed));
|
||||
}
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant uint3 gl_WorkGroupSize = uint3(8u, 8u, 1u);
|
||||
|
||||
struct UBO
|
||||
{
|
||||
float4 uInvSize;
|
||||
float4 uScale;
|
||||
};
|
||||
|
||||
kernel void main0(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], constant UBO& _46 [[buffer(0)]], texture2d<float> uHeight [[texture(0)]], sampler uHeightSmplr [[sampler(0)]], texture2d<float> uDisplacement [[texture(1)]], sampler uDisplacementSmplr [[sampler(1)]], texture2d<float, access::write> iHeightDisplacement [[texture(2)]], texture2d<float, access::write> iGradJacobian [[texture(3)]])
|
||||
{
|
||||
float4 _59 = (float2(gl_GlobalInvocationID.xy) * _46.uInvSize.xy).xyxy + (_46.uInvSize * 0.5);
|
||||
float2 _157 = ((uDisplacement.sample(uDisplacementSmplr, _59.zw, level(0.0), int2(1, 0)).xy - uDisplacement.sample(uDisplacementSmplr, _59.zw, level(0.0), int2(-1, 0)).xy) * 0.60000002384185791015625) * _46.uScale.z;
|
||||
float2 _161 = ((uDisplacement.sample(uDisplacementSmplr, _59.zw, level(0.0), int2(0, 1)).xy - uDisplacement.sample(uDisplacementSmplr, _59.zw, level(0.0), int2(0, -1)).xy) * 0.60000002384185791015625) * _46.uScale.z;
|
||||
iHeightDisplacement.write(float4(uHeight.sample(uHeightSmplr, _59.xy, level(0.0)).x, 0.0, 0.0, 0.0), uint2(int2(gl_GlobalInvocationID.xy)));
|
||||
iGradJacobian.write(float4((_46.uScale.xy * 0.5) * float2(uHeight.sample(uHeightSmplr, _59.xy, level(0.0), int2(1, 0)).x - uHeight.sample(uHeightSmplr, _59.xy, level(0.0), int2(-1, 0)).x, uHeight.sample(uHeightSmplr, _59.xy, level(0.0), int2(0, 1)).x - uHeight.sample(uHeightSmplr, _59.xy, level(0.0), int2(0, -1)).x), ((1.0 + _157.x) * (1.0 + _161.y)) - (_157.y * _161.x), 0.0), uint2(int2(gl_GlobalInvocationID.xy)));
|
||||
}
|
||||
|
@ -21,12 +21,12 @@ struct SSBO3
|
||||
uint counter;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _45 [[buffer(1)]], device SSBO3& _48 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _45 [[buffer(1)]], device SSBO3& _48 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
float4 _29 = _23.in_data[gl_GlobalInvocationID.x];
|
||||
if (dot(_29, float4(1.0, 5.0, 6.0, 2.0)) > 8.19999980926513671875)
|
||||
{
|
||||
uint _52 = atomic_fetch_add_explicit((volatile device atomic_uint*)&(_48.counter), 1u, memory_order_relaxed);
|
||||
uint _52 = atomic_fetch_add_explicit((volatile device atomic_uint*)&_48.counter, 1u, memory_order_relaxed);
|
||||
_45.out_data[_52] = _29;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant uint3 gl_WorkGroupSize = uint3(8u, 4u, 2u);
|
||||
|
||||
kernel void main0(uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]], uint3 gl_NumWorkGroups [[threadgroups_per_grid]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]])
|
||||
{
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ struct SSBO
|
||||
float4 value;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _10 [[buffer(0)]])
|
||||
kernel void main0(device SSBO& _10 [[buffer(1)]])
|
||||
{
|
||||
_10.value = float4(20.0);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ struct SSBO
|
||||
int4 value;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _10 [[buffer(0)]], texture2d<int> uImage [[texture(0)]])
|
||||
kernel void main0(device SSBO& _10 [[buffer(1)]], texture2d<int> uImage [[texture(3)]])
|
||||
{
|
||||
_10.value = uImage.read(uint2(int2(10)));
|
||||
}
|
||||
|
35
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/composite-construct.comp
vendored
Normal file
35
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/composite-construct.comp
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct SSBO0
|
||||
{
|
||||
float4 as[1];
|
||||
};
|
||||
|
||||
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
}
|
||||
|
||||
// An overload for constant arrays.
|
||||
template<typename T, uint N>
|
||||
void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N])
|
||||
{
|
||||
for (uint i = 0; i < N; dst[i] = src[i], i++);
|
||||
}
|
||||
|
||||
kernel void main0(device SSBO0& _16 [[buffer(0)]], device SSBO0& _32 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
{
|
||||
float4 _37[2] = { _16.as[gl_GlobalInvocationID.x], _32.as[gl_GlobalInvocationID.x] };
|
||||
float4 values[2];
|
||||
spvArrayCopy(values, _37);
|
||||
_16.as[0] = values[gl_LocalInvocationIndex];
|
||||
_32.as[1] = float4(40.0);
|
||||
}
|
||||
|
@ -23,12 +23,12 @@ struct SSBO3
|
||||
uint count;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _22 [[buffer(0)]], device SSBO2& _38 [[buffer(1)]], device SSBO3& _41 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(const device SSBO& _22 [[buffer(0)]], device SSBO2& _38 [[buffer(1)]], device SSBO3& _41 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
float _28 = _22.in_data[gl_GlobalInvocationID.x];
|
||||
if (_28 > 12.0)
|
||||
{
|
||||
uint _45 = atomic_fetch_add_explicit((volatile device atomic_uint*)&(_41.count), 1u, memory_order_relaxed);
|
||||
uint _45 = atomic_fetch_add_explicit((volatile device atomic_uint*)&_41.count, 1u, memory_order_relaxed);
|
||||
_38.out_data[_45] = _28;
|
||||
}
|
||||
}
|
||||
|
@ -12,10 +12,11 @@ struct SSBO
|
||||
kernel void main0(device SSBO& _13 [[buffer(0)]])
|
||||
{
|
||||
float4 _17 = _13.data;
|
||||
_13.data = float4(_17.x, _17.yz + float2(10.0), _17.w);
|
||||
float2 _28 = _17.yz + float2(10.0);
|
||||
_13.data = float4(_17.x, _28, _17.w);
|
||||
_13.data = (_17 + _17) + _17;
|
||||
_13.data = (_17.yz + float2(10.0)).xxyy;
|
||||
_13.data = float4((_17.yz + float2(10.0)).y);
|
||||
_13.data = _28.xxyy;
|
||||
_13.data = float4(_28.y);
|
||||
_13.data = float4((_17.zw + float2(10.0))[_13.index]);
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ struct SSBO2
|
||||
float4 out_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _28 [[buffer(0)]], device SSBO2& _52 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(const device SSBO& _28 [[buffer(0)]], device SSBO2& _52 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
int i = 0;
|
||||
float4 _56;
|
||||
@ -27,7 +27,6 @@ kernel void main0(device SSBO& _28 [[buffer(0)]], device SSBO2& _52 [[buffer(1)]
|
||||
if (i < 16)
|
||||
{
|
||||
_56 = _42;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
10
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/image-cube-array-load-store.comp
vendored
Normal file
10
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/image-cube-array-load-store.comp
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
kernel void main0(texturecube_array<float> uImageIn [[texture(0)]], texturecube_array<float, access::write> uImageOut [[texture(1)]])
|
||||
{
|
||||
uImageOut.write(uImageIn.read(uint2(int3(9, 7, 11).xy), uint(int3(9, 7, 11).z) % 6u, uint(int3(9, 7, 11).z) / 6u), uint2(int3(9, 7, 11).xy), uint(int3(9, 7, 11).z) % 6u, uint(int3(9, 7, 11).z) / 6u);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ using namespace metal;
|
||||
|
||||
kernel void main0(texture2d<float> uImageIn [[texture(0)]], texture2d<float, access::write> uImageOut [[texture(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
uImageOut.write(uImageIn.read(uint2((int2(gl_GlobalInvocationID.xy) + int2(uImageIn.get_width(), uImageIn.get_height())))), uint2(int2(gl_GlobalInvocationID.xy)));
|
||||
int2 _23 = int2(gl_GlobalInvocationID.xy);
|
||||
uImageOut.write(uImageIn.read(uint2((_23 + int2(uImageIn.get_width(), uImageIn.get_height())))), uint2(_23));
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ float2x2 spvInverse2x2(float2x2 m)
|
||||
return (det != 0.0f) ? (adj * (1.0f / det)) : m;
|
||||
}
|
||||
|
||||
kernel void main0(device MatrixOut& _15 [[buffer(0)]], device MatrixIn& _20 [[buffer(1)]])
|
||||
kernel void main0(device MatrixOut& _15 [[buffer(0)]], const device MatrixIn& _20 [[buffer(1)]])
|
||||
{
|
||||
_15.m2out = spvInverse2x2(_20.m2in);
|
||||
_15.m3out = spvInverse3x3(_20.m3in);
|
||||
|
@ -8,7 +8,7 @@ struct SSBO2
|
||||
float3x3 out_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO2& _22 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO2& _22 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_22.out_data[gl_GlobalInvocationID.x] = float3x3(float3(10.0), float3(20.0), float3(40.0));
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ Tx mod(Tx x, Ty y)
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _33 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _33 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_33.out_data[gl_GlobalInvocationID.x] = mod(_23.in_data[gl_GlobalInvocationID.x], _33.out_data[gl_GlobalInvocationID.x]);
|
||||
_33.out_data[gl_GlobalInvocationID.x] = as_type<float4>(as_type<uint4>(_23.in_data[gl_GlobalInvocationID.x]) % as_type<uint4>(_33.out_data[gl_GlobalInvocationID.x]));
|
||||
|
@ -13,7 +13,7 @@ struct SSBO2
|
||||
float4 out_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _35 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _35 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
float4 i;
|
||||
float4 _31 = modf(_23.in_data[gl_GlobalInvocationID.x], i);
|
||||
|
28
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-1.comp
vendored
Normal file
28
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-1.comp
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant uint3 gl_WorkGroupSize = uint3(32u, 1u, 1u);
|
||||
|
||||
struct T1
|
||||
{
|
||||
packed_float3 a;
|
||||
float b;
|
||||
};
|
||||
|
||||
struct Buffer0
|
||||
{
|
||||
T1 buf0[1];
|
||||
};
|
||||
|
||||
struct Buffer1
|
||||
{
|
||||
float buf1[1];
|
||||
};
|
||||
|
||||
kernel void main0(device Buffer0& _15 [[buffer(1)]], device Buffer1& _34 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_34.buf1[gl_GlobalInvocationID.x] = _15.buf0[0].b;
|
||||
}
|
||||
|
28
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-2.comp
vendored
Normal file
28
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-2.comp
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant uint3 gl_WorkGroupSize = uint3(32u, 1u, 1u);
|
||||
|
||||
struct T1
|
||||
{
|
||||
packed_float3 a;
|
||||
float b;
|
||||
};
|
||||
|
||||
struct Buffer0
|
||||
{
|
||||
T1 buf0[1];
|
||||
};
|
||||
|
||||
struct Buffer1
|
||||
{
|
||||
float buf1[1];
|
||||
};
|
||||
|
||||
kernel void main0(device Buffer0& _14 [[buffer(1)]], device Buffer1& _24 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_24.buf1[gl_GlobalInvocationID.x] = _14.buf0[0].b;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ struct SSBO1
|
||||
float4 data3;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO2& _10 [[buffer(0)]], device SSBO0& _15 [[buffer(1)]], device SSBO1& _21 [[buffer(2)]])
|
||||
kernel void main0(const device SSBO0& _15 [[buffer(0)]], device SSBO1& _21 [[buffer(1)]], device SSBO2& _10 [[buffer(2)]])
|
||||
{
|
||||
_10.data4 = _15.data0 + _21.data2;
|
||||
_10.data5 = _15.data1 + _21.data3;
|
||||
|
@ -1,33 +0,0 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct SSBO2
|
||||
{
|
||||
float4 out_data[1];
|
||||
};
|
||||
|
||||
constant int _69 = {};
|
||||
|
||||
kernel void main0(device SSBO2& _27 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
if (gl_GlobalInvocationID.x == 2u)
|
||||
{
|
||||
_27.out_data[gl_GlobalInvocationID.x] = float4(20.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gl_GlobalInvocationID.x == 4u)
|
||||
{
|
||||
_27.out_data[gl_GlobalInvocationID.x] = float4(10.0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (int _68 = 0; _68 < 20; _68 = _69 + 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_27.out_data[gl_GlobalInvocationID.x] = float4(10.0);
|
||||
}
|
||||
|
22
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/rmw-matrix.comp
vendored
Normal file
22
deps/SPIRV-Cross/reference/opt/shaders-msl/comp/rmw-matrix.comp
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct SSBO
|
||||
{
|
||||
float a;
|
||||
float4 b;
|
||||
float4x4 c;
|
||||
float a1;
|
||||
float4 b1;
|
||||
float4x4 c1;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _11 [[buffer(0)]])
|
||||
{
|
||||
_11.a *= _11.a1;
|
||||
_11.b *= _11.b1;
|
||||
_11.c = _11.c * _11.c1;
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ kernel void main0(device SSBO& _9 [[buffer(0)]])
|
||||
_9.a ^= 10;
|
||||
_9.a %= 40;
|
||||
_9.a |= 1;
|
||||
bool _65 = false && true;
|
||||
_9.a = int(_65 && (true || _65));
|
||||
_9.a = 0;
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,6 @@ kernel void main0(device SSBO& _67 [[buffer(0)]], uint3 gl_LocalInvocationID [[t
|
||||
threadgroup float foo[4][4];
|
||||
foo[gl_LocalInvocationID.x][gl_LocalInvocationID.y] = float(gl_LocalInvocationIndex);
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
_67.out_data[gl_GlobalInvocationID.x] = (((0.0 + foo[gl_LocalInvocationID.x][0]) + foo[gl_LocalInvocationID.x][1]) + foo[gl_LocalInvocationID.x][2]) + foo[gl_LocalInvocationID.x][3];
|
||||
_67.out_data[gl_GlobalInvocationID.x] = ((foo[gl_LocalInvocationID.x][0] + foo[gl_LocalInvocationID.x][1]) + foo[gl_LocalInvocationID.x][2]) + foo[gl_LocalInvocationID.x][3];
|
||||
}
|
||||
|
||||
|
@ -15,11 +15,11 @@ struct SSBO2
|
||||
float out_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _22 [[buffer(0)]], device SSBO2& _44 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
kernel void main0(const device SSBO& _22 [[buffer(0)]], device SSBO2& _44 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
{
|
||||
threadgroup float sShared[4];
|
||||
sShared[gl_LocalInvocationIndex] = _22.in_data[gl_GlobalInvocationID.x];
|
||||
threadgroup_barrier(mem_flags::mem_threadgroup);
|
||||
_44.out_data[gl_GlobalInvocationID.x] = sShared[(4u - gl_LocalInvocationIndex) - 1u];
|
||||
_44.out_data[gl_GlobalInvocationID.x] = sShared[3u - gl_LocalInvocationIndex];
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ struct SSBO
|
||||
Foo in_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO2& _23 [[buffer(0)]], device SSBO& _30 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(const device SSBO& _30 [[buffer(0)]], device SSBO2& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_23.out_data[gl_GlobalInvocationID.x].m = _30.in_data[gl_GlobalInvocationID.x].m * _30.in_data[gl_GlobalInvocationID.x].m;
|
||||
}
|
||||
|
@ -18,12 +18,8 @@ struct dstbuffer
|
||||
s2 test[1];
|
||||
};
|
||||
|
||||
constant s2 _31 = {};
|
||||
|
||||
kernel void main0(device dstbuffer& _19 [[buffer(0)]])
|
||||
kernel void main0(device dstbuffer& _19 [[buffer(1)]])
|
||||
{
|
||||
s2 _30 = _31;
|
||||
_30.b.a = 0;
|
||||
_19.test[0].b.a = _30.b.a;
|
||||
_19.test[0].b.a = 0;
|
||||
}
|
||||
|
||||
|
@ -67,39 +67,60 @@ struct SSBO1
|
||||
float array[1];
|
||||
};
|
||||
|
||||
struct S0_1
|
||||
{
|
||||
float2 a[1];
|
||||
float b;
|
||||
};
|
||||
|
||||
struct Content_1
|
||||
{
|
||||
S0_1 m0s[1];
|
||||
S1 m1s[1];
|
||||
S2 m2s[1];
|
||||
S0_1 m0;
|
||||
S1 m1;
|
||||
S2 m2;
|
||||
S3 m3;
|
||||
char pad7[4];
|
||||
float m4;
|
||||
S4 m3s[8];
|
||||
};
|
||||
|
||||
struct SSBO0
|
||||
{
|
||||
Content content;
|
||||
Content content1[2];
|
||||
Content content2;
|
||||
Content_1 content;
|
||||
Content_1 content1[2];
|
||||
Content_1 content2;
|
||||
float array[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO1& ssbo_430 [[buffer(0)]], device SSBO0& ssbo_140 [[buffer(1)]])
|
||||
kernel void main0(device SSBO0& ssbo_140 [[buffer(0)]], device SSBO1& ssbo_430 [[buffer(1)]])
|
||||
{
|
||||
ssbo_430.content.m0s[0].a[0] = ssbo_140.content.m0s[0].a[0];
|
||||
ssbo_430.content.m0s[0].b = ssbo_140.content.m0s[0].b;
|
||||
ssbo_430.content.m1s[0].a = ssbo_140.content.m1s[0].a;
|
||||
ssbo_430.content.m1s[0].b = ssbo_140.content.m1s[0].b;
|
||||
ssbo_430.content.m2s[0].a[0] = ssbo_140.content.m2s[0].a[0];
|
||||
ssbo_430.content.m2s[0].b = ssbo_140.content.m2s[0].b;
|
||||
ssbo_430.content.m0.a[0] = ssbo_140.content.m0.a[0];
|
||||
ssbo_430.content.m0.b = ssbo_140.content.m0.b;
|
||||
ssbo_430.content.m1.a = ssbo_140.content.m1.a;
|
||||
ssbo_430.content.m1.b = ssbo_140.content.m1.b;
|
||||
ssbo_430.content.m2.a[0] = ssbo_140.content.m2.a[0];
|
||||
ssbo_430.content.m2.b = ssbo_140.content.m2.b;
|
||||
ssbo_430.content.m3.a = ssbo_140.content.m3.a;
|
||||
ssbo_430.content.m3.b = ssbo_140.content.m3.b;
|
||||
ssbo_430.content.m4 = ssbo_140.content.m4;
|
||||
ssbo_430.content.m3s[0].c = ssbo_140.content.m3s[0].c;
|
||||
ssbo_430.content.m3s[1].c = ssbo_140.content.m3s[1].c;
|
||||
ssbo_430.content.m3s[2].c = ssbo_140.content.m3s[2].c;
|
||||
ssbo_430.content.m3s[3].c = ssbo_140.content.m3s[3].c;
|
||||
ssbo_430.content.m3s[4].c = ssbo_140.content.m3s[4].c;
|
||||
ssbo_430.content.m3s[5].c = ssbo_140.content.m3s[5].c;
|
||||
ssbo_430.content.m3s[6].c = ssbo_140.content.m3s[6].c;
|
||||
ssbo_430.content.m3s[7].c = ssbo_140.content.m3s[7].c;
|
||||
Content_1 _60 = ssbo_140.content;
|
||||
ssbo_430.content.m0s[0].a[0] = _60.m0s[0].a[0];
|
||||
ssbo_430.content.m0s[0].b = _60.m0s[0].b;
|
||||
ssbo_430.content.m1s[0].a = _60.m1s[0].a;
|
||||
ssbo_430.content.m1s[0].b = _60.m1s[0].b;
|
||||
ssbo_430.content.m2s[0].a[0] = _60.m2s[0].a[0];
|
||||
ssbo_430.content.m2s[0].b = _60.m2s[0].b;
|
||||
ssbo_430.content.m0.a[0] = _60.m0.a[0];
|
||||
ssbo_430.content.m0.b = _60.m0.b;
|
||||
ssbo_430.content.m1.a = _60.m1.a;
|
||||
ssbo_430.content.m1.b = _60.m1.b;
|
||||
ssbo_430.content.m2.a[0] = _60.m2.a[0];
|
||||
ssbo_430.content.m2.b = _60.m2.b;
|
||||
ssbo_430.content.m3.a = _60.m3.a;
|
||||
ssbo_430.content.m3.b = _60.m3.b;
|
||||
ssbo_430.content.m4 = _60.m4;
|
||||
ssbo_430.content.m3s[0].c = _60.m3s[0].c;
|
||||
ssbo_430.content.m3s[1].c = _60.m3s[1].c;
|
||||
ssbo_430.content.m3s[2].c = _60.m3s[2].c;
|
||||
ssbo_430.content.m3s[3].c = _60.m3s[3].c;
|
||||
ssbo_430.content.m3s[4].c = _60.m3s[4].c;
|
||||
ssbo_430.content.m3s[5].c = _60.m3s[5].c;
|
||||
ssbo_430.content.m3s[6].c = _60.m3s[6].c;
|
||||
ssbo_430.content.m3s[7].c = _60.m3s[7].c;
|
||||
ssbo_430.content.m1.a = ssbo_430.content.m3.a * ssbo_430.m6[1][1];
|
||||
}
|
||||
|
||||
|
@ -14,66 +14,29 @@ struct SSBO2
|
||||
float4 out_data[1];
|
||||
};
|
||||
|
||||
constant uint _98 = {};
|
||||
|
||||
kernel void main0(device SSBO& _24 [[buffer(0)]], device SSBO2& _89 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(const device SSBO& _24 [[buffer(0)]], device SSBO2& _89 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
float4 _93;
|
||||
int _94;
|
||||
_93 = _24.in_data[gl_GlobalInvocationID.x];
|
||||
_94 = 0;
|
||||
int _40;
|
||||
float4 _46;
|
||||
int _48;
|
||||
for (;;)
|
||||
float4 _99;
|
||||
_99 = _24.in_data[gl_GlobalInvocationID.x];
|
||||
for (int _93 = 0; (_93 + 1) < 10; )
|
||||
{
|
||||
_40 = _94 + 1;
|
||||
if (_40 < 10)
|
||||
_99 *= 2.0;
|
||||
_93 += 2;
|
||||
continue;
|
||||
}
|
||||
float4 _98;
|
||||
_98 = _99;
|
||||
float4 _103;
|
||||
for (uint _94 = 0u; _94 < 16u; _98 = _103, _94++)
|
||||
{
|
||||
_103 = _98;
|
||||
for (uint _100 = 0u; _100 < 30u; )
|
||||
{
|
||||
_46 = _93 * 2.0;
|
||||
_48 = _40 + 1;
|
||||
_93 = _46;
|
||||
_94 = _48;
|
||||
_103 = _24.mvp * _103;
|
||||
_100++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
float4 _95;
|
||||
int _96;
|
||||
_95 = _93;
|
||||
_96 = _40;
|
||||
float4 _100;
|
||||
uint _101;
|
||||
uint _99;
|
||||
for (uint _97 = 0u; _97 < 16u; _95 = _100, _96++, _97++, _99 = _101)
|
||||
{
|
||||
_100 = _95;
|
||||
_101 = 0u;
|
||||
float4 _71;
|
||||
for (; _101 < 30u; _100 = _71, _101++)
|
||||
{
|
||||
_71 = _24.mvp * _100;
|
||||
}
|
||||
}
|
||||
int _102;
|
||||
_102 = _96;
|
||||
int _83;
|
||||
for (;;)
|
||||
{
|
||||
_83 = _102 + 1;
|
||||
if (_83 > 10)
|
||||
{
|
||||
_102 = _83;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
_89.out_data[gl_GlobalInvocationID.x] = _95;
|
||||
_89.out_data[gl_GlobalInvocationID.x] = _98;
|
||||
}
|
||||
|
||||
|
@ -8,28 +8,18 @@ struct S0
|
||||
float4 a;
|
||||
};
|
||||
|
||||
struct S1
|
||||
{
|
||||
float4 a;
|
||||
};
|
||||
|
||||
struct SSBO0
|
||||
{
|
||||
S0 s0s[1];
|
||||
};
|
||||
|
||||
struct SSBO1
|
||||
{
|
||||
S1 s1s[1];
|
||||
};
|
||||
|
||||
struct SSBO2
|
||||
{
|
||||
float4 outputs[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO0& _36 [[buffer(0)]], device SSBO1& _55 [[buffer(1)]], device SSBO2& _66 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO0& _36 [[buffer(0)]], device SSBO0& _55 [[buffer(1)]], device SSBO2& _66 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_66.outputs[gl_GlobalInvocationID.x] = _36.s0s[gl_GlobalInvocationID.x].a + _55.s1s[gl_GlobalInvocationID.x].a;
|
||||
_66.outputs[gl_GlobalInvocationID.x] = _36.s0s[gl_GlobalInvocationID.x].a + _55.s0s[gl_GlobalInvocationID.x].a;
|
||||
}
|
||||
|
||||
|
@ -8,13 +8,8 @@ struct SSBO2
|
||||
uint outputs[1];
|
||||
};
|
||||
|
||||
struct SSBO
|
||||
kernel void main0(device SSBO2& _23 [[buffer(0)]], device SSBO2& _10 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
uint inputs[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO2& _10 [[buffer(0)]], device SSBO& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_10.outputs[gl_GlobalInvocationID.x] = _23.inputs[gl_GlobalInvocationID.x] / 29u;
|
||||
_10.outputs[gl_GlobalInvocationID.x] = _23.outputs[gl_GlobalInvocationID.x] / 29u;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
fragment void main0(texture2d_ms<float> uImageMS [[texture(0)]], texture2d_array<float, access::read_write> uImageArray [[texture(1)]], texture2d<float, access::write> uImage [[texture(2)]])
|
||||
fragment void main0(texture2d<float, access::write> uImage [[texture(0)]], texture2d_array<float, access::read_write> uImageArray [[texture(1)]], texture2d_ms<float> uImageMS [[texture(2)]])
|
||||
{
|
||||
uImage.write(uImageMS.read(uint2(int2(1, 2)), 2), uint2(int2(2, 3)));
|
||||
uImageArray.write(uImageArray.read(uint2(int3(1, 2, 4).xy), uint(int3(1, 2, 4).z)), uint2(int3(2, 3, 7).xy), uint(int3(2, 3, 7).z));
|
||||
|
@ -8,18 +8,18 @@ struct UBO
|
||||
float4x4 uMVP;
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 aNormal [[attribute(1)]];
|
||||
float4 aVertex [[attribute(0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float3 vNormal [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 aVertex [[attribute(0)]];
|
||||
float3 aNormal [[attribute(1)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
|
@ -8,18 +8,18 @@ struct UBO
|
||||
float4x4 uMVP;
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 aNormal [[attribute(1)]];
|
||||
float4 aVertex [[attribute(0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float3 vNormal [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 aVertex [[attribute(0)]];
|
||||
float3 aNormal [[attribute(1)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
|
@ -8,16 +8,16 @@ struct UBO
|
||||
float4 Data[3][5];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
int2 aIndex [[attribute(0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
int2 aIndex [[attribute(0)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _20 [[buffer(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
|
@ -10,18 +10,18 @@ struct PushMe
|
||||
float Arr[4];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 Pos [[attribute(1)]];
|
||||
float2 Rot [[attribute(0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float2 vRot [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float2 Rot [[attribute(0)]];
|
||||
float4 Pos [[attribute(1)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant PushMe& registers [[buffer(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
|
@ -10,16 +10,16 @@ struct UBO
|
||||
float2x4 uMVP;
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 aVertex [[attribute(0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 aVertex [[attribute(0)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
|
@ -16,24 +16,24 @@ struct UBO
|
||||
Light light;
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 aNormal [[attribute(1)]];
|
||||
float4 aVertex [[attribute(0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 vColor [[user(locn0)]];
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float4 aVertex [[attribute(0)]];
|
||||
float3 aNormal [[attribute(1)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.gl_Position = _18.uMVP * in.aVertex;
|
||||
out.vColor = float4(0.0);
|
||||
float3 _39 = in.aVertex.xyz - _18.light.Position;
|
||||
float3 _39 = in.aVertex.xyz - float3(_18.light.Position);
|
||||
out.vColor += ((_18.light.Color * clamp(1.0 - (length(_39) / _18.light.Radius), 0.0, 1.0)) * dot(in.aNormal, normalize(_39)));
|
||||
return out;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user