Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-01-17 14:49:02 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-01-17 15:45:12 +0300
commitef6bde658021dae7732d9b628d58b2e0905c938c (patch)
treea355bdba0a17af8bf2eb85236d05c90fa72bbbf2 /reference/opt
parenta1bb29ccbb285618028a24efb3fe4f6718cee0b5 (diff)
Do not forward expressions which carry a huge amount of dependencies.
Need to force temporaries eventually, or compilers have a tendency to explode.
Diffstat (limited to 'reference/opt')
-rw-r--r--reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag3
-rw-r--r--reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag8
-rw-r--r--reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag29
-rw-r--r--reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert3
-rw-r--r--reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert3
5 files changed, 21 insertions, 25 deletions
diff --git a/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag b/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag
index b54a05fe..d18b674f 100644
--- a/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag
+++ b/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag
@@ -254,6 +254,7 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
{
float4 _260 = SSProfilesTexture.read(uint2(int3(1, int(uint((select(float4(0.0), SceneTexturesStruct_GBufferDTexture.sample(SceneTexturesStruct_GBufferDTextureSampler, _114, level(0.0)), bool4(!(((_240 & 4294967280u) & 16u) != 0u))).x * 255.0) + 0.5)), 0).xy), 0);
float _263 = _260.y * 0.5;
+ float3 _266 = _148 - (_236 * float3(_263));
float _274 = pow(fast::clamp(dot(-(_152 * float3(rsqrt(dot(_152, _152)))), _236), 0.0, 1.0), 1.0);
float _445;
if (_160)
@@ -286,7 +287,7 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
}
_311 = _307;
}
- float4 _318 = _Globals.ShadowViewProjectionMatrices[_311] * float4(_148 - (_236 * float3(_263)), 1.0);
+ float4 _318 = _Globals.ShadowViewProjectionMatrices[_311] * float4(_266, 1.0);
float _323 = _260.x * (10.0 / _Globals.LightPositionAndInvRadius.w);
float _329 = (1.0 / (((_318.z / _318.w) * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w;
float _342 = (_329 - ((1.0 / ((float4(ShadowDepthCubeTexture.sample(ShadowDepthTextureSampler, (_278 + (_286 * float3(2.5))), level(0.0))).x * _Globals.PointLightDepthBiasAndProjParameters.z) - _Globals.PointLightDepthBiasAndProjParameters.w)) * _Globals.LightPositionAndInvRadius.w)) * _323;
diff --git a/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag b/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
index 03fa7c53..70100279 100644
--- a/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
+++ b/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
@@ -181,15 +181,13 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float _669 = _644 + ((_660.x * _Globals.WhiteTint) * 0.0500000007450580596923828125);
float _674 = ((2.0 * _665) - (8.0 * _669)) + 4.0;
float2 _680 = select(float2(_616, (_616 * (((-3.0) * _616) + 2.86999988555908203125)) - 0.2750000059604644775390625), _653, bool2(_Globals.WhiteTemp < 4000.0)) + (float2((3.0 * _665) / _674, (2.0 * _669) / _674) - _653);
- float _681 = _680.x;
- float _682 = _680.y;
- float _683 = fast::max(_682, 1.0000000133514319600180897396058e-10);
+ float _683 = fast::max(_680.y, 1.0000000133514319600180897396058e-10);
float3 _685 = _391;
- _685.x = _681 / _683;
+ _685.x = _680.x / _683;
float3 _686 = _685;
_686.y = 1.0;
float3 _690 = _686;
- _690.z = ((1.0 - _681) - _682) / _683;
+ _690.z = ((1.0 - _680.x) - _680.y) / _683;
float3 _693 = _391;
_693.x = 0.950455963611602783203125;
float3 _694 = _693;
diff --git a/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag b/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
index f1c43630..f7e65ae7 100644
--- a/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
+++ b/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
@@ -183,15 +183,13 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float _695 = _670 + ((_686.x * _Globals.WhiteTint) * 0.0500000007450580596923828125);
float _700 = ((2.0 * _691) - (8.0 * _695)) + 4.0;
float2 _706 = select(float2(_642, (_642 * (((-3.0) * _642) + 2.86999988555908203125)) - 0.2750000059604644775390625), _679, bool2(_Globals.WhiteTemp < 4000.0)) + (float2((3.0 * _691) / _700, (2.0 * _695) / _700) - _679);
- float _707 = _706.x;
- float _708 = _706.y;
- float _709 = fast::max(_708, 1.0000000133514319600180897396058e-10);
+ float _709 = fast::max(_706.y, 1.0000000133514319600180897396058e-10);
float3 _711 = _523;
- _711.x = _707 / _709;
+ _711.x = _706.x / _709;
float3 _712 = _711;
_712.y = 1.0;
float3 _716 = _712;
- _716.z = ((1.0 - _707) - _708) / _709;
+ _716.z = ((1.0 - _706.x) - _706.y) / _709;
float3 _719 = _523;
_719.x = 0.950455963611602783203125;
float3 _720 = _719;
@@ -392,40 +390,37 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float3 _3103;
if (_Globals.OutputDevice == 0u)
{
- float _3063 = _1324.x;
float _3075;
for (;;)
{
- if (_3063 < 0.00313066993840038776397705078125)
+ if (_1324.x < 0.00313066993840038776397705078125)
{
- _3075 = _3063 * 12.9200000762939453125;
+ _3075 = _1324.x * 12.9200000762939453125;
break;
}
- _3075 = (pow(_3063, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ _3075 = (pow(_1324.x, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
- float _3076 = _1324.y;
float _3088;
for (;;)
{
- if (_3076 < 0.00313066993840038776397705078125)
+ if (_1324.y < 0.00313066993840038776397705078125)
{
- _3088 = _3076 * 12.9200000762939453125;
+ _3088 = _1324.y * 12.9200000762939453125;
break;
}
- _3088 = (pow(_3076, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ _3088 = (pow(_1324.y, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
- float _3089 = _1324.z;
float _3101;
for (;;)
{
- if (_3089 < 0.00313066993840038776397705078125)
+ if (_1324.z < 0.00313066993840038776397705078125)
{
- _3101 = _3089 * 12.9200000762939453125;
+ _3101 = _1324.z * 12.9200000762939453125;
break;
}
- _3101 = (pow(_3089, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
+ _3101 = (pow(_1324.z, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
_3103 = float3(_3075, _3088, _3101);
diff --git a/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert b/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert
index 520b58e7..e40239db 100644
--- a/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert
+++ b/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert
@@ -443,7 +443,8 @@ vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buff
}
bool _468 = (MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w > 0.0) && (_347 > MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w);
float _471 = _468 ? 1.0 : fast::max(fast::clamp(exp2(-(_428 * _393)), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.w);
- float4 _479 = float4((MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.xyz * float3(1.0 - _471)) + select(_459, float3(0.0), bool3(_468)), _471);
+ float3 _475 = (MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.xyz * float3(1.0 - _471)) + select(_459, float3(0.0), bool3(_468));
+ float4 _479 = float4(_475, _471);
float4 _482 = _338;
_482.w = _339.w;
out.out_var_TEXCOORD0 = ((_323 + LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.zw) + _292).xy;
diff --git a/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert b/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert
index 7938ecfc..ea7db420 100644
--- a/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert
+++ b/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert
@@ -363,7 +363,8 @@ vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buff
float _339 = ((_145.z + ((_145.w * EmitterUniforms.EmitterUniforms_RotationRateScale) * _146)) * 6.283185482025146484375) + EmitterUniforms.EmitterUniforms_RotationBias;
float3 _342 = float3(sin(_339));
float3 _344 = float3(cos(_339));
- float4 _371 = float4(_239 + ((float3(_204.x * (in.in_var_ATTRIBUTE0.x + EmitterUniforms.EmitterUniforms_PivotOffset.x)) * ((_342 * _336) + (_344 * _335))) + (float3(_204.y * (in.in_var_ATTRIBUTE0.y + EmitterUniforms.EmitterUniforms_PivotOffset.y)) * ((_344 * _336) - (_342 * _335)))), 1.0);
+ float3 _367 = _239 + ((float3(_204.x * (in.in_var_ATTRIBUTE0.x + EmitterUniforms.EmitterUniforms_PivotOffset.x)) * ((_342 * _336) + (_344 * _335))) + (float3(_204.y * (in.in_var_ATTRIBUTE0.y + EmitterUniforms.EmitterUniforms_PivotOffset.y)) * ((_344 * _336) - (_342 * _335))));
+ float4 _371 = float4(_367, 1.0);
float4 _375 = MobileShadowDepthPass.MobileShadowDepthPass_ProjectionMatrix * float4(_371.x, _371.y, _371.z, _371.w);
float4 _386;
if ((MobileShadowDepthPass.MobileShadowDepthPass_bClampToNearPlane > 0.0) && (_375.z < 0.0))