From bc419eed10b867d5fa86e4b4faf5fb8c6c340375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 20 Jul 2019 10:45:34 -0700 Subject: [PATCH] Updated spirv-cross. --- 3rdparty/spirv-cross/CMakeLists.txt | 2 +- .../checkout_glslang_spirv_tools.sh | 6 +- 3rdparty/spirv-cross/main.cpp | 5 + .../shaders-hlsl/frag/demote-to-helper.frag | 9 + ...orm-qualifier.nonuniformresource.sm51.frag | 15 +- .../amd/shader_trinary_minmax.msl21.comp | 11 + .../asm/comp/atomic-decrement.asm.comp | 2 +- .../asm/comp/atomic-increment.asm.comp | 2 +- .../asm/comp/bitcast_iadd.asm.comp | 2 +- .../asm/comp/multiple-entry.asm.comp | 2 +- .../opt/shaders-msl/comp/atomic.comp | 64 +- .../reference/opt/shaders-msl/comp/basic.comp | 2 +- .../opt/shaders-msl/comp/coherent-block.comp | 2 +- .../opt/shaders-msl/comp/coherent-image.comp | 2 +- .../opt/shaders-msl/comp/culling.comp | 2 +- ...ants.frag => 16bit-constants.invalid.frag} | 0 .../frag/nonuniform-qualifier.msl2.frag | 15 +- .../frag/post-depth-coverage.ios.msl2.frag | 17 + .../intel/shader-integer-functions2.asm.comp | 31 + .../opt/shaders-msl/vert/functions.vert | 8 +- .../vert/no_stage_out.write_buff_atomic.vert | 2 +- ...e-to-helper.vk.nocompat.msl21.invalid.frag | 10 + ...oup.multiview.viewfromdev.nocompat.vk.vert | 19 + .../vulkan/vert/device-group.nocompat.vk.vert | 18 + ...ants.frag => 16bit-constants.invalid.frag} | 0 .../opt/shaders/frag/post-depth-coverage.frag | 11 + ...-helper-forwarding.asm.vk.nocompat.frag.vk | 15 + .../frag/demote-to-helper.vk.nocompat.frag.vk | 10 + .../nonuniform-qualifier.vk.nocompat.frag.vk | 15 +- .../vert/device-group.nocompat.vk.vert.vk | 8 + .../asm/comp/bitscan.asm.comp | 25 + ....std450.frexp-modf-struct.fxconly.asm.comp | 31 + .../comp/glsl.std450.fxconly.comp | 295 +++++++ .../shaders-hlsl/frag/demote-to-helper.frag | 9 + ...orm-qualifier.nonuniformresource.sm51.frag | 16 +- .../asm/comp/atomic-result-temporary.asm.comp | 2 +- .../asm/comp/bitscan.asm.comp | 53 ++ .../asm/comp/glsl-signed-operations.asm.comp | 12 +- .../glsl.std450.frexp-modf-struct.asm.comp | 35 + .../shaders-msl-no-opt/comp/bitfield.comp | 14 +- .../shaders-msl-no-opt/comp/glsl.std450.comp | 282 +++++++ .../amd/shader_trinary_minmax.msl21.comp | 14 + .../asm/comp/atomic-decrement.asm.comp | 2 +- .../asm/comp/atomic-increment.asm.comp | 2 +- .../asm/comp/bitcast_iadd.asm.comp | 2 +- .../asm/comp/multiple-entry.asm.comp | 2 +- .../reference/shaders-msl/comp/atomic.comp | 64 +- .../reference/shaders-msl/comp/basic.comp | 2 +- .../shaders-msl/comp/coherent-block.comp | 2 +- .../shaders-msl/comp/coherent-image.comp | 2 +- .../reference/shaders-msl/comp/culling.comp | 2 +- ...ants.frag => 16bit-constants.invalid.frag} | 0 .../frag/fp16.desktop.invalid.frag | 3 +- .../reference/shaders-msl/frag/mix.frag | 5 +- .../frag/nonuniform-qualifier.msl2.frag | 17 +- .../frag/post-depth-coverage.ios.msl2.frag | 17 + .../intel/shader-integer-functions2.asm.comp | 31 + .../reference/shaders-msl/vert/functions.vert | 8 +- .../vert/no_stage_out.write_buff_atomic.vert | 2 +- ...e-to-helper.vk.nocompat.msl21.invalid.frag | 11 + ...oup.multiview.viewfromdev.nocompat.vk.vert | 19 + .../vulkan/vert/device-group.nocompat.vk.vert | 18 + .../shaders-no-opt/asm/comp/bitscan.asm.comp | 27 + .../glsl.std450.frexp-modf-struct.asm.comp | 33 + .../shaders-no-opt/comp/glsl.std450.comp | 112 +++ ...ants.frag => 16bit-constants.invalid.frag} | 0 .../shaders/frag/post-depth-coverage.frag | 11 + ...-helper-forwarding.asm.vk.nocompat.frag.vk | 15 + .../frag/demote-to-helper.vk.nocompat.frag.vk | 10 + .../nonuniform-qualifier.vk.nocompat.frag.vk | 15 +- .../vert/device-group.nocompat.vk.vert.vk | 8 + .../asm/comp/bitscan.asm.comp | 72 ++ ....std450.frexp-modf-struct.fxconly.asm.comp | 55 ++ .../comp/glsl.std450.fxconly.comp | 130 ++++ .../asm/frag/texture-sampling-fp16.asm.frag | 1 + .../shaders-hlsl/frag/demote-to-helper.frag | 7 + .../asm/comp/bitscan.asm.comp | 72 ++ .../glsl.std450.frexp-modf-struct.asm.comp | 55 ++ .../shaders-msl-no-opt/comp/glsl.std450.comp | 129 ++++ .../amd/shader_trinary_minmax.msl21.comp | 11 + .../asm/frag/texture-sampling-fp16.asm.frag | 1 + ...ants.frag => 16bit-constants.invalid.frag} | 0 .../frag/post-depth-coverage.ios.msl2.frag | 11 + .../intel/shader-integer-functions2.asm.comp | 137 ++++ ...e-to-helper.vk.nocompat.msl21.invalid.frag | 8 + ...oup.multiview.viewfromdev.nocompat.vk.vert | 8 + .../vulkan/vert/device-group.nocompat.vk.vert | 7 + .../shaders-no-opt/asm/comp/bitscan.asm.comp | 72 ++ .../glsl.std450.frexp-modf-struct.asm.comp | 55 ++ .../shaders-no-opt/comp/glsl.std450.comp | 129 ++++ .../frag/texture-sampling-fp16.asm.vk.frag | 1 + ...ants.frag => 16bit-constants.invalid.frag} | 0 .../shaders/frag/post-depth-coverage.frag | 11 + ...-to-helper-forwarding.asm.vk.nocompat.frag | 41 + .../frag/demote-to-helper.vk.nocompat.frag | 8 + .../vulkan/vert/device-group.nocompat.vk.vert | 7 + 3rdparty/spirv-cross/spirv.h | 720 ++++++++++++++++- 3rdparty/spirv-cross/spirv.hpp | 726 +++++++++++++++++- 3rdparty/spirv-cross/spirv_cross_c.cpp | 8 +- 3rdparty/spirv-cross/spirv_glsl.cpp | 33 +- 3rdparty/spirv-cross/spirv_glsl.hpp | 3 +- 3rdparty/spirv-cross/spirv_hlsl.cpp | 35 +- 3rdparty/spirv-cross/spirv_hlsl.hpp | 1 + 3rdparty/spirv-cross/spirv_msl.cpp | 401 ++++++++-- 3rdparty/spirv-cross/spirv_msl.hpp | 8 +- 3rdparty/spirv-cross/test_shaders.py | 11 +- 106 files changed, 4262 insertions(+), 249 deletions(-) create mode 100644 3rdparty/spirv-cross/reference/opt/shaders-hlsl/frag/demote-to-helper.frag create mode 100644 3rdparty/spirv-cross/reference/opt/shaders-msl/amd/shader_trinary_minmax.msl21.comp rename 3rdparty/spirv-cross/reference/opt/shaders-msl/frag/{16bit-constants.frag => 16bit-constants.invalid.frag} (100%) create mode 100644 3rdparty/spirv-cross/reference/opt/shaders-msl/frag/post-depth-coverage.ios.msl2.frag create mode 100644 3rdparty/spirv-cross/reference/opt/shaders-msl/intel/shader-integer-functions2.asm.comp create mode 100644 3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag create mode 100644 3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert create mode 100644 3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert rename 3rdparty/spirv-cross/reference/opt/shaders/frag/{16bit-constants.frag => 16bit-constants.invalid.frag} (100%) create mode 100644 3rdparty/spirv-cross/reference/opt/shaders/frag/post-depth-coverage.frag create mode 100644 3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag.vk create mode 100644 3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag.vk create mode 100644 3rdparty/spirv-cross/reference/opt/shaders/vulkan/vert/device-group.nocompat.vk.vert.vk create mode 100644 3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/bitscan.asm.comp create mode 100644 3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.fxconly.asm.comp create mode 100644 3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/comp/glsl.std450.fxconly.comp create mode 100644 3rdparty/spirv-cross/reference/shaders-hlsl/frag/demote-to-helper.frag create mode 100644 3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/bitscan.asm.comp create mode 100644 3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp create mode 100644 3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/glsl.std450.comp create mode 100644 3rdparty/spirv-cross/reference/shaders-msl/amd/shader_trinary_minmax.msl21.comp rename 3rdparty/spirv-cross/reference/shaders-msl/frag/{16bit-constants.frag => 16bit-constants.invalid.frag} (100%) create mode 100644 3rdparty/spirv-cross/reference/shaders-msl/frag/post-depth-coverage.ios.msl2.frag create mode 100644 3rdparty/spirv-cross/reference/shaders-msl/intel/shader-integer-functions2.asm.comp create mode 100644 3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag create mode 100644 3rdparty/spirv-cross/reference/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert create mode 100644 3rdparty/spirv-cross/reference/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert create mode 100644 3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/bitscan.asm.comp create mode 100644 3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp create mode 100644 3rdparty/spirv-cross/reference/shaders-no-opt/comp/glsl.std450.comp rename 3rdparty/spirv-cross/reference/shaders/frag/{16bit-constants.frag => 16bit-constants.invalid.frag} (100%) create mode 100644 3rdparty/spirv-cross/reference/shaders/frag/post-depth-coverage.frag create mode 100644 3rdparty/spirv-cross/reference/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag.vk create mode 100644 3rdparty/spirv-cross/reference/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag.vk create mode 100644 3rdparty/spirv-cross/reference/shaders/vulkan/vert/device-group.nocompat.vk.vert.vk create mode 100644 3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/bitscan.asm.comp create mode 100644 3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.fxconly.asm.comp create mode 100644 3rdparty/spirv-cross/shaders-hlsl-no-opt/comp/glsl.std450.fxconly.comp create mode 100644 3rdparty/spirv-cross/shaders-hlsl/frag/demote-to-helper.frag create mode 100644 3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/bitscan.asm.comp create mode 100644 3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp create mode 100644 3rdparty/spirv-cross/shaders-msl-no-opt/comp/glsl.std450.comp create mode 100644 3rdparty/spirv-cross/shaders-msl/amd/shader_trinary_minmax.msl21.comp rename 3rdparty/spirv-cross/shaders-msl/frag/{16bit-constants.frag => 16bit-constants.invalid.frag} (100%) create mode 100644 3rdparty/spirv-cross/shaders-msl/frag/post-depth-coverage.ios.msl2.frag create mode 100644 3rdparty/spirv-cross/shaders-msl/intel/shader-integer-functions2.asm.comp create mode 100644 3rdparty/spirv-cross/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag create mode 100644 3rdparty/spirv-cross/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert create mode 100644 3rdparty/spirv-cross/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert create mode 100644 3rdparty/spirv-cross/shaders-no-opt/asm/comp/bitscan.asm.comp create mode 100644 3rdparty/spirv-cross/shaders-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp create mode 100644 3rdparty/spirv-cross/shaders-no-opt/comp/glsl.std450.comp rename 3rdparty/spirv-cross/shaders/frag/{16bit-constants.frag => 16bit-constants.invalid.frag} (100%) create mode 100644 3rdparty/spirv-cross/shaders/frag/post-depth-coverage.frag create mode 100644 3rdparty/spirv-cross/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag create mode 100644 3rdparty/spirv-cross/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag create mode 100644 3rdparty/spirv-cross/shaders/vulkan/vert/device-group.nocompat.vk.vert diff --git a/3rdparty/spirv-cross/CMakeLists.txt b/3rdparty/spirv-cross/CMakeLists.txt index aa33262ac..5cfa74117 100644 --- a/3rdparty/spirv-cross/CMakeLists.txt +++ b/3rdparty/spirv-cross/CMakeLists.txt @@ -103,7 +103,7 @@ if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")) set(spirv-cross-link-flags "${spirv-cross-link-flags} -fsanitize=thread") endif() elseif (MSVC) - set(spirv-compiler-options ${spirv-compiler-options} /wd4267) + set(spirv-compiler-options ${spirv-compiler-options} /wd4267 /wd4996) endif() macro(extract_headers out_abs file_list) diff --git a/3rdparty/spirv-cross/checkout_glslang_spirv_tools.sh b/3rdparty/spirv-cross/checkout_glslang_spirv_tools.sh index 37b99a0e0..bd2b5fab8 100755 --- a/3rdparty/spirv-cross/checkout_glslang_spirv_tools.sh +++ b/3rdparty/spirv-cross/checkout_glslang_spirv_tools.sh @@ -1,8 +1,8 @@ #!/bin/bash -GLSLANG_REV=e291f7a09f6733f6634fe077a228056fabee881e -SPIRV_TOOLS_REV=89fe836fe22c3e5c2a062ebeade012e2c2f0839b -SPIRV_HEADERS_REV=c4f8f65792d4bf2657ca751904c511bbcf2ac77b +GLSLANG_REV=25a508cc735109cc4e382c3a1cc293a9452a41f3 +SPIRV_TOOLS_REV=55adf4cf707bb12c29fc12f784ebeaa29a819e9b +SPIRV_HEADERS_REV=29c11140baaf9f7fdaa39a583672c556bf1795a1 if [ -z $PROTOCOL ]; then PROTOCOL=git diff --git a/3rdparty/spirv-cross/main.cpp b/3rdparty/spirv-cross/main.cpp index c441d2358..00db1be1f 100644 --- a/3rdparty/spirv-cross/main.cpp +++ b/3rdparty/spirv-cross/main.cpp @@ -515,6 +515,7 @@ struct CLIArguments bool msl_argument_buffers = false; bool msl_texture_buffer_native = false; bool msl_multiview = false; + bool msl_view_index_from_device_index = false; bool glsl_emit_push_constant_as_ubo = false; bool glsl_emit_ubo_as_plain_uniforms = false; bool emit_line_directives = false; @@ -594,6 +595,7 @@ static void print_help() "\t[--msl-texture-buffer-native]\n" "\t[--msl-discrete-descriptor-set ]\n" "\t[--msl-multiview]\n" + "\t[--msl-view-index-from-device-index]\n" "\t[--hlsl]\n" "\t[--reflect]\n" "\t[--shader-model]\n" @@ -753,6 +755,7 @@ static string compile_iteration(const CLIArguments &args, std::vector msl_opts.argument_buffers = args.msl_argument_buffers; msl_opts.texture_buffer_native = args.msl_texture_buffer_native; msl_opts.multiview = args.msl_multiview; + msl_opts.view_index_from_device_index = args.msl_view_index_from_device_index; msl_comp->set_msl_options(msl_opts); for (auto &v : args.msl_discrete_descriptor_sets) msl_comp->add_discrete_descriptor_set(v); @@ -1073,6 +1076,8 @@ static int main_inner(int argc, char *argv[]) [&args](CLIParser &parser) { args.msl_discrete_descriptor_sets.push_back(parser.next_uint()); }); cbs.add("--msl-texture-buffer-native", [&args](CLIParser &) { args.msl_texture_buffer_native = true; }); cbs.add("--msl-multiview", [&args](CLIParser &) { args.msl_multiview = true; }); + cbs.add("--msl-view-index-from-device-index", + [&args](CLIParser &) { args.msl_view_index_from_device_index = true; }); cbs.add("--extension", [&args](CLIParser &parser) { args.extensions.push_back(parser.next_string()); }); cbs.add("--rename-entry-point", [&args](CLIParser &parser) { auto old_name = parser.next_string(); diff --git a/3rdparty/spirv-cross/reference/opt/shaders-hlsl/frag/demote-to-helper.frag b/3rdparty/spirv-cross/reference/opt/shaders-hlsl/frag/demote-to-helper.frag new file mode 100644 index 000000000..743a4228b --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders-hlsl/frag/demote-to-helper.frag @@ -0,0 +1,9 @@ +void frag_main() +{ + discard; +} + +void main() +{ + frag_main(); +} diff --git a/3rdparty/spirv-cross/reference/opt/shaders-hlsl/frag/nonuniform-qualifier.nonuniformresource.sm51.frag b/3rdparty/spirv-cross/reference/opt/shaders-hlsl/frag/nonuniform-qualifier.nonuniformresource.sm51.frag index 544c57053..65b486518 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-hlsl/frag/nonuniform-qualifier.nonuniformresource.sm51.frag +++ b/3rdparty/spirv-cross/reference/opt/shaders-hlsl/frag/nonuniform-qualifier.nonuniformresource.sm51.frag @@ -27,12 +27,15 @@ struct SPIRV_Cross_Output void frag_main() { - int _22 = vIndex + 10; - int _32 = vIndex + 40; - FragColor = uSamplers[NonUniformResourceIndex(_22)].Sample(uSamps[NonUniformResourceIndex(_32)], vUV); - FragColor = uCombinedSamplers[NonUniformResourceIndex(_22)].Sample(_uCombinedSamplers_sampler[NonUniformResourceIndex(_22)], vUV); - FragColor += ubos[NonUniformResourceIndex(vIndex + 20)].v[_32]; - FragColor += asfloat(ssbos[NonUniformResourceIndex(vIndex + 50)].Load4((vIndex + 60) * 16 + 0)); + int _23 = vIndex + 10; + int _34 = vIndex + 40; + FragColor = uSamplers[NonUniformResourceIndex(_23)].Sample(uSamps[NonUniformResourceIndex(_34)], vUV); + FragColor = uCombinedSamplers[NonUniformResourceIndex(_23)].Sample(_uCombinedSamplers_sampler[NonUniformResourceIndex(_23)], vUV); + int _66 = vIndex + 20; + FragColor += ubos[NonUniformResourceIndex(_66)].v[_34]; + int _84 = vIndex + 50; + int _88 = vIndex + 60; + FragColor += asfloat(ssbos[NonUniformResourceIndex(_84)].Load4(_88 * 16 + 0)); } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/amd/shader_trinary_minmax.msl21.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/amd/shader_trinary_minmax.msl21.comp new file mode 100644 index 000000000..9c33c22ca --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/amd/shader_trinary_minmax.msl21.comp @@ -0,0 +1,11 @@ +#include +#include + +using namespace metal; + +constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u); + +kernel void main0() +{ +} + diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-decrement.asm.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-decrement.asm.comp index feb7dbbe5..04d92a346 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-decrement.asm.comp +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-decrement.asm.comp @@ -20,7 +20,7 @@ uint2 spvTexelBufferCoord(uint tc) kernel void main0(device u0_counters& u0_counter [[buffer(0)]], texture2d u0 [[texture(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { - uint _29 = atomic_fetch_sub_explicit((volatile device atomic_uint*)&u0_counter.c, 1, memory_order_relaxed); + uint _29 = atomic_fetch_sub_explicit((device atomic_uint*)&u0_counter.c, 1, memory_order_relaxed); u0.write(uint4(uint(int(gl_GlobalInvocationID.x))), spvTexelBufferCoord(as_type(as_type(_29)))); } diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-increment.asm.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-increment.asm.comp index 22409301c..b0fd1d4f3 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-increment.asm.comp +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/atomic-increment.asm.comp @@ -20,7 +20,7 @@ uint2 spvTexelBufferCoord(uint tc) kernel void main0(device u0_counters& u0_counter [[buffer(0)]], texture2d u0 [[texture(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { - uint _29 = atomic_fetch_add_explicit((volatile device atomic_uint*)&u0_counter.c, 1, memory_order_relaxed); + uint _29 = atomic_fetch_add_explicit((device atomic_uint*)&u0_counter.c, 1, memory_order_relaxed); u0.write(uint4(uint(int(gl_GlobalInvocationID.x))), spvTexelBufferCoord(as_type(as_type(_29)))); } diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/bitcast_iadd.asm.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/bitcast_iadd.asm.comp index 47ce85f8f..ad61d750d 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/bitcast_iadd.asm.comp +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/bitcast_iadd.asm.comp @@ -15,7 +15,7 @@ struct _4 int4 _m1; }; -kernel void main0(device _3& _5 [[buffer(0)]], device _4& _6 [[buffer(1)]]) +kernel void main0(device _3& restrict _5 [[buffer(0)]], device _4& restrict _6 [[buffer(1)]]) { _6._m0 = _5._m1 + uint4(_5._m0); _6._m0 = uint4(_5._m0) + _5._m1; diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/multiple-entry.asm.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/multiple-entry.asm.comp index 765273326..25ccf623e 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/multiple-entry.asm.comp +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/asm/comp/multiple-entry.asm.comp @@ -15,7 +15,7 @@ struct _7 int4 _m1; }; -kernel void main0(device _6& _8 [[buffer(0)]], device _7& _9 [[buffer(1)]]) +kernel void main0(device _6& restrict _8 [[buffer(0)]], device _7& restrict _9 [[buffer(1)]]) { _9._m0 = _8._m1 + uint4(_8._m0); _9._m0 = uint4(_8._m0) + _8._m1; diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/atomic.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/atomic.comp index 43e6a8f03..047215022 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/atomic.comp +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/atomic.comp @@ -16,55 +16,55 @@ kernel void main0(device SSBO& ssbo [[buffer(0)]]) { 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 _16 = atomic_fetch_add_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _18 = atomic_fetch_or_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _20 = atomic_fetch_xor_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _22 = atomic_fetch_and_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _24 = atomic_fetch_min_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _26 = atomic_fetch_max_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _28 = atomic_exchange_explicit((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) && _32 == 10u); - 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); + } while (!atomic_compare_exchange_weak_explicit((device atomic_uint*)&ssbo.u32, &_32, 2u, memory_order_relaxed, memory_order_relaxed) && _32 == 10u); + int _36 = atomic_fetch_add_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _38 = atomic_fetch_or_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _40 = atomic_fetch_xor_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _42 = atomic_fetch_and_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _44 = atomic_fetch_min_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _46 = atomic_fetch_max_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _48 = atomic_exchange_explicit((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) && _52 == 10); + } while (!atomic_compare_exchange_weak_explicit((device atomic_int*)&ssbo.i32, &_52, 2, memory_order_relaxed, memory_order_relaxed) && _52 == 10); 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 _57 = atomic_fetch_add_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _58 = atomic_fetch_or_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _59 = atomic_fetch_xor_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _60 = atomic_fetch_and_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _61 = atomic_fetch_min_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _62 = atomic_fetch_max_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _63 = atomic_exchange_explicit((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) && _64 == 10u); - 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); + } while (!atomic_compare_exchange_weak_explicit((threadgroup atomic_uint*)&shared_u32, &_64, 2u, memory_order_relaxed, memory_order_relaxed) && _64 == 10u); + int _65 = atomic_fetch_add_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _66 = atomic_fetch_or_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _67 = atomic_fetch_xor_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _68 = atomic_fetch_and_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _69 = atomic_fetch_min_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _70 = atomic_fetch_max_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _71 = atomic_exchange_explicit((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) && _72 == 10); + } while (!atomic_compare_exchange_weak_explicit((threadgroup atomic_int*)&shared_i32, &_72, 2, memory_order_relaxed, memory_order_relaxed) && _72 == 10); } diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/basic.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/basic.comp index 22ec74196..e37d4fc59 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/basic.comp +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/basic.comp @@ -26,7 +26,7 @@ kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _45 [[buff 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((device atomic_uint*)&_48.counter, 1u, memory_order_relaxed); _45.out_data[_52] = _29; } } diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/coherent-block.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/coherent-block.comp index bec9b218c..580b9e3e9 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/coherent-block.comp +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/coherent-block.comp @@ -8,7 +8,7 @@ struct SSBO float4 value; }; -kernel void main0(device SSBO& _10 [[buffer(0)]]) +kernel void main0(volatile device SSBO& _10 [[buffer(0)]]) { _10.value = float4(20.0); } diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/coherent-image.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/coherent-image.comp index 0fe044fb9..c6af46b5a 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/coherent-image.comp +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/coherent-image.comp @@ -8,7 +8,7 @@ struct SSBO int4 value; }; -kernel void main0(device SSBO& _10 [[buffer(0)]], texture2d uImage [[texture(0)]]) +kernel void main0(volatile device SSBO& _10 [[buffer(0)]], texture2d uImage [[texture(0)]]) { _10.value = uImage.read(uint2(int2(10))); } diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/culling.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/culling.comp index 95ffff839..55735475a 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/culling.comp +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/comp/culling.comp @@ -28,7 +28,7 @@ kernel void main0(const device SSBO& _22 [[buffer(0)]], device SSBO2& _38 [[buff 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((device atomic_uint*)&_41.count, 1u, memory_order_relaxed); _38.out_data[_45] = _28; } } diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/16bit-constants.frag b/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/16bit-constants.invalid.frag similarity index 100% rename from 3rdparty/spirv-cross/reference/opt/shaders-msl/frag/16bit-constants.frag rename to 3rdparty/spirv-cross/reference/opt/shaders-msl/frag/16bit-constants.invalid.frag diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/nonuniform-qualifier.msl2.frag b/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/nonuniform-qualifier.msl2.frag index 14a6999f3..c120959c3 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/nonuniform-qualifier.msl2.frag +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/nonuniform-qualifier.msl2.frag @@ -39,12 +39,15 @@ fragment main0_out main0(main0_in in [[stage_in]], constant UBO* ubos_0 [[buffer }; main0_out out = {}; - int _24 = in.vIndex + 10; - int _35 = in.vIndex + 40; - out.FragColor = uSamplers[_24].sample(uSamps[_35], in.vUV); - out.FragColor = uCombinedSamplers[_24].sample(uCombinedSamplersSmplr[_24], in.vUV); - out.FragColor += ubos[(in.vIndex + 20)]->v[_35]; - out.FragColor += ssbos[(in.vIndex + 50)]->v[in.vIndex + 60]; + int _25 = in.vIndex + 10; + int _37 = in.vIndex + 40; + out.FragColor = uSamplers[_25].sample(uSamps[_37], in.vUV); + out.FragColor = uCombinedSamplers[_25].sample(uCombinedSamplersSmplr[_25], in.vUV); + int _69 = in.vIndex + 20; + out.FragColor += ubos[(_69)]->v[_37]; + int _87 = in.vIndex + 50; + int _91 = in.vIndex + 60; + out.FragColor += ssbos[(_87)]->v[_91]; return out; } diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/post-depth-coverage.ios.msl2.frag b/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/post-depth-coverage.ios.msl2.frag new file mode 100644 index 000000000..3b2885e2e --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/frag/post-depth-coverage.ios.msl2.frag @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +[[ early_fragment_tests ]] fragment main0_out main0(uint gl_SampleMaskIn [[sample_mask, post_depth_coverage]]) +{ + main0_out out = {}; + out.FragColor = float4(float(gl_SampleMaskIn)); + return out; +} + diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/intel/shader-integer-functions2.asm.comp b/3rdparty/spirv-cross/reference/opt/shaders-msl/intel/shader-integer-functions2.asm.comp new file mode 100644 index 000000000..1e5d889d4 --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/intel/shader-integer-functions2.asm.comp @@ -0,0 +1,31 @@ +#include +#include + +using namespace metal; + +struct foo +{ + uint a; + uint b; + int c; + int d; +}; + +kernel void main0(device foo& _4 [[buffer(0)]]) +{ + _4.a = clz(_4.a); + _4.a = ctz(_4.a); + _4.a = absdiff(_4.c, _4.d); + _4.a = absdiff(_4.a, _4.b); + _4.c = addsat(_4.c, _4.d); + _4.a = addsat(_4.a, _4.b); + _4.c = hadd(_4.c, _4.d); + _4.a = hadd(_4.a, _4.b); + _4.c = rhadd(_4.c, _4.d); + _4.a = rhadd(_4.a, _4.b); + _4.c = subsat(_4.c, _4.d); + _4.a = subsat(_4.a, _4.b); + _4.c = int(short(_4.c)) * int(short(_4.d)); + _4.a = uint(ushort(_4.a)) * uint(ushort(_4.b)); +} + diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/functions.vert b/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/functions.vert index f71022526..9af0f3f35 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/functions.vert +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/functions.vert @@ -45,14 +45,14 @@ T degrees(T r) // Implementation of the GLSL findLSB() function template -T findLSB(T x) +T spvFindLSB(T x) { return select(ctz(x), T(-1), x == T(0)); } // Implementation of the signed GLSL findMSB() function template -T findSMSB(T x) +T spvFindSMSB(T x) { T v = select(x, T(-1) - x, x < T(0)); return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0)); @@ -112,8 +112,8 @@ vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]] out.vNormal = in.aNormal; out.vRotDeg = degrees(_18.rotRad); out.vRotRad = radians(_18.rotDeg); - out.vLSB = findLSB(_18.bits); - out.vMSB = findSMSB(_18.bits); + out.vLSB = spvFindLSB(_18.bits); + out.vMSB = spvFindSMSB(_18.bits); return out; } diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/no_stage_out.write_buff_atomic.vert b/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/no_stage_out.write_buff_atomic.vert index ca4d6a5b9..e2f38878f 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/no_stage_out.write_buff_atomic.vert +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/vert/no_stage_out.write_buff_atomic.vert @@ -21,7 +21,7 @@ struct main0_in float4 m_17 [[attribute(0)]]; }; -vertex void main0(main0_in in [[stage_in]], device _23& _25 [[buffer(0)]]) +vertex void main0(main0_in in [[stage_in]], volatile device _23& _25 [[buffer(0)]]) { main0_out out = {}; out.gl_Position = in.m_17; diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag b/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag new file mode 100644 index 000000000..429da4767 --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag @@ -0,0 +1,10 @@ +#include +#include + +using namespace metal; + +fragment void main0() +{ + bool _9 = simd_is_helper_thread(); +} + diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert b/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert new file mode 100644 index 000000000..e36576b86 --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert @@ -0,0 +1,19 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; +}; + +vertex main0_out main0() +{ + main0_out out = {}; + const int gl_DeviceIndex = 0; + const uint gl_ViewIndex = 0; + out.gl_Position = float4(float(gl_DeviceIndex), float(int(gl_ViewIndex)), 0.0, 1.0); + return out; +} + diff --git a/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert b/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert new file mode 100644 index 000000000..cc4bcc420 --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert @@ -0,0 +1,18 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; +}; + +vertex main0_out main0() +{ + main0_out out = {}; + const int gl_DeviceIndex = 0; + out.gl_Position = float4(float(gl_DeviceIndex)); + return out; +} + diff --git a/3rdparty/spirv-cross/reference/opt/shaders/frag/16bit-constants.frag b/3rdparty/spirv-cross/reference/opt/shaders/frag/16bit-constants.invalid.frag similarity index 100% rename from 3rdparty/spirv-cross/reference/opt/shaders/frag/16bit-constants.frag rename to 3rdparty/spirv-cross/reference/opt/shaders/frag/16bit-constants.invalid.frag diff --git a/3rdparty/spirv-cross/reference/opt/shaders/frag/post-depth-coverage.frag b/3rdparty/spirv-cross/reference/opt/shaders/frag/post-depth-coverage.frag new file mode 100644 index 000000000..3e78fcd0a --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders/frag/post-depth-coverage.frag @@ -0,0 +1,11 @@ +#version 450 +#extension GL_ARB_post_depth_coverage : require +layout(early_fragment_tests, post_depth_coverage) in; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = vec4(float(gl_SampleMaskIn[0])); +} + diff --git a/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag.vk b/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag.vk new file mode 100644 index 000000000..153164920 --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag.vk @@ -0,0 +1,15 @@ +#version 450 +#extension GL_EXT_demote_to_helper_invocation : require + +layout(location = 0) out vec4 FragColor; + +void main() +{ + bool _15 = helperInvocationEXT(); + demote; + if (!_15) + { + FragColor = vec4(1.0, 0.0, 0.0, 1.0); + } +} + diff --git a/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag.vk b/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag.vk new file mode 100644 index 000000000..302f83540 --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag.vk @@ -0,0 +1,10 @@ +#version 450 +#extension GL_EXT_demote_to_helper_invocation : require + +void main() +{ + demote; + bool _9 = helperInvocationEXT(); + bool helper = _9; +} + diff --git a/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/nonuniform-qualifier.vk.nocompat.frag.vk b/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/nonuniform-qualifier.vk.nocompat.frag.vk index 294f908d1..7662cd215 100644 --- a/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/nonuniform-qualifier.vk.nocompat.frag.vk +++ b/3rdparty/spirv-cross/reference/opt/shaders/vulkan/frag/nonuniform-qualifier.vk.nocompat.frag.vk @@ -21,11 +21,14 @@ layout(location = 1) in vec2 vUV; void main() { - int _22 = vIndex + 10; - int _32 = vIndex + 40; - FragColor = texture(sampler2D(uSamplers[nonuniformEXT(_22)], uSamps[nonuniformEXT(_32)]), vUV); - FragColor = texture(uCombinedSamplers[nonuniformEXT(_22)], vUV); - FragColor += ubos[nonuniformEXT(vIndex + 20)].v[_32]; - FragColor += ssbos[nonuniformEXT(vIndex + 50)].v[vIndex + 60]; + int _23 = vIndex + 10; + int _34 = vIndex + 40; + FragColor = texture(sampler2D(uSamplers[nonuniformEXT(_23)], uSamps[nonuniformEXT(_34)]), vUV); + FragColor = texture(uCombinedSamplers[nonuniformEXT(_23)], vUV); + int _66 = vIndex + 20; + FragColor += ubos[nonuniformEXT(_66)].v[_34]; + int _84 = vIndex + 50; + int _88 = vIndex + 60; + FragColor += ssbos[nonuniformEXT(_84)].v[_88]; } diff --git a/3rdparty/spirv-cross/reference/opt/shaders/vulkan/vert/device-group.nocompat.vk.vert.vk b/3rdparty/spirv-cross/reference/opt/shaders/vulkan/vert/device-group.nocompat.vk.vert.vk new file mode 100644 index 000000000..9cadcdb6d --- /dev/null +++ b/3rdparty/spirv-cross/reference/opt/shaders/vulkan/vert/device-group.nocompat.vk.vert.vk @@ -0,0 +1,8 @@ +#version 450 +#extension GL_EXT_device_group : require + +void main() +{ + gl_Position = vec4(float(gl_DeviceIndex)); +} + diff --git a/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/bitscan.asm.comp b/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/bitscan.asm.comp new file mode 100644 index 000000000..f8a5fb6fa --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/bitscan.asm.comp @@ -0,0 +1,25 @@ +RWByteAddressBuffer _4 : register(u0); + +void comp_main() +{ + uint4 _19 = _4.Load4(0); + int4 _20 = int4(_4.Load4(16)); + _4.Store4(0, firstbitlow(_19)); + _4.Store4(16, uint4(int4(firstbitlow(_19)))); + _4.Store4(0, uint4(firstbitlow(_20))); + _4.Store4(16, uint4(firstbitlow(_20))); + _4.Store4(0, firstbithigh(_19)); + _4.Store4(16, uint4(int4(firstbithigh(_19)))); + _4.Store4(0, firstbithigh(uint4(_20))); + _4.Store4(16, uint4(int4(firstbithigh(uint4(_20))))); + _4.Store4(0, uint4(firstbithigh(int4(_19)))); + _4.Store4(16, uint4(firstbithigh(int4(_19)))); + _4.Store4(0, uint4(firstbithigh(_20))); + _4.Store4(16, uint4(firstbithigh(_20))); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.fxconly.asm.comp b/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.fxconly.asm.comp new file mode 100644 index 000000000..b1232635e --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.fxconly.asm.comp @@ -0,0 +1,31 @@ +struct _8 +{ + float _m0; + float _m1; +}; + +struct _15 +{ + float _m0; + int _m1; +}; + +RWByteAddressBuffer _4 : register(u0); + +void comp_main() +{ + _8 _23; + _23._m0 = modf(20.0f, _23._m1); + _15 _24; + _24._m0 = frexp(40.0f, _24._m1); + _4.Store(0, asuint(_23._m0)); + _4.Store(0, asuint(_23._m1)); + _4.Store(0, asuint(_24._m0)); + _4.Store(4, uint(_24._m1)); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/comp/glsl.std450.fxconly.comp b/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/comp/glsl.std450.fxconly.comp new file mode 100644 index 000000000..d697ed4e7 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-hlsl-no-opt/comp/glsl.std450.fxconly.comp @@ -0,0 +1,295 @@ +struct ResType +{ + float _m0; + int _m1; +}; + +RWByteAddressBuffer _19 : register(u0); + +uint SPIRV_Cross_packHalf2x16(float2 value) +{ + uint2 Packed = f32tof16(value); + return Packed.x | (Packed.y << 16); +} + +float2 SPIRV_Cross_unpackHalf2x16(uint value) +{ + return f16tof32(uint2(value & 0xffff, value >> 16)); +} + +uint SPIRV_Cross_packUnorm4x8(float4 value) +{ + uint4 Packed = uint4(round(saturate(value) * 255.0)); + return Packed.x | (Packed.y << 8) | (Packed.z << 16) | (Packed.w << 24); +} + +float4 SPIRV_Cross_unpackUnorm4x8(uint value) +{ + uint4 Packed = uint4(value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, value >> 24); + return float4(Packed) / 255.0; +} + +uint SPIRV_Cross_packSnorm4x8(float4 value) +{ + int4 Packed = int4(round(clamp(value, -1.0, 1.0) * 127.0)) & 0xff; + return uint(Packed.x | (Packed.y << 8) | (Packed.z << 16) | (Packed.w << 24)); +} + +float4 SPIRV_Cross_unpackSnorm4x8(uint value) +{ + int SignedValue = int(value); + int4 Packed = int4(SignedValue << 24, SignedValue << 16, SignedValue << 8, SignedValue) >> 24; + return clamp(float4(Packed) / 127.0, -1.0, 1.0); +} + +uint SPIRV_Cross_packUnorm2x16(float2 value) +{ + uint2 Packed = uint2(round(saturate(value) * 65535.0)); + return Packed.x | (Packed.y << 16); +} + +float2 SPIRV_Cross_unpackUnorm2x16(uint value) +{ + uint2 Packed = uint2(value & 0xffff, value >> 16); + return float2(Packed) / 65535.0; +} + +uint SPIRV_Cross_packSnorm2x16(float2 value) +{ + int2 Packed = int2(round(clamp(value, -1.0, 1.0) * 32767.0)) & 0xffff; + return uint(Packed.x | (Packed.y << 16)); +} + +float2 SPIRV_Cross_unpackSnorm2x16(uint value) +{ + int SignedValue = int(value); + int2 Packed = int2(SignedValue << 16, SignedValue) >> 16; + return clamp(float2(Packed) / 32767.0, -1.0, 1.0); +} + +// Returns the inverse of a matrix, by using the algorithm of calculating the classical +// adjoint and dividing by the determinant. The contents of the matrix are changed. +float2x2 SPIRV_Cross_Inverse(float2x2 m) +{ + float2x2 adj; // The adjoint matrix (inverse after dividing by determinant) + + // Create the transpose of the cofactors, as the classical adjoint of the matrix. + adj[0][0] = m[1][1]; + adj[0][1] = -m[0][1]; + + adj[1][0] = -m[1][0]; + adj[1][1] = m[0][0]; + + // Calculate the determinant as a combination of the cofactors of the first row. + float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]); + + // Divide the classical adjoint matrix by the determinant. + // If determinant is zero, matrix is not invertable, so leave it unchanged. + return (det != 0.0f) ? (adj * (1.0f / det)) : m; +} + +// Returns the determinant of a 2x2 matrix. +float SPIRV_Cross_Det2x2(float a1, float a2, float b1, float b2) +{ + return a1 * b2 - b1 * a2; +} + +// Returns the inverse of a matrix, by using the algorithm of calculating the classical +// adjoint and dividing by the determinant. The contents of the matrix are changed. +float3x3 SPIRV_Cross_Inverse(float3x3 m) +{ + float3x3 adj; // The adjoint matrix (inverse after dividing by determinant) + + // Create the transpose of the cofactors, as the classical adjoint of the matrix. + adj[0][0] = SPIRV_Cross_Det2x2(m[1][1], m[1][2], m[2][1], m[2][2]); + adj[0][1] = -SPIRV_Cross_Det2x2(m[0][1], m[0][2], m[2][1], m[2][2]); + adj[0][2] = SPIRV_Cross_Det2x2(m[0][1], m[0][2], m[1][1], m[1][2]); + + adj[1][0] = -SPIRV_Cross_Det2x2(m[1][0], m[1][2], m[2][0], m[2][2]); + adj[1][1] = SPIRV_Cross_Det2x2(m[0][0], m[0][2], m[2][0], m[2][2]); + adj[1][2] = -SPIRV_Cross_Det2x2(m[0][0], m[0][2], m[1][0], m[1][2]); + + adj[2][0] = SPIRV_Cross_Det2x2(m[1][0], m[1][1], m[2][0], m[2][1]); + adj[2][1] = -SPIRV_Cross_Det2x2(m[0][0], m[0][1], m[2][0], m[2][1]); + adj[2][2] = SPIRV_Cross_Det2x2(m[0][0], m[0][1], m[1][0], m[1][1]); + + // Calculate the determinant as a combination of the cofactors of the first row. + float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]); + + // Divide the classical adjoint matrix by the determinant. + // If determinant is zero, matrix is not invertable, so leave it unchanged. + return (det != 0.0f) ? (adj * (1.0f / det)) : m; +} + +// Returns the determinant of a 3x3 matrix. +float SPIRV_Cross_Det3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3) +{ + return a1 * SPIRV_Cross_Det2x2(b2, b3, c2, c3) - b1 * SPIRV_Cross_Det2x2(a2, a3, c2, c3) + c1 * SPIRV_Cross_Det2x2(a2, a3, b2, b3); +} + +// Returns the inverse of a matrix, by using the algorithm of calculating the classical +// adjoint and dividing by the determinant. The contents of the matrix are changed. +float4x4 SPIRV_Cross_Inverse(float4x4 m) +{ + float4x4 adj; // The adjoint matrix (inverse after dividing by determinant) + + // Create the transpose of the cofactors, as the classical adjoint of the matrix. + adj[0][0] = SPIRV_Cross_Det3x3(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3]); + adj[0][1] = -SPIRV_Cross_Det3x3(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3]); + adj[0][2] = SPIRV_Cross_Det3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], m[3][3]); + adj[0][3] = -SPIRV_Cross_Det3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3]); + + adj[1][0] = -SPIRV_Cross_Det3x3(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3]); + adj[1][1] = SPIRV_Cross_Det3x3(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3]); + adj[1][2] = -SPIRV_Cross_Det3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], m[3][3]); + adj[1][3] = SPIRV_Cross_Det3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3]); + + adj[2][0] = SPIRV_Cross_Det3x3(m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3]); + adj[2][1] = -SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3]); + adj[2][2] = SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], m[3][3]); + adj[2][3] = -SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3]); + + adj[3][0] = -SPIRV_Cross_Det3x3(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2]); + adj[3][1] = SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2]); + adj[3][2] = -SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], m[3][2]); + adj[3][3] = SPIRV_Cross_Det3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2]); + + // Calculate the determinant as a combination of the cofactors of the first row. + float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]) + (adj[0][3] * m[3][0]); + + // Divide the classical adjoint matrix by the determinant. + // If determinant is zero, matrix is not invertable, so leave it unchanged. + return (det != 0.0f) ? (adj * (1.0f / det)) : m; +} + +float SPIRV_Cross_Reflect(float i, float n) +{ + return i - 2.0 * dot(n, i) * n; +} + +float SPIRV_Cross_Refract(float i, float n, float eta) +{ + float NoI = n * i; + float NoI2 = NoI * NoI; + float k = 1.0 - eta * eta * (1.0 - NoI2); + if (k < 0.0) + { + return 0.0; + } + else + { + return eta * i - (eta * NoI + sqrt(k)) * n; + } +} + +float SPIRV_Cross_FaceForward(float n, float i, float nref) +{ + return i * nref < 0.0 ? n : -n; +} + +void comp_main() +{ + _19.Store(0, asuint(round(asfloat(_19.Load(16))))); + _19.Store(0, asuint(trunc(asfloat(_19.Load(16))))); + _19.Store(0, asuint(abs(asfloat(_19.Load(16))))); + _19.Store(4, uint(abs(int(_19.Load(32))))); + _19.Store(0, asuint(sign(asfloat(_19.Load(16))))); + _19.Store(4, uint(sign(int(_19.Load(32))))); + _19.Store(0, asuint(floor(asfloat(_19.Load(16))))); + _19.Store(0, asuint(ceil(asfloat(_19.Load(16))))); + _19.Store(0, asuint(frac(asfloat(_19.Load(16))))); + _19.Store(0, asuint(radians(asfloat(_19.Load(16))))); + _19.Store(0, asuint(degrees(asfloat(_19.Load(16))))); + _19.Store(0, asuint(sin(asfloat(_19.Load(16))))); + _19.Store(0, asuint(cos(asfloat(_19.Load(16))))); + _19.Store(0, asuint(tan(asfloat(_19.Load(16))))); + _19.Store(0, asuint(asin(asfloat(_19.Load(16))))); + _19.Store(0, asuint(acos(asfloat(_19.Load(16))))); + _19.Store(0, asuint(atan(asfloat(_19.Load(16))))); + _19.Store(0, asuint(sinh(asfloat(_19.Load(16))))); + _19.Store(0, asuint(cosh(asfloat(_19.Load(16))))); + _19.Store(0, asuint(tanh(asfloat(_19.Load(16))))); + _19.Store(0, asuint(atan2(asfloat(_19.Load(16)), asfloat(_19.Load(20))))); + _19.Store(0, asuint(pow(asfloat(_19.Load(16)), asfloat(_19.Load(20))))); + _19.Store(0, asuint(exp(asfloat(_19.Load(16))))); + _19.Store(0, asuint(log(asfloat(_19.Load(16))))); + _19.Store(0, asuint(exp2(asfloat(_19.Load(16))))); + _19.Store(0, asuint(log2(asfloat(_19.Load(16))))); + _19.Store(0, asuint(sqrt(asfloat(_19.Load(16))))); + _19.Store(0, asuint(rsqrt(asfloat(_19.Load(16))))); + _19.Store(0, asuint(length(asfloat(_19.Load(16))))); + _19.Store(0, asuint(distance(asfloat(_19.Load(16)), asfloat(_19.Load(20))))); + _19.Store(0, asuint(sign(asfloat(_19.Load(16))))); + _19.Store(0, asuint(SPIRV_Cross_FaceForward(asfloat(_19.Load(16)), asfloat(_19.Load(20)), asfloat(_19.Load(24))))); + _19.Store(0, asuint(SPIRV_Cross_Reflect(asfloat(_19.Load(16)), asfloat(_19.Load(20))))); + _19.Store(0, asuint(SPIRV_Cross_Refract(asfloat(_19.Load(16)), asfloat(_19.Load(20)), asfloat(_19.Load(24))))); + _19.Store(0, asuint(length(asfloat(_19.Load4(16)).xy))); + _19.Store(0, asuint(distance(asfloat(_19.Load4(16)).xy, asfloat(_19.Load4(16)).zw))); + float2 v2 = normalize(asfloat(_19.Load4(16)).xy); + v2 = faceforward(asfloat(_19.Load4(16)).xy, asfloat(_19.Load4(16)).yz, asfloat(_19.Load4(16)).zw); + v2 = reflect(asfloat(_19.Load4(16)).xy, asfloat(_19.Load4(16)).zw); + v2 = refract(asfloat(_19.Load4(16)).xy, asfloat(_19.Load4(16)).yz, asfloat(_19.Load(28))); + float3 v3 = cross(asfloat(_19.Load4(16)).xyz, asfloat(_19.Load4(16)).yzw); + float2x2 _240 = asfloat(uint2x2(_19.Load2(64), _19.Load2(72))); + _19.Store(0, asuint(determinant(_240))); + float3x3 _246 = asfloat(uint3x3(_19.Load3(80), _19.Load3(96), _19.Load3(112))); + _19.Store(0, asuint(determinant(_246))); + float4x4 _252 = asfloat(uint4x4(_19.Load4(128), _19.Load4(144), _19.Load4(160), _19.Load4(176))); + _19.Store(0, asuint(determinant(_252))); + float2x2 _256 = asfloat(uint2x2(_19.Load2(64), _19.Load2(72))); + float2x2 _257 = SPIRV_Cross_Inverse(_256); + _19.Store2(64, asuint(_257[0])); + _19.Store2(72, asuint(_257[1])); + float3x3 _260 = asfloat(uint3x3(_19.Load3(80), _19.Load3(96), _19.Load3(112))); + float3x3 _261 = SPIRV_Cross_Inverse(_260); + _19.Store3(80, asuint(_261[0])); + _19.Store3(96, asuint(_261[1])); + _19.Store3(112, asuint(_261[2])); + float4x4 _264 = asfloat(uint4x4(_19.Load4(128), _19.Load4(144), _19.Load4(160), _19.Load4(176))); + float4x4 _265 = SPIRV_Cross_Inverse(_264); + _19.Store4(128, asuint(_265[0])); + _19.Store4(144, asuint(_265[1])); + _19.Store4(160, asuint(_265[2])); + _19.Store4(176, asuint(_265[3])); + float tmp; + float _271 = modf(asfloat(_19.Load(16)), tmp); + _19.Store(0, asuint(_271)); + _19.Store(0, asuint(min(asfloat(_19.Load(16)), asfloat(_19.Load(20))))); + _19.Store(8, min(_19.Load(48), _19.Load(52))); + _19.Store(4, uint(min(int(_19.Load(32)), int(_19.Load(36))))); + _19.Store(0, asuint(max(asfloat(_19.Load(16)), asfloat(_19.Load(20))))); + _19.Store(8, max(_19.Load(48), _19.Load(52))); + _19.Store(4, uint(max(int(_19.Load(32)), int(_19.Load(36))))); + _19.Store(0, asuint(clamp(asfloat(_19.Load(16)), asfloat(_19.Load(20)), asfloat(_19.Load(24))))); + _19.Store(8, clamp(_19.Load(48), _19.Load(52), _19.Load(56))); + _19.Store(4, uint(clamp(int(_19.Load(32)), int(_19.Load(36)), int(_19.Load(40))))); + _19.Store(0, asuint(lerp(asfloat(_19.Load(16)), asfloat(_19.Load(20)), asfloat(_19.Load(24))))); + _19.Store(0, asuint(step(asfloat(_19.Load(16)), asfloat(_19.Load(20))))); + _19.Store(0, asuint(smoothstep(asfloat(_19.Load(16)), asfloat(_19.Load(20)), asfloat(_19.Load(24))))); + _19.Store(0, asuint(mad(asfloat(_19.Load(16)), asfloat(_19.Load(20)), asfloat(_19.Load(24))))); + ResType _371; + _371._m0 = frexp(asfloat(_19.Load(16)), _371._m1); + int itmp = _371._m1; + _19.Store(0, asuint(_371._m0)); + _19.Store(0, asuint(ldexp(asfloat(_19.Load(16)), itmp))); + _19.Store(8, SPIRV_Cross_packSnorm4x8(asfloat(_19.Load4(16)))); + _19.Store(8, SPIRV_Cross_packUnorm4x8(asfloat(_19.Load4(16)))); + _19.Store(8, SPIRV_Cross_packSnorm2x16(asfloat(_19.Load4(16)).xy)); + _19.Store(8, SPIRV_Cross_packUnorm2x16(asfloat(_19.Load4(16)).xy)); + _19.Store(8, SPIRV_Cross_packHalf2x16(asfloat(_19.Load4(16)).xy)); + v2 = SPIRV_Cross_unpackSnorm2x16(_19.Load(48)); + v2 = SPIRV_Cross_unpackUnorm2x16(_19.Load(48)); + v2 = SPIRV_Cross_unpackHalf2x16(_19.Load(48)); + float4 v4 = SPIRV_Cross_unpackSnorm4x8(_19.Load(48)); + v4 = SPIRV_Cross_unpackUnorm4x8(_19.Load(48)); + _19.Store4(32, uint4(firstbitlow(int4(_19.Load4(32))))); + _19.Store4(32, uint4(int4(firstbitlow(_19.Load4(48))))); + _19.Store4(32, uint4(firstbithigh(int4(_19.Load4(32))))); + _19.Store4(32, uint4(int4(firstbithigh(_19.Load4(48))))); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/3rdparty/spirv-cross/reference/shaders-hlsl/frag/demote-to-helper.frag b/3rdparty/spirv-cross/reference/shaders-hlsl/frag/demote-to-helper.frag new file mode 100644 index 000000000..743a4228b --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-hlsl/frag/demote-to-helper.frag @@ -0,0 +1,9 @@ +void frag_main() +{ + discard; +} + +void main() +{ + frag_main(); +} diff --git a/3rdparty/spirv-cross/reference/shaders-hlsl/frag/nonuniform-qualifier.nonuniformresource.sm51.frag b/3rdparty/spirv-cross/reference/shaders-hlsl/frag/nonuniform-qualifier.nonuniformresource.sm51.frag index 8f5e022eb..a8594bf29 100644 --- a/3rdparty/spirv-cross/reference/shaders-hlsl/frag/nonuniform-qualifier.nonuniformresource.sm51.frag +++ b/3rdparty/spirv-cross/reference/shaders-hlsl/frag/nonuniform-qualifier.nonuniformresource.sm51.frag @@ -28,11 +28,17 @@ struct SPIRV_Cross_Output void frag_main() { int i = vIndex; - FragColor = uSamplers[NonUniformResourceIndex(i + 10)].Sample(uSamps[NonUniformResourceIndex(i + 40)], vUV); - int _47 = i + 10; - FragColor = uCombinedSamplers[NonUniformResourceIndex(_47)].Sample(_uCombinedSamplers_sampler[NonUniformResourceIndex(_47)], vUV); - FragColor += ubos[NonUniformResourceIndex(i + 20)].v[i + 40]; - FragColor += asfloat(ssbos[NonUniformResourceIndex(i + 50)].Load4((i + 60) * 16 + 0)); + int _23 = i + 10; + int _34 = i + 40; + FragColor = uSamplers[NonUniformResourceIndex(_23)].Sample(uSamps[NonUniformResourceIndex(_34)], vUV); + int _50 = i + 10; + FragColor = uCombinedSamplers[NonUniformResourceIndex(_50)].Sample(_uCombinedSamplers_sampler[NonUniformResourceIndex(_50)], vUV); + int _66 = i + 20; + int _70 = i + 40; + FragColor += ubos[NonUniformResourceIndex(_66)].v[_70]; + int _84 = i + 50; + int _88 = i + 60; + FragColor += asfloat(ssbos[NonUniformResourceIndex(_84)].Load4(_88 * 16 + 0)); } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) diff --git a/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/atomic-result-temporary.asm.comp b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/atomic-result-temporary.asm.comp index 8b6694288..4624ef0b7 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/atomic-result-temporary.asm.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/atomic-result-temporary.asm.comp @@ -14,7 +14,7 @@ struct SSBO kernel void main0(device SSBO& _5 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { - uint _24 = atomic_fetch_add_explicit((volatile device atomic_uint*)&_5.count, 1u, memory_order_relaxed); + uint _24 = atomic_fetch_add_explicit((device atomic_uint*)&_5.count, 1u, memory_order_relaxed); if (_24 < 1024u) { _5.data[_24] = gl_GlobalInvocationID.x; diff --git a/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/bitscan.asm.comp b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/bitscan.asm.comp new file mode 100644 index 000000000..1b9c4bd95 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/bitscan.asm.comp @@ -0,0 +1,53 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct SSBO +{ + uint4 u; + int4 i; +}; + +// Implementation of the GLSL findLSB() function +template +T spvFindLSB(T x) +{ + return select(ctz(x), T(-1), x == T(0)); +} + +// Implementation of the signed GLSL findMSB() function +template +T spvFindSMSB(T x) +{ + T v = select(x, T(-1) - x, x < T(0)); + return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0)); +} + +// Implementation of the unsigned GLSL findMSB() function +template +T spvFindUMSB(T x) +{ + return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0)); +} + +kernel void main0(device SSBO& _4 [[buffer(0)]]) +{ + uint4 _19 = _4.u; + int4 _20 = _4.i; + _4.u = spvFindLSB(_19); + _4.i = int4(spvFindLSB(_19)); + _4.u = uint4(spvFindLSB(_20)); + _4.i = spvFindLSB(_20); + _4.u = spvFindUMSB(_19); + _4.i = int4(spvFindUMSB(_19)); + _4.u = spvFindUMSB(uint4(_20)); + _4.i = int4(spvFindUMSB(uint4(_20))); + _4.u = uint4(spvFindSMSB(int4(_19))); + _4.i = spvFindSMSB(int4(_19)); + _4.u = uint4(spvFindSMSB(_20)); + _4.i = spvFindSMSB(_20); +} + diff --git a/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/glsl-signed-operations.asm.comp b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/glsl-signed-operations.asm.comp index e6682c513..0376bc4fb 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/glsl-signed-operations.asm.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/glsl-signed-operations.asm.comp @@ -13,7 +13,7 @@ struct SSBO // Implementation of the signed GLSL findMSB() function template -T findSMSB(T x) +T spvFindSMSB(T x) { T v = select(x, T(-1) - x, x < T(0)); return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0)); @@ -21,7 +21,7 @@ T findSMSB(T x) // Implementation of the unsigned GLSL findMSB() function template -T findUMSB(T x) +T spvFindUMSB(T x) { return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0)); } @@ -45,10 +45,10 @@ kernel void main0(device SSBO& _4 [[buffer(0)]]) _4.uints = uint4(sign(_19)); _4.ints = sign(int4(_20)); _4.uints = uint4(sign(int4(_20))); - _4.ints = findSMSB(int4(_20)); - _4.uints = uint4(findSMSB(int4(_20))); - _4.ints = int4(findUMSB(uint4(_19))); - _4.uints = findUMSB(uint4(_19)); + _4.ints = spvFindSMSB(int4(_20)); + _4.uints = uint4(spvFindSMSB(int4(_20))); + _4.ints = int4(spvFindUMSB(uint4(_19))); + _4.uints = spvFindUMSB(uint4(_19)); _4.ints = min(_19, _19); _4.uints = uint4(min(_19, int4(_20))); _4.ints = min(int4(_20), int4(_20)); diff --git a/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp new file mode 100644 index 000000000..0063facea --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp @@ -0,0 +1,35 @@ +#include +#include + +using namespace metal; + +struct _8 +{ + float _m0; + float _m1; +}; + +struct _15 +{ + float _m0; + int _m1; +}; + +struct _3 +{ + float _m0; + int _m1; +}; + +kernel void main0(device _3& _4 [[buffer(0)]]) +{ + _8 _23; + _23._m0 = modf(20.0, _23._m1); + _15 _24; + _24._m0 = frexp(40.0, _24._m1); + _4._m0 = _23._m0; + _4._m0 = _23._m1; + _4._m0 = _24._m0; + _4._m1 = _24._m1; +} + diff --git a/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/bitfield.comp b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/bitfield.comp index dbc27f02b..6da1225ee 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/bitfield.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/bitfield.comp @@ -7,14 +7,14 @@ using namespace metal; // Implementation of the GLSL findLSB() function template -T findLSB(T x) +T spvFindLSB(T x) { return select(ctz(x), T(-1), x == T(0)); } // Implementation of the signed GLSL findMSB() function template -T findSMSB(T x) +T spvFindSMSB(T x) { T v = select(x, T(-1) - x, x < T(0)); return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0)); @@ -22,7 +22,7 @@ T findSMSB(T x) // Implementation of the unsigned GLSL findMSB() function template -T findUMSB(T x) +T spvFindUMSB(T x) { return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0)); } @@ -39,9 +39,9 @@ kernel void main0() s = reverse_bits(s); int v0 = popcount(u); int v1 = popcount(s); - int v2 = int(findUMSB(u)); - int v3 = findSMSB(s); - int v4 = findLSB(u); - int v5 = findLSB(s); + int v2 = int(spvFindUMSB(u)); + int v3 = spvFindSMSB(s); + int v4 = int(spvFindLSB(u)); + int v5 = spvFindLSB(s); } diff --git a/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/glsl.std450.comp b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/glsl.std450.comp new file mode 100644 index 000000000..47dd35d02 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-msl-no-opt/comp/glsl.std450.comp @@ -0,0 +1,282 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct SSBO +{ + float res; + int ires; + uint ures; + float4 f32; + int4 s32; + uint4 u32; + float2x2 m2; + float3x3 m3; + float4x4 m4; +}; + +struct ResType +{ + float _m0; + int _m1; +}; + +// Implementation of the GLSL radians() function +template +T radians(T d) +{ + return d * T(0.01745329251); +} + +// Implementation of the GLSL degrees() function +template +T degrees(T r) +{ + return r * T(57.2957795131); +} + +// Implementation of the GLSL findLSB() function +template +T spvFindLSB(T x) +{ + return select(ctz(x), T(-1), x == T(0)); +} + +// Implementation of the signed GLSL findMSB() function +template +T spvFindSMSB(T x) +{ + T v = select(x, T(-1) - x, x < T(0)); + return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0)); +} + +// Implementation of the unsigned GLSL findMSB() function +template +T spvFindUMSB(T x) +{ + return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0)); +} + +// Implementation of the GLSL sign() function for integer types +template::value>::type> +T sign(T x) +{ + return select(select(select(x, T(0), x == T(0)), T(1), x > T(0)), T(-1), x < T(0)); +} + +// Returns the determinant of a 2x2 matrix. +inline float spvDet2x2(float a1, float a2, float b1, float b2) +{ + return a1 * b2 - b1 * a2; +} + +// Returns the determinant of a 3x3 matrix. +inline float spvDet3x3(float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3) +{ + return a1 * spvDet2x2(b2, b3, c2, c3) - b1 * spvDet2x2(a2, a3, c2, c3) + c1 * spvDet2x2(a2, a3, b2, b3); +} + +// Returns the inverse of a matrix, by using the algorithm of calculating the classical +// adjoint and dividing by the determinant. The contents of the matrix are changed. +float4x4 spvInverse4x4(float4x4 m) +{ + float4x4 adj; // The adjoint matrix (inverse after dividing by determinant) + + // Create the transpose of the cofactors, as the classical adjoint of the matrix. + adj[0][0] = spvDet3x3(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3]); + adj[0][1] = -spvDet3x3(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3]); + adj[0][2] = spvDet3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], m[3][3]); + adj[0][3] = -spvDet3x3(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3]); + + adj[1][0] = -spvDet3x3(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3]); + adj[1][1] = spvDet3x3(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3]); + adj[1][2] = -spvDet3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], m[3][3]); + adj[1][3] = spvDet3x3(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3]); + + adj[2][0] = spvDet3x3(m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3]); + adj[2][1] = -spvDet3x3(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3]); + adj[2][2] = spvDet3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], m[3][3]); + adj[2][3] = -spvDet3x3(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3]); + + adj[3][0] = -spvDet3x3(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2]); + adj[3][1] = spvDet3x3(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2]); + adj[3][2] = -spvDet3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], m[3][2]); + adj[3][3] = spvDet3x3(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2]); + + // Calculate the determinant as a combination of the cofactors of the first row. + float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]) + (adj[0][3] * m[3][0]); + + // Divide the classical adjoint matrix by the determinant. + // If determinant is zero, matrix is not invertable, so leave it unchanged. + return (det != 0.0f) ? (adj * (1.0f / det)) : m; +} + +// Returns the inverse of a matrix, by using the algorithm of calculating the classical +// adjoint and dividing by the determinant. The contents of the matrix are changed. +float3x3 spvInverse3x3(float3x3 m) +{ + float3x3 adj; // The adjoint matrix (inverse after dividing by determinant) + + // Create the transpose of the cofactors, as the classical adjoint of the matrix. + adj[0][0] = spvDet2x2(m[1][1], m[1][2], m[2][1], m[2][2]); + adj[0][1] = -spvDet2x2(m[0][1], m[0][2], m[2][1], m[2][2]); + adj[0][2] = spvDet2x2(m[0][1], m[0][2], m[1][1], m[1][2]); + + adj[1][0] = -spvDet2x2(m[1][0], m[1][2], m[2][0], m[2][2]); + adj[1][1] = spvDet2x2(m[0][0], m[0][2], m[2][0], m[2][2]); + adj[1][2] = -spvDet2x2(m[0][0], m[0][2], m[1][0], m[1][2]); + + adj[2][0] = spvDet2x2(m[1][0], m[1][1], m[2][0], m[2][1]); + adj[2][1] = -spvDet2x2(m[0][0], m[0][1], m[2][0], m[2][1]); + adj[2][2] = spvDet2x2(m[0][0], m[0][1], m[1][0], m[1][1]); + + // Calculate the determinant as a combination of the cofactors of the first row. + float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]) + (adj[0][2] * m[2][0]); + + // Divide the classical adjoint matrix by the determinant. + // If determinant is zero, matrix is not invertable, so leave it unchanged. + return (det != 0.0f) ? (adj * (1.0f / det)) : m; +} + +// Returns the inverse of a matrix, by using the algorithm of calculating the classical +// adjoint and dividing by the determinant. The contents of the matrix are changed. +float2x2 spvInverse2x2(float2x2 m) +{ + float2x2 adj; // The adjoint matrix (inverse after dividing by determinant) + + // Create the transpose of the cofactors, as the classical adjoint of the matrix. + adj[0][0] = m[1][1]; + adj[0][1] = -m[0][1]; + + adj[1][0] = -m[1][0]; + adj[1][1] = m[0][0]; + + // Calculate the determinant as a combination of the cofactors of the first row. + float det = (adj[0][0] * m[0][0]) + (adj[0][1] * m[1][0]); + + // Divide the classical adjoint matrix by the determinant. + // If determinant is zero, matrix is not invertable, so leave it unchanged. + return (det != 0.0f) ? (adj * (1.0f / det)) : m; +} + +template +inline T spvReflect(T i, T n) +{ + return i - T(2) * i * n * n; +} + +template +inline T spvRefract(T i, T n, T eta) +{ + T NoI = n * i; + T NoI2 = NoI * NoI; + T k = T(1) - eta * eta * (T(1) - NoI2); + if (k < T(0)) + { + return T(0); + } + else + { + return eta * i - (eta * NoI + sqrt(k)) * n; + } +} + +template +inline T spvFaceForward(T n, T i, T nref) +{ + return i * nref < T(0) ? n : -n; +} + +kernel void main0(device SSBO& _19 [[buffer(0)]]) +{ + _19.res = round(_19.f32.x); + _19.res = rint(_19.f32.x); + _19.res = trunc(_19.f32.x); + _19.res = abs(_19.f32.x); + _19.ires = abs(_19.s32.x); + _19.res = sign(_19.f32.x); + _19.ires = sign(_19.s32.x); + _19.res = floor(_19.f32.x); + _19.res = ceil(_19.f32.x); + _19.res = fract(_19.f32.x); + _19.res = radians(_19.f32.x); + _19.res = degrees(_19.f32.x); + _19.res = sin(_19.f32.x); + _19.res = cos(_19.f32.x); + _19.res = tan(_19.f32.x); + _19.res = asin(_19.f32.x); + _19.res = acos(_19.f32.x); + _19.res = atan(_19.f32.x); + _19.res = sinh(_19.f32.x); + _19.res = cosh(_19.f32.x); + _19.res = tanh(_19.f32.x); + _19.res = asinh(_19.f32.x); + _19.res = acosh(_19.f32.x); + _19.res = atanh(_19.f32.x); + _19.res = atan2(_19.f32.x, _19.f32.y); + _19.res = pow(_19.f32.x, _19.f32.y); + _19.res = exp(_19.f32.x); + _19.res = log(_19.f32.x); + _19.res = exp2(_19.f32.x); + _19.res = log2(_19.f32.x); + _19.res = sqrt(_19.f32.x); + _19.res = rsqrt(_19.f32.x); + _19.res = abs(_19.f32.x); + _19.res = abs(_19.f32.x - _19.f32.y); + _19.res = sign(_19.f32.x); + _19.res = spvFaceForward(_19.f32.x, _19.f32.y, _19.f32.z); + _19.res = spvReflect(_19.f32.x, _19.f32.y); + _19.res = spvRefract(_19.f32.x, _19.f32.y, _19.f32.z); + _19.res = length(_19.f32.xy); + _19.res = distance(_19.f32.xy, _19.f32.zw); + float2 v2 = normalize(_19.f32.xy); + v2 = faceforward(_19.f32.xy, _19.f32.yz, _19.f32.zw); + v2 = reflect(_19.f32.xy, _19.f32.zw); + v2 = refract(_19.f32.xy, _19.f32.yz, _19.f32.w); + float3 v3 = cross(_19.f32.xyz, _19.f32.yzw); + _19.res = determinant(_19.m2); + _19.res = determinant(_19.m3); + _19.res = determinant(_19.m4); + _19.m2 = spvInverse2x2(_19.m2); + _19.m3 = spvInverse3x3(_19.m3); + _19.m4 = spvInverse4x4(_19.m4); + float tmp; + float _287 = modf(_19.f32.x, tmp); + _19.res = _287; + _19.res = fast::min(_19.f32.x, _19.f32.y); + _19.ures = min(_19.u32.x, _19.u32.y); + _19.ires = min(_19.s32.x, _19.s32.y); + _19.res = fast::max(_19.f32.x, _19.f32.y); + _19.ures = max(_19.u32.x, _19.u32.y); + _19.ires = max(_19.s32.x, _19.s32.y); + _19.res = fast::clamp(_19.f32.x, _19.f32.y, _19.f32.z); + _19.ures = clamp(_19.u32.x, _19.u32.y, _19.u32.z); + _19.ires = clamp(_19.s32.x, _19.s32.y, _19.s32.z); + _19.res = mix(_19.f32.x, _19.f32.y, _19.f32.z); + _19.res = step(_19.f32.x, _19.f32.y); + _19.res = smoothstep(_19.f32.x, _19.f32.y, _19.f32.z); + _19.res = fma(_19.f32.x, _19.f32.y, _19.f32.z); + ResType _387; + _387._m0 = frexp(_19.f32.x, _387._m1); + int itmp = _387._m1; + _19.res = _387._m0; + _19.res = ldexp(_19.f32.x, itmp); + _19.ures = pack_float_to_snorm4x8(_19.f32); + _19.ures = pack_float_to_unorm4x8(_19.f32); + _19.ures = pack_float_to_snorm2x16(_19.f32.xy); + _19.ures = pack_float_to_unorm2x16(_19.f32.xy); + _19.ures = as_type(half2(_19.f32.xy)); + v2 = unpack_snorm2x16_to_float(_19.u32.x); + v2 = unpack_unorm2x16_to_float(_19.u32.x); + v2 = float2(as_type(_19.u32.x)); + float4 v4 = unpack_snorm4x8_to_float(_19.u32.x); + v4 = unpack_unorm4x8_to_float(_19.u32.x); + _19.s32 = spvFindLSB(_19.s32); + _19.s32 = int4(spvFindLSB(_19.u32)); + _19.s32 = spvFindSMSB(_19.s32); + _19.s32 = int4(spvFindUMSB(_19.u32)); +} + diff --git a/3rdparty/spirv-cross/reference/shaders-msl/amd/shader_trinary_minmax.msl21.comp b/3rdparty/spirv-cross/reference/shaders-msl/amd/shader_trinary_minmax.msl21.comp new file mode 100644 index 000000000..144047196 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-msl/amd/shader_trinary_minmax.msl21.comp @@ -0,0 +1,14 @@ +#include +#include + +using namespace metal; + +constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(64u, 1u, 1u); + +kernel void main0() +{ + int t11 = min3(0, 3, 2); + int t12 = max3(0, 3, 2); + int t13 = median3(0, 3, 2); +} + diff --git a/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-decrement.asm.comp b/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-decrement.asm.comp index 95841a78a..b06c0e9cd 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-decrement.asm.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-decrement.asm.comp @@ -20,7 +20,7 @@ uint2 spvTexelBufferCoord(uint tc) kernel void main0(device u0_counters& u0_counter [[buffer(0)]], texture2d u0 [[texture(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { - uint _29 = atomic_fetch_sub_explicit((volatile device atomic_uint*)&u0_counter.c, 1, memory_order_relaxed); + uint _29 = atomic_fetch_sub_explicit((device atomic_uint*)&u0_counter.c, 1, memory_order_relaxed); float4 r0; r0.x = as_type(_29); u0.write(uint4(uint(int(gl_GlobalInvocationID.x))), spvTexelBufferCoord(((uint(as_type(r0.x)) * 1u) + (uint(0) >> 2u)))); diff --git a/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-increment.asm.comp b/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-increment.asm.comp index cd78fa2c6..71af7bee3 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-increment.asm.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/atomic-increment.asm.comp @@ -20,7 +20,7 @@ uint2 spvTexelBufferCoord(uint tc) kernel void main0(device u0_counters& u0_counter [[buffer(0)]], texture2d u0 [[texture(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { - uint _29 = atomic_fetch_add_explicit((volatile device atomic_uint*)&u0_counter.c, 1, memory_order_relaxed); + uint _29 = atomic_fetch_add_explicit((device atomic_uint*)&u0_counter.c, 1, memory_order_relaxed); float4 r0; r0.x = as_type(_29); u0.write(uint4(uint(int(gl_GlobalInvocationID.x))), spvTexelBufferCoord(((uint(as_type(r0.x)) * 1u) + (uint(0) >> 2u)))); diff --git a/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/bitcast_iadd.asm.comp b/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/bitcast_iadd.asm.comp index 47ce85f8f..ad61d750d 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/bitcast_iadd.asm.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/bitcast_iadd.asm.comp @@ -15,7 +15,7 @@ struct _4 int4 _m1; }; -kernel void main0(device _3& _5 [[buffer(0)]], device _4& _6 [[buffer(1)]]) +kernel void main0(device _3& restrict _5 [[buffer(0)]], device _4& restrict _6 [[buffer(1)]]) { _6._m0 = _5._m1 + uint4(_5._m0); _6._m0 = uint4(_5._m0) + _5._m1; diff --git a/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/multiple-entry.asm.comp b/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/multiple-entry.asm.comp index 765273326..25ccf623e 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/multiple-entry.asm.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl/asm/comp/multiple-entry.asm.comp @@ -15,7 +15,7 @@ struct _7 int4 _m1; }; -kernel void main0(device _6& _8 [[buffer(0)]], device _7& _9 [[buffer(1)]]) +kernel void main0(device _6& restrict _8 [[buffer(0)]], device _7& restrict _9 [[buffer(1)]]) { _9._m0 = _8._m1 + uint4(_8._m0); _9._m0 = uint4(_8._m0) + _8._m1; diff --git a/3rdparty/spirv-cross/reference/shaders-msl/comp/atomic.comp b/3rdparty/spirv-cross/reference/shaders-msl/comp/atomic.comp index 43e6a8f03..047215022 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/comp/atomic.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl/comp/atomic.comp @@ -16,55 +16,55 @@ kernel void main0(device SSBO& ssbo [[buffer(0)]]) { 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 _16 = atomic_fetch_add_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _18 = atomic_fetch_or_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _20 = atomic_fetch_xor_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _22 = atomic_fetch_and_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _24 = atomic_fetch_min_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _26 = atomic_fetch_max_explicit((device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _28 = atomic_exchange_explicit((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) && _32 == 10u); - 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); + } while (!atomic_compare_exchange_weak_explicit((device atomic_uint*)&ssbo.u32, &_32, 2u, memory_order_relaxed, memory_order_relaxed) && _32 == 10u); + int _36 = atomic_fetch_add_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _38 = atomic_fetch_or_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _40 = atomic_fetch_xor_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _42 = atomic_fetch_and_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _44 = atomic_fetch_min_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _46 = atomic_fetch_max_explicit((device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _48 = atomic_exchange_explicit((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) && _52 == 10); + } while (!atomic_compare_exchange_weak_explicit((device atomic_int*)&ssbo.i32, &_52, 2, memory_order_relaxed, memory_order_relaxed) && _52 == 10); 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 _57 = atomic_fetch_add_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _58 = atomic_fetch_or_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _59 = atomic_fetch_xor_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _60 = atomic_fetch_and_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _61 = atomic_fetch_min_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _62 = atomic_fetch_max_explicit((threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _63 = atomic_exchange_explicit((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) && _64 == 10u); - 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); + } while (!atomic_compare_exchange_weak_explicit((threadgroup atomic_uint*)&shared_u32, &_64, 2u, memory_order_relaxed, memory_order_relaxed) && _64 == 10u); + int _65 = atomic_fetch_add_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _66 = atomic_fetch_or_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _67 = atomic_fetch_xor_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _68 = atomic_fetch_and_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _69 = atomic_fetch_min_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _70 = atomic_fetch_max_explicit((threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _71 = atomic_exchange_explicit((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) && _72 == 10); + } while (!atomic_compare_exchange_weak_explicit((threadgroup atomic_int*)&shared_i32, &_72, 2, memory_order_relaxed, memory_order_relaxed) && _72 == 10); } diff --git a/3rdparty/spirv-cross/reference/shaders-msl/comp/basic.comp b/3rdparty/spirv-cross/reference/shaders-msl/comp/basic.comp index 6410894ba..36b419b72 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/comp/basic.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl/comp/basic.comp @@ -27,7 +27,7 @@ kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _45 [[buff float4 idata = _23.in_data[ident]; if (dot(idata, 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((device atomic_uint*)&_48.counter, 1u, memory_order_relaxed); _45.out_data[_52] = idata; } } diff --git a/3rdparty/spirv-cross/reference/shaders-msl/comp/coherent-block.comp b/3rdparty/spirv-cross/reference/shaders-msl/comp/coherent-block.comp index bec9b218c..580b9e3e9 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/comp/coherent-block.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl/comp/coherent-block.comp @@ -8,7 +8,7 @@ struct SSBO float4 value; }; -kernel void main0(device SSBO& _10 [[buffer(0)]]) +kernel void main0(volatile device SSBO& _10 [[buffer(0)]]) { _10.value = float4(20.0); } diff --git a/3rdparty/spirv-cross/reference/shaders-msl/comp/coherent-image.comp b/3rdparty/spirv-cross/reference/shaders-msl/comp/coherent-image.comp index 0fe044fb9..c6af46b5a 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/comp/coherent-image.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl/comp/coherent-image.comp @@ -8,7 +8,7 @@ struct SSBO int4 value; }; -kernel void main0(device SSBO& _10 [[buffer(0)]], texture2d uImage [[texture(0)]]) +kernel void main0(volatile device SSBO& _10 [[buffer(0)]], texture2d uImage [[texture(0)]]) { _10.value = uImage.read(uint2(int2(10))); } diff --git a/3rdparty/spirv-cross/reference/shaders-msl/comp/culling.comp b/3rdparty/spirv-cross/reference/shaders-msl/comp/culling.comp index 32acf599e..13578363b 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/comp/culling.comp +++ b/3rdparty/spirv-cross/reference/shaders-msl/comp/culling.comp @@ -29,7 +29,7 @@ kernel void main0(const device SSBO& _22 [[buffer(0)]], device SSBO2& _38 [[buff float idata = _22.in_data[ident]; if (idata > 12.0) { - uint _45 = atomic_fetch_add_explicit((volatile device atomic_uint*)&_41.count, 1u, memory_order_relaxed); + uint _45 = atomic_fetch_add_explicit((device atomic_uint*)&_41.count, 1u, memory_order_relaxed); _38.out_data[_45] = idata; } } diff --git a/3rdparty/spirv-cross/reference/shaders-msl/frag/16bit-constants.frag b/3rdparty/spirv-cross/reference/shaders-msl/frag/16bit-constants.invalid.frag similarity index 100% rename from 3rdparty/spirv-cross/reference/shaders-msl/frag/16bit-constants.frag rename to 3rdparty/spirv-cross/reference/shaders-msl/frag/16bit-constants.invalid.frag diff --git a/3rdparty/spirv-cross/reference/shaders-msl/frag/fp16.desktop.invalid.frag b/3rdparty/spirv-cross/reference/shaders-msl/frag/fp16.desktop.invalid.frag index 001944fcb..55be16a0b 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/frag/fp16.desktop.invalid.frag +++ b/3rdparty/spirv-cross/reference/shaders-msl/frag/fp16.desktop.invalid.frag @@ -119,8 +119,7 @@ void test_builtins(thread half4& v4, thread half3& v3, thread half& v1) res = max(v4, v4); res = clamp(v4, v4, v4); res = mix(v4, v4, v4); - bool4 _243 = v4 < v4; - res = half4(_243.x ? v4.x : v4.x, _243.y ? v4.y : v4.y, _243.z ? v4.z : v4.z, _243.w ? v4.w : v4.w); + res = select(v4, v4, v4 < v4); res = step(v4, v4); res = smoothstep(v4, v4, v4); bool4 btmp = isnan(v4); diff --git a/3rdparty/spirv-cross/reference/shaders-msl/frag/mix.frag b/3rdparty/spirv-cross/reference/shaders-msl/frag/mix.frag index ad7c5adee..ee28bf926 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/frag/mix.frag +++ b/3rdparty/spirv-cross/reference/shaders-msl/frag/mix.frag @@ -20,11 +20,10 @@ fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; bool4 l = bool4(false, true, false, false); - out.FragColor = float4(l.x ? in.vIn1.x : in.vIn0.x, l.y ? in.vIn1.y : in.vIn0.y, l.z ? in.vIn1.z : in.vIn0.z, l.w ? in.vIn1.w : in.vIn0.w); + out.FragColor = select(in.vIn0, in.vIn1, l); bool f = true; out.FragColor = float4(f ? in.vIn3 : in.vIn2); - bool4 _37 = bool4(f); - out.FragColor = float4(_37.x ? in.vIn0.x : in.vIn1.x, _37.y ? in.vIn0.y : in.vIn1.y, _37.z ? in.vIn0.z : in.vIn1.z, _37.w ? in.vIn0.w : in.vIn1.w); + out.FragColor = select(in.vIn1, in.vIn0, bool4(f)); out.FragColor = float4(f ? in.vIn2 : in.vIn3); return out; } diff --git a/3rdparty/spirv-cross/reference/shaders-msl/frag/nonuniform-qualifier.msl2.frag b/3rdparty/spirv-cross/reference/shaders-msl/frag/nonuniform-qualifier.msl2.frag index 34f2bde10..e896c2d06 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/frag/nonuniform-qualifier.msl2.frag +++ b/3rdparty/spirv-cross/reference/shaders-msl/frag/nonuniform-qualifier.msl2.frag @@ -40,12 +40,17 @@ fragment main0_out main0(main0_in in [[stage_in]], constant UBO* ubos_0 [[buffer main0_out out = {}; int i = in.vIndex; - int _24 = i + 10; - out.FragColor = uSamplers[_24].sample(uSamps[i + 40], in.vUV); - int _50 = i + 10; - out.FragColor = uCombinedSamplers[_50].sample(uCombinedSamplersSmplr[_50], in.vUV); - out.FragColor += ubos[(i + 20)]->v[i + 40]; - out.FragColor += ssbos[(i + 50)]->v[i + 60]; + int _25 = i + 10; + int _37 = i + 40; + out.FragColor = uSamplers[_25].sample(uSamps[_37], in.vUV); + int _53 = i + 10; + out.FragColor = uCombinedSamplers[_53].sample(uCombinedSamplersSmplr[_53], in.vUV); + int _69 = i + 20; + int _73 = i + 40; + out.FragColor += ubos[(_69)]->v[_73]; + int _87 = i + 50; + int _91 = i + 60; + out.FragColor += ssbos[(_87)]->v[_91]; return out; } diff --git a/3rdparty/spirv-cross/reference/shaders-msl/frag/post-depth-coverage.ios.msl2.frag b/3rdparty/spirv-cross/reference/shaders-msl/frag/post-depth-coverage.ios.msl2.frag new file mode 100644 index 000000000..3b2885e2e --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-msl/frag/post-depth-coverage.ios.msl2.frag @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +[[ early_fragment_tests ]] fragment main0_out main0(uint gl_SampleMaskIn [[sample_mask, post_depth_coverage]]) +{ + main0_out out = {}; + out.FragColor = float4(float(gl_SampleMaskIn)); + return out; +} + diff --git a/3rdparty/spirv-cross/reference/shaders-msl/intel/shader-integer-functions2.asm.comp b/3rdparty/spirv-cross/reference/shaders-msl/intel/shader-integer-functions2.asm.comp new file mode 100644 index 000000000..1e5d889d4 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-msl/intel/shader-integer-functions2.asm.comp @@ -0,0 +1,31 @@ +#include +#include + +using namespace metal; + +struct foo +{ + uint a; + uint b; + int c; + int d; +}; + +kernel void main0(device foo& _4 [[buffer(0)]]) +{ + _4.a = clz(_4.a); + _4.a = ctz(_4.a); + _4.a = absdiff(_4.c, _4.d); + _4.a = absdiff(_4.a, _4.b); + _4.c = addsat(_4.c, _4.d); + _4.a = addsat(_4.a, _4.b); + _4.c = hadd(_4.c, _4.d); + _4.a = hadd(_4.a, _4.b); + _4.c = rhadd(_4.c, _4.d); + _4.a = rhadd(_4.a, _4.b); + _4.c = subsat(_4.c, _4.d); + _4.a = subsat(_4.a, _4.b); + _4.c = int(short(_4.c)) * int(short(_4.d)); + _4.a = uint(ushort(_4.a)) * uint(ushort(_4.b)); +} + diff --git a/3rdparty/spirv-cross/reference/shaders-msl/vert/functions.vert b/3rdparty/spirv-cross/reference/shaders-msl/vert/functions.vert index f71022526..9af0f3f35 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/vert/functions.vert +++ b/3rdparty/spirv-cross/reference/shaders-msl/vert/functions.vert @@ -45,14 +45,14 @@ T degrees(T r) // Implementation of the GLSL findLSB() function template -T findLSB(T x) +T spvFindLSB(T x) { return select(ctz(x), T(-1), x == T(0)); } // Implementation of the signed GLSL findMSB() function template -T findSMSB(T x) +T spvFindSMSB(T x) { T v = select(x, T(-1) - x, x < T(0)); return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0)); @@ -112,8 +112,8 @@ vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]] out.vNormal = in.aNormal; out.vRotDeg = degrees(_18.rotRad); out.vRotRad = radians(_18.rotDeg); - out.vLSB = findLSB(_18.bits); - out.vMSB = findSMSB(_18.bits); + out.vLSB = spvFindLSB(_18.bits); + out.vMSB = spvFindSMSB(_18.bits); return out; } diff --git a/3rdparty/spirv-cross/reference/shaders-msl/vert/no_stage_out.write_buff_atomic.vert b/3rdparty/spirv-cross/reference/shaders-msl/vert/no_stage_out.write_buff_atomic.vert index 9fe99e29f..cb4a21958 100644 --- a/3rdparty/spirv-cross/reference/shaders-msl/vert/no_stage_out.write_buff_atomic.vert +++ b/3rdparty/spirv-cross/reference/shaders-msl/vert/no_stage_out.write_buff_atomic.vert @@ -21,7 +21,7 @@ struct main0_in float4 m_17 [[attribute(0)]]; }; -vertex void main0(main0_in in [[stage_in]], device _23& _25 [[buffer(0)]]) +vertex void main0(main0_in in [[stage_in]], volatile device _23& _25 [[buffer(0)]]) { main0_out out = {}; out.gl_Position = in.m_17; diff --git a/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag b/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag new file mode 100644 index 000000000..0e0348bf8 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag @@ -0,0 +1,11 @@ +#include +#include + +using namespace metal; + +fragment void main0() +{ + bool _9 = simd_is_helper_thread(); + bool helper = _9; +} + diff --git a/3rdparty/spirv-cross/reference/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert b/3rdparty/spirv-cross/reference/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert new file mode 100644 index 000000000..e36576b86 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert @@ -0,0 +1,19 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; +}; + +vertex main0_out main0() +{ + main0_out out = {}; + const int gl_DeviceIndex = 0; + const uint gl_ViewIndex = 0; + out.gl_Position = float4(float(gl_DeviceIndex), float(int(gl_ViewIndex)), 0.0, 1.0); + return out; +} + diff --git a/3rdparty/spirv-cross/reference/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert b/3rdparty/spirv-cross/reference/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert new file mode 100644 index 000000000..cc4bcc420 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert @@ -0,0 +1,18 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; +}; + +vertex main0_out main0() +{ + main0_out out = {}; + const int gl_DeviceIndex = 0; + out.gl_Position = float4(float(gl_DeviceIndex)); + return out; +} + diff --git a/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/bitscan.asm.comp b/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/bitscan.asm.comp new file mode 100644 index 000000000..31a6234ab --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/bitscan.asm.comp @@ -0,0 +1,27 @@ +#version 450 +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(binding = 0, std430) buffer SSBO +{ + uvec4 u; + ivec4 i; +} _4; + +void main() +{ + uvec4 _19 = _4.u; + ivec4 _20 = _4.i; + _4.u = uvec4(findLSB(_19)); + _4.i = findLSB(_19); + _4.u = uvec4(findLSB(_20)); + _4.i = findLSB(_20); + _4.u = uvec4(findMSB(_19)); + _4.i = findMSB(_19); + _4.u = uvec4(findMSB(uvec4(_20))); + _4.i = findMSB(uvec4(_20)); + _4.u = uvec4(findMSB(ivec4(_19))); + _4.i = findMSB(ivec4(_19)); + _4.u = uvec4(findMSB(_20)); + _4.i = findMSB(_20); +} + diff --git a/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp b/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp new file mode 100644 index 000000000..dc0956c34 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp @@ -0,0 +1,33 @@ +#version 450 +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +struct _8 +{ + float _m0; + float _m1; +}; + +struct _15 +{ + float _m0; + int _m1; +}; + +layout(binding = 0, std430) buffer _3_4 +{ + float _m0; + int _m1; +} _4; + +void main() +{ + _8 _23; + _23._m0 = modf(20.0, _23._m1); + _15 _24; + _24._m0 = frexp(40.0, _24._m1); + _4._m0 = _23._m0; + _4._m0 = _23._m1; + _4._m0 = _24._m0; + _4._m1 = _24._m1; +} + diff --git a/3rdparty/spirv-cross/reference/shaders-no-opt/comp/glsl.std450.comp b/3rdparty/spirv-cross/reference/shaders-no-opt/comp/glsl.std450.comp new file mode 100644 index 000000000..d2628a9ab --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders-no-opt/comp/glsl.std450.comp @@ -0,0 +1,112 @@ +#version 450 +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +struct ResType +{ + float _m0; + int _m1; +}; + +layout(binding = 0, std430) buffer SSBO +{ + float res; + int ires; + uint ures; + vec4 f32; + ivec4 s32; + uvec4 u32; + mat2 m2; + mat3 m3; + mat4 m4; +} _19; + +void main() +{ + _19.res = round(_19.f32.x); + _19.res = roundEven(_19.f32.x); + _19.res = trunc(_19.f32.x); + _19.res = abs(_19.f32.x); + _19.ires = abs(_19.s32.x); + _19.res = sign(_19.f32.x); + _19.ires = sign(_19.s32.x); + _19.res = floor(_19.f32.x); + _19.res = ceil(_19.f32.x); + _19.res = fract(_19.f32.x); + _19.res = radians(_19.f32.x); + _19.res = degrees(_19.f32.x); + _19.res = sin(_19.f32.x); + _19.res = cos(_19.f32.x); + _19.res = tan(_19.f32.x); + _19.res = asin(_19.f32.x); + _19.res = acos(_19.f32.x); + _19.res = atan(_19.f32.x); + _19.res = sinh(_19.f32.x); + _19.res = cosh(_19.f32.x); + _19.res = tanh(_19.f32.x); + _19.res = asinh(_19.f32.x); + _19.res = acosh(_19.f32.x); + _19.res = atanh(_19.f32.x); + _19.res = atan(_19.f32.x, _19.f32.y); + _19.res = pow(_19.f32.x, _19.f32.y); + _19.res = exp(_19.f32.x); + _19.res = log(_19.f32.x); + _19.res = exp2(_19.f32.x); + _19.res = log2(_19.f32.x); + _19.res = sqrt(_19.f32.x); + _19.res = inversesqrt(_19.f32.x); + _19.res = length(_19.f32.x); + _19.res = distance(_19.f32.x, _19.f32.y); + _19.res = normalize(_19.f32.x); + _19.res = faceforward(_19.f32.x, _19.f32.y, _19.f32.z); + _19.res = reflect(_19.f32.x, _19.f32.y); + _19.res = refract(_19.f32.x, _19.f32.y, _19.f32.z); + _19.res = length(_19.f32.xy); + _19.res = distance(_19.f32.xy, _19.f32.zw); + vec2 v2 = normalize(_19.f32.xy); + v2 = faceforward(_19.f32.xy, _19.f32.yz, _19.f32.zw); + v2 = reflect(_19.f32.xy, _19.f32.zw); + v2 = refract(_19.f32.xy, _19.f32.yz, _19.f32.w); + vec3 v3 = cross(_19.f32.xyz, _19.f32.yzw); + _19.res = determinant(_19.m2); + _19.res = determinant(_19.m3); + _19.res = determinant(_19.m4); + _19.m2 = inverse(_19.m2); + _19.m3 = inverse(_19.m3); + _19.m4 = inverse(_19.m4); + float tmp; + float _287 = modf(_19.f32.x, tmp); + _19.res = _287; + _19.res = min(_19.f32.x, _19.f32.y); + _19.ures = min(_19.u32.x, _19.u32.y); + _19.ires = min(_19.s32.x, _19.s32.y); + _19.res = max(_19.f32.x, _19.f32.y); + _19.ures = max(_19.u32.x, _19.u32.y); + _19.ires = max(_19.s32.x, _19.s32.y); + _19.res = clamp(_19.f32.x, _19.f32.y, _19.f32.z); + _19.ures = clamp(_19.u32.x, _19.u32.y, _19.u32.z); + _19.ires = clamp(_19.s32.x, _19.s32.y, _19.s32.z); + _19.res = mix(_19.f32.x, _19.f32.y, _19.f32.z); + _19.res = step(_19.f32.x, _19.f32.y); + _19.res = smoothstep(_19.f32.x, _19.f32.y, _19.f32.z); + _19.res = fma(_19.f32.x, _19.f32.y, _19.f32.z); + ResType _387; + _387._m0 = frexp(_19.f32.x, _387._m1); + int itmp = _387._m1; + _19.res = _387._m0; + _19.res = ldexp(_19.f32.x, itmp); + _19.ures = packSnorm4x8(_19.f32); + _19.ures = packUnorm4x8(_19.f32); + _19.ures = packSnorm2x16(_19.f32.xy); + _19.ures = packUnorm2x16(_19.f32.xy); + _19.ures = packHalf2x16(_19.f32.xy); + v2 = unpackSnorm2x16(_19.u32.x); + v2 = unpackUnorm2x16(_19.u32.x); + v2 = unpackHalf2x16(_19.u32.x); + vec4 v4 = unpackSnorm4x8(_19.u32.x); + v4 = unpackUnorm4x8(_19.u32.x); + _19.s32 = findLSB(_19.s32); + _19.s32 = findLSB(_19.u32); + _19.s32 = findMSB(_19.s32); + _19.s32 = findMSB(_19.u32); +} + diff --git a/3rdparty/spirv-cross/reference/shaders/frag/16bit-constants.frag b/3rdparty/spirv-cross/reference/shaders/frag/16bit-constants.invalid.frag similarity index 100% rename from 3rdparty/spirv-cross/reference/shaders/frag/16bit-constants.frag rename to 3rdparty/spirv-cross/reference/shaders/frag/16bit-constants.invalid.frag diff --git a/3rdparty/spirv-cross/reference/shaders/frag/post-depth-coverage.frag b/3rdparty/spirv-cross/reference/shaders/frag/post-depth-coverage.frag new file mode 100644 index 000000000..3e78fcd0a --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders/frag/post-depth-coverage.frag @@ -0,0 +1,11 @@ +#version 450 +#extension GL_ARB_post_depth_coverage : require +layout(early_fragment_tests, post_depth_coverage) in; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = vec4(float(gl_SampleMaskIn[0])); +} + diff --git a/3rdparty/spirv-cross/reference/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag.vk b/3rdparty/spirv-cross/reference/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag.vk new file mode 100644 index 000000000..153164920 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag.vk @@ -0,0 +1,15 @@ +#version 450 +#extension GL_EXT_demote_to_helper_invocation : require + +layout(location = 0) out vec4 FragColor; + +void main() +{ + bool _15 = helperInvocationEXT(); + demote; + if (!_15) + { + FragColor = vec4(1.0, 0.0, 0.0, 1.0); + } +} + diff --git a/3rdparty/spirv-cross/reference/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag.vk b/3rdparty/spirv-cross/reference/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag.vk new file mode 100644 index 000000000..302f83540 --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag.vk @@ -0,0 +1,10 @@ +#version 450 +#extension GL_EXT_demote_to_helper_invocation : require + +void main() +{ + demote; + bool _9 = helperInvocationEXT(); + bool helper = _9; +} + diff --git a/3rdparty/spirv-cross/reference/shaders/vulkan/frag/nonuniform-qualifier.vk.nocompat.frag.vk b/3rdparty/spirv-cross/reference/shaders/vulkan/frag/nonuniform-qualifier.vk.nocompat.frag.vk index 6e98ca0bf..703c5fd8f 100644 --- a/3rdparty/spirv-cross/reference/shaders/vulkan/frag/nonuniform-qualifier.vk.nocompat.frag.vk +++ b/3rdparty/spirv-cross/reference/shaders/vulkan/frag/nonuniform-qualifier.vk.nocompat.frag.vk @@ -22,9 +22,16 @@ layout(location = 1) in vec2 vUV; void main() { int i = vIndex; - FragColor = texture(sampler2D(uSamplers[nonuniformEXT(i + 10)], uSamps[nonuniformEXT(i + 40)]), vUV); - FragColor = texture(uCombinedSamplers[nonuniformEXT(i + 10)], vUV); - FragColor += ubos[nonuniformEXT(i + 20)].v[i + 40]; - FragColor += ssbos[nonuniformEXT(i + 50)].v[i + 60]; + int _23 = i + 10; + int _34 = i + 40; + FragColor = texture(sampler2D(uSamplers[nonuniformEXT(_23)], uSamps[nonuniformEXT(_34)]), vUV); + int _50 = i + 10; + FragColor = texture(uCombinedSamplers[nonuniformEXT(_50)], vUV); + int _66 = i + 20; + int _70 = i + 40; + FragColor += ubos[nonuniformEXT(_66)].v[_70]; + int _84 = i + 50; + int _88 = i + 60; + FragColor += ssbos[nonuniformEXT(_84)].v[_88]; } diff --git a/3rdparty/spirv-cross/reference/shaders/vulkan/vert/device-group.nocompat.vk.vert.vk b/3rdparty/spirv-cross/reference/shaders/vulkan/vert/device-group.nocompat.vk.vert.vk new file mode 100644 index 000000000..9cadcdb6d --- /dev/null +++ b/3rdparty/spirv-cross/reference/shaders/vulkan/vert/device-group.nocompat.vk.vert.vk @@ -0,0 +1,8 @@ +#version 450 +#extension GL_EXT_device_group : require + +void main() +{ + gl_Position = vec4(float(gl_DeviceIndex)); +} + diff --git a/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/bitscan.asm.comp b/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/bitscan.asm.comp new file mode 100644 index 000000000..e3b785cd5 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/bitscan.asm.comp @@ -0,0 +1,72 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 7 +; Bound: 35 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource GLSL 450 + OpName %main "main" + OpName %SSBO "SSBO" + OpMemberName %SSBO 0 "u" + OpMemberName %SSBO 1 "i" + OpMemberDecorate %SSBO 0 Offset 0 + OpMemberDecorate %SSBO 1 Offset 16 + OpDecorate %SSBO BufferBlock + OpDecorate %_ DescriptorSet 0 + OpDecorate %_ Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %ivec4 = OpTypeVector %int 4 + %uint = OpTypeInt 32 0 + %uvec4 = OpTypeVector %uint 4 + %SSBO = OpTypeStruct %uvec4 %ivec4 +%_ptr_Uniform_SSBO = OpTypePointer Uniform %SSBO + %_ = OpVariable %_ptr_Uniform_SSBO Uniform + %int_0 = OpConstant %int 0 +%_ptr_Uniform_uvec4 = OpTypePointer Uniform %uvec4 + %int_1 = OpConstant %int 1 +%_ptr_Uniform_ivec4 = OpTypePointer Uniform %ivec4 + %main = OpFunction %void None %3 + %5 = OpLabel + %uptr = OpAccessChain %_ptr_Uniform_uvec4 %_ %int_0 + %iptr = OpAccessChain %_ptr_Uniform_ivec4 %_ %int_1 + %uvalue = OpLoad %uvec4 %uptr + %ivalue = OpLoad %ivec4 %iptr + + %lsb_uint_to_uint = OpExtInst %uvec4 %1 FindILsb %uvalue + %lsb_uint_to_int = OpExtInst %ivec4 %1 FindILsb %uvalue + %lsb_int_to_uint = OpExtInst %uvec4 %1 FindILsb %ivalue + %lsb_int_to_int = OpExtInst %ivec4 %1 FindILsb %ivalue + + %umsb_uint_to_uint = OpExtInst %uvec4 %1 FindUMsb %uvalue + %umsb_uint_to_int = OpExtInst %ivec4 %1 FindUMsb %uvalue + %umsb_int_to_uint = OpExtInst %uvec4 %1 FindUMsb %ivalue + %umsb_int_to_int = OpExtInst %ivec4 %1 FindUMsb %ivalue + + %smsb_uint_to_uint = OpExtInst %uvec4 %1 FindSMsb %uvalue + %smsb_uint_to_int = OpExtInst %ivec4 %1 FindSMsb %uvalue + %smsb_int_to_uint = OpExtInst %uvec4 %1 FindSMsb %ivalue + %smsb_int_to_int = OpExtInst %ivec4 %1 FindSMsb %ivalue + + OpStore %uptr %lsb_uint_to_uint + OpStore %iptr %lsb_uint_to_int + OpStore %uptr %lsb_int_to_uint + OpStore %iptr %lsb_int_to_int + + OpStore %uptr %umsb_uint_to_uint + OpStore %iptr %umsb_uint_to_int + OpStore %uptr %umsb_int_to_uint + OpStore %iptr %umsb_int_to_int + + OpStore %uptr %smsb_uint_to_uint + OpStore %iptr %smsb_uint_to_int + OpStore %uptr %smsb_int_to_uint + OpStore %iptr %smsb_int_to_int + + OpReturn + OpFunctionEnd diff --git a/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.fxconly.asm.comp b/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.fxconly.asm.comp new file mode 100644 index 000000000..30db11d45 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-hlsl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.fxconly.asm.comp @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 7 +; Bound: 45 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource GLSL 450 + OpMemberDecorate %SSBO 0 Offset 0 + OpMemberDecorate %SSBO 1 Offset 4 + OpDecorate %SSBO BufferBlock + OpDecorate %_ DescriptorSet 0 + OpDecorate %_ Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %ResTypeMod = OpTypeStruct %float %float +%_ptr_Function_ResTypeMod = OpTypePointer Function %ResTypeMod + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 + %float_20 = OpConstant %float 20 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float +%ResTypeFrexp = OpTypeStruct %float %int +%_ptr_Function_ResTypeFrexp = OpTypePointer Function %ResTypeFrexp + %float_40 = OpConstant %float 40 +%_ptr_Function_int = OpTypePointer Function %int + %SSBO = OpTypeStruct %float %int +%_ptr_Uniform_SSBO = OpTypePointer Uniform %SSBO + %_ = OpVariable %_ptr_Uniform_SSBO Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Uniform_int = OpTypePointer Uniform %int + %main = OpFunction %void None %3 + %5 = OpLabel + %modres = OpExtInst %ResTypeMod %1 ModfStruct %float_20 + %frexpres = OpExtInst %ResTypeFrexp %1 FrexpStruct %float_40 + + %modres_f = OpCompositeExtract %float %modres 0 + %modres_i = OpCompositeExtract %float %modres 1 + %frexpres_f = OpCompositeExtract %float %frexpres 0 + %frexpres_i = OpCompositeExtract %int %frexpres 1 + + %float_ptr = OpAccessChain %_ptr_Uniform_float %_ %int_0 + %int_ptr = OpAccessChain %_ptr_Uniform_int %_ %int_1 + + OpStore %float_ptr %modres_f + OpStore %float_ptr %modres_i + OpStore %float_ptr %frexpres_f + OpStore %int_ptr %frexpres_i + + OpReturn + OpFunctionEnd diff --git a/3rdparty/spirv-cross/shaders-hlsl-no-opt/comp/glsl.std450.fxconly.comp b/3rdparty/spirv-cross/shaders-hlsl-no-opt/comp/glsl.std450.fxconly.comp new file mode 100644 index 000000000..83b714bc4 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-hlsl-no-opt/comp/glsl.std450.fxconly.comp @@ -0,0 +1,130 @@ +#version 450 +layout(local_size_x = 1) in; + +layout(binding = 0, std430) buffer SSBO +{ + float res; + int ires; + uint ures; + + vec4 f32; + ivec4 s32; + uvec4 u32; + + mat2 m2; + mat3 m3; + mat4 m4; +}; + +void main() +{ + float tmp; + vec2 v2; + vec3 v3; + vec4 v4; + int itmp; + + res = round(f32.x); + //res = roundEven(f32.x); + res = trunc(f32.x); + res = abs(f32.x); + ires = abs(s32.x); + res = sign(f32.x); + ires = sign(s32.x); + res = floor(f32.x); + res = ceil(f32.x); + res = fract(f32.x); + res = radians(f32.x); + res = degrees(f32.x); + res = sin(f32.x); + res = cos(f32.x); + res = tan(f32.x); + res = asin(f32.x); + res = acos(f32.x); + res = atan(f32.x); + res = sinh(f32.x); + res = cosh(f32.x); + res = tanh(f32.x); + //res = asinh(f32.x); + //res = acosh(f32.x); + //res = atanh(f32.x); + res = atan(f32.x, f32.y); + res = pow(f32.x, f32.y); + res = exp(f32.x); + res = log(f32.x); + res = exp2(f32.x); + res = log2(f32.x); + res = sqrt(f32.x); + res = inversesqrt(f32.x); + + res = length(f32.x); + res = distance(f32.x, f32.y); + res = normalize(f32.x); + res = faceforward(f32.x, f32.y, f32.z); + res = reflect(f32.x, f32.y); + res = refract(f32.x, f32.y, f32.z); + + res = length(f32.xy); + res = distance(f32.xy, f32.zw); + v2 = normalize(f32.xy); + v2 = faceforward(f32.xy, f32.yz, f32.zw); + v2 = reflect(f32.xy, f32.zw); + v2 = refract(f32.xy, f32.yz, f32.w); + + v3 = cross(f32.xyz, f32.yzw); + + res = determinant(m2); + res = determinant(m3); + res = determinant(m4); + m2 = inverse(m2); + m3 = inverse(m3); + m4 = inverse(m4); + + res = modf(f32.x, tmp); + // ModfStruct + + res = min(f32.x, f32.y); + ures = min(u32.x, u32.y); + ires = min(s32.x, s32.y); + res = max(f32.x, f32.y); + ures = max(u32.x, u32.y); + ires = max(s32.x, s32.y); + + res = clamp(f32.x, f32.y, f32.z); + ures = clamp(u32.x, u32.y, u32.z); + ires = clamp(s32.x, s32.y, s32.z); + + res = mix(f32.x, f32.y, f32.z); + res = step(f32.x, f32.y); + res = smoothstep(f32.x, f32.y, f32.z); + res = fma(f32.x, f32.y, f32.z); + + res = frexp(f32.x, itmp); + + // FrexpStruct + res = ldexp(f32.x, itmp); + + ures = packSnorm4x8(f32); + ures = packUnorm4x8(f32); + ures = packSnorm2x16(f32.xy); + ures = packUnorm2x16(f32.xy); + ures = packHalf2x16(f32.xy); + // packDouble2x32 + + v2 = unpackSnorm2x16(u32.x); + v2 = unpackUnorm2x16(u32.x); + v2 = unpackHalf2x16(u32.x); + v4 = unpackSnorm4x8(u32.x); + v4 = unpackUnorm4x8(u32.x); + // unpackDouble2x32 + + s32 = findLSB(s32); + s32 = findLSB(u32); + s32 = findMSB(s32); + s32 = findMSB(u32); + + // interpolateAtSample + // interpolateAtOffset + + // NMin, NMax, NClamp +} diff --git a/3rdparty/spirv-cross/shaders-hlsl/asm/frag/texture-sampling-fp16.asm.frag b/3rdparty/spirv-cross/shaders-hlsl/asm/frag/texture-sampling-fp16.asm.frag index ae7a972d7..e7e6f37ea 100644 --- a/3rdparty/spirv-cross/shaders-hlsl/asm/frag/texture-sampling-fp16.asm.frag +++ b/3rdparty/spirv-cross/shaders-hlsl/asm/frag/texture-sampling-fp16.asm.frag @@ -5,6 +5,7 @@ ; Schema: 0 OpCapability Shader OpCapability StorageInputOutput16 + OpCapability Float16 OpExtension "SPV_KHR_16bit_storage" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 diff --git a/3rdparty/spirv-cross/shaders-hlsl/frag/demote-to-helper.frag b/3rdparty/spirv-cross/shaders-hlsl/frag/demote-to-helper.frag new file mode 100644 index 000000000..bdfef6f9b --- /dev/null +++ b/3rdparty/spirv-cross/shaders-hlsl/frag/demote-to-helper.frag @@ -0,0 +1,7 @@ +#version 450 +#extension GL_EXT_demote_to_helper_invocation : require + +void main() +{ + demote; +} diff --git a/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/bitscan.asm.comp b/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/bitscan.asm.comp new file mode 100644 index 000000000..e3b785cd5 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/bitscan.asm.comp @@ -0,0 +1,72 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 7 +; Bound: 35 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource GLSL 450 + OpName %main "main" + OpName %SSBO "SSBO" + OpMemberName %SSBO 0 "u" + OpMemberName %SSBO 1 "i" + OpMemberDecorate %SSBO 0 Offset 0 + OpMemberDecorate %SSBO 1 Offset 16 + OpDecorate %SSBO BufferBlock + OpDecorate %_ DescriptorSet 0 + OpDecorate %_ Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %ivec4 = OpTypeVector %int 4 + %uint = OpTypeInt 32 0 + %uvec4 = OpTypeVector %uint 4 + %SSBO = OpTypeStruct %uvec4 %ivec4 +%_ptr_Uniform_SSBO = OpTypePointer Uniform %SSBO + %_ = OpVariable %_ptr_Uniform_SSBO Uniform + %int_0 = OpConstant %int 0 +%_ptr_Uniform_uvec4 = OpTypePointer Uniform %uvec4 + %int_1 = OpConstant %int 1 +%_ptr_Uniform_ivec4 = OpTypePointer Uniform %ivec4 + %main = OpFunction %void None %3 + %5 = OpLabel + %uptr = OpAccessChain %_ptr_Uniform_uvec4 %_ %int_0 + %iptr = OpAccessChain %_ptr_Uniform_ivec4 %_ %int_1 + %uvalue = OpLoad %uvec4 %uptr + %ivalue = OpLoad %ivec4 %iptr + + %lsb_uint_to_uint = OpExtInst %uvec4 %1 FindILsb %uvalue + %lsb_uint_to_int = OpExtInst %ivec4 %1 FindILsb %uvalue + %lsb_int_to_uint = OpExtInst %uvec4 %1 FindILsb %ivalue + %lsb_int_to_int = OpExtInst %ivec4 %1 FindILsb %ivalue + + %umsb_uint_to_uint = OpExtInst %uvec4 %1 FindUMsb %uvalue + %umsb_uint_to_int = OpExtInst %ivec4 %1 FindUMsb %uvalue + %umsb_int_to_uint = OpExtInst %uvec4 %1 FindUMsb %ivalue + %umsb_int_to_int = OpExtInst %ivec4 %1 FindUMsb %ivalue + + %smsb_uint_to_uint = OpExtInst %uvec4 %1 FindSMsb %uvalue + %smsb_uint_to_int = OpExtInst %ivec4 %1 FindSMsb %uvalue + %smsb_int_to_uint = OpExtInst %uvec4 %1 FindSMsb %ivalue + %smsb_int_to_int = OpExtInst %ivec4 %1 FindSMsb %ivalue + + OpStore %uptr %lsb_uint_to_uint + OpStore %iptr %lsb_uint_to_int + OpStore %uptr %lsb_int_to_uint + OpStore %iptr %lsb_int_to_int + + OpStore %uptr %umsb_uint_to_uint + OpStore %iptr %umsb_uint_to_int + OpStore %uptr %umsb_int_to_uint + OpStore %iptr %umsb_int_to_int + + OpStore %uptr %smsb_uint_to_uint + OpStore %iptr %smsb_uint_to_int + OpStore %uptr %smsb_int_to_uint + OpStore %iptr %smsb_int_to_int + + OpReturn + OpFunctionEnd diff --git a/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp b/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp new file mode 100644 index 000000000..30db11d45 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-msl-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 7 +; Bound: 45 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource GLSL 450 + OpMemberDecorate %SSBO 0 Offset 0 + OpMemberDecorate %SSBO 1 Offset 4 + OpDecorate %SSBO BufferBlock + OpDecorate %_ DescriptorSet 0 + OpDecorate %_ Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %ResTypeMod = OpTypeStruct %float %float +%_ptr_Function_ResTypeMod = OpTypePointer Function %ResTypeMod + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 + %float_20 = OpConstant %float 20 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float +%ResTypeFrexp = OpTypeStruct %float %int +%_ptr_Function_ResTypeFrexp = OpTypePointer Function %ResTypeFrexp + %float_40 = OpConstant %float 40 +%_ptr_Function_int = OpTypePointer Function %int + %SSBO = OpTypeStruct %float %int +%_ptr_Uniform_SSBO = OpTypePointer Uniform %SSBO + %_ = OpVariable %_ptr_Uniform_SSBO Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Uniform_int = OpTypePointer Uniform %int + %main = OpFunction %void None %3 + %5 = OpLabel + %modres = OpExtInst %ResTypeMod %1 ModfStruct %float_20 + %frexpres = OpExtInst %ResTypeFrexp %1 FrexpStruct %float_40 + + %modres_f = OpCompositeExtract %float %modres 0 + %modres_i = OpCompositeExtract %float %modres 1 + %frexpres_f = OpCompositeExtract %float %frexpres 0 + %frexpres_i = OpCompositeExtract %int %frexpres 1 + + %float_ptr = OpAccessChain %_ptr_Uniform_float %_ %int_0 + %int_ptr = OpAccessChain %_ptr_Uniform_int %_ %int_1 + + OpStore %float_ptr %modres_f + OpStore %float_ptr %modres_i + OpStore %float_ptr %frexpres_f + OpStore %int_ptr %frexpres_i + + OpReturn + OpFunctionEnd diff --git a/3rdparty/spirv-cross/shaders-msl-no-opt/comp/glsl.std450.comp b/3rdparty/spirv-cross/shaders-msl-no-opt/comp/glsl.std450.comp new file mode 100644 index 000000000..a17a82b82 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-msl-no-opt/comp/glsl.std450.comp @@ -0,0 +1,129 @@ +#version 450 +layout(local_size_x = 1) in; + +layout(binding = 0, std430) buffer SSBO +{ + float res; + int ires; + uint ures; + + vec4 f32; + ivec4 s32; + uvec4 u32; + + mat2 m2; + mat3 m3; + mat4 m4; +}; + +void main() +{ + float tmp; + vec2 v2; + vec3 v3; + vec4 v4; + int itmp; + + res = round(f32.x); + res = roundEven(f32.x); + res = trunc(f32.x); + res = abs(f32.x); + ires = abs(s32.x); + res = sign(f32.x); + ires = sign(s32.x); + res = floor(f32.x); + res = ceil(f32.x); + res = fract(f32.x); + res = radians(f32.x); + res = degrees(f32.x); + res = sin(f32.x); + res = cos(f32.x); + res = tan(f32.x); + res = asin(f32.x); + res = acos(f32.x); + res = atan(f32.x); + res = sinh(f32.x); + res = cosh(f32.x); + res = tanh(f32.x); + res = asinh(f32.x); + res = acosh(f32.x); + res = atanh(f32.x); + res = atan(f32.x, f32.y); + res = pow(f32.x, f32.y); + res = exp(f32.x); + res = log(f32.x); + res = exp2(f32.x); + res = log2(f32.x); + res = sqrt(f32.x); + res = inversesqrt(f32.x); + + res = length(f32.x); + res = distance(f32.x, f32.y); + res = normalize(f32.x); + res = faceforward(f32.x, f32.y, f32.z); + res = reflect(f32.x, f32.y); + res = refract(f32.x, f32.y, f32.z); + + res = length(f32.xy); + res = distance(f32.xy, f32.zw); + v2 = normalize(f32.xy); + v2 = faceforward(f32.xy, f32.yz, f32.zw); + v2 = reflect(f32.xy, f32.zw); + v2 = refract(f32.xy, f32.yz, f32.w); + + v3 = cross(f32.xyz, f32.yzw); + + res = determinant(m2); + res = determinant(m3); + res = determinant(m4); + m2 = inverse(m2); + m3 = inverse(m3); + m4 = inverse(m4); + + res = modf(f32.x, tmp); + // ModfStruct + + res = min(f32.x, f32.y); + ures = min(u32.x, u32.y); + ires = min(s32.x, s32.y); + res = max(f32.x, f32.y); + ures = max(u32.x, u32.y); + ires = max(s32.x, s32.y); + + res = clamp(f32.x, f32.y, f32.z); + ures = clamp(u32.x, u32.y, u32.z); + ires = clamp(s32.x, s32.y, s32.z); + + res = mix(f32.x, f32.y, f32.z); + res = step(f32.x, f32.y); + res = smoothstep(f32.x, f32.y, f32.z); + res = fma(f32.x, f32.y, f32.z); + + res = frexp(f32.x, itmp); + // FrexpStruct + res = ldexp(f32.x, itmp); + + ures = packSnorm4x8(f32); + ures = packUnorm4x8(f32); + ures = packSnorm2x16(f32.xy); + ures = packUnorm2x16(f32.xy); + ures = packHalf2x16(f32.xy); + // packDouble2x32 + + v2 = unpackSnorm2x16(u32.x); + v2 = unpackUnorm2x16(u32.x); + v2 = unpackHalf2x16(u32.x); + v4 = unpackSnorm4x8(u32.x); + v4 = unpackUnorm4x8(u32.x); + // unpackDouble2x32 + + s32 = findLSB(s32); + s32 = findLSB(u32); + s32 = findMSB(s32); + s32 = findMSB(u32); + + // interpolateAtSample + // interpolateAtOffset + + // NMin, NMax, NClamp +} diff --git a/3rdparty/spirv-cross/shaders-msl/amd/shader_trinary_minmax.msl21.comp b/3rdparty/spirv-cross/shaders-msl/amd/shader_trinary_minmax.msl21.comp new file mode 100644 index 000000000..f836146a1 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-msl/amd/shader_trinary_minmax.msl21.comp @@ -0,0 +1,11 @@ +#version 450 +#extension GL_AMD_shader_trinary_minmax : require + +layout (local_size_x = 64) in; + +void main () +{ + int t11 = min3(0, 3, 2); + int t12 = max3(0, 3, 2); + int t13 = mid3(0, 3, 2); +} diff --git a/3rdparty/spirv-cross/shaders-msl/asm/frag/texture-sampling-fp16.asm.frag b/3rdparty/spirv-cross/shaders-msl/asm/frag/texture-sampling-fp16.asm.frag index ae7a972d7..e7e6f37ea 100644 --- a/3rdparty/spirv-cross/shaders-msl/asm/frag/texture-sampling-fp16.asm.frag +++ b/3rdparty/spirv-cross/shaders-msl/asm/frag/texture-sampling-fp16.asm.frag @@ -5,6 +5,7 @@ ; Schema: 0 OpCapability Shader OpCapability StorageInputOutput16 + OpCapability Float16 OpExtension "SPV_KHR_16bit_storage" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 diff --git a/3rdparty/spirv-cross/shaders-msl/frag/16bit-constants.frag b/3rdparty/spirv-cross/shaders-msl/frag/16bit-constants.invalid.frag similarity index 100% rename from 3rdparty/spirv-cross/shaders-msl/frag/16bit-constants.frag rename to 3rdparty/spirv-cross/shaders-msl/frag/16bit-constants.invalid.frag diff --git a/3rdparty/spirv-cross/shaders-msl/frag/post-depth-coverage.ios.msl2.frag b/3rdparty/spirv-cross/shaders-msl/frag/post-depth-coverage.ios.msl2.frag new file mode 100644 index 000000000..4f134b4f3 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-msl/frag/post-depth-coverage.ios.msl2.frag @@ -0,0 +1,11 @@ +#version 450 +#extension GL_ARB_post_depth_coverage : require + +layout(post_depth_coverage) in; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = vec4(gl_SampleMaskIn[0]); +} diff --git a/3rdparty/spirv-cross/shaders-msl/intel/shader-integer-functions2.asm.comp b/3rdparty/spirv-cross/shaders-msl/intel/shader-integer-functions2.asm.comp new file mode 100644 index 000000000..9189794ef --- /dev/null +++ b/3rdparty/spirv-cross/shaders-msl/intel/shader-integer-functions2.asm.comp @@ -0,0 +1,137 @@ +; SPIR-V +; Version: 1.4 +; Generator: Khronos SPIR-V Tools Assembler; 0 +; Bound: 97 +; Schema: 0 + OpCapability Shader + OpCapability IntegerFunctions2INTEL + OpExtension "SPV_INTEL_shader_integer_functions2" + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpName %main "main" + OpName %foo "foo" + OpMemberName %foo 0 "a" + OpMemberName %foo 1 "b" + OpMemberName %foo 2 "c" + OpMemberName %foo 3 "d" + OpName %_ "" + OpMemberDecorate %foo 0 Offset 0 + OpMemberDecorate %foo 1 Offset 4 + OpMemberDecorate %foo 2 Offset 8 + OpMemberDecorate %foo 3 Offset 12 + OpDecorate %foo Block + OpDecorate %_ DescriptorSet 0 + OpDecorate %_ Binding 0 + %void = OpTypeVoid + %6 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %int = OpTypeInt 32 1 + %foo = OpTypeStruct %uint %uint %int %int +%_ptr_StorageBuffer_foo = OpTypePointer StorageBuffer %foo + %_ = OpVariable %_ptr_StorageBuffer_foo StorageBuffer + %int_0 = OpConstant %int 0 +%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint + %int_1 = OpConstant %int 1 + %int_2 = OpConstant %int 2 +%_ptr_StorageBuffer_int = OpTypePointer StorageBuffer %int + %int_3 = OpConstant %int 3 + %main = OpFunction %void None %6 + %15 = OpLabel + %16 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + %17 = OpLoad %uint %16 + %18 = OpUCountLeadingZerosINTEL %uint %17 + %19 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + OpStore %19 %18 + %20 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + %21 = OpLoad %uint %20 + %22 = OpUCountTrailingZerosINTEL %uint %21 + %23 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + OpStore %23 %22 + %24 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + %25 = OpLoad %int %24 + %26 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_3 + %27 = OpLoad %int %26 + %28 = OpAbsISubINTEL %uint %25 %27 + %29 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + OpStore %29 %28 + %30 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + %31 = OpLoad %uint %30 + %32 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_1 + %33 = OpLoad %uint %32 + %34 = OpAbsUSubINTEL %uint %31 %33 + %35 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + OpStore %35 %34 + %37 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + %38 = OpLoad %int %37 + %39 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_3 + %40 = OpLoad %int %39 + %41 = OpIAddSatINTEL %int %38 %40 + %42 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + OpStore %42 %41 + %43 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + %44 = OpLoad %uint %43 + %45 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_1 + %46 = OpLoad %uint %45 + %47 = OpUAddSatINTEL %uint %44 %46 + %48 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + OpStore %48 %47 + %49 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + %50 = OpLoad %int %49 + %51 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_3 + %52 = OpLoad %int %51 + %53 = OpIAverageINTEL %int %50 %52 + %54 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + OpStore %54 %53 + %55 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + %56 = OpLoad %uint %55 + %57 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_1 + %58 = OpLoad %uint %57 + %59 = OpUAverageINTEL %uint %56 %58 + %60 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + OpStore %60 %59 + %61 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + %62 = OpLoad %int %61 + %63 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_3 + %64 = OpLoad %int %63 + %65 = OpIAverageRoundedINTEL %int %62 %64 + %66 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + OpStore %66 %65 + %67 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + %68 = OpLoad %uint %67 + %69 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_1 + %70 = OpLoad %uint %69 + %71 = OpUAverageRoundedINTEL %uint %68 %70 + %72 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + OpStore %72 %71 + %73 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + %74 = OpLoad %int %73 + %75 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_3 + %76 = OpLoad %int %75 + %77 = OpISubSatINTEL %int %74 %76 + %78 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + OpStore %78 %77 + %79 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + %80 = OpLoad %uint %79 + %81 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_1 + %82 = OpLoad %uint %81 + %83 = OpUSubSatINTEL %uint %80 %82 + %84 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + OpStore %84 %83 + %85 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + %86 = OpLoad %int %85 + %87 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_3 + %88 = OpLoad %int %87 + %89 = OpIMul32x16INTEL %int %86 %88 + %90 = OpAccessChain %_ptr_StorageBuffer_int %_ %int_2 + OpStore %90 %89 + %91 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + %92 = OpLoad %uint %91 + %93 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_1 + %94 = OpLoad %uint %93 + %95 = OpUMul32x16INTEL %uint %92 %94 + %96 = OpAccessChain %_ptr_StorageBuffer_uint %_ %int_0 + OpStore %96 %95 + OpReturn + OpFunctionEnd diff --git a/3rdparty/spirv-cross/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag b/3rdparty/spirv-cross/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag new file mode 100644 index 000000000..8cce059ba --- /dev/null +++ b/3rdparty/spirv-cross/shaders-msl/vulkan/frag/demote-to-helper.vk.nocompat.msl21.invalid.frag @@ -0,0 +1,8 @@ +#version 450 +#extension GL_EXT_demote_to_helper_invocation : require + +void main() +{ + //demote; // FIXME: Not implemented for MSL + bool helper = helperInvocationEXT(); +} diff --git a/3rdparty/spirv-cross/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert b/3rdparty/spirv-cross/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert new file mode 100644 index 000000000..d54931a6d --- /dev/null +++ b/3rdparty/spirv-cross/shaders-msl/vulkan/vert/device-group.multiview.viewfromdev.nocompat.vk.vert @@ -0,0 +1,8 @@ +#version 450 core +#extension GL_EXT_device_group : require +#extension GL_EXT_multiview : require + +void main() +{ + gl_Position = vec4(gl_DeviceIndex, gl_ViewIndex, 0.0, 1.0); +} diff --git a/3rdparty/spirv-cross/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert b/3rdparty/spirv-cross/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert new file mode 100644 index 000000000..16ed51b15 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-msl/vulkan/vert/device-group.nocompat.vk.vert @@ -0,0 +1,7 @@ +#version 450 core +#extension GL_EXT_device_group : require + +void main() +{ + gl_Position = vec4(gl_DeviceIndex); +} diff --git a/3rdparty/spirv-cross/shaders-no-opt/asm/comp/bitscan.asm.comp b/3rdparty/spirv-cross/shaders-no-opt/asm/comp/bitscan.asm.comp new file mode 100644 index 000000000..e3b785cd5 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-no-opt/asm/comp/bitscan.asm.comp @@ -0,0 +1,72 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 7 +; Bound: 35 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource GLSL 450 + OpName %main "main" + OpName %SSBO "SSBO" + OpMemberName %SSBO 0 "u" + OpMemberName %SSBO 1 "i" + OpMemberDecorate %SSBO 0 Offset 0 + OpMemberDecorate %SSBO 1 Offset 16 + OpDecorate %SSBO BufferBlock + OpDecorate %_ DescriptorSet 0 + OpDecorate %_ Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %ivec4 = OpTypeVector %int 4 + %uint = OpTypeInt 32 0 + %uvec4 = OpTypeVector %uint 4 + %SSBO = OpTypeStruct %uvec4 %ivec4 +%_ptr_Uniform_SSBO = OpTypePointer Uniform %SSBO + %_ = OpVariable %_ptr_Uniform_SSBO Uniform + %int_0 = OpConstant %int 0 +%_ptr_Uniform_uvec4 = OpTypePointer Uniform %uvec4 + %int_1 = OpConstant %int 1 +%_ptr_Uniform_ivec4 = OpTypePointer Uniform %ivec4 + %main = OpFunction %void None %3 + %5 = OpLabel + %uptr = OpAccessChain %_ptr_Uniform_uvec4 %_ %int_0 + %iptr = OpAccessChain %_ptr_Uniform_ivec4 %_ %int_1 + %uvalue = OpLoad %uvec4 %uptr + %ivalue = OpLoad %ivec4 %iptr + + %lsb_uint_to_uint = OpExtInst %uvec4 %1 FindILsb %uvalue + %lsb_uint_to_int = OpExtInst %ivec4 %1 FindILsb %uvalue + %lsb_int_to_uint = OpExtInst %uvec4 %1 FindILsb %ivalue + %lsb_int_to_int = OpExtInst %ivec4 %1 FindILsb %ivalue + + %umsb_uint_to_uint = OpExtInst %uvec4 %1 FindUMsb %uvalue + %umsb_uint_to_int = OpExtInst %ivec4 %1 FindUMsb %uvalue + %umsb_int_to_uint = OpExtInst %uvec4 %1 FindUMsb %ivalue + %umsb_int_to_int = OpExtInst %ivec4 %1 FindUMsb %ivalue + + %smsb_uint_to_uint = OpExtInst %uvec4 %1 FindSMsb %uvalue + %smsb_uint_to_int = OpExtInst %ivec4 %1 FindSMsb %uvalue + %smsb_int_to_uint = OpExtInst %uvec4 %1 FindSMsb %ivalue + %smsb_int_to_int = OpExtInst %ivec4 %1 FindSMsb %ivalue + + OpStore %uptr %lsb_uint_to_uint + OpStore %iptr %lsb_uint_to_int + OpStore %uptr %lsb_int_to_uint + OpStore %iptr %lsb_int_to_int + + OpStore %uptr %umsb_uint_to_uint + OpStore %iptr %umsb_uint_to_int + OpStore %uptr %umsb_int_to_uint + OpStore %iptr %umsb_int_to_int + + OpStore %uptr %smsb_uint_to_uint + OpStore %iptr %smsb_uint_to_int + OpStore %uptr %smsb_int_to_uint + OpStore %iptr %smsb_int_to_int + + OpReturn + OpFunctionEnd diff --git a/3rdparty/spirv-cross/shaders-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp b/3rdparty/spirv-cross/shaders-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp new file mode 100644 index 000000000..30db11d45 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-no-opt/asm/comp/glsl.std450.frexp-modf-struct.asm.comp @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 7 +; Bound: 45 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource GLSL 450 + OpMemberDecorate %SSBO 0 Offset 0 + OpMemberDecorate %SSBO 1 Offset 4 + OpDecorate %SSBO BufferBlock + OpDecorate %_ DescriptorSet 0 + OpDecorate %_ Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %ResTypeMod = OpTypeStruct %float %float +%_ptr_Function_ResTypeMod = OpTypePointer Function %ResTypeMod + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 + %float_20 = OpConstant %float 20 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float +%ResTypeFrexp = OpTypeStruct %float %int +%_ptr_Function_ResTypeFrexp = OpTypePointer Function %ResTypeFrexp + %float_40 = OpConstant %float 40 +%_ptr_Function_int = OpTypePointer Function %int + %SSBO = OpTypeStruct %float %int +%_ptr_Uniform_SSBO = OpTypePointer Uniform %SSBO + %_ = OpVariable %_ptr_Uniform_SSBO Uniform +%_ptr_Uniform_float = OpTypePointer Uniform %float +%_ptr_Uniform_int = OpTypePointer Uniform %int + %main = OpFunction %void None %3 + %5 = OpLabel + %modres = OpExtInst %ResTypeMod %1 ModfStruct %float_20 + %frexpres = OpExtInst %ResTypeFrexp %1 FrexpStruct %float_40 + + %modres_f = OpCompositeExtract %float %modres 0 + %modres_i = OpCompositeExtract %float %modres 1 + %frexpres_f = OpCompositeExtract %float %frexpres 0 + %frexpres_i = OpCompositeExtract %int %frexpres 1 + + %float_ptr = OpAccessChain %_ptr_Uniform_float %_ %int_0 + %int_ptr = OpAccessChain %_ptr_Uniform_int %_ %int_1 + + OpStore %float_ptr %modres_f + OpStore %float_ptr %modres_i + OpStore %float_ptr %frexpres_f + OpStore %int_ptr %frexpres_i + + OpReturn + OpFunctionEnd diff --git a/3rdparty/spirv-cross/shaders-no-opt/comp/glsl.std450.comp b/3rdparty/spirv-cross/shaders-no-opt/comp/glsl.std450.comp new file mode 100644 index 000000000..a17a82b82 --- /dev/null +++ b/3rdparty/spirv-cross/shaders-no-opt/comp/glsl.std450.comp @@ -0,0 +1,129 @@ +#version 450 +layout(local_size_x = 1) in; + +layout(binding = 0, std430) buffer SSBO +{ + float res; + int ires; + uint ures; + + vec4 f32; + ivec4 s32; + uvec4 u32; + + mat2 m2; + mat3 m3; + mat4 m4; +}; + +void main() +{ + float tmp; + vec2 v2; + vec3 v3; + vec4 v4; + int itmp; + + res = round(f32.x); + res = roundEven(f32.x); + res = trunc(f32.x); + res = abs(f32.x); + ires = abs(s32.x); + res = sign(f32.x); + ires = sign(s32.x); + res = floor(f32.x); + res = ceil(f32.x); + res = fract(f32.x); + res = radians(f32.x); + res = degrees(f32.x); + res = sin(f32.x); + res = cos(f32.x); + res = tan(f32.x); + res = asin(f32.x); + res = acos(f32.x); + res = atan(f32.x); + res = sinh(f32.x); + res = cosh(f32.x); + res = tanh(f32.x); + res = asinh(f32.x); + res = acosh(f32.x); + res = atanh(f32.x); + res = atan(f32.x, f32.y); + res = pow(f32.x, f32.y); + res = exp(f32.x); + res = log(f32.x); + res = exp2(f32.x); + res = log2(f32.x); + res = sqrt(f32.x); + res = inversesqrt(f32.x); + + res = length(f32.x); + res = distance(f32.x, f32.y); + res = normalize(f32.x); + res = faceforward(f32.x, f32.y, f32.z); + res = reflect(f32.x, f32.y); + res = refract(f32.x, f32.y, f32.z); + + res = length(f32.xy); + res = distance(f32.xy, f32.zw); + v2 = normalize(f32.xy); + v2 = faceforward(f32.xy, f32.yz, f32.zw); + v2 = reflect(f32.xy, f32.zw); + v2 = refract(f32.xy, f32.yz, f32.w); + + v3 = cross(f32.xyz, f32.yzw); + + res = determinant(m2); + res = determinant(m3); + res = determinant(m4); + m2 = inverse(m2); + m3 = inverse(m3); + m4 = inverse(m4); + + res = modf(f32.x, tmp); + // ModfStruct + + res = min(f32.x, f32.y); + ures = min(u32.x, u32.y); + ires = min(s32.x, s32.y); + res = max(f32.x, f32.y); + ures = max(u32.x, u32.y); + ires = max(s32.x, s32.y); + + res = clamp(f32.x, f32.y, f32.z); + ures = clamp(u32.x, u32.y, u32.z); + ires = clamp(s32.x, s32.y, s32.z); + + res = mix(f32.x, f32.y, f32.z); + res = step(f32.x, f32.y); + res = smoothstep(f32.x, f32.y, f32.z); + res = fma(f32.x, f32.y, f32.z); + + res = frexp(f32.x, itmp); + // FrexpStruct + res = ldexp(f32.x, itmp); + + ures = packSnorm4x8(f32); + ures = packUnorm4x8(f32); + ures = packSnorm2x16(f32.xy); + ures = packUnorm2x16(f32.xy); + ures = packHalf2x16(f32.xy); + // packDouble2x32 + + v2 = unpackSnorm2x16(u32.x); + v2 = unpackUnorm2x16(u32.x); + v2 = unpackHalf2x16(u32.x); + v4 = unpackSnorm4x8(u32.x); + v4 = unpackUnorm4x8(u32.x); + // unpackDouble2x32 + + s32 = findLSB(s32); + s32 = findLSB(u32); + s32 = findMSB(s32); + s32 = findMSB(u32); + + // interpolateAtSample + // interpolateAtOffset + + // NMin, NMax, NClamp +} diff --git a/3rdparty/spirv-cross/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag b/3rdparty/spirv-cross/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag index ae7a972d7..e7e6f37ea 100644 --- a/3rdparty/spirv-cross/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag +++ b/3rdparty/spirv-cross/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag @@ -5,6 +5,7 @@ ; Schema: 0 OpCapability Shader OpCapability StorageInputOutput16 + OpCapability Float16 OpExtension "SPV_KHR_16bit_storage" %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 diff --git a/3rdparty/spirv-cross/shaders/frag/16bit-constants.frag b/3rdparty/spirv-cross/shaders/frag/16bit-constants.invalid.frag similarity index 100% rename from 3rdparty/spirv-cross/shaders/frag/16bit-constants.frag rename to 3rdparty/spirv-cross/shaders/frag/16bit-constants.invalid.frag diff --git a/3rdparty/spirv-cross/shaders/frag/post-depth-coverage.frag b/3rdparty/spirv-cross/shaders/frag/post-depth-coverage.frag new file mode 100644 index 000000000..4f134b4f3 --- /dev/null +++ b/3rdparty/spirv-cross/shaders/frag/post-depth-coverage.frag @@ -0,0 +1,11 @@ +#version 450 +#extension GL_ARB_post_depth_coverage : require + +layout(post_depth_coverage) in; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = vec4(gl_SampleMaskIn[0]); +} diff --git a/3rdparty/spirv-cross/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag b/3rdparty/spirv-cross/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag new file mode 100644 index 000000000..ba57b8c5a --- /dev/null +++ b/3rdparty/spirv-cross/shaders/vulkan/frag/demote-to-helper-forwarding.asm.vk.nocompat.frag @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.3 +; Generator: Khronos Glslang Reference Front End; 7 +; Bound: 19 +; Schema: 0 + OpCapability Shader + OpCapability DemoteToHelperInvocationEXT + OpExtension "SPV_EXT_demote_to_helper_invocation" + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpSourceExtension "GL_EXT_demote_to_helper_invocation" + OpName %main "main" + OpName %FragColor "FragColor" + OpDecorate %FragColor Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %bool = OpTypeBool +%_ptr_Function_bool = OpTypePointer Function %bool + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %float_1 = OpConstant %float 1 + %float_0 = OpConstant %float 0 + %19 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1 + %main = OpFunction %void None %3 + %5 = OpLabel + %9 = OpIsHelperInvocationEXT %bool + OpDemoteToHelperInvocationEXT + %10 = OpLogicalNot %bool %9 + OpSelectionMerge %12 None + OpBranchConditional %10 %11 %12 + %11 = OpLabel + OpStore %FragColor %19 + OpBranch %12 + %12 = OpLabel + OpReturn + OpFunctionEnd diff --git a/3rdparty/spirv-cross/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag b/3rdparty/spirv-cross/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag new file mode 100644 index 000000000..8b8bb61ff --- /dev/null +++ b/3rdparty/spirv-cross/shaders/vulkan/frag/demote-to-helper.vk.nocompat.frag @@ -0,0 +1,8 @@ +#version 450 +#extension GL_EXT_demote_to_helper_invocation : require + +void main() +{ + demote; + bool helper = helperInvocationEXT(); +} diff --git a/3rdparty/spirv-cross/shaders/vulkan/vert/device-group.nocompat.vk.vert b/3rdparty/spirv-cross/shaders/vulkan/vert/device-group.nocompat.vk.vert new file mode 100644 index 000000000..16ed51b15 --- /dev/null +++ b/3rdparty/spirv-cross/shaders/vulkan/vert/device-group.nocompat.vk.vert @@ -0,0 +1,7 @@ +#version 450 core +#extension GL_EXT_device_group : require + +void main() +{ + gl_Position = vec4(gl_DeviceIndex); +} diff --git a/3rdparty/spirv-cross/spirv.h b/3rdparty/spirv-cross/spirv.h index 8da27dd26..4b6d9dc49 100644 --- a/3rdparty/spirv-cross/spirv.h +++ b/3rdparty/spirv-cross/spirv.h @@ -53,12 +53,12 @@ typedef unsigned int SpvId; -#define SPV_VERSION 0x10300 -#define SPV_REVISION 6 +#define SPV_VERSION 0x10400 +#define SPV_REVISION 1 static const unsigned int SpvMagicNumber = 0x07230203; -static const unsigned int SpvVersion = 0x00010300; -static const unsigned int SpvRevision = 6; +static const unsigned int SpvVersion = 0x00010400; +static const unsigned int SpvRevision = 1; static const unsigned int SpvOpCodeMask = 0xffff; static const unsigned int SpvWordCountShift = 16; @@ -158,6 +158,12 @@ typedef enum SpvExecutionMode_ { SpvExecutionModeDerivativeGroupQuadsNV = 5289, SpvExecutionModeDerivativeGroupLinearNV = 5290, SpvExecutionModeOutputTrianglesNV = 5298, + SpvExecutionModePixelInterlockOrderedEXT = 5366, + SpvExecutionModePixelInterlockUnorderedEXT = 5367, + SpvExecutionModeSampleInterlockOrderedEXT = 5368, + SpvExecutionModeSampleInterlockUnorderedEXT = 5369, + SpvExecutionModeShadingRateInterlockOrderedEXT = 5370, + SpvExecutionModeShadingRateInterlockUnorderedEXT = 5371, SpvExecutionModeMax = 0x7fffffff, } SpvExecutionMode; @@ -313,6 +319,8 @@ typedef enum SpvImageOperandsShift_ { SpvImageOperandsMakeTexelVisibleKHRShift = 9, SpvImageOperandsNonPrivateTexelKHRShift = 10, SpvImageOperandsVolatileTexelKHRShift = 11, + SpvImageOperandsSignExtendShift = 12, + SpvImageOperandsZeroExtendShift = 13, SpvImageOperandsMax = 0x7fffffff, } SpvImageOperandsShift; @@ -330,6 +338,8 @@ typedef enum SpvImageOperandsMask_ { SpvImageOperandsMakeTexelVisibleKHRMask = 0x00000200, SpvImageOperandsNonPrivateTexelKHRMask = 0x00000400, SpvImageOperandsVolatileTexelKHRMask = 0x00000800, + SpvImageOperandsSignExtendMask = 0x00001000, + SpvImageOperandsZeroExtendMask = 0x00002000, } SpvImageOperandsMask; typedef enum SpvFPFastMathModeShift_ { @@ -410,6 +420,7 @@ typedef enum SpvDecoration_ { SpvDecorationNonWritable = 24, SpvDecorationNonReadable = 25, SpvDecorationUniform = 26, + SpvDecorationUniformId = 27, SpvDecorationSaturatedConversion = 28, SpvDecorationStream = 29, SpvDecorationLocation = 30, @@ -444,8 +455,11 @@ typedef enum SpvDecoration_ { SpvDecorationNonUniformEXT = 5300, SpvDecorationRestrictPointerEXT = 5355, SpvDecorationAliasedPointerEXT = 5356, + SpvDecorationCounterBuffer = 5634, SpvDecorationHlslCounterBufferGOOGLE = 5634, SpvDecorationHlslSemanticGOOGLE = 5635, + SpvDecorationUserSemantic = 5635, + SpvDecorationUserTypeGOOGLE = 5636, SpvDecorationMax = 0x7fffffff, } SpvDecoration; @@ -548,6 +562,10 @@ typedef enum SpvBuiltIn_ { SpvBuiltInHitTNV = 5332, SpvBuiltInHitKindNV = 5333, SpvBuiltInIncomingRayFlagsNV = 5351, + SpvBuiltInWarpsPerSMNV = 5374, + SpvBuiltInSMCountNV = 5375, + SpvBuiltInWarpIDNV = 5376, + SpvBuiltInSMIDNV = 5377, SpvBuiltInMax = 0x7fffffff, } SpvBuiltIn; @@ -568,6 +586,11 @@ typedef enum SpvLoopControlShift_ { SpvLoopControlDontUnrollShift = 1, SpvLoopControlDependencyInfiniteShift = 2, SpvLoopControlDependencyLengthShift = 3, + SpvLoopControlMinIterationsShift = 4, + SpvLoopControlMaxIterationsShift = 5, + SpvLoopControlIterationMultipleShift = 6, + SpvLoopControlPeelCountShift = 7, + SpvLoopControlPartialCountShift = 8, SpvLoopControlMax = 0x7fffffff, } SpvLoopControlShift; @@ -577,6 +600,11 @@ typedef enum SpvLoopControlMask_ { SpvLoopControlDontUnrollMask = 0x00000002, SpvLoopControlDependencyInfiniteMask = 0x00000004, SpvLoopControlDependencyLengthMask = 0x00000008, + SpvLoopControlMinIterationsMask = 0x00000010, + SpvLoopControlMaxIterationsMask = 0x00000020, + SpvLoopControlIterationMultipleMask = 0x00000040, + SpvLoopControlPeelCountMask = 0x00000080, + SpvLoopControlPartialCountMask = 0x00000100, } SpvLoopControlMask; typedef enum SpvFunctionControlShift_ { @@ -609,6 +637,7 @@ typedef enum SpvMemorySemanticsShift_ { SpvMemorySemanticsOutputMemoryKHRShift = 12, SpvMemorySemanticsMakeAvailableKHRShift = 13, SpvMemorySemanticsMakeVisibleKHRShift = 14, + SpvMemorySemanticsVolatileShift = 15, SpvMemorySemanticsMax = 0x7fffffff, } SpvMemorySemanticsShift; @@ -627,6 +656,7 @@ typedef enum SpvMemorySemanticsMask_ { SpvMemorySemanticsOutputMemoryKHRMask = 0x00001000, SpvMemorySemanticsMakeAvailableKHRMask = 0x00002000, SpvMemorySemanticsMakeVisibleKHRMask = 0x00004000, + SpvMemorySemanticsVolatileMask = 0x00008000, } SpvMemorySemanticsMask; typedef enum SpvMemoryAccessShift_ { @@ -816,10 +846,19 @@ typedef enum SpvCapability_ { SpvCapabilityPhysicalStorageBufferAddressesEXT = 5347, SpvCapabilityComputeDerivativeGroupLinearNV = 5350, SpvCapabilityCooperativeMatrixNV = 5357, + SpvCapabilityFragmentShaderSampleInterlockEXT = 5363, + SpvCapabilityFragmentShaderShadingRateInterlockEXT = 5372, + SpvCapabilityShaderSMBuiltinsNV = 5373, + SpvCapabilityFragmentShaderPixelInterlockEXT = 5378, + SpvCapabilityDemoteToHelperInvocationEXT = 5379, SpvCapabilitySubgroupShuffleINTEL = 5568, SpvCapabilitySubgroupBufferBlockIOINTEL = 5569, SpvCapabilitySubgroupImageBlockIOINTEL = 5570, SpvCapabilitySubgroupImageMediaBlockIOINTEL = 5579, + SpvCapabilityIntegerFunctions2INTEL = 5584, + SpvCapabilitySubgroupAvcMotionEstimationINTEL = 5696, + SpvCapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697, + SpvCapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698, SpvCapabilityMax = 0x7fffffff, } SpvCapability; @@ -1164,6 +1203,10 @@ typedef enum SpvOp_ { SpvOpGroupNonUniformLogicalXor = 364, SpvOpGroupNonUniformQuadBroadcast = 365, SpvOpGroupNonUniformQuadSwap = 366, + SpvOpCopyLogical = 400, + SpvOpPtrEqual = 401, + SpvOpPtrNotEqual = 402, + SpvOpPtrDiff = 403, SpvOpSubgroupBallotKHR = 4421, SpvOpSubgroupFirstInvocationKHR = 4422, SpvOpSubgroupAllKHR = 4428, @@ -1194,6 +1237,10 @@ typedef enum SpvOp_ { SpvOpCooperativeMatrixStoreNV = 5360, SpvOpCooperativeMatrixMulAddNV = 5361, SpvOpCooperativeMatrixLengthNV = 5362, + SpvOpBeginInvocationInterlockEXT = 5364, + SpvOpEndInvocationInterlockEXT = 5365, + SpvOpDemoteToHelperInvocationEXT = 5380, + SpvOpIsHelperInvocationEXT = 5381, SpvOpSubgroupShuffleINTEL = 5571, SpvOpSubgroupShuffleDownINTEL = 5572, SpvOpSubgroupShuffleUpINTEL = 5573, @@ -1204,10 +1251,675 @@ typedef enum SpvOp_ { SpvOpSubgroupImageBlockWriteINTEL = 5578, SpvOpSubgroupImageMediaBlockReadINTEL = 5580, SpvOpSubgroupImageMediaBlockWriteINTEL = 5581, + SpvOpUCountLeadingZerosINTEL = 5585, + SpvOpUCountTrailingZerosINTEL = 5586, + SpvOpAbsISubINTEL = 5587, + SpvOpAbsUSubINTEL = 5588, + SpvOpIAddSatINTEL = 5589, + SpvOpUAddSatINTEL = 5590, + SpvOpIAverageINTEL = 5591, + SpvOpUAverageINTEL = 5592, + SpvOpIAverageRoundedINTEL = 5593, + SpvOpUAverageRoundedINTEL = 5594, + SpvOpISubSatINTEL = 5595, + SpvOpUSubSatINTEL = 5596, + SpvOpIMul32x16INTEL = 5597, + SpvOpUMul32x16INTEL = 5598, + SpvOpDecorateString = 5632, SpvOpDecorateStringGOOGLE = 5632, + SpvOpMemberDecorateString = 5633, SpvOpMemberDecorateStringGOOGLE = 5633, + SpvOpVmeImageINTEL = 5699, + SpvOpTypeVmeImageINTEL = 5700, + SpvOpTypeAvcImePayloadINTEL = 5701, + SpvOpTypeAvcRefPayloadINTEL = 5702, + SpvOpTypeAvcSicPayloadINTEL = 5703, + SpvOpTypeAvcMcePayloadINTEL = 5704, + SpvOpTypeAvcMceResultINTEL = 5705, + SpvOpTypeAvcImeResultINTEL = 5706, + SpvOpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, + SpvOpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, + SpvOpTypeAvcImeSingleReferenceStreaminINTEL = 5709, + SpvOpTypeAvcImeDualReferenceStreaminINTEL = 5710, + SpvOpTypeAvcRefResultINTEL = 5711, + SpvOpTypeAvcSicResultINTEL = 5712, + SpvOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, + SpvOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, + SpvOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, + SpvOpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, + SpvOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, + SpvOpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, + SpvOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, + SpvOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, + SpvOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, + SpvOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, + SpvOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, + SpvOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, + SpvOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, + SpvOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, + SpvOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, + SpvOpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, + SpvOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, + SpvOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, + SpvOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, + SpvOpSubgroupAvcMceConvertToImePayloadINTEL = 5732, + SpvOpSubgroupAvcMceConvertToImeResultINTEL = 5733, + SpvOpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, + SpvOpSubgroupAvcMceConvertToRefResultINTEL = 5735, + SpvOpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, + SpvOpSubgroupAvcMceConvertToSicResultINTEL = 5737, + SpvOpSubgroupAvcMceGetMotionVectorsINTEL = 5738, + SpvOpSubgroupAvcMceGetInterDistortionsINTEL = 5739, + SpvOpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, + SpvOpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, + SpvOpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, + SpvOpSubgroupAvcMceGetInterDirectionsINTEL = 5743, + SpvOpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, + SpvOpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, + SpvOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, + SpvOpSubgroupAvcImeInitializeINTEL = 5747, + SpvOpSubgroupAvcImeSetSingleReferenceINTEL = 5748, + SpvOpSubgroupAvcImeSetDualReferenceINTEL = 5749, + SpvOpSubgroupAvcImeRefWindowSizeINTEL = 5750, + SpvOpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, + SpvOpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, + SpvOpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, + SpvOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, + SpvOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, + SpvOpSubgroupAvcImeSetWeightedSadINTEL = 5756, + SpvOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, + SpvOpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, + SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, + SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, + SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, + SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, + SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, + SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, + SpvOpSubgroupAvcImeConvertToMceResultINTEL = 5765, + SpvOpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, + SpvOpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, + SpvOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, + SpvOpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, + SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, + SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, + SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, + SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, + SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, + SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, + SpvOpSubgroupAvcImeGetBorderReachedINTEL = 5776, + SpvOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, + SpvOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, + SpvOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, + SpvOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, + SpvOpSubgroupAvcFmeInitializeINTEL = 5781, + SpvOpSubgroupAvcBmeInitializeINTEL = 5782, + SpvOpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, + SpvOpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, + SpvOpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, + SpvOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, + SpvOpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, + SpvOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, + SpvOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, + SpvOpSubgroupAvcRefConvertToMceResultINTEL = 5790, + SpvOpSubgroupAvcSicInitializeINTEL = 5791, + SpvOpSubgroupAvcSicConfigureSkcINTEL = 5792, + SpvOpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, + SpvOpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, + SpvOpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, + SpvOpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, + SpvOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, + SpvOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, + SpvOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, + SpvOpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, + SpvOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, + SpvOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, + SpvOpSubgroupAvcSicEvaluateIpeINTEL = 5803, + SpvOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, + SpvOpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, + SpvOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, + SpvOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, + SpvOpSubgroupAvcSicConvertToMceResultINTEL = 5808, + SpvOpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, + SpvOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, + SpvOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, + SpvOpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, + SpvOpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, + SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, + SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, + SpvOpSubgroupAvcSicGetInterRawSadsINTEL = 5816, SpvOpMax = 0x7fffffff, } SpvOp; +#ifdef SPV_ENABLE_UTILITY_CODE +inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultType) { + *hasResult = *hasResultType = false; + switch (opcode) { + default: /* unknown opcode */ break; + case SpvOpNop: *hasResult = false; *hasResultType = false; break; + case SpvOpUndef: *hasResult = true; *hasResultType = true; break; + case SpvOpSourceContinued: *hasResult = false; *hasResultType = false; break; + case SpvOpSource: *hasResult = false; *hasResultType = false; break; + case SpvOpSourceExtension: *hasResult = false; *hasResultType = false; break; + case SpvOpName: *hasResult = false; *hasResultType = false; break; + case SpvOpMemberName: *hasResult = false; *hasResultType = false; break; + case SpvOpString: *hasResult = true; *hasResultType = false; break; + case SpvOpLine: *hasResult = false; *hasResultType = false; break; + case SpvOpExtension: *hasResult = false; *hasResultType = false; break; + case SpvOpExtInstImport: *hasResult = true; *hasResultType = false; break; + case SpvOpExtInst: *hasResult = true; *hasResultType = true; break; + case SpvOpMemoryModel: *hasResult = false; *hasResultType = false; break; + case SpvOpEntryPoint: *hasResult = false; *hasResultType = false; break; + case SpvOpExecutionMode: *hasResult = false; *hasResultType = false; break; + case SpvOpCapability: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeVoid: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeBool: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeInt: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeFloat: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeVector: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeMatrix: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeImage: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeSampler: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeSampledImage: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeArray: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeStruct: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeOpaque: *hasResult = true; *hasResultType = false; break; + case SpvOpTypePointer: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeFunction: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeEvent: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeReserveId: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeQueue: *hasResult = true; *hasResultType = false; break; + case SpvOpTypePipe: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; + case SpvOpConstantTrue: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantFalse: *hasResult = true; *hasResultType = true; break; + case SpvOpConstant: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantComposite: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantSampler: *hasResult = true; *hasResultType = true; break; + case SpvOpConstantNull: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstant: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; + case SpvOpSpecConstantOp: *hasResult = true; *hasResultType = true; break; + case SpvOpFunction: *hasResult = true; *hasResultType = true; break; + case SpvOpFunctionParameter: *hasResult = true; *hasResultType = true; break; + case SpvOpFunctionEnd: *hasResult = false; *hasResultType = false; break; + case SpvOpFunctionCall: *hasResult = true; *hasResultType = true; break; + case SpvOpVariable: *hasResult = true; *hasResultType = true; break; + case SpvOpImageTexelPointer: *hasResult = true; *hasResultType = true; break; + case SpvOpLoad: *hasResult = true; *hasResultType = true; break; + case SpvOpStore: *hasResult = false; *hasResultType = false; break; + case SpvOpCopyMemory: *hasResult = false; *hasResultType = false; break; + case SpvOpCopyMemorySized: *hasResult = false; *hasResultType = false; break; + case SpvOpAccessChain: *hasResult = true; *hasResultType = true; break; + case SpvOpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case SpvOpArrayLength: *hasResult = true; *hasResultType = true; break; + case SpvOpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; + case SpvOpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case SpvOpDecorate: *hasResult = false; *hasResultType = false; break; + case SpvOpMemberDecorate: *hasResult = false; *hasResultType = false; break; + case SpvOpDecorationGroup: *hasResult = true; *hasResultType = false; break; + case SpvOpGroupDecorate: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; + case SpvOpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; + case SpvOpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; + case SpvOpVectorShuffle: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeConstruct: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeExtract: *hasResult = true; *hasResultType = true; break; + case SpvOpCompositeInsert: *hasResult = true; *hasResultType = true; break; + case SpvOpCopyObject: *hasResult = true; *hasResultType = true; break; + case SpvOpTranspose: *hasResult = true; *hasResultType = true; break; + case SpvOpSampledImage: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageFetch: *hasResult = true; *hasResultType = true; break; + case SpvOpImageGather: *hasResult = true; *hasResultType = true; break; + case SpvOpImageDrefGather: *hasResult = true; *hasResultType = true; break; + case SpvOpImageRead: *hasResult = true; *hasResultType = true; break; + case SpvOpImageWrite: *hasResult = false; *hasResultType = false; break; + case SpvOpImage: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQueryFormat: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQueryOrder: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQuerySize: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQueryLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQueryLevels: *hasResult = true; *hasResultType = true; break; + case SpvOpImageQuerySamples: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertFToU: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertFToS: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertSToF: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertUToF: *hasResult = true; *hasResultType = true; break; + case SpvOpUConvert: *hasResult = true; *hasResultType = true; break; + case SpvOpSConvert: *hasResult = true; *hasResultType = true; break; + case SpvOpFConvert: *hasResult = true; *hasResultType = true; break; + case SpvOpQuantizeToF16: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertPtrToU: *hasResult = true; *hasResultType = true; break; + case SpvOpSatConvertSToU: *hasResult = true; *hasResultType = true; break; + case SpvOpSatConvertUToS: *hasResult = true; *hasResultType = true; break; + case SpvOpConvertUToPtr: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; + case SpvOpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; + case SpvOpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; + case SpvOpBitcast: *hasResult = true; *hasResultType = true; break; + case SpvOpSNegate: *hasResult = true; *hasResultType = true; break; + case SpvOpFNegate: *hasResult = true; *hasResultType = true; break; + case SpvOpIAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpFAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpISub: *hasResult = true; *hasResultType = true; break; + case SpvOpFSub: *hasResult = true; *hasResultType = true; break; + case SpvOpIMul: *hasResult = true; *hasResultType = true; break; + case SpvOpFMul: *hasResult = true; *hasResultType = true; break; + case SpvOpUDiv: *hasResult = true; *hasResultType = true; break; + case SpvOpSDiv: *hasResult = true; *hasResultType = true; break; + case SpvOpFDiv: *hasResult = true; *hasResultType = true; break; + case SpvOpUMod: *hasResult = true; *hasResultType = true; break; + case SpvOpSRem: *hasResult = true; *hasResultType = true; break; + case SpvOpSMod: *hasResult = true; *hasResultType = true; break; + case SpvOpFRem: *hasResult = true; *hasResultType = true; break; + case SpvOpFMod: *hasResult = true; *hasResultType = true; break; + case SpvOpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; + case SpvOpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; + case SpvOpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; + case SpvOpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; + case SpvOpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; + case SpvOpOuterProduct: *hasResult = true; *hasResultType = true; break; + case SpvOpDot: *hasResult = true; *hasResultType = true; break; + case SpvOpIAddCarry: *hasResult = true; *hasResultType = true; break; + case SpvOpISubBorrow: *hasResult = true; *hasResultType = true; break; + case SpvOpUMulExtended: *hasResult = true; *hasResultType = true; break; + case SpvOpSMulExtended: *hasResult = true; *hasResultType = true; break; + case SpvOpAny: *hasResult = true; *hasResultType = true; break; + case SpvOpAll: *hasResult = true; *hasResultType = true; break; + case SpvOpIsNan: *hasResult = true; *hasResultType = true; break; + case SpvOpIsInf: *hasResult = true; *hasResultType = true; break; + case SpvOpIsFinite: *hasResult = true; *hasResultType = true; break; + case SpvOpIsNormal: *hasResult = true; *hasResultType = true; break; + case SpvOpSignBitSet: *hasResult = true; *hasResultType = true; break; + case SpvOpLessOrGreater: *hasResult = true; *hasResultType = true; break; + case SpvOpOrdered: *hasResult = true; *hasResultType = true; break; + case SpvOpUnordered: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalOr: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpLogicalNot: *hasResult = true; *hasResultType = true; break; + case SpvOpSelect: *hasResult = true; *hasResultType = true; break; + case SpvOpIEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpINotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpUGreaterThan: *hasResult = true; *hasResultType = true; break; + case SpvOpSGreaterThan: *hasResult = true; *hasResultType = true; break; + case SpvOpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpULessThan: *hasResult = true; *hasResultType = true; break; + case SpvOpSLessThan: *hasResult = true; *hasResultType = true; break; + case SpvOpULessThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpSLessThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdLessThan: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordLessThan: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpShiftRightLogical: *hasResult = true; *hasResultType = true; break; + case SpvOpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; + case SpvOpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; + case SpvOpBitwiseOr: *hasResult = true; *hasResultType = true; break; + case SpvOpBitwiseXor: *hasResult = true; *hasResultType = true; break; + case SpvOpBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpNot: *hasResult = true; *hasResultType = true; break; + case SpvOpBitFieldInsert: *hasResult = true; *hasResultType = true; break; + case SpvOpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; + case SpvOpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; + case SpvOpBitReverse: *hasResult = true; *hasResultType = true; break; + case SpvOpBitCount: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdx: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdy: *hasResult = true; *hasResultType = true; break; + case SpvOpFwidth: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdxFine: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdyFine: *hasResult = true; *hasResultType = true; break; + case SpvOpFwidthFine: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdxCoarse: *hasResult = true; *hasResultType = true; break; + case SpvOpDPdyCoarse: *hasResult = true; *hasResultType = true; break; + case SpvOpFwidthCoarse: *hasResult = true; *hasResultType = true; break; + case SpvOpEmitVertex: *hasResult = false; *hasResultType = false; break; + case SpvOpEndPrimitive: *hasResult = false; *hasResultType = false; break; + case SpvOpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; + case SpvOpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; + case SpvOpControlBarrier: *hasResult = false; *hasResultType = false; break; + case SpvOpMemoryBarrier: *hasResult = false; *hasResultType = false; break; + case SpvOpAtomicLoad: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicStore: *hasResult = false; *hasResultType = false; break; + case SpvOpAtomicExchange: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicIAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicISub: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicSMin: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicUMin: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicSMax: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicUMax: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicOr: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicXor: *hasResult = true; *hasResultType = true; break; + case SpvOpPhi: *hasResult = true; *hasResultType = true; break; + case SpvOpLoopMerge: *hasResult = false; *hasResultType = false; break; + case SpvOpSelectionMerge: *hasResult = false; *hasResultType = false; break; + case SpvOpLabel: *hasResult = true; *hasResultType = false; break; + case SpvOpBranch: *hasResult = false; *hasResultType = false; break; + case SpvOpBranchConditional: *hasResult = false; *hasResultType = false; break; + case SpvOpSwitch: *hasResult = false; *hasResultType = false; break; + case SpvOpKill: *hasResult = false; *hasResultType = false; break; + case SpvOpReturn: *hasResult = false; *hasResultType = false; break; + case SpvOpReturnValue: *hasResult = false; *hasResultType = false; break; + case SpvOpUnreachable: *hasResult = false; *hasResultType = false; break; + case SpvOpLifetimeStart: *hasResult = false; *hasResultType = false; break; + case SpvOpLifetimeStop: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupAll: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupAny: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupBroadcast: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupIAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupUMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupSMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupUMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupSMax: *hasResult = true; *hasResultType = true; break; + case SpvOpReadPipe: *hasResult = true; *hasResultType = true; break; + case SpvOpWritePipe: *hasResult = true; *hasResultType = true; break; + case SpvOpReservedReadPipe: *hasResult = true; *hasResultType = true; break; + case SpvOpReservedWritePipe: *hasResult = true; *hasResultType = true; break; + case SpvOpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case SpvOpCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case SpvOpIsValidReserveId: *hasResult = true; *hasResultType = true; break; + case SpvOpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case SpvOpEnqueueMarker: *hasResult = true; *hasResultType = true; break; + case SpvOpEnqueueKernel: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; + case SpvOpRetainEvent: *hasResult = false; *hasResultType = false; break; + case SpvOpReleaseEvent: *hasResult = false; *hasResultType = false; break; + case SpvOpCreateUserEvent: *hasResult = true; *hasResultType = true; break; + case SpvOpIsValidEvent: *hasResult = true; *hasResultType = true; break; + case SpvOpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; + case SpvOpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; + case SpvOpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; + case SpvOpBuildNDRange: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseFetch: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseGather: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; + case SpvOpNoLine: *hasResult = false; *hasResultType = false; break; + case SpvOpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; + case SpvOpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; + case SpvOpImageSparseRead: *hasResult = true; *hasResultType = true; break; + case SpvOpSizeOf: *hasResult = true; *hasResultType = true; break; + case SpvOpTypePipeStorage: *hasResult = true; *hasResultType = false; break; + case SpvOpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; + case SpvOpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; + case SpvOpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; + case SpvOpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; + case SpvOpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; + case SpvOpModuleProcessed: *hasResult = false; *hasResultType = false; break; + case SpvOpExecutionModeId: *hasResult = false; *hasResultType = false; break; + case SpvOpDecorateId: *hasResult = false; *hasResultType = false; break; + case SpvOpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; + case SpvOpCopyLogical: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrNotEqual: *hasResult = true; *hasResultType = true; break; + case SpvOpPtrDiff: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; + case SpvOpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; + case SpvOpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; + case SpvOpReportIntersectionNV: *hasResult = true; *hasResultType = true; break; + case SpvOpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTerminateRayNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTraceNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; + case SpvOpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; + case SpvOpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; + case SpvOpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; + case SpvOpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case SpvOpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; + case SpvOpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case SpvOpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case SpvOpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break; + case SpvOpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case SpvOpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpIAverageINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUAverageINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpISubSatINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpDecorateString: *hasResult = false; *hasResultType = false; break; + case SpvOpMemberDecorateString: *hasResult = false; *hasResultType = false; break; + case SpvOpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; + case SpvOpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case SpvOpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; + } +} +#endif /* SPV_ENABLE_UTILITY_CODE */ + #endif diff --git a/3rdparty/spirv-cross/spirv.hpp b/3rdparty/spirv-cross/spirv.hpp index adc13de3f..50cc20da3 100644 --- a/3rdparty/spirv-cross/spirv.hpp +++ b/3rdparty/spirv-cross/spirv.hpp @@ -49,12 +49,12 @@ namespace spv { typedef unsigned int Id; -#define SPV_VERSION 0x10300 -#define SPV_REVISION 6 +#define SPV_VERSION 0x10400 +#define SPV_REVISION 1 static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010300; -static const unsigned int Revision = 6; +static const unsigned int Version = 0x00010400; +static const unsigned int Revision = 1; static const unsigned int OpCodeMask = 0xffff; static const unsigned int WordCountShift = 16; @@ -154,6 +154,12 @@ enum ExecutionMode { ExecutionModeDerivativeGroupQuadsNV = 5289, ExecutionModeDerivativeGroupLinearNV = 5290, ExecutionModeOutputTrianglesNV = 5298, + ExecutionModePixelInterlockOrderedEXT = 5366, + ExecutionModePixelInterlockUnorderedEXT = 5367, + ExecutionModeSampleInterlockOrderedEXT = 5368, + ExecutionModeSampleInterlockUnorderedEXT = 5369, + ExecutionModeShadingRateInterlockOrderedEXT = 5370, + ExecutionModeShadingRateInterlockUnorderedEXT = 5371, ExecutionModeMax = 0x7fffffff, }; @@ -309,6 +315,8 @@ enum ImageOperandsShift { ImageOperandsMakeTexelVisibleKHRShift = 9, ImageOperandsNonPrivateTexelKHRShift = 10, ImageOperandsVolatileTexelKHRShift = 11, + ImageOperandsSignExtendShift = 12, + ImageOperandsZeroExtendShift = 13, ImageOperandsMax = 0x7fffffff, }; @@ -326,6 +334,8 @@ enum ImageOperandsMask { ImageOperandsMakeTexelVisibleKHRMask = 0x00000200, ImageOperandsNonPrivateTexelKHRMask = 0x00000400, ImageOperandsVolatileTexelKHRMask = 0x00000800, + ImageOperandsSignExtendMask = 0x00001000, + ImageOperandsZeroExtendMask = 0x00002000, }; enum FPFastMathModeShift { @@ -406,6 +416,7 @@ enum Decoration { DecorationNonWritable = 24, DecorationNonReadable = 25, DecorationUniform = 26, + DecorationUniformId = 27, DecorationSaturatedConversion = 28, DecorationStream = 29, DecorationLocation = 30, @@ -440,8 +451,11 @@ enum Decoration { DecorationNonUniformEXT = 5300, DecorationRestrictPointerEXT = 5355, DecorationAliasedPointerEXT = 5356, + DecorationCounterBuffer = 5634, DecorationHlslCounterBufferGOOGLE = 5634, DecorationHlslSemanticGOOGLE = 5635, + DecorationUserSemantic = 5635, + DecorationUserTypeGOOGLE = 5636, DecorationMax = 0x7fffffff, }; @@ -544,6 +558,10 @@ enum BuiltIn { BuiltInHitTNV = 5332, BuiltInHitKindNV = 5333, BuiltInIncomingRayFlagsNV = 5351, + BuiltInWarpsPerSMNV = 5374, + BuiltInSMCountNV = 5375, + BuiltInWarpIDNV = 5376, + BuiltInSMIDNV = 5377, BuiltInMax = 0x7fffffff, }; @@ -564,6 +582,11 @@ enum LoopControlShift { LoopControlDontUnrollShift = 1, LoopControlDependencyInfiniteShift = 2, LoopControlDependencyLengthShift = 3, + LoopControlMinIterationsShift = 4, + LoopControlMaxIterationsShift = 5, + LoopControlIterationMultipleShift = 6, + LoopControlPeelCountShift = 7, + LoopControlPartialCountShift = 8, LoopControlMax = 0x7fffffff, }; @@ -573,6 +596,11 @@ enum LoopControlMask { LoopControlDontUnrollMask = 0x00000002, LoopControlDependencyInfiniteMask = 0x00000004, LoopControlDependencyLengthMask = 0x00000008, + LoopControlMinIterationsMask = 0x00000010, + LoopControlMaxIterationsMask = 0x00000020, + LoopControlIterationMultipleMask = 0x00000040, + LoopControlPeelCountMask = 0x00000080, + LoopControlPartialCountMask = 0x00000100, }; enum FunctionControlShift { @@ -605,6 +633,7 @@ enum MemorySemanticsShift { MemorySemanticsOutputMemoryKHRShift = 12, MemorySemanticsMakeAvailableKHRShift = 13, MemorySemanticsMakeVisibleKHRShift = 14, + MemorySemanticsVolatileShift = 15, MemorySemanticsMax = 0x7fffffff, }; @@ -623,6 +652,7 @@ enum MemorySemanticsMask { MemorySemanticsOutputMemoryKHRMask = 0x00001000, MemorySemanticsMakeAvailableKHRMask = 0x00002000, MemorySemanticsMakeVisibleKHRMask = 0x00004000, + MemorySemanticsVolatileMask = 0x00008000, }; enum MemoryAccessShift { @@ -811,10 +841,20 @@ enum Capability { CapabilityVulkanMemoryModelDeviceScopeKHR = 5346, CapabilityPhysicalStorageBufferAddressesEXT = 5347, CapabilityComputeDerivativeGroupLinearNV = 5350, + CapabilityCooperativeMatrixNV = 5357, + CapabilityFragmentShaderSampleInterlockEXT = 5363, + CapabilityFragmentShaderShadingRateInterlockEXT = 5372, + CapabilityShaderSMBuiltinsNV = 5373, + CapabilityFragmentShaderPixelInterlockEXT = 5378, + CapabilityDemoteToHelperInvocationEXT = 5379, CapabilitySubgroupShuffleINTEL = 5568, CapabilitySubgroupBufferBlockIOINTEL = 5569, CapabilitySubgroupImageBlockIOINTEL = 5570, CapabilitySubgroupImageMediaBlockIOINTEL = 5579, + CapabilityIntegerFunctions2INTEL = 5584, + CapabilitySubgroupAvcMotionEstimationINTEL = 5696, + CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697, + CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698, CapabilityMax = 0x7fffffff, }; @@ -1159,6 +1199,10 @@ enum Op { OpGroupNonUniformLogicalXor = 364, OpGroupNonUniformQuadBroadcast = 365, OpGroupNonUniformQuadSwap = 366, + OpCopyLogical = 400, + OpPtrEqual = 401, + OpPtrNotEqual = 402, + OpPtrDiff = 403, OpSubgroupBallotKHR = 4421, OpSubgroupFirstInvocationKHR = 4422, OpSubgroupAllKHR = 4428, @@ -1184,6 +1228,15 @@ enum Op { OpTraceNV = 5337, OpTypeAccelerationStructureNV = 5341, OpExecuteCallableNV = 5344, + OpTypeCooperativeMatrixNV = 5358, + OpCooperativeMatrixLoadNV = 5359, + OpCooperativeMatrixStoreNV = 5360, + OpCooperativeMatrixMulAddNV = 5361, + OpCooperativeMatrixLengthNV = 5362, + OpBeginInvocationInterlockEXT = 5364, + OpEndInvocationInterlockEXT = 5365, + OpDemoteToHelperInvocationEXT = 5380, + OpIsHelperInvocationEXT = 5381, OpSubgroupShuffleINTEL = 5571, OpSubgroupShuffleDownINTEL = 5572, OpSubgroupShuffleUpINTEL = 5573, @@ -1194,11 +1247,676 @@ enum Op { OpSubgroupImageBlockWriteINTEL = 5578, OpSubgroupImageMediaBlockReadINTEL = 5580, OpSubgroupImageMediaBlockWriteINTEL = 5581, + OpUCountLeadingZerosINTEL = 5585, + OpUCountTrailingZerosINTEL = 5586, + OpAbsISubINTEL = 5587, + OpAbsUSubINTEL = 5588, + OpIAddSatINTEL = 5589, + OpUAddSatINTEL = 5590, + OpIAverageINTEL = 5591, + OpUAverageINTEL = 5592, + OpIAverageRoundedINTEL = 5593, + OpUAverageRoundedINTEL = 5594, + OpISubSatINTEL = 5595, + OpUSubSatINTEL = 5596, + OpIMul32x16INTEL = 5597, + OpUMul32x16INTEL = 5598, + OpDecorateString = 5632, OpDecorateStringGOOGLE = 5632, + OpMemberDecorateString = 5633, OpMemberDecorateStringGOOGLE = 5633, + OpVmeImageINTEL = 5699, + OpTypeVmeImageINTEL = 5700, + OpTypeAvcImePayloadINTEL = 5701, + OpTypeAvcRefPayloadINTEL = 5702, + OpTypeAvcSicPayloadINTEL = 5703, + OpTypeAvcMcePayloadINTEL = 5704, + OpTypeAvcMceResultINTEL = 5705, + OpTypeAvcImeResultINTEL = 5706, + OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707, + OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708, + OpTypeAvcImeSingleReferenceStreaminINTEL = 5709, + OpTypeAvcImeDualReferenceStreaminINTEL = 5710, + OpTypeAvcRefResultINTEL = 5711, + OpTypeAvcSicResultINTEL = 5712, + OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713, + OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714, + OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715, + OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716, + OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717, + OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718, + OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719, + OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720, + OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721, + OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722, + OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723, + OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724, + OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725, + OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726, + OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727, + OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728, + OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729, + OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730, + OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731, + OpSubgroupAvcMceConvertToImePayloadINTEL = 5732, + OpSubgroupAvcMceConvertToImeResultINTEL = 5733, + OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734, + OpSubgroupAvcMceConvertToRefResultINTEL = 5735, + OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736, + OpSubgroupAvcMceConvertToSicResultINTEL = 5737, + OpSubgroupAvcMceGetMotionVectorsINTEL = 5738, + OpSubgroupAvcMceGetInterDistortionsINTEL = 5739, + OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740, + OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741, + OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742, + OpSubgroupAvcMceGetInterDirectionsINTEL = 5743, + OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744, + OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745, + OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746, + OpSubgroupAvcImeInitializeINTEL = 5747, + OpSubgroupAvcImeSetSingleReferenceINTEL = 5748, + OpSubgroupAvcImeSetDualReferenceINTEL = 5749, + OpSubgroupAvcImeRefWindowSizeINTEL = 5750, + OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751, + OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752, + OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753, + OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754, + OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755, + OpSubgroupAvcImeSetWeightedSadINTEL = 5756, + OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757, + OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761, + OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762, + OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763, + OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764, + OpSubgroupAvcImeConvertToMceResultINTEL = 5765, + OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766, + OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767, + OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768, + OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771, + OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774, + OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775, + OpSubgroupAvcImeGetBorderReachedINTEL = 5776, + OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777, + OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778, + OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779, + OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780, + OpSubgroupAvcFmeInitializeINTEL = 5781, + OpSubgroupAvcBmeInitializeINTEL = 5782, + OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783, + OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784, + OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785, + OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786, + OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787, + OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788, + OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789, + OpSubgroupAvcRefConvertToMceResultINTEL = 5790, + OpSubgroupAvcSicInitializeINTEL = 5791, + OpSubgroupAvcSicConfigureSkcINTEL = 5792, + OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793, + OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794, + OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795, + OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796, + OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797, + OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798, + OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799, + OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800, + OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801, + OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802, + OpSubgroupAvcSicEvaluateIpeINTEL = 5803, + OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804, + OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805, + OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806, + OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807, + OpSubgroupAvcSicConvertToMceResultINTEL = 5808, + OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809, + OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810, + OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811, + OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812, + OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813, + OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, + OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, + OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, OpMax = 0x7fffffff, }; +#ifdef SPV_ENABLE_UTILITY_CODE +inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { + *hasResult = *hasResultType = false; + switch (opcode) { + default: /* unknown opcode */ break; + case OpNop: *hasResult = false; *hasResultType = false; break; + case OpUndef: *hasResult = true; *hasResultType = true; break; + case OpSourceContinued: *hasResult = false; *hasResultType = false; break; + case OpSource: *hasResult = false; *hasResultType = false; break; + case OpSourceExtension: *hasResult = false; *hasResultType = false; break; + case OpName: *hasResult = false; *hasResultType = false; break; + case OpMemberName: *hasResult = false; *hasResultType = false; break; + case OpString: *hasResult = true; *hasResultType = false; break; + case OpLine: *hasResult = false; *hasResultType = false; break; + case OpExtension: *hasResult = false; *hasResultType = false; break; + case OpExtInstImport: *hasResult = true; *hasResultType = false; break; + case OpExtInst: *hasResult = true; *hasResultType = true; break; + case OpMemoryModel: *hasResult = false; *hasResultType = false; break; + case OpEntryPoint: *hasResult = false; *hasResultType = false; break; + case OpExecutionMode: *hasResult = false; *hasResultType = false; break; + case OpCapability: *hasResult = false; *hasResultType = false; break; + case OpTypeVoid: *hasResult = true; *hasResultType = false; break; + case OpTypeBool: *hasResult = true; *hasResultType = false; break; + case OpTypeInt: *hasResult = true; *hasResultType = false; break; + case OpTypeFloat: *hasResult = true; *hasResultType = false; break; + case OpTypeVector: *hasResult = true; *hasResultType = false; break; + case OpTypeMatrix: *hasResult = true; *hasResultType = false; break; + case OpTypeImage: *hasResult = true; *hasResultType = false; break; + case OpTypeSampler: *hasResult = true; *hasResultType = false; break; + case OpTypeSampledImage: *hasResult = true; *hasResultType = false; break; + case OpTypeArray: *hasResult = true; *hasResultType = false; break; + case OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break; + case OpTypeStruct: *hasResult = true; *hasResultType = false; break; + case OpTypeOpaque: *hasResult = true; *hasResultType = false; break; + case OpTypePointer: *hasResult = true; *hasResultType = false; break; + case OpTypeFunction: *hasResult = true; *hasResultType = false; break; + case OpTypeEvent: *hasResult = true; *hasResultType = false; break; + case OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break; + case OpTypeReserveId: *hasResult = true; *hasResultType = false; break; + case OpTypeQueue: *hasResult = true; *hasResultType = false; break; + case OpTypePipe: *hasResult = true; *hasResultType = false; break; + case OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break; + case OpConstantTrue: *hasResult = true; *hasResultType = true; break; + case OpConstantFalse: *hasResult = true; *hasResultType = true; break; + case OpConstant: *hasResult = true; *hasResultType = true; break; + case OpConstantComposite: *hasResult = true; *hasResultType = true; break; + case OpConstantSampler: *hasResult = true; *hasResultType = true; break; + case OpConstantNull: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break; + case OpSpecConstant: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break; + case OpSpecConstantOp: *hasResult = true; *hasResultType = true; break; + case OpFunction: *hasResult = true; *hasResultType = true; break; + case OpFunctionParameter: *hasResult = true; *hasResultType = true; break; + case OpFunctionEnd: *hasResult = false; *hasResultType = false; break; + case OpFunctionCall: *hasResult = true; *hasResultType = true; break; + case OpVariable: *hasResult = true; *hasResultType = true; break; + case OpImageTexelPointer: *hasResult = true; *hasResultType = true; break; + case OpLoad: *hasResult = true; *hasResultType = true; break; + case OpStore: *hasResult = false; *hasResultType = false; break; + case OpCopyMemory: *hasResult = false; *hasResultType = false; break; + case OpCopyMemorySized: *hasResult = false; *hasResultType = false; break; + case OpAccessChain: *hasResult = true; *hasResultType = true; break; + case OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break; + case OpPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case OpArrayLength: *hasResult = true; *hasResultType = true; break; + case OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break; + case OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break; + case OpDecorate: *hasResult = false; *hasResultType = false; break; + case OpMemberDecorate: *hasResult = false; *hasResultType = false; break; + case OpDecorationGroup: *hasResult = true; *hasResultType = false; break; + case OpGroupDecorate: *hasResult = false; *hasResultType = false; break; + case OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break; + case OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break; + case OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break; + case OpVectorShuffle: *hasResult = true; *hasResultType = true; break; + case OpCompositeConstruct: *hasResult = true; *hasResultType = true; break; + case OpCompositeExtract: *hasResult = true; *hasResultType = true; break; + case OpCompositeInsert: *hasResult = true; *hasResultType = true; break; + case OpCopyObject: *hasResult = true; *hasResultType = true; break; + case OpTranspose: *hasResult = true; *hasResultType = true; break; + case OpSampledImage: *hasResult = true; *hasResultType = true; break; + case OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageFetch: *hasResult = true; *hasResultType = true; break; + case OpImageGather: *hasResult = true; *hasResultType = true; break; + case OpImageDrefGather: *hasResult = true; *hasResultType = true; break; + case OpImageRead: *hasResult = true; *hasResultType = true; break; + case OpImageWrite: *hasResult = false; *hasResultType = false; break; + case OpImage: *hasResult = true; *hasResultType = true; break; + case OpImageQueryFormat: *hasResult = true; *hasResultType = true; break; + case OpImageQueryOrder: *hasResult = true; *hasResultType = true; break; + case OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break; + case OpImageQuerySize: *hasResult = true; *hasResultType = true; break; + case OpImageQueryLod: *hasResult = true; *hasResultType = true; break; + case OpImageQueryLevels: *hasResult = true; *hasResultType = true; break; + case OpImageQuerySamples: *hasResult = true; *hasResultType = true; break; + case OpConvertFToU: *hasResult = true; *hasResultType = true; break; + case OpConvertFToS: *hasResult = true; *hasResultType = true; break; + case OpConvertSToF: *hasResult = true; *hasResultType = true; break; + case OpConvertUToF: *hasResult = true; *hasResultType = true; break; + case OpUConvert: *hasResult = true; *hasResultType = true; break; + case OpSConvert: *hasResult = true; *hasResultType = true; break; + case OpFConvert: *hasResult = true; *hasResultType = true; break; + case OpQuantizeToF16: *hasResult = true; *hasResultType = true; break; + case OpConvertPtrToU: *hasResult = true; *hasResultType = true; break; + case OpSatConvertSToU: *hasResult = true; *hasResultType = true; break; + case OpSatConvertUToS: *hasResult = true; *hasResultType = true; break; + case OpConvertUToPtr: *hasResult = true; *hasResultType = true; break; + case OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break; + case OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break; + case OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break; + case OpBitcast: *hasResult = true; *hasResultType = true; break; + case OpSNegate: *hasResult = true; *hasResultType = true; break; + case OpFNegate: *hasResult = true; *hasResultType = true; break; + case OpIAdd: *hasResult = true; *hasResultType = true; break; + case OpFAdd: *hasResult = true; *hasResultType = true; break; + case OpISub: *hasResult = true; *hasResultType = true; break; + case OpFSub: *hasResult = true; *hasResultType = true; break; + case OpIMul: *hasResult = true; *hasResultType = true; break; + case OpFMul: *hasResult = true; *hasResultType = true; break; + case OpUDiv: *hasResult = true; *hasResultType = true; break; + case OpSDiv: *hasResult = true; *hasResultType = true; break; + case OpFDiv: *hasResult = true; *hasResultType = true; break; + case OpUMod: *hasResult = true; *hasResultType = true; break; + case OpSRem: *hasResult = true; *hasResultType = true; break; + case OpSMod: *hasResult = true; *hasResultType = true; break; + case OpFRem: *hasResult = true; *hasResultType = true; break; + case OpFMod: *hasResult = true; *hasResultType = true; break; + case OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break; + case OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break; + case OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break; + case OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break; + case OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break; + case OpOuterProduct: *hasResult = true; *hasResultType = true; break; + case OpDot: *hasResult = true; *hasResultType = true; break; + case OpIAddCarry: *hasResult = true; *hasResultType = true; break; + case OpISubBorrow: *hasResult = true; *hasResultType = true; break; + case OpUMulExtended: *hasResult = true; *hasResultType = true; break; + case OpSMulExtended: *hasResult = true; *hasResultType = true; break; + case OpAny: *hasResult = true; *hasResultType = true; break; + case OpAll: *hasResult = true; *hasResultType = true; break; + case OpIsNan: *hasResult = true; *hasResultType = true; break; + case OpIsInf: *hasResult = true; *hasResultType = true; break; + case OpIsFinite: *hasResult = true; *hasResultType = true; break; + case OpIsNormal: *hasResult = true; *hasResultType = true; break; + case OpSignBitSet: *hasResult = true; *hasResultType = true; break; + case OpLessOrGreater: *hasResult = true; *hasResultType = true; break; + case OpOrdered: *hasResult = true; *hasResultType = true; break; + case OpUnordered: *hasResult = true; *hasResultType = true; break; + case OpLogicalEqual: *hasResult = true; *hasResultType = true; break; + case OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break; + case OpLogicalOr: *hasResult = true; *hasResultType = true; break; + case OpLogicalAnd: *hasResult = true; *hasResultType = true; break; + case OpLogicalNot: *hasResult = true; *hasResultType = true; break; + case OpSelect: *hasResult = true; *hasResultType = true; break; + case OpIEqual: *hasResult = true; *hasResultType = true; break; + case OpINotEqual: *hasResult = true; *hasResultType = true; break; + case OpUGreaterThan: *hasResult = true; *hasResultType = true; break; + case OpSGreaterThan: *hasResult = true; *hasResultType = true; break; + case OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case OpULessThan: *hasResult = true; *hasResultType = true; break; + case OpSLessThan: *hasResult = true; *hasResultType = true; break; + case OpULessThanEqual: *hasResult = true; *hasResultType = true; break; + case OpSLessThanEqual: *hasResult = true; *hasResultType = true; break; + case OpFOrdEqual: *hasResult = true; *hasResultType = true; break; + case OpFUnordEqual: *hasResult = true; *hasResultType = true; break; + case OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break; + case OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break; + case OpFOrdLessThan: *hasResult = true; *hasResultType = true; break; + case OpFUnordLessThan: *hasResult = true; *hasResultType = true; break; + case OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break; + case OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break; + case OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break; + case OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break; + case OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break; + case OpShiftRightLogical: *hasResult = true; *hasResultType = true; break; + case OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break; + case OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break; + case OpBitwiseOr: *hasResult = true; *hasResultType = true; break; + case OpBitwiseXor: *hasResult = true; *hasResultType = true; break; + case OpBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case OpNot: *hasResult = true; *hasResultType = true; break; + case OpBitFieldInsert: *hasResult = true; *hasResultType = true; break; + case OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break; + case OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break; + case OpBitReverse: *hasResult = true; *hasResultType = true; break; + case OpBitCount: *hasResult = true; *hasResultType = true; break; + case OpDPdx: *hasResult = true; *hasResultType = true; break; + case OpDPdy: *hasResult = true; *hasResultType = true; break; + case OpFwidth: *hasResult = true; *hasResultType = true; break; + case OpDPdxFine: *hasResult = true; *hasResultType = true; break; + case OpDPdyFine: *hasResult = true; *hasResultType = true; break; + case OpFwidthFine: *hasResult = true; *hasResultType = true; break; + case OpDPdxCoarse: *hasResult = true; *hasResultType = true; break; + case OpDPdyCoarse: *hasResult = true; *hasResultType = true; break; + case OpFwidthCoarse: *hasResult = true; *hasResultType = true; break; + case OpEmitVertex: *hasResult = false; *hasResultType = false; break; + case OpEndPrimitive: *hasResult = false; *hasResultType = false; break; + case OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break; + case OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break; + case OpControlBarrier: *hasResult = false; *hasResultType = false; break; + case OpMemoryBarrier: *hasResult = false; *hasResultType = false; break; + case OpAtomicLoad: *hasResult = true; *hasResultType = true; break; + case OpAtomicStore: *hasResult = false; *hasResultType = false; break; + case OpAtomicExchange: *hasResult = true; *hasResultType = true; break; + case OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break; + case OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break; + case OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break; + case OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break; + case OpAtomicIAdd: *hasResult = true; *hasResultType = true; break; + case OpAtomicISub: *hasResult = true; *hasResultType = true; break; + case OpAtomicSMin: *hasResult = true; *hasResultType = true; break; + case OpAtomicUMin: *hasResult = true; *hasResultType = true; break; + case OpAtomicSMax: *hasResult = true; *hasResultType = true; break; + case OpAtomicUMax: *hasResult = true; *hasResultType = true; break; + case OpAtomicAnd: *hasResult = true; *hasResultType = true; break; + case OpAtomicOr: *hasResult = true; *hasResultType = true; break; + case OpAtomicXor: *hasResult = true; *hasResultType = true; break; + case OpPhi: *hasResult = true; *hasResultType = true; break; + case OpLoopMerge: *hasResult = false; *hasResultType = false; break; + case OpSelectionMerge: *hasResult = false; *hasResultType = false; break; + case OpLabel: *hasResult = true; *hasResultType = false; break; + case OpBranch: *hasResult = false; *hasResultType = false; break; + case OpBranchConditional: *hasResult = false; *hasResultType = false; break; + case OpSwitch: *hasResult = false; *hasResultType = false; break; + case OpKill: *hasResult = false; *hasResultType = false; break; + case OpReturn: *hasResult = false; *hasResultType = false; break; + case OpReturnValue: *hasResult = false; *hasResultType = false; break; + case OpUnreachable: *hasResult = false; *hasResultType = false; break; + case OpLifetimeStart: *hasResult = false; *hasResultType = false; break; + case OpLifetimeStop: *hasResult = false; *hasResultType = false; break; + case OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break; + case OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break; + case OpGroupAll: *hasResult = true; *hasResultType = true; break; + case OpGroupAny: *hasResult = true; *hasResultType = true; break; + case OpGroupBroadcast: *hasResult = true; *hasResultType = true; break; + case OpGroupIAdd: *hasResult = true; *hasResultType = true; break; + case OpGroupFAdd: *hasResult = true; *hasResultType = true; break; + case OpGroupFMin: *hasResult = true; *hasResultType = true; break; + case OpGroupUMin: *hasResult = true; *hasResultType = true; break; + case OpGroupSMin: *hasResult = true; *hasResultType = true; break; + case OpGroupFMax: *hasResult = true; *hasResultType = true; break; + case OpGroupUMax: *hasResult = true; *hasResultType = true; break; + case OpGroupSMax: *hasResult = true; *hasResultType = true; break; + case OpReadPipe: *hasResult = true; *hasResultType = true; break; + case OpWritePipe: *hasResult = true; *hasResultType = true; break; + case OpReservedReadPipe: *hasResult = true; *hasResultType = true; break; + case OpReservedWritePipe: *hasResult = true; *hasResultType = true; break; + case OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case OpCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case OpCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case OpIsValidReserveId: *hasResult = true; *hasResultType = true; break; + case OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break; + case OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break; + case OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break; + case OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break; + case OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break; + case OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break; + case OpEnqueueMarker: *hasResult = true; *hasResultType = true; break; + case OpEnqueueKernel: *hasResult = true; *hasResultType = true; break; + case OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break; + case OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break; + case OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break; + case OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break; + case OpRetainEvent: *hasResult = false; *hasResultType = false; break; + case OpReleaseEvent: *hasResult = false; *hasResultType = false; break; + case OpCreateUserEvent: *hasResult = true; *hasResultType = true; break; + case OpIsValidEvent: *hasResult = true; *hasResultType = true; break; + case OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break; + case OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break; + case OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break; + case OpBuildNDRange: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break; + case OpImageSparseFetch: *hasResult = true; *hasResultType = true; break; + case OpImageSparseGather: *hasResult = true; *hasResultType = true; break; + case OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break; + case OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break; + case OpNoLine: *hasResult = false; *hasResultType = false; break; + case OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break; + case OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break; + case OpImageSparseRead: *hasResult = true; *hasResultType = true; break; + case OpSizeOf: *hasResult = true; *hasResultType = true; break; + case OpTypePipeStorage: *hasResult = true; *hasResultType = false; break; + case OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break; + case OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break; + case OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break; + case OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break; + case OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break; + case OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break; + case OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break; + case OpModuleProcessed: *hasResult = false; *hasResultType = false; break; + case OpExecutionModeId: *hasResult = false; *hasResultType = false; break; + case OpDecorateId: *hasResult = false; *hasResultType = false; break; + case OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break; + case OpCopyLogical: *hasResult = true; *hasResultType = true; break; + case OpPtrEqual: *hasResult = true; *hasResultType = true; break; + case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break; + case OpPtrDiff: *hasResult = true; *hasResultType = true; break; + case OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break; + case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break; + case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break; + case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break; + case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break; + case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break; + case OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break; + case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; + case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; + case OpTraceNV: *hasResult = false; *hasResultType = false; break; + case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; + case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; + case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; + case OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; + case OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break; + case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break; + case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break; + case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break; + case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break; + case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break; + case OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break; + case OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break; + case OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break; + case OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break; + case OpIAverageINTEL: *hasResult = true; *hasResultType = true; break; + case OpUAverageINTEL: *hasResult = true; *hasResultType = true; break; + case OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break; + case OpISubSatINTEL: *hasResult = true; *hasResultType = true; break; + case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; + case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; + case OpDecorateString: *hasResult = false; *hasResultType = false; break; + case OpMemberDecorateString: *hasResult = false; *hasResultType = false; break; + case OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break; + case OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break; + case OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break; + case OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; + case OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; + } +} +#endif /* SPV_ENABLE_UTILITY_CODE */ + // Overload operator| for mask bit combining inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); } diff --git a/3rdparty/spirv-cross/spirv_cross_c.cpp b/3rdparty/spirv-cross/spirv_cross_c.cpp index 8048274f0..7add2685e 100644 --- a/3rdparty/spirv-cross/spirv_cross_c.cpp +++ b/3rdparty/spirv-cross/spirv_cross_c.cpp @@ -845,7 +845,7 @@ spvc_result spvc_compiler_msl_add_vertex_attribute(spvc_compiler compiler, const attr.msl_stride = va->msl_stride; attr.format = static_cast(va->format); attr.builtin = static_cast(va->builtin); - attr.per_instance = va->per_instance; + attr.per_instance = va->per_instance != 0; msl.add_msl_vertex_attribute(attr); return SPVC_SUCCESS; #else @@ -949,12 +949,12 @@ static void spvc_convert_msl_sampler(MSLConstexprSampler &samp, const spvc_msl_c samp.r_address = static_cast(sampler->r_address); samp.lod_clamp_min = sampler->lod_clamp_min; samp.lod_clamp_max = sampler->lod_clamp_max; - samp.lod_clamp_enable = sampler->lod_clamp_enable; + samp.lod_clamp_enable = sampler->lod_clamp_enable != 0; samp.min_filter = static_cast(sampler->min_filter); samp.mag_filter = static_cast(sampler->mag_filter); samp.mip_filter = static_cast(sampler->mip_filter); - samp.compare_enable = sampler->compare_enable; - samp.anisotropy_enable = sampler->anisotropy_enable; + samp.compare_enable = sampler->compare_enable != 0; + samp.anisotropy_enable = sampler->anisotropy_enable != 0; samp.max_anisotropy = sampler->max_anisotropy; samp.compare_func = static_cast(sampler->compare_func); samp.coord = static_cast(sampler->coord); diff --git a/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/spirv-cross/spirv_glsl.cpp index 837135cb8..526dffcf8 100644 --- a/3rdparty/spirv-cross/spirv_glsl.cpp +++ b/3rdparty/spirv-cross/spirv_glsl.cpp @@ -600,6 +600,10 @@ void CompilerGLSL::emit_header() require_extension_internal("GL_ARB_shader_image_load_store"); } + // Needed for: layout(post_depth_coverage) in; + if (execution.flags.get(ExecutionModePostDepthCoverage)) + require_extension_internal("GL_ARB_post_depth_coverage"); + for (auto &ext : forced_extensions) { if (ext == "GL_EXT_shader_explicit_arithmetic_types_float16") @@ -763,6 +767,8 @@ void CompilerGLSL::emit_header() if (execution.flags.get(ExecutionModeEarlyFragmentTests)) inputs.push_back("early_fragment_tests"); + if (execution.flags.get(ExecutionModePostDepthCoverage)) + inputs.push_back("post_depth_coverage"); if (!options.es && execution.flags.get(ExecutionModeDepthGreater)) statement("layout(depth_greater) out float gl_FragDepth;"); @@ -4493,7 +4499,7 @@ void CompilerGLSL::emit_mix_op(uint32_t result_type, uint32_t id, uint32_t left, } string mix_op; - bool has_boolean_mix = backend.boolean_mix_support && + bool has_boolean_mix = *backend.boolean_mix_function && ((options.es && options.version >= 310) || (!options.es && options.version >= 450)); bool trivial_mix = to_trivial_mix_op(restype, mix_op, left, right, lerp); @@ -4523,6 +4529,8 @@ void CompilerGLSL::emit_mix_op(uint32_t result_type, uint32_t id, uint32_t left, inherit_expression_dependencies(id, right); inherit_expression_dependencies(id, lerp); } + else if (lerptype.basetype == SPIRType::Boolean) + emit_trinary_func_op(result_type, id, left, right, lerp, backend.boolean_mix_function); else emit_trinary_func_op(result_type, id, left, right, lerp, "mix"); } @@ -5437,7 +5445,8 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, // Bit-fiddling case GLSLstd450FindILsb: - emit_unary_func_op(result_type, id, args[0], "findLSB"); + // findLSB always returns int. + emit_unary_func_op_cast(result_type, id, args[0], "findLSB", expression_type(args[0]).basetype, int_type); break; case GLSLstd450FindSMsb: @@ -6281,6 +6290,12 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) SPIRV_CROSS_THROW("Stencil export not supported in GLES."); } + case BuiltInDeviceIndex: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for device group support."); + require_extension_internal("GL_EXT_device_group"); + return "gl_DeviceIndex"; + default: return join("gl_BuiltIn_", convert_to_string(builtin)); } @@ -9763,6 +9778,20 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) case OpNoLine: break; + case OpDemoteToHelperInvocationEXT: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("GL_EXT_demote_to_helper_invocation is only supported in Vulkan GLSL."); + require_extension_internal("GL_EXT_demote_to_helper_invocation"); + statement(backend.demote_literal, ";"); + break; + + case OpIsHelperInvocationEXT: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("GL_EXT_demote_to_helper_invocation is only supported in Vulkan GLSL."); + require_extension_internal("GL_EXT_demote_to_helper_invocation"); + emit_op(ops[0], ops[1], "helperInvocationEXT()", false); + break; + default: statement("// unimplemented op ", instruction.op); break; diff --git a/3rdparty/spirv-cross/spirv_glsl.hpp b/3rdparty/spirv-cross/spirv_glsl.hpp index e1eb39bf7..c66499870 100644 --- a/3rdparty/spirv-cross/spirv_glsl.hpp +++ b/3rdparty/spirv-cross/spirv_glsl.hpp @@ -369,6 +369,7 @@ protected: struct BackendVariations { std::string discard_literal = "discard"; + std::string demote_literal = "demote"; std::string null_pointer_literal = ""; bool float_literal_suffix = false; bool double_literal_suffix = true; @@ -383,6 +384,7 @@ protected: const char *int16_t_literal_suffix = "s"; const char *uint16_t_literal_suffix = "us"; const char *nonuniform_qualifier = "nonuniformEXT"; + const char *boolean_mix_function = "mix"; bool swizzle_is_function = false; bool shared_is_implied = false; bool unsized_array_supported = true; @@ -393,7 +395,6 @@ protected: bool can_declare_arrays_inline = true; bool native_row_major_matrix = true; bool use_constructor_splatting = true; - bool boolean_mix_support = true; bool allow_precision_qualifiers = false; bool can_swizzle_scalar = false; bool force_gl_in_out_block = false; diff --git a/3rdparty/spirv-cross/spirv_hlsl.cpp b/3rdparty/spirv-cross/spirv_hlsl.cpp index 57bbef8b8..b1bc5b139 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.cpp +++ b/3rdparty/spirv-cross/spirv_hlsl.cpp @@ -1772,6 +1772,16 @@ void CompilerHLSL::emit_resources() end_scope(); statement(""); } + + if (requires_scalar_faceforward) + { + // FP16/FP64? No templates in HLSL. + statement("float SPIRV_Cross_FaceForward(float n, float i, float nref)"); + begin_scope(); + statement("return i * nref < 0.0 ? n : -n;"); + end_scope(); + statement(""); + } } string CompilerHLSL::layout_for_member(const SPIRType &type, uint32_t index) @@ -3237,8 +3247,11 @@ void CompilerHLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, SPIRV_CROSS_THROW("packDouble2x32/unpackDouble2x32 not supported in HLSL."); case GLSLstd450FindILsb: - emit_unary_func_op(result_type, id, args[0], "firstbitlow"); + { + auto basetype = expression_type(args[0]).basetype; + emit_unary_func_op_cast(result_type, id, args[0], "firstbitlow", basetype, basetype); break; + } case GLSLstd450FindSMsb: emit_unary_func_op_cast(result_type, id, args[0], "firstbithigh", int_type, int_type); @@ -3318,6 +3331,20 @@ void CompilerHLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); break; + case GLSLstd450FaceForward: + if (get(result_type).vecsize == 1) + { + if (!requires_scalar_faceforward) + { + requires_scalar_faceforward = true; + force_recompile(); + } + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "SPIRV_Cross_FaceForward"); + } + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + default: CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); break; @@ -4636,6 +4663,9 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) break; } + case OpIsHelperInvocationEXT: + SPIRV_CROSS_THROW("helperInvocationEXT() is not supported in HLSL."); + default: CompilerGLSL::emit_instruction(instruction); break; @@ -4792,13 +4822,14 @@ string CompilerHLSL::compile() backend.uint16_t_literal_suffix = "u"; backend.basic_int_type = "int"; backend.basic_uint_type = "uint"; + backend.demote_literal = "discard"; + backend.boolean_mix_function = ""; backend.swizzle_is_function = false; backend.shared_is_implied = true; backend.unsized_array_supported = true; backend.explicit_struct_type = false; backend.use_initializer_list = true; backend.use_constructor_splatting = false; - backend.boolean_mix_support = false; backend.can_swizzle_scalar = true; backend.can_declare_struct_inline = false; backend.can_declare_arrays_inline = false; diff --git a/3rdparty/spirv-cross/spirv_hlsl.hpp b/3rdparty/spirv-cross/spirv_hlsl.hpp index 796f502c5..6f1014145 100644 --- a/3rdparty/spirv-cross/spirv_hlsl.hpp +++ b/3rdparty/spirv-cross/spirv_hlsl.hpp @@ -183,6 +183,7 @@ private: bool requires_inverse_4x4 = false; bool requires_scalar_reflect = false; bool requires_scalar_refract = false; + bool requires_scalar_faceforward = false; uint64_t required_textureSizeVariants = 0; void require_texture_query_variant(const SPIRType &type); diff --git a/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/spirv-cross/spirv_msl.cpp index eaee10a04..d23c1ae5f 100644 --- a/3rdparty/spirv-cross/spirv_msl.cpp +++ b/3rdparty/spirv-cross/spirv_msl.cpp @@ -105,7 +105,7 @@ void CompilerMSL::build_implicit_builtins() active_input_builtins.get(BuiltInSubgroupLtMask); bool need_subgroup_ge_mask = !msl_options.is_ios() && (active_input_builtins.get(BuiltInSubgroupGeMask) || active_input_builtins.get(BuiltInSubgroupGtMask)); - bool need_multiview = get_execution_model() == ExecutionModelVertex && + bool need_multiview = get_execution_model() == ExecutionModelVertex && !msl_options.view_index_from_device_index && (msl_options.multiview || active_input_builtins.get(BuiltInViewIndex)); if (need_subpass_input || need_sample_pos || need_subgroup_mask || need_vertex_params || need_tesc_params || need_multiview || needs_subgroup_invocation_id) @@ -316,27 +316,6 @@ void CompilerMSL::build_implicit_builtins() set_decoration(var_id, DecorationBuiltIn, BuiltInInstanceIndex); builtin_instance_idx_id = var_id; mark_implicit_builtin(StorageClassInput, BuiltInInstanceIndex, var_id); - - if (need_multiview) - { - // Multiview shaders are not allowed to write to gl_Layer, ostensibly because - // it is implicitly written from gl_ViewIndex, but we have to do that explicitly. - // Note that we can't just abuse gl_ViewIndex for this purpose: it's an input, but - // gl_Layer is an output in vertex-pipeline shaders. - uint32_t type_ptr_out_id = ir.increase_bound_by(2); - SPIRType uint_type_ptr_out; - uint_type_ptr_out = uint_type; - uint_type_ptr_out.pointer = true; - uint_type_ptr_out.parent_type = type_id; - uint_type_ptr_out.storage = StorageClassOutput; - auto &ptr_out_type = set(type_ptr_out_id, uint_type_ptr_out); - ptr_out_type.self = type_id; - var_id = type_ptr_out_id + 1; - set(var_id, type_ptr_out_id, StorageClassOutput); - set_decoration(var_id, DecorationBuiltIn, BuiltInLayer); - builtin_layer_id = var_id; - mark_implicit_builtin(StorageClassOutput, BuiltInLayer, var_id); - } } if (need_vertex_params && !has_base_instance) @@ -350,6 +329,27 @@ void CompilerMSL::build_implicit_builtins() mark_implicit_builtin(StorageClassInput, BuiltInBaseInstance, var_id); } + if (need_multiview) + { + // Multiview shaders are not allowed to write to gl_Layer, ostensibly because + // it is implicitly written from gl_ViewIndex, but we have to do that explicitly. + // Note that we can't just abuse gl_ViewIndex for this purpose: it's an input, but + // gl_Layer is an output in vertex-pipeline shaders. + uint32_t type_ptr_out_id = ir.increase_bound_by(2); + SPIRType uint_type_ptr_out; + uint_type_ptr_out = uint_type; + uint_type_ptr_out.pointer = true; + uint_type_ptr_out.parent_type = type_id; + uint_type_ptr_out.storage = StorageClassOutput; + auto &ptr_out_type = set(type_ptr_out_id, uint_type_ptr_out); + ptr_out_type.self = type_id; + uint32_t var_id = type_ptr_out_id + 1; + set(var_id, type_ptr_out_id, StorageClassOutput); + set_decoration(var_id, DecorationBuiltIn, BuiltInLayer); + builtin_layer_id = var_id; + mark_implicit_builtin(StorageClassOutput, BuiltInLayer, var_id); + } + if (need_multiview && !has_view_idx) { uint32_t var_id = ir.increase_bound_by(1); @@ -728,7 +728,7 @@ void CompilerMSL::emit_entry_point_declarations() const auto &var = get(array_id); const auto &type = get_variable_data_type(var); string name = to_name(array_id); - statement(get_argument_address_space(var) + " " + type_to_glsl(type) + "* " + name + "[] ="); + statement(get_argument_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(array_id), name, "[] ="); begin_scope(); for (uint32_t i = 0; i < type.array[0]; ++i) statement(name + "_" + convert_to_string(i) + ","); @@ -757,6 +757,8 @@ string CompilerMSL::compile() backend.basic_int16_type = "short"; backend.basic_uint16_type = "ushort"; backend.discard_literal = "discard_fragment()"; + backend.demote_literal = "unsupported-demote"; + backend.boolean_mix_function = "select"; backend.swizzle_is_function = false; backend.shared_is_implied = false; backend.use_initializer_list = true; @@ -765,7 +767,6 @@ string CompilerMSL::compile() backend.unsized_array_supported = false; backend.can_declare_arrays_inline = false; backend.can_return_array = false; - backend.boolean_mix_support = false; backend.allow_truncated_access_chain = true; backend.array_is_value_type = false; backend.comparison_image_samples_scalar = true; @@ -2629,7 +2630,8 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp if (transpose) { lhs_e->need_transpose = false; - if (rhs_e) rhs_e->need_transpose = !rhs_e->need_transpose; + if (rhs_e) + rhs_e->need_transpose = !rhs_e->need_transpose; lhs = to_dereferenced_expression(lhs_expression); rhs = to_pointer_expression(rhs_expression); } @@ -2638,7 +2640,8 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp if (transpose) { lhs_e->need_transpose = true; - if (rhs_e) rhs_e->need_transpose = !rhs_e->need_transpose; + if (rhs_e) + rhs_e->need_transpose = !rhs_e->need_transpose; } } else if (is_array(type) && stride == 4 * type.width / 8) @@ -2787,7 +2790,7 @@ void CompilerMSL::emit_custom_functions() case SPVFuncImplFindILsb: statement("// Implementation of the GLSL findLSB() function"); statement("template"); - statement("T findLSB(T x)"); + statement("T spvFindLSB(T x)"); begin_scope(); statement("return select(ctz(x), T(-1), x == T(0));"); end_scope(); @@ -2797,7 +2800,7 @@ void CompilerMSL::emit_custom_functions() case SPVFuncImplFindUMsb: statement("// Implementation of the unsigned GLSL findMSB() function"); statement("template"); - statement("T findUMSB(T x)"); + statement("T spvFindUMSB(T x)"); begin_scope(); statement("return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0));"); end_scope(); @@ -2807,7 +2810,7 @@ void CompilerMSL::emit_custom_functions() case SPVFuncImplFindSMsb: statement("// Implementation of the signed GLSL findMSB() function"); statement("template"); - statement("T findSMSB(T x)"); + statement("T spvFindSMSB(T x)"); begin_scope(); statement("T v = select(x, T(-1) - x, x < T(0));"); statement("return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0));"); @@ -3343,6 +3346,16 @@ void CompilerMSL::emit_custom_functions() statement(""); break; + case SPVFuncImplFaceForwardScalar: + // Metal does not support scalar versions of these functions. + statement("template"); + statement("inline T spvFaceForward(T n, T i, T nref)"); + begin_scope(); + statement("return i * nref < T(0) ? n : -n;"); + end_scope(); + statement(""); + break; + default: break; } @@ -4395,6 +4408,74 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) break; } + // SPV_INTEL_shader_integer_functions2 + case OpUCountLeadingZerosINTEL: + MSL_UFOP(clz); + break; + + case OpUCountTrailingZerosINTEL: + MSL_UFOP(ctz); + break; + + case OpAbsISubINTEL: + case OpAbsUSubINTEL: + MSL_BFOP(absdiff); + break; + + case OpIAddSatINTEL: + case OpUAddSatINTEL: + MSL_BFOP(addsat); + break; + + case OpIAverageINTEL: + case OpUAverageINTEL: + MSL_BFOP(hadd); + break; + + case OpIAverageRoundedINTEL: + case OpUAverageRoundedINTEL: + MSL_BFOP(rhadd); + break; + + case OpISubSatINTEL: + case OpUSubSatINTEL: + MSL_BFOP(subsat); + break; + + case OpIMul32x16INTEL: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t a = ops[2], b = ops[3]; + bool forward = should_forward(a) && should_forward(b); + emit_op(result_type, id, join("int(short(", to_expression(a), ")) * int(short(", to_expression(b), "))"), + forward); + inherit_expression_dependencies(id, a); + inherit_expression_dependencies(id, b); + break; + } + + case OpUMul32x16INTEL: + { + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + uint32_t a = ops[2], b = ops[3]; + bool forward = should_forward(a) && should_forward(b); + emit_op(result_type, id, join("uint(ushort(", to_expression(a), ")) * uint(ushort(", to_expression(b), "))"), + forward); + inherit_expression_dependencies(id, a); + inherit_expression_dependencies(id, b); + break; + } + + case OpIsHelperInvocationEXT: + if (msl_options.is_ios()) + SPIRV_CROSS_THROW("simd_is_helper_thread() is only supported on macOS."); + else if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.1 on macOS."); + emit_op(ops[0], ops[1], "simd_is_helper_thread()", false); + break; + default: CompilerGLSL::emit_instruction(instruction); break; @@ -4594,7 +4675,7 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, string exp = string(op) + "("; auto &type = get_pointee_type(expression_type(obj)); - exp += "(volatile "; + exp += "("; auto *var = maybe_get_backing_variable(obj); if (!var) SPIRV_CROSS_THROW("No backing variable for atomic operation."); @@ -4688,12 +4769,20 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, emit_unary_func_op(result_type, id, args[0], "rint"); break; + case GLSLstd450FindILsb: + { + // In this template version of findLSB, we return T. + auto basetype = expression_type(args[0]).basetype; + emit_unary_func_op_cast(result_type, id, args[0], "spvFindLSB", basetype, basetype); + break; + } + case GLSLstd450FindSMsb: - emit_unary_func_op_cast(result_type, id, args[0], "findSMSB", int_type, int_type); + emit_unary_func_op_cast(result_type, id, args[0], "spvFindSMSB", int_type, int_type); break; case GLSLstd450FindUMsb: - emit_unary_func_op_cast(result_type, id, args[0], "findUMSB", uint_type, uint_type); + emit_unary_func_op_cast(result_type, id, args[0], "spvFindUMSB", uint_type, uint_type); break; case GLSLstd450PackSnorm4x8: @@ -4868,12 +4957,53 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); break; + case GLSLstd450FaceForward: + if (get(result_type).vecsize == 1) + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "spvFaceForward"); + else + CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); + break; + default: CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count); break; } } +void CompilerMSL::emit_spv_amd_shader_trinary_minmax_op(uint32_t result_type, uint32_t id, uint32_t eop, + const uint32_t *args, uint32_t count) +{ + enum AMDShaderTrinaryMinMax + { + FMin3AMD = 1, + UMin3AMD = 2, + SMin3AMD = 3, + FMax3AMD = 4, + UMax3AMD = 5, + SMax3AMD = 6, + FMid3AMD = 7, + UMid3AMD = 8, + SMid3AMD = 9 + }; + + if (!msl_options.supports_msl_version(2, 1)) + SPIRV_CROSS_THROW("Trinary min/max functions require MSL 2.1."); + + auto op = static_cast(eop); + + switch (op) + { + case FMid3AMD: + case UMid3AMD: + case SMid3AMD: + emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "median3"); + break; + default: + CompilerGLSL::emit_spv_amd_shader_trinary_minmax_op(result_type, id, eop, args, count); + break; + } +} + // Emit a structure declaration for the specified interface variable. void CompilerMSL::emit_interface_block(uint32_t ib_var_id) { @@ -6165,8 +6295,10 @@ string CompilerMSL::func_type_decl(SPIRType &type) execution.output_vertices, ") ]] vertex"); break; case ExecutionModelFragment: - entry_type = - execution.flags.get(ExecutionModeEarlyFragmentTests) ? "[[ early_fragment_tests ]] fragment" : "fragment"; + entry_type = execution.flags.get(ExecutionModeEarlyFragmentTests) || + execution.flags.get(ExecutionModePostDepthCoverage) ? + "[[ early_fragment_tests ]] fragment" : + "fragment"; break; case ExecutionModelTessellationControl: if (!msl_options.supports_msl_version(1, 2)) @@ -6190,11 +6322,19 @@ string CompilerMSL::func_type_decl(SPIRType &type) string CompilerMSL::get_argument_address_space(const SPIRVariable &argument) { const auto &type = get(argument.basetype); + Bitset flags; + if (type.basetype == SPIRType::Struct && + (has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock))) + flags = ir.get_buffer_block_flags(argument); + else + flags = get_decoration_bitset(argument.self); + const char *addr_space = nullptr; switch (type.storage) { case StorageClassWorkgroup: - return "threadgroup"; + addr_space = "threadgroup"; + break; case StorageClassStorageBuffer: { @@ -6202,9 +6342,10 @@ string CompilerMSL::get_argument_address_space(const SPIRVariable &argument) // we should not assume any constness here. Only for global SSBOs. bool readonly = false; if (has_decoration(type.self, DecorationBlock)) - readonly = ir.get_buffer_block_flags(argument).get(DecorationNonWritable); + readonly = flags.get(DecorationNonWritable); - return readonly ? "const device" : "device"; + addr_space = readonly ? "const device" : "device"; + break; } case StorageClassUniform: @@ -6215,54 +6356,61 @@ string CompilerMSL::get_argument_address_space(const SPIRVariable &argument) bool ssbo = has_decoration(type.self, DecorationBufferBlock); if (ssbo) { - bool readonly = ir.get_buffer_block_flags(argument).get(DecorationNonWritable); - return readonly ? "const device" : "device"; + bool readonly = flags.get(DecorationNonWritable); + addr_space = readonly ? "const device" : "device"; } else - return "constant"; + addr_space = "constant"; + break; } break; case StorageClassFunction: case StorageClassGeneric: // No address space for plain values. - return type.pointer ? "thread" : ""; + addr_space = type.pointer ? "thread" : ""; + break; case StorageClassInput: if (get_execution_model() == ExecutionModelTessellationControl && argument.basevariable == stage_in_ptr_var_id) - return "threadgroup"; + addr_space = "threadgroup"; break; case StorageClassOutput: if (capture_output_to_buffer) - return "device"; + addr_space = "device"; break; default: break; } - return "thread"; + if (!addr_space) + addr_space = "thread"; + + return join(flags.get(DecorationVolatile) || flags.get(DecorationCoherent) ? "volatile " : "", addr_space); } string CompilerMSL::get_type_address_space(const SPIRType &type, uint32_t id) { + // This can be called for variable pointer contexts as well, so be very careful about which method we choose. + Bitset flags; + if (ir.ids[id].get_type() == TypeVariable && type.basetype == SPIRType::Struct && + (has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock))) + flags = get_buffer_block_flags(id); + else + flags = get_decoration_bitset(id); + + const char *addr_space = nullptr; switch (type.storage) { case StorageClassWorkgroup: - return "threadgroup"; + addr_space = "threadgroup"; + break; case StorageClassStorageBuffer: - { - // This can be called for variable pointer contexts as well, so be very careful about which method we choose. - Bitset flags; - if (ir.ids[id].get_type() == TypeVariable && has_decoration(type.self, DecorationBlock)) - flags = get_buffer_block_flags(id); - else - flags = get_decoration_bitset(id); - - return flags.get(DecorationNonWritable) ? "const device" : "device"; - } + addr_space = flags.get(DecorationNonWritable) ? "const device" : "device"; + break; case StorageClassUniform: case StorageClassUniformConstant: @@ -6271,37 +6419,53 @@ string CompilerMSL::get_type_address_space(const SPIRType &type, uint32_t id) { bool ssbo = has_decoration(type.self, DecorationBufferBlock); if (ssbo) - { - // This can be called for variable pointer contexts as well, so be very careful about which method we choose. - Bitset flags; - if (ir.ids[id].get_type() == TypeVariable && has_decoration(type.self, DecorationBlock)) - flags = get_buffer_block_flags(id); - else - flags = get_decoration_bitset(id); - - return flags.get(DecorationNonWritable) ? "const device" : "device"; - } + addr_space = flags.get(DecorationNonWritable) ? "const device" : "device"; else - return "constant"; + addr_space = "constant"; } else - return "constant"; + addr_space = "constant"; + break; case StorageClassFunction: case StorageClassGeneric: // No address space for plain values. - return type.pointer ? "thread" : ""; + addr_space = type.pointer ? "thread" : ""; + break; case StorageClassOutput: if (capture_output_to_buffer) - return "device"; + addr_space = "device"; break; default: break; } - return "thread"; + if (!addr_space) + addr_space = "thread"; + + return join(flags.get(DecorationVolatile) || flags.get(DecorationCoherent) ? "volatile " : "", addr_space); +} + +const char *CompilerMSL::to_restrict(uint32_t id, bool space) +{ + // This can be called for variable pointer contexts as well, so be very careful about which method we choose. + Bitset flags; + if (ir.ids[id].get_type() == TypeVariable) + { + uint32_t type_id = expression_type_id(id); + auto &type = expression_type(id); + if (type.basetype == SPIRType::Struct && + (has_decoration(type_id, DecorationBlock) || has_decoration(type_id, DecorationBufferBlock))) + flags = get_buffer_block_flags(id); + else + flags = get_decoration_bitset(id); + } + else + flags = get_decoration_bitset(id); + + return flags.get(DecorationRestrict) ? (space ? "restrict " : "restrict") : ""; } string CompilerMSL::entry_point_arg_stage_in() @@ -6330,6 +6494,7 @@ string CompilerMSL::entry_point_arg_stage_in() void CompilerMSL::entry_point_args_builtin(string &ep_args) { // Builtin variables + SmallVector, 8> active_builtins; ir.for_each_typed_id([&](uint32_t var_id, SPIRVariable &var) { auto bi_type = BuiltIn(get_decoration(var_id, DecorationBuiltIn)); @@ -6344,6 +6509,9 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args) if (!active_input_builtins.get(bi_type) || !interface_variable_exists_in_entry_point(var_id)) return; + // Remember this variable. We may need to correct its type. + active_builtins.push_back(make_pair(&var, bi_type)); + // These builtins are emitted specially. If we pass this branch, the builtin directly matches // a MSL builtin. if (bi_type != BuiltInSamplePosition && bi_type != BuiltInHelperInvocation && @@ -6352,7 +6520,7 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args) bi_type != BuiltInClipDistance && bi_type != BuiltInCullDistance && bi_type != BuiltInSubgroupEqMask && bi_type != BuiltInBaryCoordNV && bi_type != BuiltInBaryCoordNoPerspNV && bi_type != BuiltInSubgroupGeMask && bi_type != BuiltInSubgroupGtMask && - bi_type != BuiltInSubgroupLeMask && bi_type != BuiltInSubgroupLtMask && + bi_type != BuiltInSubgroupLeMask && bi_type != BuiltInSubgroupLtMask && bi_type != BuiltInDeviceIndex && ((get_execution_model() == ExecutionModelFragment && msl_options.multiview) || bi_type != BuiltInViewIndex) && (get_execution_model() == ExecutionModelGLCompute || @@ -6363,11 +6531,26 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args) ep_args += ", "; ep_args += builtin_type_decl(bi_type, var_id) + " " + to_expression(var_id); - ep_args += " [[" + builtin_qualifier(bi_type) + "]]"; + ep_args += " [[" + builtin_qualifier(bi_type); + if (bi_type == BuiltInSampleMask && get_entry_point().flags.get(ExecutionModePostDepthCoverage)) + { + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW("Post-depth coverage requires Metal 2.0."); + if (!msl_options.is_ios()) + SPIRV_CROSS_THROW("Post-depth coverage is only supported on iOS."); + ep_args += ", post_depth_coverage"; + } + ep_args += "]]"; } } }); + // Correct the types of all encountered active builtins. We couldn't do this before + // because ensure_correct_builtin_type() may increase the bound, which isn't allowed + // while iterating over IDs. + for (auto &var : active_builtins) + var.first->basetype = ensure_correct_builtin_type(var.first->basetype, var.second); + // Vertex and instance index built-ins if (needs_vertex_idx_arg) ep_args += built_in_func_arg(BuiltInVertexIndex, !ep_args.empty()); @@ -6469,7 +6652,7 @@ string CompilerMSL::entry_point_args_argument_buffer(bool append_comma) claimed_bindings.set(buffer_binding); - ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + to_name(id); + ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + to_restrict(id) + to_name(id); ep_args += " [[buffer(" + convert_to_string(buffer_binding) + ")]]"; next_metal_resource_index_buffer = max(next_metal_resource_index_buffer, buffer_binding + 1); @@ -6605,8 +6788,8 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) { if (!ep_args.empty()) ep_args += ", "; - ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "* " + r.name + "_" + - convert_to_string(i); + ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "* " + to_restrict(var_id) + + r.name + "_" + convert_to_string(i); ep_args += " [[buffer(" + convert_to_string(r.index + i) + ")]]"; } } @@ -6614,7 +6797,8 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args) { if (!ep_args.empty()) ep_args += ", "; - ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + r.name; + ep_args += + get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + to_restrict(var_id) + r.name; ep_args += " [[buffer(" + convert_to_string(r.index) + ")]]"; } break; @@ -6905,6 +7089,17 @@ void CompilerMSL::fix_up_shader_inputs_outputs() statement("const ", builtin_type_decl(bi_type), " ", to_expression(var_id), " = 0;"); }); } + else if (msl_options.view_index_from_device_index) + { + // In this case, we take the view index from that of the device we're running on. + entry_func.fixup_hooks_in.push_back([=]() { + statement("const ", builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + msl_options.device_index, ";"); + }); + // We actually don't want to set the render_target_array_index here. + // Since every physical device is rendering a different view, + // there's no need for layered rendering here. + } else if (get_execution_model() == ExecutionModelFragment) { // Because we adjusted the view index in the vertex shader, we have to @@ -6934,6 +7129,15 @@ void CompilerMSL::fix_up_shader_inputs_outputs() }); } break; + case BuiltInDeviceIndex: + // Metal pipelines belong to the devices which create them, so we'll + // need to create a MTLPipelineState for every MTLDevice in a grouped + // VkDevice. We can assume, then, that the device index is constant. + entry_func.fixup_hooks_in.push_back([=]() { + statement("const ", builtin_type_decl(bi_type), " ", to_expression(var_id), " = ", + msl_options.device_index, ";"); + }); + break; default: break; } @@ -7087,6 +7291,12 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) // non-constant arrays, but we can create thread const from constant. decl = string("thread const ") + decl; decl += " (&"; + const char *restrict_kw = to_restrict(name_id); + if (*restrict_kw) + { + decl += " "; + decl += restrict_kw; + } decl += to_expression(name_id); decl += ")"; decl += type_to_array_glsl(type); @@ -7125,6 +7335,12 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) } decl += " (&"; + const char *restrict_kw = to_restrict(name_id); + if (*restrict_kw) + { + decl += " "; + decl += restrict_kw; + } decl += to_expression(name_id); decl += ")"; decl += type_to_array_glsl(type); @@ -7142,6 +7358,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) } decl += "&"; decl += " "; + decl += to_restrict(name_id); decl += to_expression(name_id); } else @@ -7520,6 +7737,7 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id) // Pointer? if (type.pointer) { + const char *restrict_kw; type_name = join(get_type_address_space(type, id), " ", type_to_glsl(get(type.parent_type), id)); switch (type.basetype) { @@ -7531,6 +7749,12 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id) default: // Anything else can be a raw pointer. type_name += "*"; + restrict_kw = to_restrict(id); + if (*restrict_kw) + { + type_name += " "; + type_name += restrict_kw; + } break; } return type_name; @@ -8411,6 +8635,14 @@ string CompilerMSL::builtin_type_decl(BuiltIn builtin, uint32_t id) case BuiltInViewIndex: return "uint"; + case BuiltInHelperInvocation: + return "bool"; + + case BuiltInBaryCoordNV: + case BuiltInBaryCoordNoPerspNV: + // Use the type as declared, can be 1, 2 or 3 components. + return type_to_glsl(get_variable_data_type(get(id))); + // Fragment function out case BuiltInFragDepth: return "float"; @@ -8437,13 +8669,8 @@ string CompilerMSL::builtin_type_decl(BuiltIn builtin, uint32_t id) case BuiltInSubgroupLtMask: return "uint4"; - case BuiltInHelperInvocation: - return "bool"; - - case BuiltInBaryCoordNV: - case BuiltInBaryCoordNoPerspNV: - // Use the type as declared, can be 1, 2 or 3 components. - return type_to_glsl(get_variable_data_type(get(id))); + case BuiltInDeviceIndex: + return "int"; default: return "unsupported-built-in-type"; @@ -8860,6 +9087,14 @@ CompilerMSL::SPVFuncImpl CompilerMSL::OpCodePreprocessor::get_spv_func_impl(Op o else return SPVFuncImplNone; } + case GLSLstd450FaceForward: + { + auto &type = compiler.get(args[0]); + if (type.vecsize == 1) + return SPVFuncImplFaceForwardScalar; + else + return SPVFuncImplNone; + } case GLSLstd450MatrixInverse: { auto &mat_type = compiler.get(args[0]); diff --git a/3rdparty/spirv-cross/spirv_msl.hpp b/3rdparty/spirv-cross/spirv_msl.hpp index 9f2bab49d..7b8b64c50 100644 --- a/3rdparty/spirv-cross/spirv_msl.hpp +++ b/3rdparty/spirv-cross/spirv_msl.hpp @@ -193,12 +193,14 @@ public: uint32_t buffer_size_buffer_index = 25; uint32_t view_mask_buffer_index = 24; uint32_t shader_input_wg_index = 0; + uint32_t device_index = 0; bool enable_point_size_builtin = true; bool disable_rasterization = false; bool capture_output_to_buffer = false; bool swizzle_texture_samples = false; bool tess_domain_origin_lower_left = false; bool multiview = false; + bool view_index_from_device_index = false; // Enable use of MSL 2.0 indirect argument buffers. // MSL 2.0 must also be enabled. @@ -274,7 +276,7 @@ public: // containing the view mask for the current multiview subpass. bool needs_view_mask_buffer() const { - return msl_options.multiview; + return msl_options.multiview && !msl_options.view_index_from_device_index; } // Provide feedback to calling API to allow it to pass an output @@ -403,6 +405,7 @@ protected: SPVFuncImplSubgroupAllEqual, SPVFuncImplReflectScalar, SPVFuncImplRefractScalar, + SPVFuncImplFaceForwardScalar, SPVFuncImplArrayCopyMultidimMax = 6 }; @@ -410,6 +413,8 @@ protected: void emit_instruction(const Instruction &instr) override; void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, uint32_t count) override; + void emit_spv_amd_shader_trinary_minmax_op(uint32_t result_type, uint32_t result_id, uint32_t op, + const uint32_t *args, uint32_t count) override; void emit_header() override; void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) override; void emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) override; @@ -516,6 +521,7 @@ protected: MSLStructMemberKey get_struct_member_key(uint32_t type_id, uint32_t index); std::string get_argument_address_space(const SPIRVariable &argument); std::string get_type_address_space(const SPIRType &type, uint32_t id); + const char *to_restrict(uint32_t id, bool space = true); SPIRType &get_stage_in_struct_type(); SPIRType &get_stage_out_struct_type(); SPIRType &get_patch_stage_in_struct_type(); diff --git a/3rdparty/spirv-cross/test_shaders.py b/3rdparty/spirv-cross/test_shaders.py index d2f75e801..cf6ef1b4f 100755 --- a/3rdparty/spirv-cross/test_shaders.py +++ b/3rdparty/spirv-cross/test_shaders.py @@ -205,6 +205,8 @@ def cross_compile_msl(shader, spirv, opt, iterations, paths): msl_args.append('--emit-line-directives') if '.multiview.' in shader: msl_args.append('--msl-multiview') + if '.viewfromdev.' in shader: + msl_args.append('--msl-view-index-from-device-index') subprocess.check_call(msl_args) @@ -245,8 +247,13 @@ def shader_to_win_path(shader): ignore_fxc = False def validate_shader_hlsl(shader, force_no_external_validation, paths): - if not '.nonuniformresource' in shader: - # glslang HLSL does not support this, so rely on fxc to test it. + test_glslang = True + if '.nonuniformresource.' in shader: + test_glslang = False + if '.fxconly.' in shader: + test_glslang = False + + if test_glslang: subprocess.check_call([paths.glslang, '-e', 'main', '-D', '--target-env', 'vulkan1.1', '-V', shader]) is_no_fxc = '.nofxc.' in shader global ignore_fxc