Bläddra i källkod

Updated spirv-cross.

Бранимир Караџић 6 år sedan
förälder
incheckning
484ae21339
54 ändrade filer med 540 tillägg och 1364 borttagningar
  1. 5 0
      3rdparty/spirv-cross/CMakeLists.txt
  2. 3 3
      3rdparty/spirv-cross/checkout_glslang_spirv_tools.sh
  3. 4 0
      3rdparty/spirv-cross/main.cpp
  4. 29 0
      3rdparty/spirv-cross/reference/opt/shaders-msl/asm/vert/clip-distance-plain-variable.asm.vert
  5. 4 0
      3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/vert/clip-cull-distance.desktop.vert
  6. 67 0
      3rdparty/spirv-cross/reference/opt/shaders-msl/frag/clip-distance-varying.frag
  7. 29 0
      3rdparty/spirv-cross/reference/opt/shaders-msl/vert/clip-distance-block.vert
  8. 0 366
      3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag
  9. 4 4
      3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
  10. 2 0
      3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
  11. 4 2
      3rdparty/spirv-cross/reference/opt/shaders/asm/comp/switch-break-ladder.asm.comp
  12. 0 21
      3rdparty/spirv-cross/reference/opt/shaders/asm/frag/loop-merge-to-continue.asm.frag
  13. 0 21
      3rdparty/spirv-cross/reference/opt/shaders/asm/frag/selection-merge-to-continue.asm.frag
  14. 0 30
      3rdparty/spirv-cross/reference/opt/shaders/asm/frag/switch-merge-to-continue.asm.frag
  15. 0 6
      3rdparty/spirv-cross/reference/opt/shaders/comp/barriers.comp
  16. 0 1
      3rdparty/spirv-cross/reference/opt/shaders/comp/shared.comp
  17. 4 1
      3rdparty/spirv-cross/reference/opt/shaders/frag/hoisted-temporary-use-continue-block-as-value.frag
  18. 49 0
      3rdparty/spirv-cross/reference/shaders-msl/asm/vert/clip-distance-plain-variable.asm.vert
  19. 4 0
      3rdparty/spirv-cross/reference/shaders-msl/desktop-only/vert/clip-cull-distance.desktop.vert
  20. 67 0
      3rdparty/spirv-cross/reference/shaders-msl/frag/clip-distance-varying.frag
  21. 29 0
      3rdparty/spirv-cross/reference/shaders-msl/vert/clip-distance-block.vert
  22. 0 0
      3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/phi-temporary-copy-loop-variable.asm.invalid.comp
  23. 0 0
      3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/do-while-continue-phi.asm.invalid.frag
  24. 0 0
      3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/loop-merge-to-continue.asm.invalid.frag
  25. 0 0
      3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/selection-merge-to-continue.asm.invalid.frag
  26. 0 0
      3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/switch-merge-to-continue.asm.invalid.frag
  27. 0 0
      3rdparty/spirv-cross/reference/shaders-ue4-no-opt/asm/frag/accesschain-invalid-expression.asm.invalid.frag
  28. 0 0
      3rdparty/spirv-cross/reference/shaders-ue4-no-opt/asm/frag/array-copy-error.asm.invalid.frag
  29. 0 0
      3rdparty/spirv-cross/reference/shaders-ue4-no-opt/asm/frag/phi-variable-declaration.asm.invalid.frag
  30. 0 0
      3rdparty/spirv-cross/reference/shaders-ue4-no-opt/asm/vert/loop-accesschain-writethrough.asm.invalid.vert
  31. 0 350
      3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/array-copy-error.asm.frag
  32. 0 350
      3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag
  33. 2 0
      3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
  34. 0 122
      3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert
  35. 0 20
      3rdparty/spirv-cross/reference/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp
  36. 0 6
      3rdparty/spirv-cross/reference/shaders/comp/barriers.comp
  37. 0 1
      3rdparty/spirv-cross/reference/shaders/comp/shared.comp
  38. 91 0
      3rdparty/spirv-cross/shaders-msl/asm/vert/clip-distance-plain-variable.asm.vert
  39. 10 0
      3rdparty/spirv-cross/shaders-msl/frag/clip-distance-varying.frag
  40. 15 0
      3rdparty/spirv-cross/shaders-msl/vert/clip-distance-block.vert
  41. 0 0
      3rdparty/spirv-cross/shaders-no-opt/asm/comp/phi-temporary-copy-loop-variable.asm.invalid.comp
  42. 0 0
      3rdparty/spirv-cross/shaders-no-opt/asm/frag/do-while-continue-phi.asm.invalid.frag
  43. 0 0
      3rdparty/spirv-cross/shaders-no-opt/asm/frag/loop-merge-to-continue.asm.invalid.frag
  44. 0 0
      3rdparty/spirv-cross/shaders-no-opt/asm/frag/selection-merge-to-continue.asm.invalid.frag
  45. 0 0
      3rdparty/spirv-cross/shaders-no-opt/asm/frag/switch-merge-to-continue.asm.invalid.frag
  46. 0 0
      3rdparty/spirv-cross/shaders-ue4-no-opt/asm/frag/accesschain-invalid-expression.asm.invalid.frag
  47. 0 0
      3rdparty/spirv-cross/shaders-ue4-no-opt/asm/frag/array-copy-error.asm.invalid.frag
  48. 0 0
      3rdparty/spirv-cross/shaders-ue4-no-opt/asm/frag/phi-variable-declaration.asm.invalid.frag
  49. 0 0
      3rdparty/spirv-cross/shaders-ue4-no-opt/asm/vert/loop-accesschain-writethrough.asm.invalid.vert
  50. 2 0
      3rdparty/spirv-cross/spirv_cross_error_handling.hpp
  51. 7 4
      3rdparty/spirv-cross/spirv_glsl.cpp
  52. 93 20
      3rdparty/spirv-cross/spirv_msl.cpp
  53. 15 12
      3rdparty/spirv-cross/test_shaders.sh
  54. 1 24
      3rdparty/spirv-cross/update_test_shaders.sh

+ 5 - 0
3rdparty/spirv-cross/CMakeLists.txt

@@ -575,6 +575,11 @@ if (SPIRV_CROSS_CLI)
 						${spirv-cross-externals}
 						${CMAKE_CURRENT_SOURCE_DIR}/shaders-ue4
 						WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
+				add_test(NAME spirv-cross-test-ue4-no-opt
+						COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --msl --parallel
+						${spirv-cross-externals}
+						${CMAKE_CURRENT_SOURCE_DIR}/shaders-ue4-no-opt
+						WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
 			endif()
 		elseif(NOT ${PYTHONINTERP_FOUND})
 			message(WARNING "SPIRV-Cross: Testing disabled. Could not find python3. If you have python3 installed try running "

+ 3 - 3
3rdparty/spirv-cross/checkout_glslang_spirv_tools.sh

@@ -1,8 +1,8 @@
 #!/bin/bash
 
-GLSLANG_REV=5d0e01d9e7f9fae7609843d00f9fc5f41c3ddfdd
-SPIRV_TOOLS_REV=e0d5544c9864e1b6852c4ab949892898b2866c3e
-SPIRV_HEADERS_REV=601d738723ac381741311c6c98c36d6170be14a2
+GLSLANG_REV=a4af7676feb011d61b1dfa8915bd41d9c5aaf22a
+SPIRV_TOOLS_REV=e82a428605f6ce0a07337b36f8ba3935c9f165ac
+SPIRV_HEADERS_REV=204cd131c42b90d129073719f2766293ce35c081
 
 if [ -z $PROTOCOL ]; then
 	PROTOCOL=git

+ 4 - 0
3rdparty/spirv-cross/main.cpp

@@ -520,6 +520,7 @@ struct CLIArguments
 	bool msl_multiview = false;
 	bool msl_view_index_from_device_index = false;
 	bool msl_dispatch_base = false;
+	bool msl_decoration_binding = false;
 	bool glsl_emit_push_constant_as_ubo = false;
 	bool glsl_emit_ubo_as_plain_uniforms = false;
 	bool vulkan_glsl_disable_ext_samplerless_texture_functions = false;
@@ -610,6 +611,7 @@ static void print_help()
 	                "\t[--msl-view-index-from-device-index]\n"
 	                "\t[--msl-dispatch-base]\n"
 	                "\t[--msl-dynamic-buffer <set index> <binding>]\n"
+	                "\t[--msl-decoration-binding]\n"
 	                "\t[--hlsl]\n"
 	                "\t[--reflect]\n"
 	                "\t[--shader-model]\n"
@@ -798,6 +800,7 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
 		msl_opts.multiview = args.msl_multiview;
 		msl_opts.view_index_from_device_index = args.msl_view_index_from_device_index;
 		msl_opts.dispatch_base = args.msl_dispatch_base;
+		msl_opts.enable_decoration_binding = args.msl_decoration_binding;
 		msl_comp->set_msl_options(msl_opts);
 		for (auto &v : args.msl_discrete_descriptor_sets)
 			msl_comp->add_discrete_descriptor_set(v);
@@ -1144,6 +1147,7 @@ static int main_inner(int argc, char *argv[])
 		uint32_t binding = parser.next_uint();
 		args.msl_dynamic_buffers.push_back(make_pair(desc_set, binding));
 	});
+	cbs.add("--msl-decoration-binding", [&args](CLIParser &) { args.msl_decoration_binding = 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();

+ 29 - 0
3rdparty/spirv-cross/reference/opt/shaders-msl/asm/vert/clip-distance-plain-variable.asm.vert

@@ -0,0 +1,29 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct main0_out
+{
+    float4 gl_Position [[position]];
+    float gl_ClipDistance [[clip_distance]] [2];
+    float gl_ClipDistance_0 [[user(clip0)]];
+    float gl_ClipDistance_1 [[user(clip1)]];
+};
+
+struct main0_in
+{
+    float4 pos [[attribute(0)]];
+};
+
+vertex main0_out main0(main0_in in [[stage_in]])
+{
+    main0_out out = {};
+    out.gl_Position = in.pos;
+    out.gl_ClipDistance[0] = in.pos.x;
+    out.gl_ClipDistance[1] = in.pos.y;
+    out.gl_ClipDistance_0 = out.gl_ClipDistance[0];
+    out.gl_ClipDistance_1 = out.gl_ClipDistance[1];
+    return out;
+}
+

+ 4 - 0
3rdparty/spirv-cross/reference/opt/shaders-msl/desktop-only/vert/clip-cull-distance.desktop.vert

@@ -7,6 +7,8 @@ struct main0_out
 {
     float4 gl_Position [[position]];
     float gl_ClipDistance [[clip_distance]] [2];
+    float gl_ClipDistance_0 [[user(clip0)]];
+    float gl_ClipDistance_1 [[user(clip1)]];
 };
 
 vertex main0_out main0()
@@ -15,6 +17,8 @@ vertex main0_out main0()
     out.gl_Position = float4(10.0);
     out.gl_ClipDistance[0] = 1.0;
     out.gl_ClipDistance[1] = 4.0;
+    out.gl_ClipDistance_0 = out.gl_ClipDistance[0];
+    out.gl_ClipDistance_1 = out.gl_ClipDistance[1];
     return out;
 }
 

+ 67 - 0
3rdparty/spirv-cross/reference/opt/shaders-msl/frag/clip-distance-varying.frag

@@ -0,0 +1,67 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+    T elements[Num ? Num : 1];
+    
+    thread T& operator [] (size_t pos) thread
+    {
+        return elements[pos];
+    }
+    constexpr const thread T& operator [] (size_t pos) const thread
+    {
+        return elements[pos];
+    }
+    
+    device T& operator [] (size_t pos) device
+    {
+        return elements[pos];
+    }
+    constexpr const device T& operator [] (size_t pos) const device
+    {
+        return elements[pos];
+    }
+    
+    constexpr const constant T& operator [] (size_t pos) const constant
+    {
+        return elements[pos];
+    }
+    
+    threadgroup T& operator [] (size_t pos) threadgroup
+    {
+        return elements[pos];
+    }
+    constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+    {
+        return elements[pos];
+    }
+};
+
+struct main0_out
+{
+    float4 FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+    float gl_ClipDistance_0 [[user(clip0)]];
+    float gl_ClipDistance_1 [[user(clip1)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]])
+{
+    main0_out out = {};
+    spvUnsafeArray<float, 2> gl_ClipDistance = {};
+    gl_ClipDistance[0] = in.gl_ClipDistance_0;
+    gl_ClipDistance[1] = in.gl_ClipDistance_1;
+    out.FragColor = float4((1.0 - gl_ClipDistance[0]) - gl_ClipDistance[1]);
+    return out;
+}
+

+ 29 - 0
3rdparty/spirv-cross/reference/opt/shaders-msl/vert/clip-distance-block.vert

@@ -0,0 +1,29 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct main0_out
+{
+    float4 gl_Position [[position]];
+    float gl_ClipDistance [[clip_distance]] [2];
+    float gl_ClipDistance_0 [[user(clip0)]];
+    float gl_ClipDistance_1 [[user(clip1)]];
+};
+
+struct main0_in
+{
+    float4 Position [[attribute(0)]];
+};
+
+vertex main0_out main0(main0_in in [[stage_in]])
+{
+    main0_out out = {};
+    out.gl_Position = in.Position;
+    out.gl_ClipDistance[0] = in.Position.x;
+    out.gl_ClipDistance[1] = in.Position.y;
+    out.gl_ClipDistance_0 = out.gl_ClipDistance[0];
+    out.gl_ClipDistance_1 = out.gl_ClipDistance[1];
+    return out;
+}
+

+ 0 - 366
3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag

