Parcourir la source

Updated spirv-cross.

Бранимир Караџић il y a 6 ans
Parent
commit
53285a62a7

+ 1 - 1
3rdparty/spirv-cross/CMakeLists.txt

@@ -308,7 +308,7 @@ if (SPIRV_CROSS_STATIC)
 endif()
 
 set(spirv-cross-abi-major 0)
-set(spirv-cross-abi-minor 19)
+set(spirv-cross-abi-minor 20)
 set(spirv-cross-abi-patch 0)
 
 if (SPIRV_CROSS_SHARED)

+ 63 - 0
3rdparty/spirv-cross/gn/BUILD.gn

@@ -0,0 +1,63 @@
+# Copyright (C) 2019 Google, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+config("spirv_cross_public") {
+  include_dirs = [ ".." ]
+
+  defines = [ "SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS" ]
+}
+
+source_set("spirv_cross_sources") {
+  public_configs = [ ":spirv_cross_public" ]
+
+  sources = [
+    "../GLSL.std.450.h",
+    "../spirv.hpp",
+    "../spirv_cfg.cpp",
+    "../spirv_cfg.hpp",
+    "../spirv_common.hpp",
+    "../spirv_cross.cpp",
+    "../spirv_cross.hpp",
+    "../spirv_cross_containers.hpp",
+    "../spirv_cross_error_handling.hpp",
+    "../spirv_cross_parsed_ir.cpp",
+    "../spirv_cross_parsed_ir.hpp",
+    "../spirv_cross_util.cpp",
+    "../spirv_cross_util.hpp",
+    "../spirv_glsl.cpp",
+    "../spirv_glsl.hpp",
+    "../spirv_msl.cpp",
+    "../spirv_msl.hpp",
+    "../spirv_parser.cpp",
+    "../spirv_parser.hpp",
+    "../spirv_reflect.cpp",
+    "../spirv_reflect.hpp",
+  ]
+
+  cflags = [ "-fno-exceptions" ]
+
+  if (is_clang) {
+    cflags_cc = [
+      "-Wno-extra-semi",
+      "-Wno-ignored-qualifiers",
+      "-Wno-implicit-fallthrough",
+      "-Wno-inconsistent-missing-override",
+      "-Wno-missing-field-initializers",
+      "-Wno-newline-eof",
+      "-Wno-sign-compare",
+      "-Wno-unused-variable",
+    ]
+  }
+}

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

@@ -0,0 +1,366 @@
+#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;
+}
+

+ 10 - 0
3rdparty/spirv-cross/reference/opt/shaders/tese/load-array-of-array.tese

@@ -0,0 +1,10 @@
+#version 450
+layout(quads, ccw, equal_spacing) in;
+
+layout(location = 0) in vec4 vTexCoord[][1];
+
+void main()
+{
+    gl_Position = (vTexCoord[0u][0] + vTexCoord[2u][0]) + vTexCoord[3u][0];
+}
+

+ 24 - 0
3rdparty/spirv-cross/reference/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp

@@ -0,0 +1,24 @@
+#version 460
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+
+layout(binding = 0, std430) buffer Output
+{
+    int myout;
+} _5;
+
+int foo()
+{
+    return 12;
+}
+
+void main()
+{
+    int _17 = foo();
+    while (true)
+    {
+        _5.myout = _17;
+        return;
+    }
+    _5.myout = _17;
+}
+

+ 16 - 0
3rdparty/spirv-cross/reference/shaders/tese/load-array-of-array.tese

@@ -0,0 +1,16 @@
+#version 450
+layout(quads, ccw, equal_spacing) in;
+
+layout(location = 0) in vec4 vTexCoord[][1];
+
+void main()
+{
+    vec4 _17_unrolled[32][1];
+    for (int i = 0; i < int(32); i++)
+    {
+        _17_unrolled[i] = vTexCoord[i];
+    }
+    vec4 tmp[32][1] = _17_unrolled;
+    gl_Position = (tmp[0][0] + tmp[2][0]) + tmp[3][0];
+}
+

+ 54 - 0
3rdparty/spirv-cross/shaders-no-opt/asm/comp/access-tracking-function-call-result.asm.comp