@@ -1,366 +0,0 @@
-#include <metal_stdlib>
-#include <simd/simd.h>
-
-using namespace metal;
-
-struct type_View
-{
-    float4x4 View_TranslatedWorldToClip;
-    float4x4 View_WorldToClip;
-    float4x4 View_TranslatedWorldToView;
-    float4x4 View_ViewToTranslatedWorld;
-    float4x4 View_TranslatedWorldToCameraView;
-    float4x4 View_CameraViewToTranslatedWorld;
-    float4x4 View_ViewToClip;
-    float4x4 View_ViewToClipNoAA;
-    float4x4 View_ClipToView;
-    float4x4 View_ClipToTranslatedWorld;
-    float4x4 View_SVPositionToTranslatedWorld;
-    float4x4 View_ScreenToWorld;
-    float4x4 View_ScreenToTranslatedWorld;
-    packed_float3 View_ViewForward;
-    float PrePadding_View_844;
-    packed_float3 View_ViewUp;
-    float PrePadding_View_860;
-    packed_float3 View_ViewRight;
-    float PrePadding_View_876;
-    packed_float3 View_HMDViewNoRollUp;
-    float PrePadding_View_892;
-    packed_float3 View_HMDViewNoRollRight;
-    float PrePadding_View_908;
-    float4 View_InvDeviceZToWorldZTransform;
-    float4 View_ScreenPositionScaleBias;
-    packed_float3 View_WorldCameraOrigin;
-    float PrePadding_View_956;
-    packed_float3 View_TranslatedWorldCameraOrigin;
-    float PrePadding_View_972;
-    packed_float3 View_WorldViewOrigin;
-    float PrePadding_View_988;
-    packed_float3 View_PreViewTranslation;
-    float PrePadding_View_1004;
-    float4x4 View_PrevProjection;
-    float4x4 View_PrevViewProj;
-    float4x4 View_PrevViewRotationProj;
-    float4x4 View_PrevViewToClip;
-    float4x4 View_PrevClipToView;
-    float4x4 View_PrevTranslatedWorldToClip;
-    float4x4 View_PrevTranslatedWorldToView;
-    float4x4 View_PrevViewToTranslatedWorld;
-    float4x4 View_PrevTranslatedWorldToCameraView;
-    float4x4 View_PrevCameraViewToTranslatedWorld;
-    packed_float3 View_PrevWorldCameraOrigin;
-    float PrePadding_View_1660;
-    packed_float3 View_PrevWorldViewOrigin;
-    float PrePadding_View_1676;
-    packed_float3 View_PrevPreViewTranslation;
-    float PrePadding_View_1692;
-    float4x4 View_PrevInvViewProj;
-    float4x4 View_PrevScreenToTranslatedWorld;
-    float4x4 View_ClipToPrevClip;
-    float4 View_TemporalAAJitter;
-    float4 View_GlobalClippingPlane;
-    float2 View_FieldOfViewWideAngles;
-    float2 View_PrevFieldOfViewWideAngles;
-    float4 View_ViewRectMin;
-    float4 View_ViewSizeAndInvSize;
-    float4 View_BufferSizeAndInvSize;
-    float4 View_BufferBilinearUVMinMax;
-    int View_NumSceneColorMSAASamples;
-    float View_PreExposure;
-    float View_OneOverPreExposure;
-    float PrePadding_View_2012;
-    float4 View_DiffuseOverrideParameter;
-    float4 View_SpecularOverrideParameter;
-    float4 View_NormalOverrideParameter;
-    float2 View_RoughnessOverrideParameter;
-    float View_PrevFrameGameTime;
-    float View_PrevFrameRealTime;
-    float View_OutOfBoundsMask;
-    float PrePadding_View_2084;
-    float PrePadding_View_2088;
-    float PrePadding_View_2092;
-    packed_float3 View_WorldCameraMovementSinceLastFrame;
-    float View_CullingSign;
-    float View_NearPlane;
-    float View_AdaptiveTessellationFactor;
-    float View_GameTime;
-    float View_RealTime;
-    float View_DeltaTime;
-    float View_MaterialTextureMipBias;
-    float View_MaterialTextureDerivativeMultiply;
-    uint View_Random;
-    uint View_FrameNumber;
-    uint View_StateFrameIndexMod8;
-    uint View_StateFrameIndex;
-    float View_CameraCut;
-    float View_UnlitViewmodeMask;
-    float PrePadding_View_2164;
-    float PrePadding_View_2168;
-    float PrePadding_View_2172;
-    float4 View_DirectionalLightColor;
-    packed_float3 View_DirectionalLightDirection;
-    float PrePadding_View_2204;
-    float4 View_TranslucencyLightingVolumeMin[2];
-    float4 View_TranslucencyLightingVolumeInvSize[2];
-    float4 View_TemporalAAParams;
-    float4 View_CircleDOFParams;
-    float View_DepthOfFieldSensorWidth;
-    float View_DepthOfFieldFocalDistance;
-    float View_DepthOfFieldScale;
-    float View_DepthOfFieldFocalLength;
-    float View_DepthOfFieldFocalRegion;
-    float View_DepthOfFieldNearTransitionRegion;
-    float View_DepthOfFieldFarTransitionRegion;
-    float View_MotionBlurNormalizedToPixel;
-    float View_bSubsurfacePostprocessEnabled;
-    float View_GeneralPurposeTweak;
-    float View_DemosaicVposOffset;
-    float PrePadding_View_2348;
-    packed_float3 View_IndirectLightingColorScale;
-    float View_HDR32bppEncodingMode;
-    packed_float3 View_AtmosphericFogSunDirection;
-    float View_AtmosphericFogSunPower;
-    float View_AtmosphericFogPower;
-    float View_AtmosphericFogDensityScale;
-    float View_AtmosphericFogDensityOffset;
-    float View_AtmosphericFogGroundOffset;
-    float View_AtmosphericFogDistanceScale;
-    float View_AtmosphericFogAltitudeScale;
-    float View_AtmosphericFogHeightScaleRayleigh;
-    float View_AtmosphericFogStartDistance;
-    float View_AtmosphericFogDistanceOffset;
-    float View_AtmosphericFogSunDiscScale;
-    uint View_AtmosphericFogRenderMask;
-    uint View_AtmosphericFogInscatterAltitudeSampleNum;
-    float4 View_AtmosphericFogSunColor;
-    packed_float3 View_NormalCurvatureToRoughnessScaleBias;
-    float View_RenderingReflectionCaptureMask;
-    float4 View_AmbientCubemapTint;
-    float View_AmbientCubemapIntensity;
-    float View_SkyLightParameters;
-    float PrePadding_View_2488;
-    float PrePadding_View_2492;
-    float4 View_SkyLightColor;
-    float4 View_SkyIrradianceEnvironmentMap[7];
-    float View_MobilePreviewMode;
-    float View_HMDEyePaddingOffset;
-    float View_ReflectionCubemapMaxMip;
-    float View_ShowDecalsMask;
-    uint View_DistanceFieldAOSpecularOcclusionMode;
-    float View_IndirectCapsuleSelfShadowingIntensity;
-    float PrePadding_View_2648;
-    float PrePadding_View_2652;
-    packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
-    int View_StereoPassIndex;
-    float4 View_GlobalVolumeCenterAndExtent[4];
-    float4 View_GlobalVolumeWorldToUVAddAndMul[4];
-    float View_GlobalVolumeDimension;
-    float View_GlobalVolumeTexelSize;
-    float View_MaxGlobalDistance;
-    float View_bCheckerboardSubsurfaceProfileRendering;
-    packed_float3 View_VolumetricFogInvGridSize;
-    float PrePadding_View_2828;
-    packed_float3 View_VolumetricFogGridZParams;
-    float PrePadding_View_2844;
-    float2 View_VolumetricFogSVPosToVolumeUV;
-    float View_VolumetricFogMaxDistance;
-    float PrePadding_View_2860;
-    packed_float3 View_VolumetricLightmapWorldToUVScale;
-    float PrePadding_View_2876;
-    packed_float3 View_VolumetricLightmapWorldToUVAdd;
-    float PrePadding_View_2892;
-    packed_float3 View_VolumetricLightmapIndirectionTextureSize;
-    float View_VolumetricLightmapBrickSize;
-    packed_float3 View_VolumetricLightmapBrickTexelSize;
-    float View_StereoIPD;
-    float View_IndirectLightingCacheShowFlag;
-    float View_EyeToPixelSpreadAngle;
-};
-
-struct type_MobileDirectionalLight
-{
-    float4 MobileDirectionalLight_DirectionalLightColor;
-    float4 MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition;
-    float4 MobileDirectionalLight_DirectionalLightShadowSize;
-    float4 MobileDirectionalLight_DirectionalLightDistanceFadeMAD;
-    float4 MobileDirectionalLight_DirectionalLightShadowDistances;
-    float4x4 MobileDirectionalLight_DirectionalLightScreenToShadow[4];
-};
-
-struct type_Globals
-{
-    int NumDynamicPointLights;
-    float4 LightPositionAndInvRadius[4];
-    float4 LightColorAndFalloffExponent[4];
-    float4 MobileReflectionParams;
-};
-
-constant float3 _136 = {};
-constant float4 _137 = {};
-constant float _138 = {};
-constant float3 _573 = {};
-
-struct main0_out
-{
-    float4 out_var_SV_Target0 [[color(0)]];
-};
-
-struct main0_in
-{
-    float2 in_var_TEXCOORD0 [[user(locn0)]];
-    float4 in_var_TEXCOORD7 [[user(locn1)]];
-    float4 in_var_TEXCOORD8 [[user(locn2)]];
-};
-
-fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_MobileDirectionalLight& MobileDirectionalLight [[buffer(1)]], constant type_Globals& _Globals [[buffer(2)]], texture2d<float> MobileDirectionalLight_DirectionalLightShadowTexture [[texture(0)]], texture2d<float> Material_Texture2D_0 [[texture(1)]], texture2d<float> Material_Texture2D_1 [[texture(2)]], texturecube<float> ReflectionCubemap [[texture(3)]], sampler MobileDirectionalLight_DirectionalLightShadowSampler [[sampler(0)]], sampler Material_Texture2D_0Sampler [[sampler(1)]], sampler Material_Texture2D_1Sampler [[sampler(2)]], sampler ReflectionCubemapSampler [[sampler(3)]], float4 gl_FragCoord [[position]])
-{
-    main0_out out = {};
-    float4 _177 = float4((((gl_FragCoord.xy - View.View_ViewRectMin.xy) * View.View_ViewSizeAndInvSize.zw) - float2(0.5)) * float2(2.0, -2.0), _138, 1.0) * float4(gl_FragCoord.w);
-    float3 _181 = normalize(-in.in_var_TEXCOORD8.xyz);
-    float2 _190 = (Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (in.in_var_TEXCOORD0 * float2(10.0))).xy * float2(2.0)) - float2(1.0);
-    float3 _206 = normalize(float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0)) * (((float4(_190, sqrt(fast::clamp(1.0 - dot(_190, _190), 0.0, 1.0)), 1.0).xyz * float3(0.300000011920928955078125, 0.300000011920928955078125, 1.0)) * float3(View.View_NormalOverrideParameter.w)) + View.View_NormalOverrideParameter.xyz));
-    float _208 = dot(_206, _181);
-    float _219 = mix(0.4000000059604644775390625, 1.0, Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(20.0))).x);
-    float4 _223 = Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(5.0)));
-    float _224 = _177.w;
-    float _228 = fast::min(fast::max((_224 - 24.0) * 0.000666666659526526927947998046875, 0.0), 1.0);
-    float _229 = _223.y;
-    float4 _233 = Material_Texture2D_1.sample(Material_Texture2D_1Sampler, (in.in_var_TEXCOORD0 * float2(0.5)));
-    float _235 = _233.y;
-    float _253 = fast::clamp((fast::min(fast::max(mix(0.0, 0.5, _235) + mix(mix(0.699999988079071044921875, 1.0, _229), 1.0, _228), 0.0), 1.0) * View.View_RoughnessOverrideParameter.y) + View.View_RoughnessOverrideParameter.x, 0.119999997317790985107421875, 1.0);
-    float2 _257 = (float2(_253) * float2(-1.0, -0.0274999998509883880615234375)) + float2(1.0, 0.0425000004470348358154296875);
-    float _258 = _257.x;
-    float3 _270 = (fast::clamp(float3(mix(_219, 1.0 - _219, mix(_229, 1.0, _228)) * (mix(0.2949999868869781494140625, 0.660000026226043701171875, mix(_235 + mix(_229, 0.0, _228), 0.5, 0.5)) * 0.5)), float3(0.0), float3(1.0)) * float3(View.View_DiffuseOverrideParameter.w)) + View.View_DiffuseOverrideParameter.xyz;
-    float3 _275 = float3(((fast::min(_258 * _258, exp2((-9.27999973297119140625) * fast::max(_208, 0.0))) * _258) + _257.y) * View.View_SpecularOverrideParameter.w) + View.View_SpecularOverrideParameter.xyz;
-    float _276 = _275.x;
-    float4 _303;
-    int _286 = 0;
-    for (;;)
-    {
-        if (_286 < 2)
-        {
-            if (_224 < MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowDistances[uint(_286)])
-            {
-                _303 = MobileDirectionalLight.MobileDirectionalLight_DirectionalLightScreenToShadow[_286] * float4(_177.xy, _224, 1.0);
-                break;
-            }
-            _286++;
-            continue;
-        }
-        else
-        {
-            _303 = float4(0.0);
-            break;
-        }
-    }
-    float _423;
-    if (_303.z > 0.0)
-    {
-        float2 _311 = _303.xy * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.xy;
-        float2 _312 = fract(_311);
-        float2 _313 = floor(_311);
-        float3 _320 = _573;
-        _320.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
-        float3 _326 = _320;
-        _326.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, -0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
-        float3 _332 = _326;
-        _332.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5, -0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
-        float3 _335 = float3(MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.w);
-        float3 _337 = float3((fast::min(_303.z, 0.999989986419677734375) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.w) - 1.0);
-        float3 _339 = fast::clamp((_332 * _335) - _337, float3(0.0), float3(1.0));
-        float3 _345 = _573;
-        _345.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5, 0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
-        float3 _351 = _345;
-        _351.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
-        float3 _357 = _351;
-        _357.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5, 0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
-        float3 _360 = fast::clamp((_357 * _335) - _337, float3(0.0), float3(1.0));
-        float3 _366 = _573;
-        _366.x = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(-0.5, 1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
-        float3 _372 = _366;
-        _372.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, 1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
-        float3 _378 = _372;
-        _378.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
-        float3 _381 = fast::clamp((_378 * _335) - _337, float3(0.0), float3(1.0));
-        float _383 = _312.x;
-        float _384 = 1.0 - _383;
-        float3 _399 = _136;
-        _399.x = ((_339.x * _384) + _339.y) + (_339.z * _383);
-        float3 _403 = _399;
-        _403.y = ((_360.x * _384) + _360.y) + (_360.z * _383);
-        float3 _407 = _403;
-        _407.z = ((_381.x * _384) + _381.y) + (_381.z * _383);
-        float _408 = _312.y;
-        float _420 = fast::clamp((_224 * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDistanceFadeMAD.x) + MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDistanceFadeMAD.y, 0.0, 1.0);
-        _423 = mix(fast::clamp(0.25 * dot(_407, float3(1.0 - _408, 1.0, _408)), 0.0, 1.0), 1.0, _420 * _420);
-    }
-    else
-    {
-        _423 = 1.0;
-    }
-    float3 _429 = normalize(_181 + MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.xyz);
-    float _439 = (_253 * 0.25) + 0.25;
-    float3 _440 = cross(_206, _429);
-    float _442 = _253 * _253;
-    float _443 = fast::max(0.0, dot(_206, _429)) * _442;
-    float _446 = _442 / (dot(_440, _440) + (_443 * _443));
-    bool _458 = float(_Globals.MobileReflectionParams.w > 0.0) != 0.0;
-    float4 _468 = ReflectionCubemap.sample(ReflectionCubemapSampler, ((-_181) + ((_206 * float3(_208)) * float3(2.0))), level(((_458 ? _Globals.MobileReflectionParams.w : View.View_ReflectionCubemapMaxMip) - 1.0) - (1.0 - (1.2000000476837158203125 * log2(_253)))));
-    float3 _481;
-    if (_458)
-    {
-        _481 = _468.xyz * View.View_SkyLightColor.xyz;
-    }
-    else
-    {
-        float3 _476 = _468.xyz * float3(_468.w * 16.0);
-        _481 = _476 * _476;
-    }
-    float3 _484 = float3(_276);
-    float3 _488;
-    _488 = ((float3(_423 * fast::max(0.0, dot(_206, MobileDirectionalLight.MobileDirectionalLight_DirectionalLightDirectionAndShadowTransition.xyz))) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightColor.xyz) * (_270 + float3(_276 * (_439 * fast::min(_446 * _446, 65504.0))))) + (_481 * _484);
-    float3 _507;
-    float _509;
-    float _511;
-    float _537;
-    int _491 = 0;
-    for (;;)
-    {
-        if (_491 < _Globals.NumDynamicPointLights)
-        {
-            float3 _501 = _Globals.LightPositionAndInvRadius[_491].xyz - (in.in_var_TEXCOORD8.xyz - float3(View.View_PreViewTranslation));
-            float _502 = dot(_501, _501);
-            float3 _505 = _501 * float3(rsqrt(_502));
-            _507 = normalize(_181 + _505);
-            _509 = fast::max(0.0, dot(_206, _505));
-            _511 = fast::max(0.0, dot(_206, _507));
-            if (_Globals.LightColorAndFalloffExponent[_491].w == 0.0)
-            {
-                float _531 = _502 * (_Globals.LightPositionAndInvRadius[_491].w * _Globals.LightPositionAndInvRadius[_491].w);
-                float _534 = fast::clamp(1.0 - (_531 * _531), 0.0, 1.0);
-                _537 = (1.0 / (_502 + 1.0)) * (_534 * _534);
-            }
-            else
-            {
-                float3 _521 = _501 * float3(_Globals.LightPositionAndInvRadius[_491].w);
-                _537 = pow(1.0 - fast::clamp(dot(_521, _521), 0.0, 1.0), _Globals.LightColorAndFalloffExponent[_491].w);
-            }
-            float3 _544 = cross(_206, _507);
-            float _546 = _511 * _442;
-            float _549 = _442 / (dot(_544, _544) + (_546 * _546));
-            _488 += fast::min(float3(65000.0), ((float3(_537 * _509) * _Globals.LightColorAndFalloffExponent[_491].xyz) * float3(0.3183098733425140380859375)) * (_270 + float3(_276 * (_439 * fast::min(_549 * _549, 65504.0)))));
-            _491++;
-            continue;
-        }
-        else
-        {
-            break;
-        }
-    }
-    float3 _567 = (mix(_488, _270 + _484, float3(View.View_UnlitViewmodeMask)) * float3(in.in_var_TEXCOORD7.w)) + in.in_var_TEXCOORD7.xyz;
-    float4 _571 = float4(_567.x, _567.y, _567.z, _137.w);
-    _571.w = fast::min(in.in_var_TEXCOORD8.w, 65500.0);
-    out.out_var_SV_Target0 = _571;
-    return out;
-}
-

+ 4 - 4
3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag

@@ -82,8 +82,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant uint* spvBufferSizeC
     float3 _102 = float3(_100.x, _100.y, _70.z);
     _102.z = 1.0;
     uint _103 = in.in_var_TEXCOORD0 * 5u;
-    uint _186 = clamp(_103 + 1u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u);
-    if (all(CulledObjectBoxBounds._m0[_186].xy > _96.xy) && all(CulledObjectBoxBounds._m0[clamp(_103, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz < _102))
+    uint _189 = uint(clamp(int(_103 + 1u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))));
+    if (all(CulledObjectBoxBounds._m0[_189].xy > _96.xy) && all(CulledObjectBoxBounds._m0[uint(clamp(int(_103), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz < _102))
     {
         float _122 = _96.x;
         float _123 = _96.y;
@@ -104,8 +104,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant uint* spvBufferSizeC
         _158 = float3(500000.0);
         for (int _160 = 0; _160 < 8; )
         {
-            float3 _166 = _73[int(clamp(uint(_160), uint(0), uint(7)))] - (float3(0.5) * (CulledObjectBoxBounds._m0[clamp(_103, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz + CulledObjectBoxBounds._m0[_186].xyz));
-            float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[clamp(_103 + 2u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz), dot(_166, CulledObjectBoxBounds._m0[clamp(_103 + 3u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz), dot(_166, CulledObjectBoxBounds._m0[clamp(_103 + 4u, 0u, ((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u)].xyz));
+            float3 _166 = _73[clamp(_160, 0, 7)] - (float3(0.5) * (CulledObjectBoxBounds._m0[uint(clamp(int(_103), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz + CulledObjectBoxBounds._m0[_189].xyz));
+            float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_166, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_166, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz));
             _155 = fast::max(_155, _170);
             _158 = fast::min(_158, _170);
             _160++;

+ 2 - 0
3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese

@@ -247,6 +247,7 @@ struct main0_out
     float4 out_var_TEXCOORD10_centroid [[user(locn2)]];
     float4 out_var_TEXCOORD11_centroid [[user(locn3)]];
     float gl_ClipDistance [[clip_distance]] [1];
+    float gl_ClipDistance_0 [[user(clip0)]];
     float4 gl_Position [[position]];
 };
 
@@ -410,6 +411,7 @@ struct main0_patchIn
     out.out_var_TEXCOORD10_centroid = float4(_256.x, _256.y, _256.z, _118.w);
     out.out_var_TEXCOORD11_centroid = _259;
     out.gl_ClipDistance[0u] = dot(View.View_GlobalClippingPlane, float4(_565.xyz - float3(View.View_PreViewTranslation), 1.0));
+    out.gl_ClipDistance_0 = out.gl_ClipDistance[0];
     return out;
 }
 

+ 4 - 2
3rdparty/spirv-cross/reference/opt/shaders/asm/comp/switch-break-ladder.asm.comp

@@ -12,9 +12,10 @@ void main()
 {
     int _44;
     _44 = o.a;
-    int _48;
+    int _41;
     for (;;)
     {
+        int _48;
         bool _22_ladder_break = false;
         switch (_44)
         {
@@ -61,7 +62,8 @@ void main()
         {
             break;
         }
-        _44 = _48 + 1;
+        _41 = _48 + 1;
+        _44 = _41;
         continue;
     }
     o.b = _44;

+ 0 - 21
3rdparty/spirv-cross/reference/opt/shaders/asm/frag/loop-merge-to-continue.asm.frag

@@ -1,21 +0,0 @@
-#version 450
-
-layout(location = 0) out vec4 FragColor;
-layout(location = 0) in vec4 v0;
-
-void main()
-{
-    FragColor = vec4(1.0);
-    int _50;
-    _50 = 0;
-    for (; _50 < 4; _50++)
-    {
-        for (int _51 = 0; _51 < 4; )
-        {
-            FragColor += vec4(v0[(_50 + _51) & 3]);
-            _51++;
-            continue;
-        }
-    }
-}
-

+ 0 - 21
3rdparty/spirv-cross/reference/opt/shaders/asm/frag/selection-merge-to-continue.asm.frag

@@ -1,21 +0,0 @@
-#version 450
-
-layout(location = 0) out vec4 FragColor;
-layout(location = 0) in vec4 v0;
-
-void main()
-{
-    FragColor = vec4(1.0);
-    for (int _54 = 0; _54 < 4; _54++)
-    {
-        if (v0.x == 20.0)
-        {
-            FragColor += vec4(v0[_54 & 3]);
-        }
-        else
-        {
-            FragColor += vec4(v0[_54 & 1]);
-        }
-    }
-}
-

+ 0 - 30
3rdparty/spirv-cross/reference/opt/shaders/asm/frag/switch-merge-to-continue.asm.frag

@@ -1,30 +0,0 @@
-#version 450
-
-layout(location = 0) out vec4 FragColor;
-
-void main()
-{
-    FragColor = vec4(1.0);
-    for (int _52 = 0; _52 < 4; _52++)
-    {
-        switch (_52)
-        {
-            case 0:
-            {
-                FragColor.x += 1.0;
-                break;
-            }
-            case 1:
-            {
-                FragColor.y += 3.0;
-                break;
-            }
-            default:
-            {
-                FragColor.z += 3.0;
-                break;
-            }
-        }
-    }
-}
-

+ 0 - 6
3rdparty/spirv-cross/reference/opt/shaders/comp/barriers.comp

@@ -8,21 +8,15 @@ void main()
     memoryBarrierImage();
     memoryBarrierBuffer();
     groupMemoryBarrier();
-    memoryBarrierShared();
     barrier();
     memoryBarrier();
-    memoryBarrierShared();
     barrier();
     memoryBarrierImage();
-    memoryBarrierShared();
     barrier();
     memoryBarrierBuffer();
-    memoryBarrierShared();
     barrier();
     groupMemoryBarrier();
-    memoryBarrierShared();
     barrier();
-    memoryBarrierShared();
     barrier();
 }
 

+ 0 - 1
3rdparty/spirv-cross/reference/opt/shaders/comp/shared.comp

@@ -16,7 +16,6 @@ shared float sShared[4];
 void main()
 {
     sShared[gl_LocalInvocationIndex] = _22.in_data[gl_GlobalInvocationID.x];
-    memoryBarrierShared();
     barrier();
     _44.out_data[gl_GlobalInvocationID.x] = sShared[3u - gl_LocalInvocationIndex];
 }

+ 4 - 1
3rdparty/spirv-cross/reference/opt/shaders/frag/hoisted-temporary-use-continue-block-as-value.frag

@@ -9,8 +9,9 @@ layout(location = 1) flat in mediump int vB;
 void main()
 {
     FragColor = vec4(0.0);
+    mediump int _49;
     mediump int _58;
-    for (mediump int _57 = 0, _60 = 0; _57 < vA; FragColor += vec4(1.0), _60 = _58, _57 += (_58 + 10))
+    for (mediump int _57 = 0, _60 = 0; _57 < vA; _60 = _58, _57 += _49)
     {
         if ((vA + _57) == 20)
         {
@@ -20,6 +21,8 @@ void main()
         {
             _58 = ((vB + _57) == 40) ? 60 : _60;
         }
+        _49 = _58 + 10;
+        FragColor += vec4(1.0);
     }
 }
 

+ 49 - 0
3rdparty/spirv-cross/reference/shaders-msl/asm/vert/clip-distance-plain-variable.asm.vert

@@ -0,0 +1,49 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct VSOut
+{
+    float4 pos;
+    float2 clip;
+};
+
+struct main0_out
+{
+    float4 gl_Position [[position]];
+    float gl_ClipDistance [[clip_distance]] [2];
+    float gl_ClipDistance_0 [[user(clip0)]];
+    float gl_ClipDistance_1 [[user(clip1)]];
+};
+
+struct main0_in
+{
+    float4 pos [[attribute(0)]];
+};
+
+static inline __attribute__((always_inline))
+VSOut _main(thread const float4& pos)
+{
+    VSOut vout;
+    vout.pos = pos;
+    vout.clip = pos.xy;
+    return vout;
+}
+
+vertex main0_out main0(main0_in in [[stage_in]])
+{
+    main0_out out = {};
+    float4 pos = in.pos;
+    float4 param = pos;
+    VSOut flattenTemp = _main(param);
+    out.gl_Position = flattenTemp.pos;
+    out.gl_ClipDistance[0] = flattenTemp.clip.x;
+    out.gl_ClipDistance[1] = flattenTemp.clip.y;
+    out.gl_ClipDistance_0 = out.gl_ClipDistance[0];
+    out.gl_ClipDistance_1 = out.gl_ClipDistance[1];
+    return out;
+}
+

+ 4 - 0
3rdparty/spirv-cross/reference/shaders-msl/desktop-only/vert/clip-cull-distance.desktop.vert

@@ -7,6 +7,8 @@ struct main0_out
 {
     float4 gl_Position [[position]];
     float gl_ClipDistance [[clip_distance]] [2];
+    float gl_ClipDistance_0 [[user(clip0)]];
+    float gl_ClipDistance_1 [[user(clip1)]];
 };
 
 vertex main0_out main0()
@@ -15,6 +17,8 @@ vertex main0_out main0()
     out.gl_Position = float4(10.0);
     out.gl_ClipDistance[0] = 1.0;
     out.gl_ClipDistance[1] = 4.0;
+    out.gl_ClipDistance_0 = out.gl_ClipDistance[0];
+    out.gl_ClipDistance_1 = out.gl_ClipDistance[1];
     return out;
 }
 

+ 67 - 0
3rdparty/spirv-cross/reference/shaders-msl/frag/clip-distance-varying.frag

@@ -0,0 +1,67 @@
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#pragma clang diagnostic ignored "-Wmissing-braces"
+
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+template<typename T, size_t Num>
+struct spvUnsafeArray
+{
+    T elements[Num ? Num : 1];
+    
+    thread T& operator [] (size_t pos) thread
+    {
+        return elements[pos];
+    }
+    constexpr const thread T& operator [] (size_t pos) const thread
+    {
+        return elements[pos];
+    }
+    
+    device T& operator [] (size_t pos) device
+    {
+        return elements[pos];
+    }
+    constexpr const device T& operator [] (size_t pos) const device
+    {
+        return elements[pos];
+    }
+    
+    constexpr const constant T& operator [] (size_t pos) const constant
+    {
+        return elements[pos];
+    }
+    
+    threadgroup T& operator [] (size_t pos) threadgroup
+    {
+        return elements[pos];
+    }
+    constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
+    {
+        return elements[pos];
+    }
+};
+
+struct main0_out
+{
+    float4 FragColor [[color(0)]];
+};
+
+struct main0_in
+{
+    float gl_ClipDistance_0 [[user(clip0)]];
+    float gl_ClipDistance_1 [[user(clip1)]];
+};
+
+fragment main0_out main0(main0_in in [[stage_in]])
+{
+    main0_out out = {};
+    spvUnsafeArray<float, 2> gl_ClipDistance = {};
+    gl_ClipDistance[0] = in.gl_ClipDistance_0;
+    gl_ClipDistance[1] = in.gl_ClipDistance_1;
+    out.FragColor = float4((1.0 - gl_ClipDistance[0]) - gl_ClipDistance[1]);
+    return out;
+}
+

+ 29 - 0
3rdparty/spirv-cross/reference/shaders-msl/vert/clip-distance-block.vert

@@ -0,0 +1,29 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct main0_out
+{
+    float4 gl_Position [[position]];
+    float gl_ClipDistance [[clip_distance]] [2];
+    float gl_ClipDistance_0 [[user(clip0)]];
+    float gl_ClipDistance_1 [[user(clip1)]];
+};
+
+struct main0_in
+{
+    float4 Position [[attribute(0)]];
+};
+
+vertex main0_out main0(main0_in in [[stage_in]])
+{
+    main0_out out = {};
+    out.gl_Position = in.Position;
+    out.gl_ClipDistance[0] = in.Position.x;
+    out.gl_ClipDistance[1] = in.Position.y;
+    out.gl_ClipDistance_0 = out.gl_ClipDistance[0];
+    out.gl_ClipDistance_1 = out.gl_ClipDistance[1];
+    return out;
+}
+

+ 0 - 0
3rdparty/spirv-cross/reference/opt/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp → 3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/phi-temporary-copy-loop-variable.asm.invalid.comp


+ 0 - 0
3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/do-while-continue-phi.asm.frag → 3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/do-while-continue-phi.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/reference/shaders/asm/frag/loop-merge-to-continue.asm.frag → 3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/loop-merge-to-continue.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/reference/shaders/asm/frag/selection-merge-to-continue.asm.frag → 3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/selection-merge-to-continue.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/reference/shaders/asm/frag/switch-merge-to-continue.asm.frag → 3rdparty/spirv-cross/reference/shaders-no-opt/asm/frag/switch-merge-to-continue.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag → 3rdparty/spirv-cross/reference/shaders-ue4-no-opt/asm/frag/accesschain-invalid-expression.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/array-copy-error.asm.frag → 3rdparty/spirv-cross/reference/shaders-ue4-no-opt/asm/frag/array-copy-error.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag → 3rdparty/spirv-cross/reference/shaders-ue4-no-opt/asm/frag/phi-variable-declaration.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/reference/opt/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert → 3rdparty/spirv-cross/reference/shaders-ue4-no-opt/asm/vert/loop-accesschain-writethrough.asm.invalid.vert


+ 0 - 350
3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/array-copy-error.asm.frag

@@ -1,350 +0,0 @@
-#pragma clang diagnostic ignored "-Wmissing-prototypes"
-#pragma clang diagnostic ignored "-Wmissing-braces"
-
-#include <metal_stdlib>
-#include <simd/simd.h>
-
-using namespace metal;
-
-template<typename T, size_t Num>
-struct spvUnsafeArray
-{
-    T elements[Num ? Num : 1];
-    
-    thread T& operator [] (size_t pos) thread
-    {
-        return elements[pos];
-    }
-    constexpr const thread T& operator [] (size_t pos) const thread
-    {
-        return elements[pos];
-    }
-    
-    device T& operator [] (size_t pos) device
-    {
-        return elements[pos];
-    }
-    constexpr const device T& operator [] (size_t pos) const device
-    {
-        return elements[pos];
-    }
-    
-    constexpr const constant T& operator [] (size_t pos) const constant
-    {
-        return elements[pos];
-    }
-    
-    threadgroup T& operator [] (size_t pos) threadgroup
-    {
-        return elements[pos];
-    }
-    constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
-    {
-        return elements[pos];
-    }
-};
-
-struct type_View
-{
-    float4x4 View_TranslatedWorldToClip;
-    float4x4 View_WorldToClip;
-    float4x4 View_ClipToWorld;
-    float4x4 View_TranslatedWorldToView;
-    float4x4 View_ViewToTranslatedWorld;
-    float4x4 View_TranslatedWorldToCameraView;
-    float4x4 View_CameraViewToTranslatedWorld;
-    float4x4 View_ViewToClip;
-    float4x4 View_ViewToClipNoAA;
-    float4x4 View_ClipToView;
-    float4x4 View_ClipToTranslatedWorld;
-    float4x4 View_SVPositionToTranslatedWorld;
-    float4x4 View_ScreenToWorld;
-    float4x4 View_ScreenToTranslatedWorld;
-    packed_float3 View_ViewForward;
-    float PrePadding_View_908;
-    packed_float3 View_ViewUp;
-    float PrePadding_View_924;
-    packed_float3 View_ViewRight;
-    float PrePadding_View_940;
-    packed_float3 View_HMDViewNoRollUp;
-    float PrePadding_View_956;
-    packed_float3 View_HMDViewNoRollRight;
-    float PrePadding_View_972;
-    float4 View_InvDeviceZToWorldZTransform;
-    float4 View_ScreenPositionScaleBias;
-    packed_float3 View_WorldCameraOrigin;
-    float PrePadding_View_1020;
-    packed_float3 View_TranslatedWorldCameraOrigin;
-    float PrePadding_View_1036;
-    packed_float3 View_WorldViewOrigin;
-    float PrePadding_View_1052;
-    packed_float3 View_PreViewTranslation;
-    float PrePadding_View_1068;
-    float4x4 View_PrevProjection;
-    float4x4 View_PrevViewProj;
-    float4x4 View_PrevViewRotationProj;
-    float4x4 View_PrevViewToClip;
-    float4x4 View_PrevClipToView;
-    float4x4 View_PrevTranslatedWorldToClip;
-    float4x4 View_PrevTranslatedWorldToView;
-    float4x4 View_PrevViewToTranslatedWorld;
-    float4x4 View_PrevTranslatedWorldToCameraView;
-    float4x4 View_PrevCameraViewToTranslatedWorld;
-    packed_float3 View_PrevWorldCameraOrigin;
-    float PrePadding_View_1724;
-    packed_float3 View_PrevWorldViewOrigin;
-    float PrePadding_View_1740;
-    packed_float3 View_PrevPreViewTranslation;
-    float PrePadding_View_1756;
-    float4x4 View_PrevInvViewProj;
-    float4x4 View_PrevScreenToTranslatedWorld;
-    float4x4 View_ClipToPrevClip;
-    float4 View_TemporalAAJitter;
-    float4 View_GlobalClippingPlane;
-    float2 View_FieldOfViewWideAngles;
-    float2 View_PrevFieldOfViewWideAngles;
-    float4 View_ViewRectMin;
-    float4 View_ViewSizeAndInvSize;
-    float4 View_BufferSizeAndInvSize;
-    float4 View_BufferBilinearUVMinMax;
-    int View_NumSceneColorMSAASamples;
-    float View_PreExposure;
-    float View_OneOverPreExposure;
-    float PrePadding_View_2076;
-    float4 View_DiffuseOverrideParameter;
-    float4 View_SpecularOverrideParameter;
-    float4 View_NormalOverrideParameter;
-    float2 View_RoughnessOverrideParameter;
-    float View_PrevFrameGameTime;
-    float View_PrevFrameRealTime;
-    float View_OutOfBoundsMask;
-    float PrePadding_View_2148;
-    float PrePadding_View_2152;
-    float PrePadding_View_2156;
-    packed_float3 View_WorldCameraMovementSinceLastFrame;
-    float View_CullingSign;
-    float View_NearPlane;
-    float View_AdaptiveTessellationFactor;
-    float View_GameTime;
-    float View_RealTime;
-    float View_DeltaTime;
-    float View_MaterialTextureMipBias;
-    float View_MaterialTextureDerivativeMultiply;
-    uint View_Random;
-    uint View_FrameNumber;
-    uint View_StateFrameIndexMod8;
-    uint View_StateFrameIndex;
-    float View_CameraCut;
-    float View_UnlitViewmodeMask;
-    float PrePadding_View_2228;
-    float PrePadding_View_2232;
-    float PrePadding_View_2236;
-    float4 View_DirectionalLightColor;
-    packed_float3 View_DirectionalLightDirection;
-    float PrePadding_View_2268;
-    float4 View_TranslucencyLightingVolumeMin[2];
-    float4 View_TranslucencyLightingVolumeInvSize[2];
-    float4 View_TemporalAAParams;
-    float4 View_CircleDOFParams;
-    float View_DepthOfFieldSensorWidth;
-    float View_DepthOfFieldFocalDistance;
-    float View_DepthOfFieldScale;
-    float View_DepthOfFieldFocalLength;
-    float View_DepthOfFieldFocalRegion;
-    float View_DepthOfFieldNearTransitionRegion;
-    float View_DepthOfFieldFarTransitionRegion;
-    float View_MotionBlurNormalizedToPixel;
-    float View_bSubsurfacePostprocessEnabled;
-    float View_GeneralPurposeTweak;
-    float View_DemosaicVposOffset;
-    float PrePadding_View_2412;
-    packed_float3 View_IndirectLightingColorScale;
-    float View_HDR32bppEncodingMode;
-    packed_float3 View_AtmosphericFogSunDirection;
-    float View_AtmosphericFogSunPower;
-    float View_AtmosphericFogPower;
-    float View_AtmosphericFogDensityScale;
-    float View_AtmosphericFogDensityOffset;
-    float View_AtmosphericFogGroundOffset;
-    float View_AtmosphericFogDistanceScale;
-    float View_AtmosphericFogAltitudeScale;
-    float View_AtmosphericFogHeightScaleRayleigh;
-    float View_AtmosphericFogStartDistance;
-    float View_AtmosphericFogDistanceOffset;
-    float View_AtmosphericFogSunDiscScale;
-    float View_AtmosphericFogSunDiscHalfApexAngleRadian;
-    float PrePadding_View_2492;
-    float4 View_AtmosphericFogSunDiscLuminance;
-    uint View_AtmosphericFogRenderMask;
-    uint View_AtmosphericFogInscatterAltitudeSampleNum;
-    uint PrePadding_View_2520;
-    uint PrePadding_View_2524;
-    float4 View_AtmosphericFogSunColor;
-    packed_float3 View_NormalCurvatureToRoughnessScaleBias;
-    float View_RenderingReflectionCaptureMask;
-    float4 View_AmbientCubemapTint;
-    float View_AmbientCubemapIntensity;
-    float View_SkyLightParameters;
-    float PrePadding_View_2584;
-    float PrePadding_View_2588;
-    float4 View_SkyLightColor;
-    float4 View_SkyIrradianceEnvironmentMap[7];
-    float View_MobilePreviewMode;
-    float View_HMDEyePaddingOffset;
-    float View_ReflectionCubemapMaxMip;
-    float View_ShowDecalsMask;
-    uint View_DistanceFieldAOSpecularOcclusionMode;
-    float View_IndirectCapsuleSelfShadowingIntensity;
-    float PrePadding_View_2744;
-    float PrePadding_View_2748;
-    packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
-    int View_StereoPassIndex;
-    float4 View_GlobalVolumeCenterAndExtent[4];
-    float4 View_GlobalVolumeWorldToUVAddAndMul[4];
-    float View_GlobalVolumeDimension;
-    float View_GlobalVolumeTexelSize;
-    float View_MaxGlobalDistance;
-    float PrePadding_View_2908;
-    int2 View_CursorPosition;
-    float View_bCheckerboardSubsurfaceProfileRendering;
-    float PrePadding_View_2924;
-    packed_float3 View_VolumetricFogInvGridSize;
-    float PrePadding_View_2940;
-    packed_float3 View_VolumetricFogGridZParams;
-    float PrePadding_View_2956;
-    float2 View_VolumetricFogSVPosToVolumeUV;
-    float View_VolumetricFogMaxDistance;
-    float PrePadding_View_2972;
-    packed_float3 View_VolumetricLightmapWorldToUVScale;
-    float PrePadding_View_2988;
-    packed_float3 View_VolumetricLightmapWorldToUVAdd;
-    float PrePadding_View_3004;
-    packed_float3 View_VolumetricLightmapIndirectionTextureSize;
-    float View_VolumetricLightmapBrickSize;
-    packed_float3 View_VolumetricLightmapBrickTexelSize;
-    float View_StereoIPD;
-    float View_IndirectLightingCacheShowFlag;
-    float View_EyeToPixelSpreadAngle;
-};
-
-struct type_PrimitiveDither
-{
-    float PrimitiveDither_LODFactor;
-};
-
-struct type_PrimitiveFade
-{
-    float2 PrimitiveFade_FadeTimeScaleBias;
-};
-
-struct type_Material
-{
-    float4 Material_VectorExpressions[9];
-    float4 Material_ScalarExpressions[3];
-};
-
-constant float _98 = {};
-constant float _103 = {};
-
-struct main0_out
-{
-    float4 out_var_SV_Target0 [[color(0)]];
-    float gl_FragDepth [[depth(less)]];
-};
-
-struct main0_in
-{
-    float4 in_var_TEXCOORD6 [[user(locn0)]];
-    float4 in_var_TEXCOORD7 [[user(locn1)]];
-    float4 in_var_TEXCOORD10_centroid [[user(locn2)]];
-    float4 in_var_TEXCOORD11_centroid [[user(locn3)]];
-    float4 in_var_TEXCOORD0_0 [[user(locn4)]];
-};
-
-fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_PrimitiveDither& PrimitiveDither [[buffer(1)]], constant type_PrimitiveFade& PrimitiveFade [[buffer(2)]], constant type_Material& Material [[buffer(3)]], texture2d<float> Material_Texture2D_0 [[texture(0)]], texture2d<float> Material_Texture2D_3 [[texture(1)]], sampler Material_Texture2D_0Sampler [[sampler(0)]], sampler Material_Texture2D_3Sampler [[sampler(1)]], float4 gl_FragCoord [[position]])
-{
-    main0_out out = {};
-    spvUnsafeArray<float4, 1> in_var_TEXCOORD0 = {};
-    in_var_TEXCOORD0[0] = in.in_var_TEXCOORD0_0;
-    float2 _135 = gl_FragCoord.xy - View.View_ViewRectMin.xy;
-    float4 _140 = float4(_103, _103, gl_FragCoord.z, 1.0) * float4(gl_FragCoord.w);
-    float4 _144 = View.View_SVPositionToTranslatedWorld * float4(gl_FragCoord.xyz, 1.0);
-    float3 _148 = _144.xyz / float3(_144.w);
-    float3 _149 = _148 - float3(View.View_PreViewTranslation);
-    float3 _151 = normalize(-_148);
-    float3 _152 = _151 * float3x3(in.in_var_TEXCOORD10_centroid.xyz, cross(in.in_var_TEXCOORD11_centroid.xyz, in.in_var_TEXCOORD10_centroid.xyz) * float3(in.in_var_TEXCOORD11_centroid.w), in.in_var_TEXCOORD11_centroid.xyz);
-    float _170 = mix(Material.Material_ScalarExpressions[0].y, Material.Material_ScalarExpressions[0].z, fast::min(fast::max(abs(dot(_151, in.in_var_TEXCOORD11_centroid.xyz)), 0.0), 1.0));
-    float _172 = 1.0 / _170;
-    float2 _174 = (float2(Material.Material_ScalarExpressions[0].x) * ((_152.xy * float2(-1.0)) / float2(_152.z))) * float2(_172);
-    float _180_copy;
-    float2 _183;
-    _183 = float2(0.0);
-    float _188;
-    float _211;
-    float2 _212;
-    float _180 = 1.0;
-    int _185 = 0;
-    float _187 = 1.0;
-    float _189 = 1.0;
-    for (;;)
-    {
-        if (float(_185) < (floor(_170) + 2.0))
-        {
-            _188 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _183), gradient2d(dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)), dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)))).y;
-            if (_180 < _188)
-            {
-                float _201 = _188 - _180;
-                float _203 = _201 / ((_189 - _187) + _201);
-                _211 = (_189 * _203) + (_180 * (1.0 - _203));
-                _212 = _183 - (float2(_203) * _174);
-                break;
-            }
-            _180_copy = _180;
-            _180 -= _172;
-            _183 += _174;
-            _185++;
-            _187 = _188;
-            _189 = _180_copy;
-            continue;
-        }
-        else
-        {
-            _211 = _98;
-            _212 = _183;
-            break;
-        }
-    }
-    float4 _218 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _212.xy), bias(View.View_MaterialTextureMipBias));
-    float2 _229 = _135 + float2(View.View_TemporalAAParams.x);
-    float _237 = float((uint(_229.x) + (2u * uint(_229.y))) % 5u);
-    float2 _238 = _135 * float2(0.015625);
-    float4 _242 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
-    float4 _254 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
-    float3 _272 = float3(_212, (1.0 - _211) * Material.Material_ScalarExpressions[0].x);
-    float2 _275 = dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
-    float2 _276 = abs(_275);
-    float3 _279 = dfdx(_149);
-    float2 _283 = dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
-    float2 _284 = abs(_283);
-    float3 _287 = dfdy(_149);
-    if (PrimitiveDither.PrimitiveDither_LODFactor != 0.0)
-    {
-        if (abs(PrimitiveDither.PrimitiveDither_LODFactor) > 0.001000000047497451305389404296875)
-        {
-            float _317 = fract(cos(dot(floor(gl_FragCoord.xy), float2(347.834503173828125, 3343.28369140625))) * 1000.0);
-            if ((float((PrimitiveDither.PrimitiveDither_LODFactor < 0.0) ? ((PrimitiveDither.PrimitiveDither_LODFactor + 1.0) > _317) : (PrimitiveDither.PrimitiveDither_LODFactor < _317)) - 0.001000000047497451305389404296875) < 0.0)
-            {
-                discard_fragment();
-            }
-        }
-    }
-    if ((((_218.z + ((fast::min(fast::max(1.0 - (_218.x * Material.Material_ScalarExpressions[2].y), 0.0), 1.0) + ((_237 + (_242.x * Material.Material_ScalarExpressions[2].z)) * 0.16666667163372039794921875)) + (-0.5))) * ((fast::clamp((View.View_RealTime * PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.x) + PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.y, 0.0, 1.0) + ((_237 + _254.x) * 0.16666667163372039794921875)) + (-0.5))) - 0.33329999446868896484375) < 0.0)
-    {
-        discard_fragment();
-    }
-    float2 _351 = ((((in.in_var_TEXCOORD6.xy / float2(in.in_var_TEXCOORD6.w)) - View.View_TemporalAAJitter.xy) - ((in.in_var_TEXCOORD7.xy / float2(in.in_var_TEXCOORD7.w)) - View.View_TemporalAAJitter.zw)) * float2(0.2495000064373016357421875)) + float2(0.49999237060546875);
-    out.gl_FragDepth = fast::min(_140.z / (_140.w + (sqrt(dot(_272, _272)) / (fast::max(sqrt(dot(_276, _276)) / sqrt(dot(_279, _279)), sqrt(dot(_284, _284)) / sqrt(dot(_287, _287))) / abs(dot(float3x3(View.View_ViewToTranslatedWorld[0].xyz, View.View_ViewToTranslatedWorld[1].xyz, View.View_ViewToTranslatedWorld[2].xyz) * float3(0.0, 0.0, 1.0), _151))))), gl_FragCoord.z);
-    out.out_var_SV_Target0 = float4(_351.x, _351.y, float2(0.0).x, float2(0.0).y);
-    return out;
-}
-

+ 0 - 350
3rdparty/spirv-cross/reference/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag

@@ -1,350 +0,0 @@
-#pragma clang diagnostic ignored "-Wmissing-prototypes"
-#pragma clang diagnostic ignored "-Wmissing-braces"
-
-#include <metal_stdlib>
-#include <simd/simd.h>
-
-using namespace metal;
-
-template<typename T, size_t Num>
-struct spvUnsafeArray
-{
-    T elements[Num ? Num : 1];
-    
-    thread T& operator [] (size_t pos) thread
-    {
-        return elements[pos];
-    }
-    constexpr const thread T& operator [] (size_t pos) const thread
-    {
-        return elements[pos];
-    }
-    
-    device T& operator [] (size_t pos) device
-    {
-        return elements[pos];
-    }
-    constexpr const device T& operator [] (size_t pos) const device
-    {
-        return elements[pos];
-    }
-    
-    constexpr const constant T& operator [] (size_t pos) const constant
-    {
-        return elements[pos];
-    }
-    
-    threadgroup T& operator [] (size_t pos) threadgroup
-    {
-        return elements[pos];
-    }
-    constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
-    {
-        return elements[pos];
-    }
-};
-
-struct type_View
-{
-    float4x4 View_TranslatedWorldToClip;
-    float4x4 View_WorldToClip;
-    float4x4 View_ClipToWorld;
-    float4x4 View_TranslatedWorldToView;
-    float4x4 View_ViewToTranslatedWorld;
-    float4x4 View_TranslatedWorldToCameraView;
-    float4x4 View_CameraViewToTranslatedWorld;
-    float4x4 View_ViewToClip;
-    float4x4 View_ViewToClipNoAA;
-    float4x4 View_ClipToView;
-    float4x4 View_ClipToTranslatedWorld;
-    float4x4 View_SVPositionToTranslatedWorld;
-    float4x4 View_ScreenToWorld;
-    float4x4 View_ScreenToTranslatedWorld;
-    packed_float3 View_ViewForward;
-    float PrePadding_View_908;
-    packed_float3 View_ViewUp;
-    float PrePadding_View_924;
-    packed_float3 View_ViewRight;
-    float PrePadding_View_940;
-    packed_float3 View_HMDViewNoRollUp;
-    float PrePadding_View_956;
-    packed_float3 View_HMDViewNoRollRight;
-    float PrePadding_View_972;
-    float4 View_InvDeviceZToWorldZTransform;
-    float4 View_ScreenPositionScaleBias;
-    packed_float3 View_WorldCameraOrigin;
-    float PrePadding_View_1020;
-    packed_float3 View_TranslatedWorldCameraOrigin;
-    float PrePadding_View_1036;
-    packed_float3 View_WorldViewOrigin;
-    float PrePadding_View_1052;
-    packed_float3 View_PreViewTranslation;
-    float PrePadding_View_1068;
-    float4x4 View_PrevProjection;
-    float4x4 View_PrevViewProj;
-    float4x4 View_PrevViewRotationProj;
-    float4x4 View_PrevViewToClip;
-    float4x4 View_PrevClipToView;
-    float4x4 View_PrevTranslatedWorldToClip;
-    float4x4 View_PrevTranslatedWorldToView;
-    float4x4 View_PrevViewToTranslatedWorld;
-    float4x4 View_PrevTranslatedWorldToCameraView;
-    float4x4 View_PrevCameraViewToTranslatedWorld;
-    packed_float3 View_PrevWorldCameraOrigin;
-    float PrePadding_View_1724;
-    packed_float3 View_PrevWorldViewOrigin;
-    float PrePadding_View_1740;
-    packed_float3 View_PrevPreViewTranslation;
-    float PrePadding_View_1756;
-    float4x4 View_PrevInvViewProj;
-    float4x4 View_PrevScreenToTranslatedWorld;
-    float4x4 View_ClipToPrevClip;
-    float4 View_TemporalAAJitter;
-    float4 View_GlobalClippingPlane;
-    float2 View_FieldOfViewWideAngles;
-    float2 View_PrevFieldOfViewWideAngles;
-    float4 View_ViewRectMin;
-    float4 View_ViewSizeAndInvSize;
-    float4 View_BufferSizeAndInvSize;
-    float4 View_BufferBilinearUVMinMax;
-    int View_NumSceneColorMSAASamples;
-    float View_PreExposure;
-    float View_OneOverPreExposure;
-    float PrePadding_View_2076;
-    float4 View_DiffuseOverrideParameter;
-    float4 View_SpecularOverrideParameter;
-    float4 View_NormalOverrideParameter;
-    float2 View_RoughnessOverrideParameter;
-    float View_PrevFrameGameTime;
-    float View_PrevFrameRealTime;
-    float View_OutOfBoundsMask;
-    float PrePadding_View_2148;
-    float PrePadding_View_2152;
-    float PrePadding_View_2156;
-    packed_float3 View_WorldCameraMovementSinceLastFrame;
-    float View_CullingSign;
-    float View_NearPlane;
-    float View_AdaptiveTessellationFactor;
-    float View_GameTime;
-    float View_RealTime;
-    float View_DeltaTime;
-    float View_MaterialTextureMipBias;
-    float View_MaterialTextureDerivativeMultiply;
-    uint View_Random;
-    uint View_FrameNumber;
-    uint View_StateFrameIndexMod8;
-    uint View_StateFrameIndex;
-    float View_CameraCut;
-    float View_UnlitViewmodeMask;
-    float PrePadding_View_2228;
-    float PrePadding_View_2232;
-    float PrePadding_View_2236;
-    float4 View_DirectionalLightColor;
-    packed_float3 View_DirectionalLightDirection;
-    float PrePadding_View_2268;
-    float4 View_TranslucencyLightingVolumeMin[2];
-    float4 View_TranslucencyLightingVolumeInvSize[2];
-    float4 View_TemporalAAParams;
-    float4 View_CircleDOFParams;
-    float View_DepthOfFieldSensorWidth;
-    float View_DepthOfFieldFocalDistance;
-    float View_DepthOfFieldScale;
-    float View_DepthOfFieldFocalLength;
-    float View_DepthOfFieldFocalRegion;
-    float View_DepthOfFieldNearTransitionRegion;
-    float View_DepthOfFieldFarTransitionRegion;
-    float View_MotionBlurNormalizedToPixel;
-    float View_bSubsurfacePostprocessEnabled;
-    float View_GeneralPurposeTweak;
-    float View_DemosaicVposOffset;
-    float PrePadding_View_2412;
-    packed_float3 View_IndirectLightingColorScale;
-    float View_HDR32bppEncodingMode;
-    packed_float3 View_AtmosphericFogSunDirection;
-    float View_AtmosphericFogSunPower;
-    float View_AtmosphericFogPower;
-    float View_AtmosphericFogDensityScale;
-    float View_AtmosphericFogDensityOffset;
-    float View_AtmosphericFogGroundOffset;
-    float View_AtmosphericFogDistanceScale;
-    float View_AtmosphericFogAltitudeScale;
-    float View_AtmosphericFogHeightScaleRayleigh;
-    float View_AtmosphericFogStartDistance;
-    float View_AtmosphericFogDistanceOffset;
-    float View_AtmosphericFogSunDiscScale;
-    float View_AtmosphericFogSunDiscHalfApexAngleRadian;
-    float PrePadding_View_2492;
-    float4 View_AtmosphericFogSunDiscLuminance;
-    uint View_AtmosphericFogRenderMask;
-    uint View_AtmosphericFogInscatterAltitudeSampleNum;
-    uint PrePadding_View_2520;
-    uint PrePadding_View_2524;
-    float4 View_AtmosphericFogSunColor;
-    packed_float3 View_NormalCurvatureToRoughnessScaleBias;
-    float View_RenderingReflectionCaptureMask;
-    float4 View_AmbientCubemapTint;
-    float View_AmbientCubemapIntensity;
-    float View_SkyLightParameters;
-    float PrePadding_View_2584;
-    float PrePadding_View_2588;
-    float4 View_SkyLightColor;
-    float4 View_SkyIrradianceEnvironmentMap[7];
-    float View_MobilePreviewMode;
-    float View_HMDEyePaddingOffset;
-    float View_ReflectionCubemapMaxMip;
-    float View_ShowDecalsMask;
-    uint View_DistanceFieldAOSpecularOcclusionMode;
-    float View_IndirectCapsuleSelfShadowingIntensity;
-    float PrePadding_View_2744;
-    float PrePadding_View_2748;
-    packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight;
-    int View_StereoPassIndex;
-    float4 View_GlobalVolumeCenterAndExtent[4];
-    float4 View_GlobalVolumeWorldToUVAddAndMul[4];
-    float View_GlobalVolumeDimension;
-    float View_GlobalVolumeTexelSize;
-    float View_MaxGlobalDistance;
-    float PrePadding_View_2908;
-    int2 View_CursorPosition;
-    float View_bCheckerboardSubsurfaceProfileRendering;
-    float PrePadding_View_2924;
-    packed_float3 View_VolumetricFogInvGridSize;
-    float PrePadding_View_2940;
-    packed_float3 View_VolumetricFogGridZParams;
-    float PrePadding_View_2956;
-    float2 View_VolumetricFogSVPosToVolumeUV;
-    float View_VolumetricFogMaxDistance;
-    float PrePadding_View_2972;
-    packed_float3 View_VolumetricLightmapWorldToUVScale;
-    float PrePadding_View_2988;
-    packed_float3 View_VolumetricLightmapWorldToUVAdd;
-    float PrePadding_View_3004;
-    packed_float3 View_VolumetricLightmapIndirectionTextureSize;
-    float View_VolumetricLightmapBrickSize;
-    packed_float3 View_VolumetricLightmapBrickTexelSize;
-    float View_StereoIPD;
-    float View_IndirectLightingCacheShowFlag;
-    float View_EyeToPixelSpreadAngle;
-};
-
-struct type_PrimitiveDither
-{
-    float PrimitiveDither_LODFactor;
-};
-
-struct type_PrimitiveFade
-{
-    float2 PrimitiveFade_FadeTimeScaleBias;
-};
-
-struct type_Material
-{
-    float4 Material_VectorExpressions[9];
-    float4 Material_ScalarExpressions[3];
-};
-
-constant float _98 = {};
-constant float _103 = {};
-
-struct main0_out
-{
-    float4 out_var_SV_Target0 [[color(0)]];
-    float gl_FragDepth [[depth(less)]];
-};
-
-struct main0_in
-{
-    float4 in_var_TEXCOORD6 [[user(locn0)]];
-    float4 in_var_TEXCOORD7 [[user(locn1)]];
-    float4 in_var_TEXCOORD10_centroid [[user(locn2)]];
-    float4 in_var_TEXCOORD11_centroid [[user(locn3)]];
-    float4 in_var_TEXCOORD0_0 [[user(locn4)]];
-};
-
-fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_PrimitiveDither& PrimitiveDither [[buffer(1)]], constant type_PrimitiveFade& PrimitiveFade [[buffer(2)]], constant type_Material& Material [[buffer(3)]], texture2d<float> Material_Texture2D_0 [[texture(0)]], texture2d<float> Material_Texture2D_3 [[texture(1)]], sampler Material_Texture2D_0Sampler [[sampler(0)]], sampler Material_Texture2D_3Sampler [[sampler(1)]], float4 gl_FragCoord [[position]])
-{
-    main0_out out = {};
-    spvUnsafeArray<float4, 1> in_var_TEXCOORD0 = {};
-    in_var_TEXCOORD0[0] = in.in_var_TEXCOORD0_0;
-    float2 _135 = gl_FragCoord.xy - View.View_ViewRectMin.xy;
-    float4 _140 = float4(_103, _103, gl_FragCoord.z, 1.0) * float4(gl_FragCoord.w);
-    float4 _144 = View.View_SVPositionToTranslatedWorld * float4(gl_FragCoord.xyz, 1.0);
-    float3 _148 = _144.xyz / float3(_144.w);
-    float3 _149 = _148 - float3(View.View_PreViewTranslation);
-    float3 _151 = normalize(-_148);
-    float3 _152 = _151 * float3x3(in.in_var_TEXCOORD10_centroid.xyz, cross(in.in_var_TEXCOORD11_centroid.xyz, in.in_var_TEXCOORD10_centroid.xyz) * float3(in.in_var_TEXCOORD11_centroid.w), in.in_var_TEXCOORD11_centroid.xyz);
-    float _170 = mix(Material.Material_ScalarExpressions[0].y, Material.Material_ScalarExpressions[0].z, fast::min(fast::max(abs(dot(_151, in.in_var_TEXCOORD11_centroid.xyz)), 0.0), 1.0));
-    float _172 = 1.0 / _170;
-    float2 _174 = (float2(Material.Material_ScalarExpressions[0].x) * ((_152.xy * float2(-1.0)) / float2(_152.z))) * float2(_172);
-    float _180_copy;
-    float2 _183;
-    _183 = float2(0.0);
-    float _188;
-    float _211;
-    float2 _212;
-    float _180 = 1.0;
-    int _185 = 0;
-    float _187 = 1.0;
-    float _189 = 1.0;
-    for (;;)
-    {
-        if (float(_185) < (floor(_170) + 2.0))
-        {
-            _188 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _183), gradient2d(dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)), dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y)))).y;
-            if (_180 < _188)
-            {
-                float _201 = _188 - _180;
-                float _203 = _201 / ((_189 - _187) + _201);
-                _211 = (_189 * _203) + (_180 * (1.0 - _203));
-                _212 = _183 - (float2(_203) * _174);
-                break;
-            }
-            _180_copy = _180;
-            _180 -= _172;
-            _183 += _174;
-            _185++;
-            _187 = _188;
-            _189 = _180_copy;
-            continue;
-        }
-        else
-        {
-            _211 = _98;
-            _212 = _183;
-            break;
-        }
-    }
-    float4 _218 = Material_Texture2D_0.sample(Material_Texture2D_0Sampler, (float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y) + _212.xy), bias(View.View_MaterialTextureMipBias));
-    float2 _229 = _135 + float2(View.View_TemporalAAParams.x);
-    float _237 = float((uint(_229.x) + (2u * uint(_229.y))) % 5u);
-    float2 _238 = _135 * float2(0.015625);
-    float4 _242 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
-    float4 _254 = Material_Texture2D_3.sample(Material_Texture2D_3Sampler, _238, bias(View.View_MaterialTextureMipBias));
-    float3 _272 = float3(_212, (1.0 - _211) * Material.Material_ScalarExpressions[0].x);
-    float2 _275 = dfdx(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
-    float2 _276 = abs(_275);
-    float3 _279 = dfdx(_149);
-    float2 _283 = dfdy(float2(in_var_TEXCOORD0[0].x, in_var_TEXCOORD0[0].y));
-    float2 _284 = abs(_283);
-    float3 _287 = dfdy(_149);
-    if (PrimitiveDither.PrimitiveDither_LODFactor != 0.0)
-    {
-        if (abs(PrimitiveDither.PrimitiveDither_LODFactor) > 0.001000000047497451305389404296875)
-        {
-            float _317 = fract(cos(dot(floor(gl_FragCoord.xy), float2(347.834503173828125, 3343.28369140625))) * 1000.0);
-            if ((float((PrimitiveDither.PrimitiveDither_LODFactor < 0.0) ? ((PrimitiveDither.PrimitiveDither_LODFactor + 1.0) > _317) : (PrimitiveDither.PrimitiveDither_LODFactor < _317)) - 0.001000000047497451305389404296875) < 0.0)
-            {
-                discard_fragment();
-            }
-        }
-    }
-    if ((((_218.z + ((fast::min(fast::max(1.0 - (_218.x * Material.Material_ScalarExpressions[2].y), 0.0), 1.0) + ((_237 + (_242.x * Material.Material_ScalarExpressions[2].z)) * 0.16666667163372039794921875)) + (-0.5))) * ((fast::clamp((View.View_RealTime * PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.x) + PrimitiveFade.PrimitiveFade_FadeTimeScaleBias.y, 0.0, 1.0) + ((_237 + _254.x) * 0.16666667163372039794921875)) + (-0.5))) - 0.33329999446868896484375) < 0.0)
-    {
-        discard_fragment();
-    }
-    float2 _351 = ((((in.in_var_TEXCOORD6.xy / float2(in.in_var_TEXCOORD6.w)) - View.View_TemporalAAJitter.xy) - ((in.in_var_TEXCOORD7.xy / float2(in.in_var_TEXCOORD7.w)) - View.View_TemporalAAJitter.zw)) * float2(0.2495000064373016357421875)) + float2(0.49999237060546875);
-    out.gl_FragDepth = fast::min(_140.z / (_140.w + (sqrt(dot(_272, _272)) / (fast::max(sqrt(dot(_276, _276)) / sqrt(dot(_279, _279)), sqrt(dot(_284, _284)) / sqrt(dot(_287, _287))) / abs(dot(float3x3(View.View_ViewToTranslatedWorld[0].xyz, View.View_ViewToTranslatedWorld[1].xyz, View.View_ViewToTranslatedWorld[2].xyz) * float3(0.0, 0.0, 1.0), _151))))), gl_FragCoord.z);
-    out.out_var_SV_Target0 = float4(_351.x, _351.y, float2(0.0).x, float2(0.0).y);
-    return out;
-}
-