@@ -0,0 +1,54 @@
+; SPIR-V
+; Version: 1.5
+; Generator: Khronos SPIR-V Tools Assembler; 0
+; Bound: 25
+; Schema: 0
+               OpCapability Shader
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint GLCompute %main "main"
+               OpExecutionMode %main LocalSize 1 1 1
+               OpSource GLSL 460
+               OpName %main "main"
+               OpName %foo_ "foo("
+               OpName %Output "Output"
+               OpMemberName %Output 0 "myout"
+               OpName %_ ""
+               OpMemberDecorate %Output 0 Offset 0
+               OpDecorate %Output BufferBlock
+               OpDecorate %_ DescriptorSet 0
+               OpDecorate %_ Binding 0
+       %void = OpTypeVoid
+          %7 = OpTypeFunction %void
+        %int = OpTypeInt 32 1
+          %9 = OpTypeFunction %int
+     %int_12 = OpConstant %int 12
+       %bool = OpTypeBool
+       %true = OpConstantTrue %bool
+     %Output = OpTypeStruct %int
+%_ptr_Uniform_Output = OpTypePointer Uniform %Output
+          %_ = OpVariable %_ptr_Uniform_Output Uniform
+      %int_0 = OpConstant %int 0
+%_ptr_Uniform_int = OpTypePointer Uniform %int
+       %main = OpFunction %void None %7
+         %16 = OpLabel
+         %17 = OpFunctionCall %int %foo_
+               OpBranch %18
+         %18 = OpLabel
+               OpLoopMerge %19 %20 None
+               OpBranchConditional %true %21 %19
+         %21 = OpLabel
+         %22 = OpAccessChain %_ptr_Uniform_int %_ %int_0
+               OpStore %22 %17
+               OpReturn
+         %20 = OpLabel
+               OpBranch %18
+         %19 = OpLabel
+         %23 = OpAccessChain %_ptr_Uniform_int %_ %int_0
+               OpStore %23 %17
+               OpReturn
+               OpFunctionEnd
+       %foo_ = OpFunction %int None %9
+         %24 = OpLabel
+               OpReturnValue %int_12
+               OpFunctionEnd

+ 10 - 0
3rdparty/spirv-cross/shaders/tese/load-array-of-array.tese

@@ -0,0 +1,10 @@
+#version 450
+layout(ccw, quads) in;
+
+layout(location = 0) in vec4 vTexCoord[][1];
+
+void main()
+{
+	vec4 tmp[gl_MaxPatchVertices][1] = vTexCoord;
+	gl_Position = tmp[0][0] + tmp[2][0] + tmp[3][0];
+}

+ 4 - 3
3rdparty/spirv-cross/spirv_cross.cpp

@@ -2902,6 +2902,10 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3
 		if (length < 3)
 			return false;
 
+		// Return value may be a temporary.
+		if (compiler.get_type(args[0]).basetype != SPIRType::Void)
+			notify_variable_access(args[1], current_block->self);
+
 		length -= 3;
 		args += 3;
 
@@ -2922,9 +2926,6 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3
 			// Might try to copy a Phi variable here.
 			notify_variable_access(args[i], current_block->self);
 		}
-
-		// Return value may be a temporary.
-		notify_variable_access(args[1], current_block->self);
 		break;
 	}
 

+ 29 - 0
3rdparty/spirv-cross/spirv_cross_c.cpp

@@ -569,6 +569,30 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c
 	case SPVC_COMPILER_OPTION_MSL_DYNAMIC_OFFSETS_BUFFER_INDEX:
 		options->msl.dynamic_offsets_buffer_index = value;
 		break;
+
+	case SPVC_COMPILER_OPTION_MSL_TEXTURE_1D_AS_2D:
+		options->msl.texture_1D_as_2D = value != 0;
+		break;
+
+	case SPVC_COMPILER_OPTION_MSL_ENABLE_BASE_INDEX_ZERO:
+		options->msl.enable_base_index_zero = value != 0;
+		break;
+
+	case SPVC_COMPILER_OPTION_MSL_IOS_FRAMEBUFFER_FETCH_SUBPASS:
+		options->msl.ios_use_framebuffer_fetch_subpasses = value != 0;
+		break;
+
+	case SPVC_COMPILER_OPTION_MSL_INVARIANT_FP_MATH:
+		options->msl.invariant_float_math = value != 0;
+		break;
+
+	case SPVC_COMPILER_OPTION_MSL_EMULATE_CUBEMAP_ARRAY:
+		options->msl.emulate_cube_array = value != 0;
+		break;
+
+	case SPVC_COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING:
+		options->msl.enable_decoration_binding = value != 0;
+		break;
 #endif
 
 	default:
@@ -1639,6 +1663,11 @@ spvc_type spvc_compiler_get_type_handle(spvc_compiler compiler, spvc_type_id id)
 	SPVC_END_SAFE_SCOPE(compiler->context, nullptr)
 }
 