+ 2 - 0
3rdparty/spirv-cross/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese

@@ -247,6 +247,7 @@ struct main0_out
     float4 out_var_TEXCOORD10_centroid [[user(locn2)]];
     float4 out_var_TEXCOORD11_centroid [[user(locn3)]];
     float gl_ClipDistance [[clip_distance]] [1];
+    float gl_ClipDistance_0 [[user(clip0)]];
     float4 gl_Position [[position]];
 };
 
@@ -410,6 +411,7 @@ struct main0_patchIn
     out.out_var_TEXCOORD10_centroid = float4(_256.x, _256.y, _256.z, _118.w);
     out.out_var_TEXCOORD11_centroid = _259;
     out.gl_ClipDistance[0u] = dot(View.View_GlobalClippingPlane, float4(_565.xyz - float3(View.View_PreViewTranslation), 1.0));
+    out.gl_ClipDistance_0 = out.gl_ClipDistance[0];
     return out;
 }
 

+ 0 - 122
3rdparty/spirv-cross/reference/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert

@@ -1,122 +0,0 @@
-#pragma clang diagnostic ignored "-Wmissing-prototypes"
-#pragma clang diagnostic ignored "-Wmissing-braces"
-
-#include <metal_stdlib>
-#include <simd/simd.h>
-
-using namespace metal;
-
-template<typename T, size_t Num>
-struct spvUnsafeArray
-{
-    T elements[Num ? Num : 1];
-    
-    thread T& operator [] (size_t pos) thread
-    {
-        return elements[pos];
-    }
-    constexpr const thread T& operator [] (size_t pos) const thread
-    {
-        return elements[pos];
-    }
-    
-    device T& operator [] (size_t pos) device
-    {
-        return elements[pos];
-    }
-    constexpr const device T& operator [] (size_t pos) const device
-    {
-        return elements[pos];
-    }
-    
-    constexpr const constant T& operator [] (size_t pos) const constant
-    {
-        return elements[pos];
-    }
-    
-    threadgroup T& operator [] (size_t pos) threadgroup
-    {
-        return elements[pos];
-    }
-    constexpr const threadgroup T& operator [] (size_t pos) const threadgroup
-    {
-        return elements[pos];
-    }
-};
-
-struct type_Globals
-{
-    float4 ViewportSize;
-    float ScatteringScaling;
-    float CocRadiusToCircumscribedRadius;
-};
-
-struct type_StructuredBuffer_v4float
-{
-    float4 _m0[1];
-};
-
-struct main0_out
-{
-    float2 out_var_TEXCOORD0 [[user(locn0)]];
-    float4 out_var_TEXCOORD1 [[user(locn1)]];
-    float4 out_var_TEXCOORD2 [[user(locn2)]];
-    float4 out_var_TEXCOORD3 [[user(locn3)]];
-    float4 out_var_TEXCOORD4 [[user(locn4)]];
-    float4 out_var_TEXCOORD5 [[user(locn5)]];
-    float4 out_var_TEXCOORD6 [[user(locn6)]];
-    float4 gl_Position [[position]];
-};
-
-vertex main0_out main0(constant type_Globals& _Globals [[buffer(0)]], const device type_StructuredBuffer_v4float& ScatterDrawList [[buffer(1)]], uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]])
-{
-    main0_out out = {};
-    uint _66 = gl_VertexIndex / 4u;
-    uint _68 = gl_VertexIndex - (_66 * 4u);
-    uint _70 = (16u * gl_InstanceIndex) + _66;
-    float _72;
-    _72 = 0.0;
-    spvUnsafeArray<float4, 4> _61;
-    spvUnsafeArray<float, 4> _62;
-    spvUnsafeArray<float2, 4> _63;
-    float _73;
-    uint _75 = 0u;
-    for (;;)
-    {
-        if (_75 < 4u)
-        {
-            uint _82 = ((5u * _70) + _75) + 1u;
-            _61[_75] = float4(ScatterDrawList._m0[_82].xyz, 0.0);
-            _62[_75] = ScatterDrawList._m0[_82].w;
-            if (_75 == 0u)
-            {
-                _73 = _62[_75];
-            }
-            else
-            {
-                _73 = fast::max(_72, _62[_75]);
-            }
-            _63[_75].x = (-0.5) / _62[_75];
-            _63[_75].y = (0.5 * _62[_75]) + 0.5;
-            _72 = _73;
-            _75++;
-            continue;
-        }
-        else
-        {
-            break;
-        }
-    }
-    float2 _144 = float2(_Globals.ScatteringScaling) * ScatterDrawList._m0[5u * _70].xy;
-    float2 _173 = (((float2((_72 * _Globals.CocRadiusToCircumscribedRadius) + 1.0) * ((float2(float(_68 % 2u), float(_68 / 2u)) * float2(2.0)) - float2(1.0))) + _144) + float2(0.5)) * _Globals.ViewportSize.zw;
-    out.out_var_TEXCOORD0 = _144;
-    out.out_var_TEXCOORD1 = float4(_61[0].xyz, _62[0]);
-    out.out_var_TEXCOORD2 = float4(_61[1].xyz, _62[1]);
-    out.out_var_TEXCOORD3 = float4(_61[2].xyz, _62[2]);
-    out.out_var_TEXCOORD4 = float4(_61[3].xyz, _62[3]);
-    out.out_var_TEXCOORD5 = float4(_63[0].x, _63[0].y, _63[1].x, _63[1].y);
-    out.out_var_TEXCOORD6 = float4(_63[2].x, _63[2].y, _63[3].x, _63[3].y);
-    out.gl_Position = float4((_173.x * 2.0) - 1.0, 1.0 - (_173.y * 2.0), 0.0, 1.0);
-    return out;
-}
-

+ 0 - 20
3rdparty/spirv-cross/reference/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp

@@ -1,20 +0,0 @@
-#version 450
-layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
-
-layout(binding = 1, rgba32f) uniform writeonly image2D outImageTexture;
-
-void main()
-{
-    int _27_copy;
-    int _30;
-    _30 = 7;
-    for (int _27 = 7; _27 >= 0; _27_copy = _27, _27--, _30 = _27_copy)
-    {
-        if (5.0 > float(_27))
-        {
-            break;
-        }
-    }
-    imageStore(outImageTexture, ivec2(gl_GlobalInvocationID.xy), vec4(float(_30 - 1), float(_30), 1.0, 1.0));
-}
-

+ 0 - 6
3rdparty/spirv-cross/reference/shaders/comp/barriers.comp

@@ -28,41 +28,35 @@ void group_barrier()
 
 void barrier_shared_exec()
 {
-    memoryBarrierShared();
     barrier();
 }
 
 void full_barrier_exec()
 {
     memoryBarrier();
-    memoryBarrierShared();
     barrier();
 }
 
 void image_barrier_exec()
 {
     memoryBarrierImage();
-    memoryBarrierShared();
     barrier();
 }
 
 void buffer_barrier_exec()
 {
     memoryBarrierBuffer();
-    memoryBarrierShared();
     barrier();
 }
 
 void group_barrier_exec()
 {
     groupMemoryBarrier();
-    memoryBarrierShared();
     barrier();
 }
 
 void exec_barrier()
 {
-    memoryBarrierShared();
     barrier();
 }
 