+spvc_type_id spvc_type_get_base_type_id(spvc_type type)
+{
+	return type->self;
+}
+
 static spvc_basetype convert_basetype(SPIRType::BaseType type)
 {
 	// For now the enums match up.

+ 13 - 1
3rdparty/spirv-cross/spirv_cross_c.h

@@ -33,7 +33,7 @@ extern "C" {
 /* Bumped if ABI or API breaks backwards compatibility. */
 #define SPVC_C_API_VERSION_MAJOR 0
 /* Bumped if APIs or enumerations are added in a backwards compatible way. */
-#define SPVC_C_API_VERSION_MINOR 19
+#define SPVC_C_API_VERSION_MINOR 20
 /* Bumped if internal implementation details change. */
 #define SPVC_C_API_VERSION_PATCH 0
 
@@ -527,6 +527,12 @@ typedef enum spvc_compiler_option
 	SPVC_COMPILER_OPTION_MSL_VIEW_INDEX_FROM_DEVICE_INDEX = 41 | SPVC_COMPILER_OPTION_MSL_BIT,
 	SPVC_COMPILER_OPTION_MSL_DISPATCH_BASE = 42 | SPVC_COMPILER_OPTION_MSL_BIT,
 	SPVC_COMPILER_OPTION_MSL_DYNAMIC_OFFSETS_BUFFER_INDEX = 43 | SPVC_COMPILER_OPTION_MSL_BIT,
+	SPVC_COMPILER_OPTION_MSL_TEXTURE_1D_AS_2D = 44 | SPVC_COMPILER_OPTION_MSL_BIT,
+	SPVC_COMPILER_OPTION_MSL_ENABLE_BASE_INDEX_ZERO = 45 | SPVC_COMPILER_OPTION_MSL_BIT,
+	SPVC_COMPILER_OPTION_MSL_IOS_FRAMEBUFFER_FETCH_SUBPASS = 46 | SPVC_COMPILER_OPTION_MSL_BIT,
+	SPVC_COMPILER_OPTION_MSL_INVARIANT_FP_MATH = 47 | SPVC_COMPILER_OPTION_MSL_BIT,
+	SPVC_COMPILER_OPTION_MSL_EMULATE_CUBEMAP_ARRAY = 48 | SPVC_COMPILER_OPTION_MSL_BIT,
+	SPVC_COMPILER_OPTION_MSL_ENABLE_DECORATION_BINDING = 49 | SPVC_COMPILER_OPTION_MSL_BIT,
 
 	SPVC_COMPILER_OPTION_INT_MAX = 0x7fffffff
 } spvc_compiler_option;
@@ -713,6 +719,12 @@ SPVC_PUBLIC_API SpvExecutionModel spvc_compiler_get_execution_model(spvc_compile
  */
 SPVC_PUBLIC_API spvc_type spvc_compiler_get_type_handle(spvc_compiler compiler, spvc_type_id id);
 
+/* Pulls out SPIRType::self. This effectively gives the type ID without array or pointer qualifiers.
+ * This is necessary when reflecting decoration/name information on members of a struct,
+ * which are placed in the base type, not the qualified type.
+ * This is similar to spvc_reflected_resource::base_type_id. */
+SPVC_PUBLIC_API spvc_type_id spvc_type_get_base_type_id(spvc_type type);
+
 SPVC_PUBLIC_API spvc_basetype spvc_type_get_basetype(spvc_type type);
 SPVC_PUBLIC_API unsigned spvc_type_get_bit_width(spvc_type type);
 SPVC_PUBLIC_API unsigned spvc_type_get_vector_size(spvc_type type);

+ 3 - 1
3rdparty/spirv-cross/spirv_cross_error_handling.hpp

@@ -17,10 +17,12 @@
 #ifndef SPIRV_CROSS_ERROR_HANDLING
 #define SPIRV_CROSS_ERROR_HANDLING
 
-#include <stdexcept>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string>
+#ifndef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
+#include <stdexcept>
+#endif
 
 #ifdef SPIRV_CROSS_NAMESPACE_OVERRIDE
 #define SPIRV_CROSS_NAMESPACE SPIRV_CROSS_NAMESPACE_OVERRIDE

+ 8 - 6
3rdparty/spirv-cross/spirv_glsl.cpp

@@ -10762,8 +10762,10 @@ string CompilerGLSL::to_array_size(const SPIRType &type, uint32_t index)
 
 	// Tessellation control and evaluation shaders must have either gl_MaxPatchVertices or unsized arrays for input arrays.
 	// Opt for unsized as it's the more "correct" variant to use.
-	if (type.storage == StorageClassInput && (get_entry_point().model == ExecutionModelTessellationControl ||
-	                                          get_entry_point().model == ExecutionModelTessellationEvaluation))
+	if (type.storage == StorageClassInput &&
+	    (get_entry_point().model == ExecutionModelTessellationControl ||
+	     get_entry_point().model == ExecutionModelTessellationEvaluation) &&
+	    index == uint32_t(type.array.size() - 1))
 		return "";
 
 	auto &size = type.array[index];
@@ -12765,14 +12767,14 @@ void CompilerGLSL::unroll_array_from_complex_load(uint32_t target_id, uint32_t s
 		auto new_expr = join("_", target_id, "_unrolled");
 		statement(variable_decl(type, new_expr, target_id), ";");
 		string array_expr;
-		if (type.array_size_literal.front())
+		if (type.array_size_literal.back())
 		{
-			array_expr = convert_to_string(type.array.front());
-			if (type.array.front() == 0)
+			array_expr = convert_to_string(type.array.back());
+			if (type.array.back() == 0)
 				SPIRV_CROSS_THROW("Cannot unroll an array copy from unsized array.");
 		}
 		else
-			array_expr = to_expression(type.array.front());
+			array_expr = to_expression(type.array.back());
 
 		// The array size might be a specialization constant, so use a for-loop instead.
 		statement("for (int i = 0; i < int(", array_expr, "); i++)");