+ 0 - 1
3rdparty/spirv-cross/reference/shaders/comp/shared.comp

@@ -18,7 +18,6 @@ void main()
     uint ident = gl_GlobalInvocationID.x;
     float idata = _22.in_data[ident];
     sShared[gl_LocalInvocationIndex] = idata;
-    memoryBarrierShared();
     barrier();
     _44.out_data[ident] = sShared[(4u - gl_LocalInvocationIndex) - 1u];
 }

+ 91 - 0
3rdparty/spirv-cross/shaders-msl/asm/vert/clip-distance-plain-variable.asm.vert

@@ -0,0 +1,91 @@
+; SPIR-V
+; Version: 1.0
+; Generator: Khronos Glslang Reference Front End; 8
+; Bound: 56
+; Schema: 0
+               OpCapability Shader
+               OpCapability ClipDistance
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %main "main" %pos_1 %_entryPointOutput_pos %_entryPointOutput_clip
+               OpSource HLSL 500
+               OpName %main "main"
+               OpName %VSOut "VSOut"
+               OpMemberName %VSOut 0 "pos"
+               OpMemberName %VSOut 1 "clip"
+               OpName %_main_vf4_ "@main(vf4;"
+               OpName %pos "pos"
+               OpName %vout "vout"
+               OpName %pos_0 "pos"
+               OpName %pos_1 "pos"
+               OpName %flattenTemp "flattenTemp"
+               OpName %param "param"
+               OpName %_entryPointOutput_pos "@entryPointOutput.pos"
+               OpName %_entryPointOutput_clip "@entryPointOutput.clip"
+               OpDecorate %pos_1 Location 0
+               OpDecorate %_entryPointOutput_pos BuiltIn Position
+               OpDecorate %_entryPointOutput_clip BuiltIn ClipDistance
+       %void = OpTypeVoid
+          %3 = OpTypeFunction %void
+      %float = OpTypeFloat 32
+    %v4float = OpTypeVector %float 4
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+    %v2float = OpTypeVector %float 2
+      %VSOut = OpTypeStruct %v4float %v2float
+         %11 = OpTypeFunction %VSOut %_ptr_Function_v4float
+%_ptr_Function_VSOut = OpTypePointer Function %VSOut
+        %int = OpTypeInt 32 1
+      %int_0 = OpConstant %int 0
+      %int_1 = OpConstant %int 1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+%_ptr_Input_v4float = OpTypePointer Input %v4float
+      %pos_1 = OpVariable %_ptr_Input_v4float Input
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+%_entryPointOutput_pos = OpVariable %_ptr_Output_v4float Output
+       %uint = OpTypeInt 32 0
+     %uint_2 = OpConstant %uint 2
+%_arr_float_uint_2 = OpTypeArray %float %uint_2
+%_ptr_Output__arr_float_uint_2 = OpTypePointer Output %_arr_float_uint_2
+%_entryPointOutput_clip = OpVariable %_ptr_Output__arr_float_uint_2 Output
+     %uint_0 = OpConstant %uint 0
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Output_float = OpTypePointer Output %float
+     %uint_1 = OpConstant %uint 1
+       %main = OpFunction %void None %3
+          %5 = OpLabel
+      %pos_0 = OpVariable %_ptr_Function_v4float Function
+%flattenTemp = OpVariable %_ptr_Function_VSOut Function
+      %param = OpVariable %_ptr_Function_v4float Function
+         %32 = OpLoad %v4float %pos_1
+               OpStore %pos_0 %32
+         %35 = OpLoad %v4float %pos_0
+               OpStore %param %35
+         %36 = OpFunctionCall %VSOut %_main_vf4_ %param
+               OpStore %flattenTemp %36
+         %39 = OpAccessChain %_ptr_Function_v4float %flattenTemp %int_0
+         %40 = OpLoad %v4float %39
+               OpStore %_entryPointOutput_pos %40
+         %48 = OpAccessChain %_ptr_Function_float %flattenTemp %int_1 %uint_0
+         %49 = OpLoad %float %48
+         %51 = OpAccessChain %_ptr_Output_float %_entryPointOutput_clip %int_0
+               OpStore %51 %49
+         %53 = OpAccessChain %_ptr_Function_float %flattenTemp %int_1 %uint_1
+         %54 = OpLoad %float %53
+         %55 = OpAccessChain %_ptr_Output_float %_entryPointOutput_clip %int_1
+               OpStore %55 %54
+               OpReturn
+               OpFunctionEnd
+ %_main_vf4_ = OpFunction %VSOut None %11
+        %pos = OpFunctionParameter %_ptr_Function_v4float
+         %14 = OpLabel
+       %vout = OpVariable %_ptr_Function_VSOut Function
+         %19 = OpLoad %v4float %pos
+         %20 = OpAccessChain %_ptr_Function_v4float %vout %int_0
+               OpStore %20 %19
+         %22 = OpLoad %v4float %pos
+         %23 = OpVectorShuffle %v2float %22 %22 0 1
+         %25 = OpAccessChain %_ptr_Function_v2float %vout %int_1
+               OpStore %25 %23
+         %26 = OpLoad %VSOut %vout
+               OpReturnValue %26
+               OpFunctionEnd

+ 10 - 0
3rdparty/spirv-cross/shaders-msl/frag/clip-distance-varying.frag

@@ -0,0 +1,10 @@
+#version 450
+
+in float gl_ClipDistance[2];
+
+layout(location = 0) out vec4 FragColor;
+
+void main()
+{
+    FragColor = vec4(1.0 - gl_ClipDistance[0] - gl_ClipDistance[1]);
+}

+ 15 - 0
3rdparty/spirv-cross/shaders-msl/vert/clip-distance-block.vert

@@ -0,0 +1,15 @@
+#version 450
+
+layout(location = 0) in vec4 Position;
+out gl_PerVertex
+{
+	vec4 gl_Position;
+	float gl_ClipDistance[2];
+};
+
+void main()
+{
+    gl_Position = Position;
+    gl_ClipDistance[0] = Position.x;
+    gl_ClipDistance[1] = Position.y;
+}

+ 0 - 0
3rdparty/spirv-cross/shaders/asm/comp/phi-temporary-copy-loop-variable.asm.comp → 3rdparty/spirv-cross/shaders-no-opt/asm/comp/phi-temporary-copy-loop-variable.asm.invalid.comp


+ 0 - 0
3rdparty/spirv-cross/shaders-no-opt/asm/frag/do-while-continue-phi.asm.frag → 3rdparty/spirv-cross/shaders-no-opt/asm/frag/do-while-continue-phi.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/shaders/asm/frag/loop-merge-to-continue.asm.frag → 3rdparty/spirv-cross/shaders-no-opt/asm/frag/loop-merge-to-continue.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/shaders/asm/frag/selection-merge-to-continue.asm.frag → 3rdparty/spirv-cross/shaders-no-opt/asm/frag/selection-merge-to-continue.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/shaders/asm/frag/switch-merge-to-continue.asm.frag → 3rdparty/spirv-cross/shaders-no-opt/asm/frag/switch-merge-to-continue.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/shaders-ue4/asm/frag/accesschain-invalid-expression.asm.frag → 3rdparty/spirv-cross/shaders-ue4-no-opt/asm/frag/accesschain-invalid-expression.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/shaders-ue4/asm/frag/array-copy-error.asm.frag → 3rdparty/spirv-cross/shaders-ue4-no-opt/asm/frag/array-copy-error.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/shaders-ue4/asm/frag/phi-variable-declaration.asm.frag → 3rdparty/spirv-cross/shaders-ue4-no-opt/asm/frag/phi-variable-declaration.asm.invalid.frag


+ 0 - 0
3rdparty/spirv-cross/shaders-ue4/asm/vert/loop-accesschain-writethrough.asm.vert → 3rdparty/spirv-cross/shaders-ue4-no-opt/asm/vert/loop-accesschain-writethrough.asm.invalid.vert


+ 2 - 0
3rdparty/spirv-cross/spirv_cross_error_handling.hpp

@@ -35,6 +35,8 @@ namespace SPIRV_CROSS_NAMESPACE
 #ifdef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
 #if !defined(_MSC_VER) || defined(__clang__)
 [[noreturn]]
+#elif defined(_MSC_VER)
+__declspec(noreturn)
 #endif
 inline void
 report_and_abort(const std::string &msg)

+ 7 - 4
3rdparty/spirv-cross/spirv_glsl.cpp

@@ -9892,7 +9892,12 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
 		if (memory == ScopeWorkgroup) // Only need to consider memory within a group
 		{
 			if (semantics == MemorySemanticsWorkgroupMemoryMask)
-				statement("memoryBarrierShared();");
+			{
+				// OpControlBarrier implies a memory barrier for shared memory as well.
+				bool implies_shared_barrier = opcode == OpControlBarrier && execution_scope == ScopeWorkgroup;
+				if (!implies_shared_barrier)
+					statement("memoryBarrierShared();");
+			}
 			else if (semantics != 0)
 				statement("groupMemoryBarrier();");
 		}
@@ -9926,7 +9931,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
 		else
 		{
 			const uint32_t all_barriers = MemorySemanticsWorkgroupMemoryMask | MemorySemanticsUniformMemoryMask |
-			                              MemorySemanticsImageMemoryMask | MemorySemanticsAtomicCounterMemoryMask;
+			                              MemorySemanticsImageMemoryMask;
 
 			if (semantics & (MemorySemanticsCrossWorkgroupMemoryMask | MemorySemanticsSubgroupMemoryMask))
 			{
@@ -9948,8 +9953,6 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
 					statement("memoryBarrierBuffer();");
 				if (semantics & MemorySemanticsImageMemoryMask)
 					statement("memoryBarrierImage();");
-				if (semantics & MemorySemanticsAtomicCounterMemoryMask)
-					statement("memoryBarrierAtomicCounter();");
 			}
 		}
 

+ 93 - 20
3rdparty/spirv-cross/spirv_msl.cpp

@@ -1611,9 +1611,23 @@ void CompilerMSL::add_composite_variable_to_interface_block(StorageClass storage
 	if (is_builtin)
 		set_name(var.self, builtin_to_glsl(builtin, StorageClassFunction));
 
-	// Only flatten/unflatten IO composites for non-tessellation cases where arrays are not stripped.
-	if (!strip_array)
+	bool flatten_from_ib_var = false;
+
+	if (storage == StorageClassOutput && is_builtin && builtin == BuiltInClipDistance)
+	{
+		// Also declare [[clip_distance]] attribute here.
+		uint32_t clip_array_mbr_idx = uint32_t(ib_type.member_types.size());
+		ib_type.member_types.push_back(get_variable_data_type_id(var));
+		set_member_decoration(ib_type.self, clip_array_mbr_idx, DecorationBuiltIn, BuiltInClipDistance);
+		set_member_name(ib_type.self, clip_array_mbr_idx, builtin_to_glsl(BuiltInClipDistance, StorageClassOutput));
+
+		// When we flatten, we flatten directly from the "out" struct,
+		// not from a function variable.
+		flatten_from_ib_var = true;
+	}
+	else if (!strip_array)
 	{
+		// Only flatten/unflatten IO composites for non-tessellation cases where arrays are not stripped.
 		entry_func.add_local_variable(var.self);
 		// We need to declare the variable early and at entry-point scope.
 		vars_needing_early_declaration.push_back(var.self);
@@ -1668,6 +1682,12 @@ void CompilerMSL::add_composite_variable_to_interface_block(StorageClass storage
 			set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
 			mark_location_as_used_by_shader(locn, storage);
 		}
+		else if (is_builtin && builtin == BuiltInClipDistance)
+		{
+			// Declare the ClipDistance as [[user(clipN)]].
+			set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, BuiltInClipDistance);
+			set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, i);
+		}
 
 		if (get_decoration_bitset(var.self).get(DecorationIndex))
 		{
@@ -1707,6 +1727,8 @@ void CompilerMSL::add_composite_variable_to_interface_block(StorageClass storage
 						    remap_swizzle(padded_type, usable_type->vecsize, join(to_name(var.self), "[", i, "]")),
 						    ";");
 					}
+					else if (flatten_from_ib_var)
+						statement(ib_var_ref, ".", mbr_name, " = ", ib_var_ref, ".", to_name(var.self), "[", i, "];");
 					else
 						statement(ib_var_ref, ".", mbr_name, " = ", to_name(var.self), "[", i, "];");
 				});
@@ -1754,7 +1776,7 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
 	auto &entry_func = get<SPIRFunction>(ir.default_entry_point);
 	auto &var_type = strip_array ? get_variable_element_type(var) : get_variable_data_type(var);
 
-	BuiltIn builtin;
+	BuiltIn builtin = BuiltInMax;
 	bool is_builtin = is_member_builtin(var_type, mbr_idx, &builtin);
 	bool is_flat =
 	    has_member_decoration(var_type.self, mbr_idx, DecorationFlat) || has_decoration(var.self, DecorationFlat);
@@ -1790,6 +1812,21 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
 	while (is_array(*usable_type) || is_matrix(*usable_type))
 		usable_type = &get<SPIRType>(usable_type->parent_type);
 
+	bool flatten_from_ib_var = false;
+
+	if (storage == StorageClassOutput && is_builtin && builtin == BuiltInClipDistance)
+	{
+		// Also declare [[clip_distance]] attribute here.
+		uint32_t clip_array_mbr_idx = uint32_t(ib_type.member_types.size());
+		ib_type.member_types.push_back(mbr_type_id);
+		set_member_decoration(ib_type.self, clip_array_mbr_idx, DecorationBuiltIn, BuiltInClipDistance);
+		set_member_name(ib_type.self, clip_array_mbr_idx, builtin_to_glsl(BuiltInClipDistance, StorageClassOutput));
+
+		// When we flatten, we flatten directly from the "out" struct,
+		// not from a function variable.
+		flatten_from_ib_var = true;
+	}
+
 	for (uint32_t i = 0; i < elem_cnt; i++)
 	{
 		// Add a reference to the variable type to the interface struct.
@@ -1818,6 +1855,12 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
 			set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
 			mark_location_as_used_by_shader(locn, storage);
 		}
+		else if (is_builtin && builtin == BuiltInClipDistance)
+		{
+			// Declare the ClipDistance as [[user(clipN)]].
+			set_member_decoration(ib_type.self, ib_mbr_idx, DecorationBuiltIn, BuiltInClipDistance);
+			set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, i);
+		}
 
 		if (has_member_decoration(var_type.self, mbr_idx, DecorationComponent))
 			SPIRV_CROSS_THROW("DecorationComponent on matrices and arrays make little sense.");
@@ -1849,8 +1892,16 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
 
 			case StorageClassOutput:
 				entry_func.fixup_hooks_out.push_back([=, &var, &var_type]() {
-					statement(ib_var_ref, ".", mbr_name, " = ", to_name(var.self), ".",
-					          to_member_name(var_type, mbr_idx), "[", i, "];");
+					if (flatten_from_ib_var)
+					{
+						statement(ib_var_ref, ".", mbr_name, " = ", ib_var_ref, ".",
+						          to_member_name(var_type, mbr_idx), "[", i, "];");
+					}
+					else
+					{
+						statement(ib_var_ref, ".", mbr_name, " = ", to_name(var.self), ".",
+						          to_member_name(var_type, mbr_idx), "[", i, "];");
+					}
 				});
 				break;
 
@@ -2148,10 +2199,15 @@ void CompilerMSL::add_variable_to_interface_block(StorageClass storage, const st
 
 				if (!is_builtin || has_active_builtin(builtin, storage))
 				{
-					if ((!is_builtin ||
-					     (storage == StorageClassInput && get_execution_model() != ExecutionModelFragment)) &&
-					    (storage == StorageClassInput || storage == StorageClassOutput) &&
-					    (is_matrix(mbr_type) || is_array(mbr_type)))
+					bool is_composite_type = is_matrix(mbr_type) || is_array(mbr_type);
+					bool attribute_load_store = storage == StorageClassInput && get_execution_model() != ExecutionModelFragment;
+					bool storage_is_stage_io = storage == StorageClassInput || storage == StorageClassOutput;
+
+					// ClipDistance always needs to be declared as user attributes.
+					if (builtin == BuiltInClipDistance)
+						is_builtin = false;
+
+					if ((!is_builtin || attribute_load_store) && storage_is_stage_io && is_composite_type)
 					{
 						add_composite_member_variable_to_interface_block(storage, ib_var_ref, ib_type, var, mbr_idx,
 						                                                 strip_array);
@@ -2175,10 +2231,17 @@ void CompilerMSL::add_variable_to_interface_block(StorageClass storage, const st
 	{
 		if (!is_builtin || has_active_builtin(builtin, storage))
 		{
+			bool is_composite_type = is_matrix(var_type) || is_array(var_type);
+			bool storage_is_stage_io =
+					storage == StorageClassInput || (storage == StorageClassOutput && !capture_output_to_buffer);
+			bool attribute_load_store = storage == StorageClassInput && get_execution_model() != ExecutionModelFragment;
+
+			// ClipDistance always needs to be declared as user attributes.
+			if (builtin == BuiltInClipDistance)
+				is_builtin = false;
+
 			// MSL does not allow matrices or arrays in input or output variables, so need to handle it specially.
-			if ((!is_builtin || (storage == StorageClassInput && get_execution_model() != ExecutionModelFragment)) &&
-			    (storage == StorageClassInput || (storage == StorageClassOutput && !capture_output_to_buffer)) &&
-			    (is_matrix(var_type) || is_array(var_type)))
+			if ((!is_builtin || attribute_load_store) && storage_is_stage_io && is_composite_type)
 			{
 				add_composite_variable_to_interface_block(storage, ib_var_ref, ib_type, var, strip_array);
 			}
@@ -2266,6 +2329,11 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
 		bool filter_patch_decoration = (has_decoration(var_id, DecorationPatch) || is_patch_block(type)) == patch;
 
 		bool hidden = is_hidden_variable(var, incl_builtins);
+
+		// ClipDistance is never hidden, we need to emulate it when used as an input.
+		if (bi_type == BuiltInClipDistance)
+			hidden = false;
+
 		// Barycentric inputs must be emitted in stage-in, because they can have interpolation arguments.
 		if (is_active && (bi_type == BuiltInBaryCoordNV || bi_type == BuiltInBaryCoordNoPerspNV))
 		{
@@ -6445,8 +6513,7 @@ void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uin
 
 		// Fix tessellation patch function processing
 		if (get_execution_model() == ExecutionModelTessellationControl ||
-		    (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask |
-		                MemorySemanticsAtomicCounterMemoryMask)))
+		    (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask)))
 		{
 			if (!mem_flags.empty())
 				mem_flags += " | ";
@@ -6467,13 +6534,11 @@ void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uin
 	else
 	{
 		if ((mem_sem & (MemorySemanticsUniformMemoryMask | MemorySemanticsCrossWorkgroupMemoryMask)) &&
-		    (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask |
-		                MemorySemanticsAtomicCounterMemoryMask)))
+		    (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask)))
 			bar_stmt += "mem_flags::mem_device_and_threadgroup";
 		else if (mem_sem & (MemorySemanticsUniformMemoryMask | MemorySemanticsCrossWorkgroupMemoryMask))
 			bar_stmt += "mem_flags::mem_device";
-		else if (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask |
-		                    MemorySemanticsAtomicCounterMemoryMask))
+		else if (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask))
 			bar_stmt += "mem_flags::mem_threadgroup";
 		else if (mem_sem & MemorySemanticsImageMemoryMask)
 			bar_stmt += "mem_flags::mem_texture";
@@ -8421,9 +8486,14 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
 				/* fallthrough */
 			case BuiltInPosition:
 			case BuiltInLayer:
-			case BuiltInClipDistance:
 				return string(" [[") + builtin_qualifier(builtin) + "]]" + (mbr_type.array.empty() ? "" : " ");
 
+			case BuiltInClipDistance:
+				if (has_member_decoration(type.self, index, DecorationLocation))
+					return join(" [[user(clip", get_member_decoration(type.self, index, DecorationLocation), ")]]");
+				else
+					return string(" [[") + builtin_qualifier(builtin) + "]]" + (mbr_type.array.empty() ? "" : " ");
+
 			default:
 				return "";
 			}
@@ -8521,6 +8591,9 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
 				quals = builtin_qualifier(builtin);
 				break;
 
+			case BuiltInClipDistance:
+				return join(" [[user(clip", get_member_decoration(type.self, index, DecorationLocation), ")]]");
+
 			default:
 				break;
 			}
@@ -11958,7 +12031,7 @@ void CompilerMSL::MemberSorter::sort()
 	size_t mbr_cnt = type.member_types.size();
 	SmallVector<uint32_t> mbr_idxs(mbr_cnt);
 	iota(mbr_idxs.begin(), mbr_idxs.end(), 0); // Fill with consecutive indices
-	std::sort(mbr_idxs.begin(), mbr_idxs.end(), *this); // Sort member indices based on sorting aspect
+	std::stable_sort(mbr_idxs.begin(), mbr_idxs.end(), *this); // Sort member indices based on sorting aspect
 
 	// Move type and meta member info to the order defined by the sorted member indices.
 	// This is done by creating temporary copies of both member types and meta, and then

+ 15 - 12
3rdparty/spirv-cross/test_shaders.sh

@@ -1,5 +1,7 @@
 #!/bin/bash
 
+OPTS=$@
+
 if [ -z "$SPIRV_CROSS_PATH" ]; then
 	echo "Building spirv-cross"
 	make -j$(nproc)
@@ -11,16 +13,17 @@ echo "Using glslangValidation in: $(which glslangValidator)."
 echo "Using spirv-opt in: $(which spirv-opt)."
 echo "Using SPIRV-Cross in: \"$SPIRV_CROSS_PATH\"."
 
-./test_shaders.py shaders --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-no-opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-msl --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-msl --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-msl-no-opt --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-hlsl --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-hlsl --hlsl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-hlsl-no-opt --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-reflection --reflect --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-ue4 --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-ue4 --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders ${OPTS} --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders ${OPTS} --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-no-opt ${OPTS} --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-msl ${OPTS} --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-msl ${OPTS} --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-msl-no-opt ${OPTS} --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-hlsl ${OPTS} --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-hlsl ${OPTS} --hlsl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-hlsl-no-opt ${OPTS} --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-reflection ${OPTS} --reflect --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-ue4 ${OPTS} --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-ue4 ${OPTS} --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
+./test_shaders.py shaders-ue4-no-opt ${OPTS} --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
 

+ 1 - 24
3rdparty/spirv-cross/update_test_shaders.sh

@@ -1,27 +1,4 @@
 #!/bin/bash
 
-if [ -z "$SPIRV_CROSS_PATH" ]; then
-	echo "Building spirv-cross"
-	make -j$(nproc)
-	SPIRV_CROSS_PATH="./spirv-cross"
-fi
-
-export PATH="./external/glslang-build/output/bin:./external/spirv-tools-build/output/bin:.:$PATH"
-echo "Using glslangValidation in: $(which glslangValidator)."
-echo "Using spirv-opt in: $(which spirv-opt)."
-echo "Using SPIRV-Cross in: \"$SPIRV_CROSS_PATH\"."
-
-./test_shaders.py shaders --update --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders --update --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-no-opt --update --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-msl --update --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-msl --update --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-msl-no-opt --update --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-hlsl --update --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-hlsl --update --hlsl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-hlsl-no-opt --update --hlsl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-reflection --reflect --update --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-ue4 --update --msl --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-./test_shaders.py shaders-ue4 --update --msl --opt --spirv-cross "$SPIRV_CROSS_PATH" || exit 1
-
+./test_shaders.sh --update