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-05-18 13:26:20 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-05-18 17:37:33 +0300
commit23662668ddc143da50ee0ccef9a020d81800c9b5 (patch)
tree704638beccb72b67d8033dfe068a729b0c3a1e87
parentd0c8dc30450351321e611b2888a48f8410226a4c (diff)
Attempt more optimal codegen for OpCompositeInsert.
Speculate that we can modify the SSA value in-place. As long as it is not used after the modify, this is fine. Also need to make sure we don't attempt to RMW something that is impossible to modify.
-rw-r--r--reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert5
-rw-r--r--reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag7
-rw-r--r--reference/opt/shaders-hlsl/frag/tex-sampling.frag10
-rw-r--r--reference/opt/shaders-hlsl/frag/texture-proj-shadow.frag15
-rw-r--r--reference/opt/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag7
-rw-r--r--reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert5
-rw-r--r--reference/opt/shaders-msl/comp/insert.comp13
-rw-r--r--reference/opt/shaders-msl/frag/in_mat.frag6
-rw-r--r--reference/opt/shaders-msl/frag/packed-expression-vector-shuffle.frag8
-rw-r--r--reference/opt/shaders-msl/frag/texture-proj-shadow.frag9
-rw-r--r--reference/opt/shaders-msl/vert/packed_matrix.vert5
-rw-r--r--reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag8
-rw-r--r--reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag91
-rw-r--r--reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag91
-rw-r--r--reference/opt/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag8
-rw-r--r--reference/opt/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag6
-rw-r--r--reference/opt/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag6
-rw-r--r--reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag6
-rw-r--r--reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag6
-rw-r--r--reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag6
-rw-r--r--reference/opt/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc19
-rw-r--r--reference/opt/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc19
-rw-r--r--reference/opt/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc19
-rw-r--r--reference/opt/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc13
-rw-r--r--reference/opt/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese5
-rw-r--r--reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese5
-rw-r--r--reference/opt/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese5
-rw-r--r--reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert5
-rw-r--r--reference/opt/shaders/asm/frag/vector-shuffle-oom.asm.frag7
-rw-r--r--reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert5
-rw-r--r--reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk5
-rw-r--r--reference/opt/shaders/comp/insert.comp13
-rw-r--r--reference/opt/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag15
-rw-r--r--reference/opt/shaders/vert/ocean.vert13
-rw-r--r--reference/shaders-hlsl/frag/sample-cmp-level-zero.frag14
-rw-r--r--reference/shaders-hlsl/frag/texture-proj-shadow.frag14
-rw-r--r--reference/shaders-msl-no-opt/asm/packing/packed-vector-extract-insert.asm.comp5
-rw-r--r--reference/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag49
-rw-r--r--reference/shaders-msl/frag/texture-proj-shadow.frag7
-rw-r--r--reference/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag74
-rw-r--r--reference/shaders-no-opt/asm/frag/switch-single-case-multiple-exit-cfg.asm.frag2
-rw-r--r--reference/shaders-no-opt/legacy/frag/switch-single-case-multiple-exit-cfg.legacy.asm.frag2
-rw-r--r--reference/shaders-ue4-no-opt/asm/frag/accesschain-invalid-expression.asm.invalid.frag46
-rw-r--r--reference/shaders-ue4/asm/frag/depth-compare.asm.frag8
-rw-r--r--reference/shaders-ue4/asm/frag/global-constant-arrays.asm.frag91
-rw-r--r--reference/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag91
-rw-r--r--reference/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag8
-rw-r--r--reference/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag6
-rw-r--r--reference/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag6
-rw-r--r--reference/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag6
-rw-r--r--reference/shaders-ue4/asm/frag/texture-atomics.asm.frag6
-rw-r--r--reference/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag6
-rw-r--r--reference/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc19
-rw-r--r--reference/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc19
-rw-r--r--reference/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc19
-rw-r--r--reference/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc13
-rw-r--r--reference/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese5
-rw-r--r--reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese5
-rw-r--r--reference/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese5
-rw-r--r--reference/shaders-ue4/asm/vert/texture-buffer.asm.vert5
-rw-r--r--reference/shaders/asm/frag/vector-shuffle-oom.asm.frag49
-rw-r--r--reference/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag14
-rw-r--r--spirv_glsl.cpp66
-rw-r--r--spirv_glsl.hpp2
64 files changed, 512 insertions, 616 deletions
diff --git a/reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert b/reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert
index a1c38b2a..3bccae3e 100644
--- a/reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert
+++ b/reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert
@@ -25,9 +25,8 @@ void vert_main()
{
float4 _63 = 0.0f.xxxx;
_63.y = float(_20);
- float4 _66 = _63;
- _66.z = float(_25);
- float4 _52 = _66 + float4(_30);
+ _63.z = float(_25);
+ float4 _52 = _63 + float4(_30);
float2 _56 = _52.xy + float2(_32);
gl_Position = float4(_56.x, _56.y, _52.z, _52.w);
_4 = _33;
diff --git a/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag b/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag
index c6539b18..82688ac5 100644
--- a/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag
+++ b/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag
@@ -24,9 +24,10 @@ struct SPIRV_Cross_Output
void frag_main()
{
- float4 _80 = vDirRef;
- _80.z = vDirRef.w;
- FragColor = (((((((uSampler2D.SampleCmp(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1)) + uSampler2DArray.SampleCmp(_uSampler2DArray_sampler, vDirRef.xyz, vDirRef.w, int2(-1, -1))) + uSamplerCube.SampleCmp(_uSamplerCube_sampler, vDirRef.xyz, vDirRef.w)) + uSamplerCubeArray.SampleCmp(_uSamplerCubeArray_sampler, vDirRef, 0.5f)) + uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1))) + uSampler2DArray.SampleCmpLevelZero(_uSampler2DArray_sampler, vDirRef.xyz, vDirRef.w, int2(-1, -1))) + uSamplerCube.SampleCmpLevelZero(_uSamplerCube_sampler, vDirRef.xyz, vDirRef.w)) + uSampler2D.SampleCmp(_uSampler2D_sampler, _80.xy / _80.z, vDirRef.z / _80.z, int2(1, 1))) + uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, _80.xy / _80.z, vDirRef.z / _80.z, int2(1, 1));
+ float4 _33 = vDirRef;
+ float4 _80 = _33;
+ _80.z = _33.w;
+ FragColor = (((((((uSampler2D.SampleCmp(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1)) + uSampler2DArray.SampleCmp(_uSampler2DArray_sampler, _33.xyz, _33.w, int2(-1, -1))) + uSamplerCube.SampleCmp(_uSamplerCube_sampler, _33.xyz, _33.w)) + uSamplerCubeArray.SampleCmp(_uSamplerCubeArray_sampler, _33, 0.5f)) + uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1))) + uSampler2DArray.SampleCmpLevelZero(_uSampler2DArray_sampler, _33.xyz, _33.w, int2(-1, -1))) + uSamplerCube.SampleCmpLevelZero(_uSamplerCube_sampler, _33.xyz, _33.w)) + uSampler2D.SampleCmp(_uSampler2D_sampler, _80.xy / _80.z, _33.z / _80.z, int2(1, 1))) + uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, _80.xy / _80.z, _33.z / _80.z, int2(1, 1));
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
diff --git a/reference/opt/shaders-hlsl/frag/tex-sampling.frag b/reference/opt/shaders-hlsl/frag/tex-sampling.frag
index fd5681b6..caedd37e 100644
--- a/reference/opt/shaders-hlsl/frag/tex-sampling.frag
+++ b/reference/opt/shaders-hlsl/frag/tex-sampling.frag
@@ -48,14 +48,12 @@ void frag_main()
float3 _88 = float3(texCoord2d, 2.0f);
float4 _135 = float4(texCoord3d, 2.0f);
float4 _162 = (((((((((((((((((((tex1d.Sample(_tex1d_sampler, texCoord1d) + tex1d.Sample(_tex1d_sampler, texCoord1d, 1)) + tex1d.SampleLevel(_tex1d_sampler, texCoord1d, 2.0f)) + tex1d.SampleGrad(_tex1d_sampler, texCoord1d, 1.0f, 2.0f)) + tex1d.Sample(_tex1d_sampler, _41.x / _41.y)) + tex1d.SampleBias(_tex1d_sampler, texCoord1d, 1.0f)) + tex2d.Sample(_tex2d_sampler, texCoord2d)) + tex2d.Sample(_tex2d_sampler, texCoord2d, int2(1, 2))) + tex2d.SampleLevel(_tex2d_sampler, texCoord2d, 2.0f)) + tex2d.SampleGrad(_tex2d_sampler, texCoord2d, float2(1.0f, 2.0f), float2(3.0f, 4.0f))) + tex2d.Sample(_tex2d_sampler, _88.xy / _88.z)) + tex2d.SampleBias(_tex2d_sampler, texCoord2d, 1.0f)) + tex3d.Sample(_tex3d_sampler, texCoord3d)) + tex3d.Sample(_tex3d_sampler, texCoord3d, int3(1, 2, 3))) + tex3d.SampleLevel(_tex3d_sampler, texCoord3d, 2.0f)) + tex3d.SampleGrad(_tex3d_sampler, texCoord3d, float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f))) + tex3d.Sample(_tex3d_sampler, _135.xyz / _135.w)) + tex3d.SampleBias(_tex3d_sampler, texCoord3d, 1.0f)) + texCube.Sample(_texCube_sampler, texCoord3d)) + texCube.SampleLevel(_texCube_sampler, texCoord3d, 2.0f)) + texCube.SampleBias(_texCube_sampler, texCoord3d, 1.0f);
- float4 _333 = _162;
- _333.w = ((_162.w + tex1dShadow.SampleCmp(_tex1dShadow_sampler, float3(texCoord1d, 0.0f, 0.0f).x, 0.0f)) + tex2dShadow.SampleCmp(_tex2dShadow_sampler, float3(texCoord2d, 0.0f).xy, 0.0f)) + texCubeShadow.SampleCmp(_texCubeShadow_sampler, float4(texCoord3d, 0.0f).xyz, 0.0f);
+ _162.w = ((_162.w + tex1dShadow.SampleCmp(_tex1dShadow_sampler, float3(texCoord1d, 0.0f, 0.0f).x, 0.0f)) + tex2dShadow.SampleCmp(_tex2dShadow_sampler, float3(texCoord2d, 0.0f).xy, 0.0f)) + texCubeShadow.SampleCmp(_texCubeShadow_sampler, float4(texCoord3d, 0.0f).xyz, 0.0f);
float4 _243 = tex2d.GatherRed(_tex2d_sampler, texCoord2d);
float4 _269 = tex2d.GatherRed(_tex2d_sampler, texCoord2d, int2(1, 1));
- float4 _308 = ((((((((((((((_333 + tex1dArray.Sample(_tex1dArray_sampler, texCoord2d)) + tex2dArray.Sample(_tex2dArray_sampler, texCoord3d)) + texCubeArray.Sample(_texCubeArray_sampler, texCoord4d)) + _243) + _243) + tex2d.GatherGreen(_tex2d_sampler, texCoord2d)) + tex2d.GatherBlue(_tex2d_sampler, texCoord2d)) + tex2d.GatherAlpha(_tex2d_sampler, texCoord2d)) + _269) + _269) + tex2d.GatherGreen(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherBlue(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherAlpha(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.Load(int3(int2(1, 2), 0))) + separateTex2d.Sample(samplerNonDepth, texCoord2d);
- float4 _336 = _308;
- _336.w = _308.w + separateTex2dDepth.SampleCmp(samplerDepth, texCoord3d.xy, texCoord3d.z);
- FragColor = _336;
+ float4 _308 = ((((((((((((((_162 + tex1dArray.Sample(_tex1dArray_sampler, texCoord2d)) + tex2dArray.Sample(_tex2dArray_sampler, texCoord3d)) + texCubeArray.Sample(_texCubeArray_sampler, texCoord4d)) + _243) + _243) + tex2d.GatherGreen(_tex2d_sampler, texCoord2d)) + tex2d.GatherBlue(_tex2d_sampler, texCoord2d)) + tex2d.GatherAlpha(_tex2d_sampler, texCoord2d)) + _269) + _269) + tex2d.GatherGreen(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherBlue(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherAlpha(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.Load(int3(int2(1, 2), 0))) + separateTex2d.Sample(samplerNonDepth, texCoord2d);
+ _308.w = _308.w + separateTex2dDepth.SampleCmp(samplerDepth, texCoord3d.xy, texCoord3d.z);
+ FragColor = _308;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
diff --git a/reference/opt/shaders-hlsl/frag/texture-proj-shadow.frag b/reference/opt/shaders-hlsl/frag/texture-proj-shadow.frag
index 07e06008..bc710227 100644
--- a/reference/opt/shaders-hlsl/frag/texture-proj-shadow.frag
+++ b/reference/opt/shaders-hlsl/frag/texture-proj-shadow.frag
@@ -28,15 +28,16 @@ struct SPIRV_Cross_Output
void frag_main()
{
- float4 _20 = vClip4;
- _20.y = vClip4.w;
- FragColor = uShadow1D.SampleCmp(_uShadow1D_sampler, _20.x / _20.y, vClip4.z / _20.y);
- float4 _30 = vClip4;
- _30.z = vClip4.w;
- FragColor = uShadow2D.SampleCmp(_uShadow2D_sampler, _30.xy / _30.z, vClip4.z / _30.z);
+ float4 _17 = vClip4;
+ float4 _20 = _17;
+ _20.y = _17.w;
+ FragColor = uShadow1D.SampleCmp(_uShadow1D_sampler, _20.x / _20.y, _17.z / _20.y);
+ float4 _30 = _17;
+ _30.z = _17.w;
+ FragColor = uShadow2D.SampleCmp(_uShadow2D_sampler, _30.xy / _30.z, _17.z / _30.z);
FragColor = uSampler1D.Sample(_uSampler1D_sampler, vClip2.x / vClip2.y).x;
FragColor = uSampler2D.Sample(_uSampler2D_sampler, vClip3.xy / vClip3.z).x;
- FragColor = uSampler3D.Sample(_uSampler3D_sampler, vClip4.xyz / vClip4.w).x;
+ FragColor = uSampler3D.Sample(_uSampler3D_sampler, _17.xyz / _17.w).x;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
diff --git a/reference/opt/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag b/reference/opt/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag
index ed2076d2..39bd33d5 100644
--- a/reference/opt/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag
+++ b/reference/opt/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag
@@ -272,11 +272,10 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
_693 = _673;
}
float3 _702 = (((((((((((((_129 * 0.5).xyz + (_176 * 0.5)).xyz + (_223 * 0.75)).xyz + (_270 * 0.5)).xyz + (_317 * 0.5)).xyz + (_364 * 0.75)).xyz + (_411 * 1.0)).xyz + (_458 * 0.75)).xyz + (_505 * 0.5)).xyz + (_552 * 0.5)).xyz + (_599 * 0.75)).xyz + (_646 * 0.5)).xyz + (_693 * 0.5)).xyz * float3(0.125);
- _28 _704 = _74;
+ _28 _704;
_704._m0 = float4(_702.x, _702.y, _702.z, float4(0.0).w);
- _28 _705 = _704;
- _705._m0.w = 1.0;
- out.m_5 = _705._m0;
+ _704._m0.w = 1.0;
+ out.m_5 = _704._m0;
return out;
}
diff --git a/reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert b/reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert
index 2ee6cd76..196057a7 100644
--- a/reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert
+++ b/reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert
@@ -25,9 +25,8 @@ vertex main0_out main0()
main0_out out = {};
float4 _66 = float4(0.0);
_66.y = float(_20);
- float4 _69 = _66;
- _69.z = float(_25);
- float4 _55 = _69 + float4(_32);
+ _66.z = float(_25);
+ float4 _55 = _66 + float4(_32);
float2 _59 = _55.xy + float2(_34);
out.gl_Position = float4(_59.x, _59.y, _55.z, _55.w);
out.m_4 = _35;
diff --git a/reference/opt/shaders-msl/comp/insert.comp b/reference/opt/shaders-msl/comp/insert.comp
index 36b846e1..059549ae 100644
--- a/reference/opt/shaders-msl/comp/insert.comp
+++ b/reference/opt/shaders-msl/comp/insert.comp
@@ -14,15 +14,12 @@ constant float4 _53 = {};
kernel void main0(device SSBO& _27 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
{
- float4 _46 = _53;
+ float4 _46;
_46.x = 10.0;
- float4 _48 = _46;
- _48.y = 30.0;
- float4 _50 = _48;
- _50.z = 70.0;
- float4 _52 = _50;
- _52.w = 90.0;
- _27.out_data[gl_GlobalInvocationID.x] = _52;
+ _46.y = 30.0;
+ _46.z = 70.0;
+ _46.w = 90.0;
+ _27.out_data[gl_GlobalInvocationID.x] = _46;
((device float*)&_27.out_data[gl_GlobalInvocationID.x])[1u] = 20.0;
}
diff --git a/reference/opt/shaders-msl/frag/in_mat.frag b/reference/opt/shaders-msl/frag/in_mat.frag
index 1defc6c3..5d0b44eb 100644
--- a/reference/opt/shaders-msl/frag/in_mat.frag
+++ b/reference/opt/shaders-msl/frag/in_mat.frag
@@ -29,9 +29,9 @@ fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> samplerCol
inInvModelView[3] = in.inInvModelView_3;
float4 _31 = inInvModelView * float4(reflect(fast::normalize(in.inPos), fast::normalize(in.inNormal)), 0.0);
float _33 = _31.x;
- float3 _59 = float3(_33, _31.yz);
- _59.x = _33 * (-1.0);
- out.outFragColor = samplerColor.sample(samplerColorSmplr, _59, bias(in.inLodBias));
+ float3 _36 = float3(_33, _31.yz);
+ _36.x = _33 * (-1.0);
+ out.outFragColor = samplerColor.sample(samplerColorSmplr, _36, bias(in.inLodBias));
return out;
}
diff --git a/reference/opt/shaders-msl/frag/packed-expression-vector-shuffle.frag b/reference/opt/shaders-msl/frag/packed-expression-vector-shuffle.frag
index 388f5381..a12c4491 100644
--- a/reference/opt/shaders-msl/frag/packed-expression-vector-shuffle.frag
+++ b/reference/opt/shaders-msl/frag/packed-expression-vector-shuffle.frag
@@ -19,11 +19,9 @@ fragment main0_out main0(constant UBO& _15 [[buffer(0)]])
main0_out out = {};
float4 _36 = float4(1.0);
_36.x = _15.color[0];
- float4 _38 = _36;
- _38.y = _15.color[1];
- float4 _40 = _38;
- _40.z = _15.color[2];
- out.FragColor = _40;
+ _36.y = _15.color[1];
+ _36.z = _15.color[2];
+ out.FragColor = _36;
return out;
}
diff --git a/reference/opt/shaders-msl/frag/texture-proj-shadow.frag b/reference/opt/shaders-msl/frag/texture-proj-shadow.frag
index 52d4a026..6d465ce9 100644
--- a/reference/opt/shaders-msl/frag/texture-proj-shadow.frag
+++ b/reference/opt/shaders-msl/frag/texture-proj-shadow.frag
@@ -18,12 +18,13 @@ struct main0_in
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow2D [[texture(0)]], texture1d<float> uSampler1D [[texture(1)]], texture2d<float> uSampler2D [[texture(2)]], texture3d<float> uSampler3D [[texture(3)]], sampler uShadow2DSmplr [[sampler(0)]], sampler uSampler1DSmplr [[sampler(1)]], sampler uSampler2DSmplr [[sampler(2)]], sampler uSampler3DSmplr [[sampler(3)]])
{
main0_out out = {};
- float4 _20 = in.vClip4;
- _20.z = in.vClip4.w;
- out.FragColor = uShadow2D.sample_compare(uShadow2DSmplr, _20.xy / _20.z, in.vClip4.z / _20.z);
+ float4 _17 = in.vClip4;
+ float4 _20 = _17;
+ _20.z = _17.w;
+ out.FragColor = uShadow2D.sample_compare(uShadow2DSmplr, _20.xy / _20.z, _17.z / _20.z);
out.FragColor = uSampler1D.sample(uSampler1DSmplr, in.vClip2.x / in.vClip2.y).x;
out.FragColor = uSampler2D.sample(uSampler2DSmplr, in.vClip3.xy / in.vClip3.z).x;
- out.FragColor = uSampler3D.sample(uSampler3DSmplr, in.vClip4.xyz / in.vClip4.w).x;
+ out.FragColor = uSampler3D.sample(uSampler3DSmplr, _17.xyz / _17.w).x;
return out;
}
diff --git a/reference/opt/shaders-msl/vert/packed_matrix.vert b/reference/opt/shaders-msl/vert/packed_matrix.vert
index b8cac0ac..2e6f9680 100644
--- a/reference/opt/shaders-msl/vert/packed_matrix.vert
+++ b/reference/opt/shaders-msl/vert/packed_matrix.vert
@@ -40,9 +40,8 @@ vertex main0_out main0(main0_in in [[stage_in]], constant _RESERVED_IDENTIFIER_F
main0_out out = {};
float4 _70 = _RESERVED_IDENTIFIER_FIXUP_22044._RESERVED_IDENTIFIER_FIXUP_m0 * float4(float3(_RESERVED_IDENTIFIER_FIXUP_22044._RESERVED_IDENTIFIER_FIXUP_m10) + (in._RESERVED_IDENTIFIER_FIXUP_5275.xyz * (_RESERVED_IDENTIFIER_FIXUP_22044._RESERVED_IDENTIFIER_FIXUP_m17 + _RESERVED_IDENTIFIER_FIXUP_22044._RESERVED_IDENTIFIER_FIXUP_m18)), 1.0);
out._RESERVED_IDENTIFIER_FIXUP_3976 = fast::normalize(float4(in._RESERVED_IDENTIFIER_FIXUP_5275.xyz, 0.0) * _RESERVED_IDENTIFIER_FIXUP_18812._RESERVED_IDENTIFIER_FIXUP_m1);
- float4 _94 = _70;
- _94.y = -_70.y;
- out.gl_Position = _94;
+ _70.y = -_70.y;
+ out.gl_Position = _70;
return out;
}
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 d18b674f..5a8a350d 100644
--- a/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag
+++ b/reference/opt/shaders-ue4/asm/frag/depth-compare.asm.frag
@@ -244,8 +244,9 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
}
float _213 = fast::clamp(((_207 - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
float _218 = sqrt(mix(1.0, _213 * _213, _Globals.ShadowFadeFraction));
- float4 _219 = _453;
+ float4 _219;
_219.z = _218;
+ float4 _220 = float4(float3(1.0).x, float3(1.0).y, _219.z, float3(1.0).z);
float3 _236 = fast::normalize((SceneTexturesStruct_GBufferATexture.sample(SceneTexturesStruct_GBufferATextureSampler, _114, level(0.0)).xyz * float3(2.0)) - float3(1.0));
uint _240 = uint(round(SceneTexturesStruct_GBufferBTexture.sample(SceneTexturesStruct_GBufferBTextureSampler, _114, level(0.0)).w * 255.0));
bool _248 = (_240 & 15u) == 5u;
@@ -307,9 +308,8 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
{
_448 = 1.0;
}
- float4 _451 = float4(float3(1.0).x, float3(1.0).y, _219.z, float3(1.0).z);
- _451.w = _248 ? sqrt(_448) : _218;
- out.out_var_SV_Target0 = _451;
+ _220.w = _248 ? sqrt(_448) : _218;
+ out.out_var_SV_Target0 = _220;
return out;
}
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 70100279..04b9018b 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
@@ -182,20 +182,16 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
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 _683 = fast::max(_680.y, 1.0000000133514319600180897396058e-10);
- float3 _685 = _391;
+ float3 _685;
_685.x = _680.x / _683;
- float3 _686 = _685;
- _686.y = 1.0;
- float3 _690 = _686;
- _690.z = ((1.0 - _680.x) - _680.y) / _683;
- float3 _693 = _391;
+ _685.y = 1.0;
+ _685.z = ((1.0 - _680.x) - _680.y) / _683;
+ float3 _693;
_693.x = 0.950455963611602783203125;
- float3 _694 = _693;
- _694.y = 1.0;
- float3 _696 = _694;
- _696.z = 1.0890576839447021484375;
- float3 _697 = _690 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
- float3 _698 = _696 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ _693.y = 1.0;
+ _693.z = 1.0890576839447021484375;
+ float3 _697 = _685 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _698 = _693 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
float3 _717 = (_599 * ((float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * ((float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875)) * float3x3(float3(_698.x / _697.x, 0.0, 0.0), float3(0.0, _698.y / _697.y, 0.0), float3(0.0, 0.0, _698.z / _697.z))) * float3x3(float3(0.986992895603179931640625, -0.14705429971218109130859375, 0.15996269881725311279296875), float3(0.4323053061962127685546875, 0.518360316753387451171875, 0.049291200935840606689453125), float3(-0.00852870009839534759521484375, 0.0400427989661693572998046875, 0.968486726284027099609375)))) * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875)))) * _547;
float3 _745;
if (_Globals.ColorShadow_Tint2.w != 0.0)
@@ -292,9 +288,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1001 = _996;
}
float _1005 = smoothstep(0.0, 1.0, 1.0 - abs(_1001 * 0.01481481455266475677490234375));
- float3 _1012 = _972;
- _1012.x = _973 + ((((_1005 * _1005) * _928) * (0.02999999932944774627685546875 - _973)) * 0.180000007152557373046875);
- float3 _1014 = fast::max(float3(0.0), _1012 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
+ _972.x = _973 + ((((_1005 * _1005) * _928) * (0.02999999932944774627685546875 - _973)) * 0.180000007152557373046875);
+ float3 _1014 = fast::max(float3(0.0), _972 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
float _1023 = (1.0 + _Globals.FilmBlackClip) - _Globals.FilmToe;
float _1026 = 1.0 + _Globals.FilmWhiteClip;
float _1029 = _1026 - _Globals.FilmShoulder;
@@ -322,13 +317,11 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float3 _1189;
if (_Globals.ColorShadow_Tint2.w == 0.0)
{
- float3 _1131 = _391;
+ float3 _1131;
_1131.x = dot(_906, _Globals.ColorMatrixR_ColorCurveCd1.xyz);
- float3 _1136 = _1131;
- _1136.y = dot(_906, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
- float3 _1141 = _1136;
- _1141.z = dot(_906, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
- float3 _1157 = fast::max(float3(0.0), _1141 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_906, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
+ _1131.y = dot(_906, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
+ _1131.z = dot(_906, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
+ float3 _1157 = fast::max(float3(0.0), _1131 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_906, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
float3 _1162 = fast::max(float3(0.0), _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx - _1157);
float3 _1164 = fast::max(_1157, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz);
_1189 = ((((_1164 * _Globals.ColorCurve_Ch1_Ch2.xxx) + _Globals.ColorCurve_Ch1_Ch2.yyy) * (float3(1.0) / (_1164 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.www))) + ((fast::clamp(_1157, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz) * _Globals.ColorMatrixB_ColorCurveCm2.www) + (((_1162 * _Globals.ColorMatrixR_ColorCurveCd1.www) * (float3(1.0) / (_1162 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.yyy))) + _Globals.ColorMatrixG_ColorCurveCd3Cm3.www))) - float3(0.00200000009499490261077880859375);
@@ -503,9 +496,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_2235 = 0.0;
}
- float3 _2242 = _2156;
- _2242.x = _2157 + ((((_2235 * 1.5) * _2112) * (0.02999999932944774627685546875 - _2157)) * 0.180000007152557373046875);
- float3 _2245 = fast::clamp(fast::clamp(_2242, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ _2156.x = _2157 + ((((_2235 * 1.5) * _2112) * (0.02999999932944774627685546875 - _2157)) * 0.180000007152557373046875);
+ float3 _2245 = fast::clamp(fast::clamp(_2156, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
float3 _2248 = mix(float3(dot(_2245, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _2245, float3(0.959999978542327880859375));
float _2249 = _2248.x;
float _2258 = log((_2249 <= 0.0) ? 6.103515625e-05 : _2249) * 0.4342944622039794921875;
@@ -542,7 +534,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2327 = _2324;
}
- float3 _2329 = _391;
+ float3 _2329;
_2329.x = pow(10.0, _2327);
float _2330 = _2248.y;
float _2334 = log((_2330 <= 0.0) ? 6.103515625e-05 : _2330) * 0.4342944622039794921875;
@@ -579,8 +571,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2401 = _2398;
}
- float3 _2403 = _2329;
- _2403.y = pow(10.0, _2401);
+ _2329.y = pow(10.0, _2401);
float _2404 = _2248.z;
float _2408 = log((_2404 <= 0.0) ? 6.103515625e-05 : _2404) * 0.4342944622039794921875;
float _2475;
@@ -616,9 +607,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2475 = _2472;
}
- float3 _2477 = _2403;
- _2477.z = pow(10.0, _2475);
- float3 _2479 = (_2477 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ _2329.z = pow(10.0, _2475);
+ float3 _2479 = (_2329 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _2612 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875)).z);
float _2684 = pow(10.0, dot(float3(0.4444443881511688232421875, 0.66666662693023681640625, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(2.0810306072235107421875, 3.66812419891357421875, 4.0)));
float _2685 = _2479.x;
@@ -662,7 +652,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2768 = _2760;
}
- float3 _2770 = _391;
+ float3 _2770;
_2770.x = pow(10.0, _2768);
float _2771 = _2479.y;
float _2774 = log((_2771 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2771);
@@ -703,8 +693,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2852 = _2844;
}
- float3 _2854 = _2770;
- _2854.y = pow(10.0, _2852);
+ _2770.y = pow(10.0, _2852);
float _2855 = _2479.z;
float _2858 = log((_2855 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2855);
float _2859 = _2858 * 0.4342944622039794921875;
@@ -744,9 +733,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2936 = _2928;
}
- float3 _2938 = _2854;
- _2938.z = pow(10.0, _2936);
- float3 _2942 = pow(((_2938 - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2770.z = pow(10.0, _2936);
+ float3 _2942 = pow(((_2770 - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2950 = pow((float3(0.8359375) + (float3(18.8515625) * _2942)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2942))), float3(78.84375));
}
else
@@ -865,9 +853,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_1398 = 0.0;
}
- float3 _1405 = _1319;
- _1405.x = _1320 + ((((_1398 * 1.5) * _1275) * (0.02999999932944774627685546875 - _1320)) * 0.180000007152557373046875);
- float3 _1408 = fast::clamp(fast::clamp(_1405, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ _1319.x = _1320 + ((((_1398 * 1.5) * _1275) * (0.02999999932944774627685546875 - _1320)) * 0.180000007152557373046875);
+ float3 _1408 = fast::clamp(fast::clamp(_1319, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
float3 _1411 = mix(float3(dot(_1408, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1408, float3(0.959999978542327880859375));
float _1412 = _1411.x;
float _1421 = log((_1412 <= 0.0) ? 6.103515625e-05 : _1412) * 0.4342944622039794921875;
@@ -904,7 +891,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1490 = _1487;
}
- float3 _1492 = _391;
+ float3 _1492;
_1492.x = pow(10.0, _1490);
float _1493 = _1411.y;
float _1497 = log((_1493 <= 0.0) ? 6.103515625e-05 : _1493) * 0.4342944622039794921875;
@@ -941,8 +928,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1564 = _1561;
}
- float3 _1566 = _1492;
- _1566.y = pow(10.0, _1564);
+ _1492.y = pow(10.0, _1564);
float _1567 = _1411.z;
float _1571 = log((_1567 <= 0.0) ? 6.103515625e-05 : _1567) * 0.4342944622039794921875;
float _1638;
@@ -978,9 +964,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1638 = _1635;
}
- float3 _1640 = _1566;
- _1640.z = pow(10.0, _1638);
- float3 _1642 = (_1640 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ _1492.z = pow(10.0, _1638);
+ float3 _1642 = (_1492 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _1775 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875)).z);
float _1847 = pow(10.0, dot(float3(0.69444429874420166015625, 0.8333332538604736328125, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(2.0810306072235107421875, 3.66812419891357421875, 4.0)));
float _1848 = _1642.x;
@@ -1023,7 +1008,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1926 = _1923;
}
- float3 _1928 = _391;
+ float3 _1928;
_1928.x = pow(10.0, _1926);
float _1929 = _1642.y;
float _1932 = log((_1929 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1929);
@@ -1064,8 +1049,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2005 = _2002;
}
- float3 _2007 = _1928;
- _2007.y = pow(10.0, _2005);
+ _1928.y = pow(10.0, _2005);
float _2008 = _1642.z;
float _2011 = log((_2008 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2008);
float _2012 = _2011 * 0.4342944622039794921875;
@@ -1105,9 +1089,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2084 = _2081;
}
- float3 _2086 = _2007;
- _2086.z = pow(10.0, _2084);
- float3 _2089 = pow((_2086 * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _1928.z = pow(10.0, _2084);
+ float3 _2089 = pow((_1928 * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2097 = pow((float3(0.8359375) + (float3(18.8515625) * _2089)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2089))), float3(78.84375));
}
else
@@ -1131,9 +1114,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3001 = _2960;
}
float3 _3002 = _3001 * float3(0.95238101482391357421875);
- float4 _3004 = float4(_3002.x, _3002.y, _3002.z, float4(0.0).w);
- _3004.w = 0.0;
- out.out_var_SV_Target0 = _3004;
+ float4 _3003 = float4(_3002.x, _3002.y, _3002.z, float4(0.0).w);
+ _3003.w = 0.0;
+ out.out_var_SV_Target0 = _3003;
return out;
}
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 f7e65ae7..4f7d1023 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
@@ -184,20 +184,16 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
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 _709 = fast::max(_706.y, 1.0000000133514319600180897396058e-10);
- float3 _711 = _523;
+ float3 _711;
_711.x = _706.x / _709;
- float3 _712 = _711;
- _712.y = 1.0;
- float3 _716 = _712;
- _716.z = ((1.0 - _706.x) - _706.y) / _709;
- float3 _719 = _523;
+ _711.y = 1.0;
+ _711.z = ((1.0 - _706.x) - _706.y) / _709;
+ float3 _719;
_719.x = 0.950455963611602783203125;
- float3 _720 = _719;
- _720.y = 1.0;
- float3 _722 = _720;
- _722.z = 1.0890576839447021484375;
- float3 _723 = _716 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
- float3 _724 = _722 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ _719.y = 1.0;
+ _719.z = 1.0890576839447021484375;
+ float3 _723 = _711 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _724 = _719 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
float3 _743 = (_625 * ((float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * ((float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875)) * float3x3(float3(_724.x / _723.x, 0.0, 0.0), float3(0.0, _724.y / _723.y, 0.0), float3(0.0, 0.0, _724.z / _723.z))) * float3x3(float3(0.986992895603179931640625, -0.14705429971218109130859375, 0.15996269881725311279296875), float3(0.4323053061962127685546875, 0.518360316753387451171875, 0.049291200935840606689453125), float3(-0.00852870009839534759521484375, 0.0400427989661693572998046875, 0.968486726284027099609375)))) * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875)))) * _573;
float3 _771;
if (_Globals.ColorShadow_Tint2.w != 0.0)
@@ -294,9 +290,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1027 = _1022;
}
float _1031 = smoothstep(0.0, 1.0, 1.0 - abs(_1027 * 0.01481481455266475677490234375));
- float3 _1038 = _998;
- _1038.x = _999 + ((((_1031 * _1031) * _954) * (0.02999999932944774627685546875 - _999)) * 0.180000007152557373046875);
- float3 _1040 = fast::max(float3(0.0), _1038 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
+ _998.x = _999 + ((((_1031 * _1031) * _954) * (0.02999999932944774627685546875 - _999)) * 0.180000007152557373046875);
+ float3 _1040 = fast::max(float3(0.0), _998 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
float _1049 = (1.0 + _Globals.FilmBlackClip) - _Globals.FilmToe;
float _1052 = 1.0 + _Globals.FilmWhiteClip;
float _1055 = _1052 - _Globals.FilmShoulder;
@@ -324,13 +319,11 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float3 _1215;
if (_Globals.ColorShadow_Tint2.w == 0.0)
{
- float3 _1157 = _3265;
+ float3 _1157;
_1157.x = dot(_932, _Globals.ColorMatrixR_ColorCurveCd1.xyz);
- float3 _1162 = _1157;
- _1162.y = dot(_932, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
- float3 _1167 = _1162;
- _1167.z = dot(_932, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
- float3 _1183 = fast::max(float3(0.0), _1167 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_932, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
+ _1157.y = dot(_932, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
+ _1157.z = dot(_932, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
+ float3 _1183 = fast::max(float3(0.0), _1157 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_932, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
float3 _1188 = fast::max(float3(0.0), _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx - _1183);
float3 _1190 = fast::max(_1183, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz);
_1215 = ((((_1190 * _Globals.ColorCurve_Ch1_Ch2.xxx) + _Globals.ColorCurve_Ch1_Ch2.yyy) * (float3(1.0) / (_1190 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.www))) + ((fast::clamp(_1183, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz) * _Globals.ColorMatrixB_ColorCurveCm2.www) + (((_1188 * _Globals.ColorMatrixR_ColorCurveCd1.www) * (float3(1.0) / (_1188 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.yyy))) + _Globals.ColorMatrixG_ColorCurveCd3Cm3.www))) - float3(0.00200000009499490261077880859375);
@@ -549,9 +542,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_2339 = 0.0;
}
- float3 _2346 = _2260;
- _2346.x = _2261 + ((((_2339 * 1.5) * _2216) * (0.02999999932944774627685546875 - _2261)) * 0.180000007152557373046875);
- float3 _2349 = fast::clamp(fast::clamp(_2346, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ _2260.x = _2261 + ((((_2339 * 1.5) * _2216) * (0.02999999932944774627685546875 - _2261)) * 0.180000007152557373046875);
+ float3 _2349 = fast::clamp(fast::clamp(_2260, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
float3 _2352 = mix(float3(dot(_2349, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _2349, float3(0.959999978542327880859375));
float _2353 = _2352.x;
float _2362 = log((_2353 <= 0.0) ? 6.103515625e-05 : _2353) * 0.4342944622039794921875;
@@ -588,7 +580,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2431 = _2428;
}
- float3 _2433 = _523;
+ float3 _2433;
_2433.x = pow(10.0, _2431);
float _2434 = _2352.y;
float _2438 = log((_2434 <= 0.0) ? 6.103515625e-05 : _2434) * 0.4342944622039794921875;
@@ -625,8 +617,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2505 = _2502;
}
- float3 _2507 = _2433;
- _2507.y = pow(10.0, _2505);
+ _2433.y = pow(10.0, _2505);
float _2508 = _2352.z;
float _2512 = log((_2508 <= 0.0) ? 6.103515625e-05 : _2508) * 0.4342944622039794921875;
float _2579;
@@ -662,9 +653,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2579 = _2576;
}
- float3 _2581 = _2507;
- _2581.z = pow(10.0, _2579);
- float3 _2583 = (_2581 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ _2433.z = pow(10.0, _2579);
+ float3 _2583 = (_2433 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _2714 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875)).z);
float _2786 = pow(10.0, dot(float3(0.4444443881511688232421875, 0.66666662693023681640625, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(2.0810306072235107421875, 3.66812419891357421875, 4.0)));
float _2787 = _2583.x;
@@ -708,7 +698,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2870 = _2862;
}
- float3 _2872 = _523;
+ float3 _2872;
_2872.x = pow(10.0, _2870);
float _2873 = _2583.y;
float _2876 = log((_2873 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2873);
@@ -749,8 +739,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2954 = _2946;
}
- float3 _2956 = _2872;
- _2956.y = pow(10.0, _2954);
+ _2872.y = pow(10.0, _2954);
float _2957 = _2583.z;
float _2960 = log((_2957 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2957);
float _2961 = _2960 * 0.4342944622039794921875;
@@ -790,9 +779,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_3038 = _3030;
}
- float3 _3040 = _2956;
- _3040.z = pow(10.0, _3038);
- float3 _3044 = pow(((_3040 - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2872.z = pow(10.0, _3038);
+ float3 _3044 = pow(((_2872 - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_3052 = pow((float3(0.8359375) + (float3(18.8515625) * _3044)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _3044))), float3(78.84375));
}
else
@@ -911,9 +899,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_1504 = 0.0;
}
- float3 _1511 = _1425;
- _1511.x = _1426 + ((((_1504 * 1.5) * _1381) * (0.02999999932944774627685546875 - _1426)) * 0.180000007152557373046875);
- float3 _1514 = fast::clamp(fast::clamp(_1511, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ _1425.x = _1426 + ((((_1504 * 1.5) * _1381) * (0.02999999932944774627685546875 - _1426)) * 0.180000007152557373046875);
+ float3 _1514 = fast::clamp(fast::clamp(_1425, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
float3 _1517 = mix(float3(dot(_1514, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1514, float3(0.959999978542327880859375));
float _1518 = _1517.x;
float _1527 = log((_1518 <= 0.0) ? 6.103515625e-05 : _1518) * 0.4342944622039794921875;
@@ -950,7 +937,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1596 = _1593;
}
- float3 _1598 = _523;
+ float3 _1598;
_1598.x = pow(10.0, _1596);
float _1599 = _1517.y;
float _1603 = log((_1599 <= 0.0) ? 6.103515625e-05 : _1599) * 0.4342944622039794921875;
@@ -987,8 +974,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1670 = _1667;
}
- float3 _1672 = _1598;
- _1672.y = pow(10.0, _1670);
+ _1598.y = pow(10.0, _1670);
float _1673 = _1517.z;
float _1677 = log((_1673 <= 0.0) ? 6.103515625e-05 : _1673) * 0.4342944622039794921875;
float _1744;
@@ -1024,9 +1010,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1744 = _1741;
}
- float3 _1746 = _1672;
- _1746.z = pow(10.0, _1744);
- float3 _1748 = (_1746 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ _1598.z = pow(10.0, _1744);
+ float3 _1748 = (_1598 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _1879 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875)).z);
float _1951 = pow(10.0, dot(float3(0.69444429874420166015625, 0.8333332538604736328125, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(2.0810306072235107421875, 3.66812419891357421875, 4.0)));
float _1952 = _1748.x;
@@ -1069,7 +1054,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2030 = _2027;
}
- float3 _2032 = _523;
+ float3 _2032;
_2032.x = pow(10.0, _2030);
float _2033 = _1748.y;
float _2036 = log((_2033 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2033);
@@ -1110,8 +1095,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2109 = _2106;
}
- float3 _2111 = _2032;
- _2111.y = pow(10.0, _2109);
+ _2032.y = pow(10.0, _2109);
float _2112 = _1748.z;
float _2115 = log((_2112 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2112);
float _2116 = _2115 * 0.4342944622039794921875;
@@ -1151,9 +1135,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2188 = _2185;
}
- float3 _2190 = _2111;
- _2190.z = pow(10.0, _2188);
- float3 _2193 = pow((_2190 * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2032.z = pow(10.0, _2188);
+ float3 _2193 = pow((_2032 * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2201 = pow((float3(0.8359375) + (float3(18.8515625) * _2193)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2193))), float3(78.84375));
}
else
@@ -1177,9 +1160,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3103 = _3062;
}
float3 _3104 = _3103 * float3(0.95238101482391357421875);
- float4 _3106 = float4(_3104.x, _3104.y, _3104.z, float4(0.0).w);
- _3106.w = 0.0;
- out.out_var_SV_Target0 = _3106;
+ float4 _3105 = float4(_3104.x, _3104.y, _3104.z, float4(0.0).w);
+ _3105.w = 0.0;
+ out.out_var_SV_Target0 = _3105;
return out;
}
diff --git a/reference/opt/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag b/reference/opt/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
index 866b1916..210aee9b 100644
--- a/reference/opt/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
+++ b/reference/opt/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
@@ -482,18 +482,18 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[bu
{
_246 = _216;
}
- float4 _256 = float4((_246 * float3(_215.w)) + _215.xyz, _108);
- _256.w = 1.0;
+ float4 _255 = float4((_246 * float3(_215.w)) + _215.xyz, _108);
+ _255.w = 1.0;
float4 _268;
uint _269;
if (View.View_NumSceneColorMSAASamples > 1)
{
- _268 = _256 * float4(float(View.View_NumSceneColorMSAASamples) * 0.25);
+ _268 = _255 * float4(float(View.View_NumSceneColorMSAASamples) * 0.25);
_269 = gl_SampleMaskIn & 15u;
}
else
{
- _268 = _256;
+ _268 = _255;
_269 = gl_SampleMaskIn;
}
out.out_var_SV_Target0 = _268;
diff --git a/reference/opt/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag b/reference/opt/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
index 8bffca17..5017be6c 100644
--- a/reference/opt/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
+++ b/reference/opt/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
@@ -206,9 +206,9 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
float4 _82 = _Globals.ScreenToShadowMatrix * float4((((gl_FragCoord.xy * View.View_BufferSizeAndInvSize.zw) - View.View_ScreenPositionScaleBias.wz) / View.View_ScreenPositionScaleBias.xy) * float2(_68), _68, 1.0);
float _118 = fast::clamp(((fast::clamp((ShadowDepthTexture.sample(ShadowDepthTextureSampler, (((_82.xyz / float3(_82.w)).xy * _Globals.ShadowTileOffsetAndSize.zw).xy + _Globals.ShadowTileOffsetAndSize.xy).xy, level(0.0)).xxx * float3(_Globals.SoftTransitionScale.z)) - float3((fast::min(_82.z, 0.999989986419677734375) * _Globals.SoftTransitionScale.z) - 1.0), float3(0.0), float3(1.0)).x - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
float3 _127 = mix(_Globals.ModulatedShadowColor.xyz, float3(1.0), float3(mix(1.0, _118 * _118, _Globals.ShadowFadeFraction)));
- float4 _129 = float4(_127.x, _127.y, _127.z, _58.w);
- _129.w = 0.0;
- out.out_var_SV_Target0 = _129;
+ float4 _128 = float4(_127.x, _127.y, _127.z, _58.w);
+ _128.w = 0.0;
+ out.out_var_SV_Target0 = _128;
return out;
}
diff --git a/reference/opt/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag b/reference/opt/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag
index 8bffca17..5017be6c 100644
--- a/reference/opt/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag
+++ b/reference/opt/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag
@@ -206,9 +206,9 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
float4 _82 = _Globals.ScreenToShadowMatrix * float4((((gl_FragCoord.xy * View.View_BufferSizeAndInvSize.zw) - View.View_ScreenPositionScaleBias.wz) / View.View_ScreenPositionScaleBias.xy) * float2(_68), _68, 1.0);
float _118 = fast::clamp(((fast::clamp((ShadowDepthTexture.sample(ShadowDepthTextureSampler, (((_82.xyz / float3(_82.w)).xy * _Globals.ShadowTileOffsetAndSize.zw).xy + _Globals.ShadowTileOffsetAndSize.xy).xy, level(0.0)).xxx * float3(_Globals.SoftTransitionScale.z)) - float3((fast::min(_82.z, 0.999989986419677734375) * _Globals.SoftTransitionScale.z) - 1.0), float3(0.0), float3(1.0)).x - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
float3 _127 = mix(_Globals.ModulatedShadowColor.xyz, float3(1.0), float3(mix(1.0, _118 * _118, _Globals.ShadowFadeFraction)));
- float4 _129 = float4(_127.x, _127.y, _127.z, _58.w);
- _129.w = 0.0;
- out.out_var_SV_Target0 = _129;
+ float4 _128 = float4(_127.x, _127.y, _127.z, _58.w);
+ _128.w = 0.0;
+ out.out_var_SV_Target0 = _128;
return out;
}
diff --git a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag
index c5c37a2d..1d330e28 100644
--- a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag
+++ b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag
@@ -46,11 +46,11 @@ fragment main0_out main0(main0_in in [[stage_in]], constant spvDescriptorSetBuff
float2 _93 = float2((*spvDescriptorSet0._Globals).ShadowTileListGroupSize);
float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
- float3 _102 = float3(_100.x, _100.y, _70.z);
- _102.z = 1.0;
+ float3 _101 = float3(_100.x, _100.y, _70.z);
+ _101.z = 1.0;
uint _103 = in.in_var_TEXCOORD0 * 5u;
uint _107 = _103 + 1u;
- if (all((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_107].xy > _96.xy) && all((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_103].xyz < _102))
+ if (all((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_107].xy > _96.xy) && all((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_103].xyz < _101))
{
float3 _121 = float3(0.5) * ((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_103].xyz + (*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_107].xyz);
float _122 = _96.x;
diff --git a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag
index d5ce54c0..5ade21c0 100644
--- a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag
+++ b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag
@@ -38,11 +38,11 @@ fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredB
float2 _93 = float2(_Globals.ShadowTileListGroupSize);
float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
- float3 _102 = float3(_100.x, _100.y, _70.z);
- _102.z = 1.0;
+ float3 _101 = float3(_100.x, _100.y, _70.z);
+ _101.z = 1.0;
uint _103 = in.in_var_TEXCOORD0 * 5u;
uint _107 = _103 + 1u;
- if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102))
+ if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _101))
{
float3 _121 = float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz);
float _122 = _96.x;
diff --git a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
index a7bb0ff2..a95aa317 100644
--- a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
+++ b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
@@ -39,11 +39,11 @@ fragment main0_out main0(main0_in in [[stage_in]], constant uint* spvBufferSizeC
float2 _93 = float2(_Globals.ShadowTileListGroupSize);
float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
- float3 _102 = float3(_100.x, _100.y, _70.z);
- _102.z = 1.0;
+ float3 _101 = float3(_100.x, _100.y, _70.z);
+ _101.z = 1.0;
uint _103 = in.in_var_TEXCOORD0 * 5u;
uint _310 = uint(clamp(int(_103 + 1u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))));
- if (all(CulledObjectBoxBounds._m0[_310].xy > _96.xy) && all(CulledObjectBoxBounds._m0[uint(clamp(int(_103), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz < _102))
+ if (all(CulledObjectBoxBounds._m0[_310].xy > _96.xy) && all(CulledObjectBoxBounds._m0[uint(clamp(int(_103), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz < _101))
{
float3 _121 = float3(0.5) * (CulledObjectBoxBounds._m0[uint(clamp(int(_103), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz + CulledObjectBoxBounds._m0[_310].xyz);
float _122 = _96.x;
diff --git a/reference/opt/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc b/reference/opt/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc
index 2748b497..1d021259 100644
--- a/reference/opt/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc
+++ b/reference/opt/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc
@@ -346,14 +346,11 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
if (gl_InvocationID == 0u)
{
float4 _450 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
- float4 _463 = _142;
+ float4 _463;
_463.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _469 = _463;
- _469.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
- float4 _474 = _469;
- _474.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
- float4 _481 = _474;
- _481.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ _463.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ _463.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ _463.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
float4 _589;
for (;;)
{
@@ -383,12 +380,12 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
float _573 = sqrt(dot(_559, _559) / dot(_566, _566));
float _577 = sqrt(dot(_560, _560) / dot(_569, _569));
float _581 = sqrt(dot(_558, _558) / dot(_563, _563));
- float4 _586 = float4(_573, _577, _581, 1.0);
- _586.w = 0.333000004291534423828125 * ((_573 + _577) + _581);
- _589 = float4(View.View_AdaptiveTessellationFactor) * _586;
+ float4 _582 = float4(_573, _577, _581, 1.0);
+ _582.w = 0.333000004291534423828125 * ((_573 + _577) + _581);
+ _589 = float4(View.View_AdaptiveTessellationFactor) * _582;
break;
}
- float4 _591 = fast::clamp(_481 * _589, float4(1.0), float4(15.0));
+ float4 _591 = fast::clamp(_463 * _589, float4(1.0), float4(15.0));
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_591.x);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_591.y);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_591.z);
diff --git a/reference/opt/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc b/reference/opt/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc
index 6aadcefe..f72e5d3b 100644
--- a/reference/opt/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc
+++ b/reference/opt/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc
@@ -414,14 +414,11 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
if (gl_InvocationID == 0u)
{
float4 _461 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
- float4 _474 = _140;
+ float4 _474;
_474.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _480 = _474;
- _480.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
- float4 _485 = _480;
- _485.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
- float4 _492 = _485;
- _492.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ _474.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ _474.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ _474.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
float4 _600;
for (;;)
{
@@ -451,12 +448,12 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
float _584 = sqrt(dot(_570, _570) / dot(_577, _577));
float _588 = sqrt(dot(_571, _571) / dot(_580, _580));
float _592 = sqrt(dot(_569, _569) / dot(_574, _574));
- float4 _597 = float4(_584, _588, _592, 1.0);
- _597.w = 0.333000004291534423828125 * ((_584 + _588) + _592);
- _600 = float4(View.View_AdaptiveTessellationFactor) * _597;
+ float4 _593 = float4(_584, _588, _592, 1.0);
+ _593.w = 0.333000004291534423828125 * ((_584 + _588) + _592);
+ _600 = float4(View.View_AdaptiveTessellationFactor) * _593;
break;
}
- float4 _602 = fast::clamp(_492 * _600, float4(1.0), float4(15.0));
+ float4 _602 = fast::clamp(_474 * _600, float4(1.0), float4(15.0));
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_602.x);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_602.y);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_602.z);
diff --git a/reference/opt/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc b/reference/opt/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc
index 8c8ebf55..5d4e320b 100644
--- a/reference/opt/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc
+++ b/reference/opt/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc
@@ -358,14 +358,11 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
if (gl_InvocationID == 0u)
{
float4 _385 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
- float4 _398 = _127;
+ float4 _398;
_398.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _404 = _398;
- _404.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
- float4 _409 = _404;
- _409.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
- float4 _416 = _409;
- _416.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ _398.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ _398.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ _398.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
float4 _524;
for (;;)
{
@@ -395,12 +392,12 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
float _508 = sqrt(dot(_494, _494) / dot(_501, _501));
float _512 = sqrt(dot(_495, _495) / dot(_504, _504));
float _516 = sqrt(dot(_493, _493) / dot(_498, _498));
- float4 _521 = float4(_508, _512, _516, 1.0);
- _521.w = 0.333000004291534423828125 * ((_508 + _512) + _516);
- _524 = float4(View.View_AdaptiveTessellationFactor) * _521;
+ float4 _517 = float4(_508, _512, _516, 1.0);
+ _517.w = 0.333000004291534423828125 * ((_508 + _512) + _516);
+ _524 = float4(View.View_AdaptiveTessellationFactor) * _517;
break;
}
- float4 _526 = fast::clamp(_416 * _524, float4(1.0), float4(15.0));
+ float4 _526 = fast::clamp(_398 * _524, float4(1.0), float4(15.0));
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_526.x);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_526.y);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_526.z);
diff --git a/reference/opt/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc b/reference/opt/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc
index 04f5a1d3..9ae81e40 100644
--- a/reference/opt/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc
+++ b/reference/opt/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc
@@ -160,15 +160,12 @@ kernel void main0(main0_in in [[stage_in]], constant type_Primitive& Primitive [
threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
if (gl_InvocationID == 0u)
{
- float4 _154 = _88;
+ float4 _154;
_154.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _160 = _154;
- _160.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
- float4 _165 = _160;
- _165.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
- float4 _172 = _165;
- _172.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _173 = fast::clamp(_172, float4(1.0), float4(15.0));
+ _154.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ _154.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ _154.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _173 = fast::clamp(_154, float4(1.0), float4(15.0));
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_173.x);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_173.y);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_173.z);
diff --git a/reference/opt/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese b/reference/opt/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
index 19e402e6..7d4ec2c5 100644
--- a/reference/opt/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
+++ b/reference/opt/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
@@ -395,9 +395,8 @@ struct main0_patchIn
{
float4 _279 = _270;
_279.z = 9.9999999747524270787835121154785e-07;
- float4 _280 = _279;
- _280.w = 1.0;
- _281 = _280;
+ _279.w = 1.0;
+ _281 = _279;
}
else
{
diff --git a/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese b/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
index 3c063c93..f1b74aac 100644
--- a/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
+++ b/reference/opt/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
@@ -403,9 +403,8 @@ struct main0_patchIn
}
float3 _565 = _264 + ((_398[2] * float3(fast::min(_547 + Material.Material_ScalarExpressions[0].z, 0.0) * Material.Material_ScalarExpressions[0].w)) * float3(((_137[0] * gl_TessCoord.x) + (_137[1] * gl_TessCoord.y)) + (_137[2] * gl_TessCoord.z)));
float4 _574 = View.View_TranslatedWorldToClip * float4(_565.x, _565.y, _565.z, _235.w);
- float4 _579 = _574;
- _579.z = _574.z + (0.001000000047497451305389404296875 * _574.w);
- out.gl_Position = _579;
+ _574.z = _574.z + (0.001000000047497451305389404296875 * _574.w);
+ out.gl_Position = _574;
out.out_var_TEXCOORD6 = ((_120[0] * _198) + (_120[1] * _202)) + (_120[2] * _207);
out.out_var_TEXCOORD7 = ((_121[0] * _198) + (_121[1] * _202)) + (_121[2] * _207);
out.out_var_TEXCOORD10_centroid = float4(_256.x, _256.y, _256.z, _118.w);
diff --git a/reference/opt/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese b/reference/opt/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
index 4a872e5f..b4dbe705 100644
--- a/reference/opt/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
+++ b/reference/opt/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
@@ -195,9 +195,8 @@ struct main0_patchIn
{
float4 _198 = _189;
_198.z = 9.9999999747524270787835121154785e-07;
- float4 _199 = _198;
- _199.w = 1.0;
- _200 = _199;
+ _198.w = 1.0;
+ _200 = _198;
}
else
{
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 ea7db420..5398fec3 100644
--- a/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert
+++ b/reference/opt/shaders-ue4/asm/vert/texture-buffer.asm.vert
@@ -371,9 +371,8 @@ vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buff
{
float4 _384 = _375;
_384.z = 9.9999999747524270787835121154785e-07;
- float4 _385 = _384;
- _385.w = 1.0;
- _386 = _385;
+ _384.w = 1.0;
+ _386 = _384;
}
else
{
diff --git a/reference/opt/shaders/asm/frag/vector-shuffle-oom.asm.frag b/reference/opt/shaders/asm/frag/vector-shuffle-oom.asm.frag
index 5476f68b..769afddd 100644
--- a/reference/opt/shaders/asm/frag/vector-shuffle-oom.asm.frag
+++ b/reference/opt/shaders/asm/frag/vector-shuffle-oom.asm.frag
@@ -293,10 +293,9 @@ void main()
_693 = _673;
}
vec3 _702 = (((((((((((((_129 * 0.5).xyz + (_176 * 0.5)).xyz + (_223 * 0.75)).xyz + (_270 * 0.5)).xyz + (_317 * 0.5)).xyz + (_364 * 0.75)).xyz + (_411 * 1.0)).xyz + (_458 * 0.75)).xyz + (_505 * 0.5)).xyz + (_552 * 0.5)).xyz + (_599 * 0.75)).xyz + (_646 * 0.5)).xyz + (_693 * 0.5)).xyz * vec3(0.125);
- _28 _704 = _74;
+ _28 _704;
_704._m0 = vec4(_702.x, _702.y, _702.z, vec4(0.0).w);
- _28 _705 = _704;
- _705._m0.w = 1.0;
- _5 = _705._m0;
+ _704._m0.w = 1.0;
+ _5 = _704._m0;
}
diff --git a/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert b/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert
index bf3e0114..3d9ad3b4 100644
--- a/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert
+++ b/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert
@@ -21,9 +21,8 @@ void main()
{
vec4 _65 = vec4(0.0);
_65.y = float(_20);
- vec4 _68 = _65;
- _68.z = float(_25);
- vec4 _54 = _68 + vec4(_32);
+ _65.z = float(_25);
+ vec4 _54 = _65 + vec4(_32);
vec2 _58 = _54.xy + vec2(_34);
gl_Position = vec4(_58.x, _58.y, _54.z, _54.w);
_4 = _35;
diff --git a/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk b/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk
index c5a8835f..ed9d98e9 100644
--- a/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk
+++ b/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk
@@ -17,10 +17,9 @@ void main()
vec4 _65 = vec4(0.0);
_65.y = _42;
float _47 = float(_25);
- vec4 _68 = _65;
- _68.z = _47;
+ _65.z = _47;
vec4 _52 = vec4(_32);
- vec4 _54 = _68 + _52;
+ vec4 _54 = _65 + _52;
vec2 _55 = vec2(_34);
vec2 _58 = _54.xy + _55;
gl_Position = vec4(_58.x, _58.y, _54.z, _54.w);
diff --git a/reference/opt/shaders/comp/insert.comp b/reference/opt/shaders/comp/insert.comp
index ad394aab..8b85e3bc 100644
--- a/reference/opt/shaders/comp/insert.comp
+++ b/reference/opt/shaders/comp/insert.comp
@@ -10,15 +10,12 @@ vec4 _53;
void main()
{
- vec4 _46 = _53;
+ vec4 _46;
_46.x = 10.0;
- vec4 _48 = _46;
- _48.y = 30.0;
- vec4 _50 = _48;
- _50.z = 70.0;
- vec4 _52 = _50;
- _52.w = 90.0;
- _27.out_data[gl_GlobalInvocationID.x] = _52;
+ _46.y = 30.0;
+ _46.z = 70.0;
+ _46.w = 90.0;
+ _27.out_data[gl_GlobalInvocationID.x] = _46;
_27.out_data[gl_GlobalInvocationID.x].y = 20.0;
}
diff --git a/reference/opt/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag b/reference/opt/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag
index d5e45bda..334a6b19 100644
--- a/reference/opt/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag
+++ b/reference/opt/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag
@@ -13,14 +13,15 @@ layout(location = 0) in vec3 vClip3;
void main()
{
- vec4 _20 = vClip4;
- _20.y = vClip4.w;
- FragColor = textureProj(uShadow1D, vec4(_20.x, 0.0, vClip4.z, _20.y));
- vec4 _30 = vClip4;
- _30.z = vClip4.w;
- FragColor = textureProj(uShadow2D, vec4(_30.xy, vClip4.z, _30.z));
+ vec4 _17 = vClip4;
+ vec4 _20 = _17;
+ _20.y = _17.w;
+ FragColor = textureProj(uShadow1D, vec4(_20.x, 0.0, _17.z, _20.y));
+ vec4 _30 = _17;
+ _30.z = _17.w;
+ FragColor = textureProj(uShadow2D, vec4(_30.xy, _17.z, _30.z));
FragColor = textureProj(uSampler1D, vClip2).x;
FragColor = textureProj(uSampler2D, vClip3).x;
- FragColor = textureProj(uSampler3D, vClip4).x;
+ FragColor = textureProj(uSampler3D, _17).x;
}
diff --git a/reference/opt/shaders/vert/ocean.vert b/reference/opt/shaders/vert/ocean.vert
index 9fab66bd..a2790870 100644
--- a/reference/opt/shaders/vert/ocean.vert
+++ b/reference/opt/shaders/vert/ocean.vert
@@ -76,7 +76,7 @@ void main()
{
_467 = 0u;
}
- uvec4 _445 = _476;
+ uvec4 _445;
_445.x = _467;
bool _380 = _360.y < 32u;
uint _470;
@@ -88,8 +88,7 @@ void main()
{
_470 = 0u;
}
- uvec4 _449 = _445;
- _449.y = _470;
+ _445.y = _470;
uint _472;
if (_370)
{
@@ -99,8 +98,7 @@ void main()
{
_472 = 0u;
}
- uvec4 _453 = _449;
- _453.z = _472;
+ _445.z = _472;
uint _474;
if (_380)
{
@@ -110,9 +108,8 @@ void main()
{
_474 = 0u;
}
- uvec4 _457 = _453;
- _457.w = _474;
- vec4 _416 = vec4((_360.xyxy + _457) & (~_367).xxyy);
+ _445.w = _474;
+ vec4 _416 = vec4((_360.xyxy + _445) & (~_367).xxyy);
vec2 _197 = ((_53.Patches[(gl_InstanceID + SPIRV_Cross_BaseInstance)].Position.xz * _180.InvOceanSize_PatchScale.zw) + mix(_416.xy, _416.zw, vec2(_351 - _353))) * _180.InvOceanSize_PatchScale.xy;
vec2 _204 = _197 * _180.NormalTexCoordScale.zw;
mediump float _433 = textureLod(TexLOD, _197, 0.0).x * 7.96875;
diff --git a/reference/shaders-hlsl/frag/sample-cmp-level-zero.frag b/reference/shaders-hlsl/frag/sample-cmp-level-zero.frag
index b6df0019..5c583c66 100644
--- a/reference/shaders-hlsl/frag/sample-cmp-level-zero.frag
+++ b/reference/shaders-hlsl/frag/sample-cmp-level-zero.frag
@@ -31,12 +31,14 @@ void frag_main()
float l0 = uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1));
float l1 = uSampler2DArray.SampleCmpLevelZero(_uSampler2DArray_sampler, vDirRef.xyz, vDirRef.w, int2(-1, -1));
float l2 = uSamplerCube.SampleCmpLevelZero(_uSamplerCube_sampler, vDirRef.xyz, vDirRef.w);
- float4 _80 = vDirRef;
- _80.z = vDirRef.w;
- float p0 = uSampler2D.SampleCmp(_uSampler2D_sampler, _80.xy / _80.z, vDirRef.z / _80.z, int2(1, 1));
- float4 _87 = vDirRef;
- _87.z = vDirRef.w;
- float p1 = uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, _87.xy / _87.z, vDirRef.z / _87.z, int2(1, 1));
+ float4 _75 = vDirRef;
+ float4 _80 = _75;
+ _80.z = _75.w;
+ float p0 = uSampler2D.SampleCmp(_uSampler2D_sampler, _80.xy / _80.z, _75.z / _80.z, int2(1, 1));
+ float4 _84 = vDirRef;
+ float4 _87 = _84;
+ _87.z = _84.w;
+ float p1 = uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, _87.xy / _87.z, _84.z / _87.z, int2(1, 1));
FragColor = (((((((s0 + s1) + s2) + s3) + l0) + l1) + l2) + p0) + p1;
}
diff --git a/reference/shaders-hlsl/frag/texture-proj-shadow.frag b/reference/shaders-hlsl/frag/texture-proj-shadow.frag
index 07e06008..f98a5126 100644
--- a/reference/shaders-hlsl/frag/texture-proj-shadow.frag
+++ b/reference/shaders-hlsl/frag/texture-proj-shadow.frag
@@ -28,12 +28,14 @@ struct SPIRV_Cross_Output
void frag_main()
{
- float4 _20 = vClip4;
- _20.y = vClip4.w;
- FragColor = uShadow1D.SampleCmp(_uShadow1D_sampler, _20.x / _20.y, vClip4.z / _20.y);
- float4 _30 = vClip4;
- _30.z = vClip4.w;
- FragColor = uShadow2D.SampleCmp(_uShadow2D_sampler, _30.xy / _30.z, vClip4.z / _30.z);
+ float4 _17 = vClip4;
+ float4 _20 = _17;
+ _20.y = _17.w;
+ FragColor = uShadow1D.SampleCmp(_uShadow1D_sampler, _20.x / _20.y, _17.z / _20.y);
+ float4 _27 = vClip4;
+ float4 _30 = _27;
+ _30.z = _27.w;
+ FragColor = uShadow2D.SampleCmp(_uShadow2D_sampler, _30.xy / _30.z, _27.z / _30.z);
FragColor = uSampler1D.Sample(_uSampler1D_sampler, vClip2.x / vClip2.y).x;
FragColor = uSampler2D.Sample(_uSampler2D_sampler, vClip3.xy / vClip3.z).x;
FragColor = uSampler3D.Sample(_uSampler3D_sampler, vClip4.xyz / vClip4.w).x;
diff --git a/reference/shaders-msl-no-opt/asm/packing/packed-vector-extract-insert.asm.comp b/reference/shaders-msl-no-opt/asm/packing/packed-vector-extract-insert.asm.comp
index b858561e..4c70aede 100644
--- a/reference/shaders-msl-no-opt/asm/packing/packed-vector-extract-insert.asm.comp
+++ b/reference/shaders-msl-no-opt/asm/packing/packed-vector-extract-insert.asm.comp
@@ -13,9 +13,10 @@ struct SSBOScalar
kernel void main0(device SSBOScalar& _4 [[buffer(0)]])
{
- float3 _24 = _4.b;
+ float3 _23 = float3(_4.b);
+ float3 _24 = _23;
_24.z = 2.0;
- _4.a = float2(_4.b[0], _4.b[1]) * _4.b[2];
+ _4.a = _23.xy * _23.z;
_4.b = _24;
}
diff --git a/reference/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag b/reference/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag
index e23fa815..9e73be47 100644
--- a/reference/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag
+++ b/reference/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag
@@ -128,7 +128,7 @@ struct main0_out
fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buffer(1)]], constant _18& _19 [[buffer(2)]], texture2d<float> _8 [[texture(0)]], texture2d<float> _12 [[texture(1)]], texture2d<float> _14 [[texture(2)]], sampler _9 [[sampler(0)]], sampler _13 [[sampler(1)]], sampler _15 [[sampler(2)]], float4 gl_FragCoord [[position]])
{
main0_out out = {};
- _28 _77 = _74;
+ _28 _77;
_77._m0 = float4(0.0);
float2 _82 = gl_FragCoord.xy * _19._m23.xy;
float4 _88 = _7._m2 * _7._m0.xyxy;
@@ -146,8 +146,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _133 = float4(0.0).xyz + (_129 * 0.5);
float4 _134 = float4(_133.x, _133.y, _133.z, float4(0.0).w);
- _28 _135 = _77;
- _135._m0 = _134;
+ _77._m0 = _134;
float2 _144 = fast::clamp(_82 + (float3(-1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _156 = float3(_11._m5) * fast::clamp(_8.sample(_9, _144, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _160 = _12.sample(_13, _144, level(0.0));
@@ -162,8 +161,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _180 = _134.xyz + (_176 * 0.5);
float4 _181 = float4(_180.x, _180.y, _180.z, _134.w);
- _28 _182 = _135;
- _182._m0 = _181;
+ _77._m0 = _181;
float2 _191 = fast::clamp(_82 + (float3(0.0, -1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _203 = float3(_11._m5) * fast::clamp(_8.sample(_9, _191, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _207 = _12.sample(_13, _191, level(0.0));
@@ -178,8 +176,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _227 = _181.xyz + (_223 * 0.75);
float4 _228 = float4(_227.x, _227.y, _227.z, _181.w);
- _28 _229 = _182;
- _229._m0 = _228;
+ _77._m0 = _228;
float2 _238 = fast::clamp(_82 + (float3(1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _250 = float3(_11._m5) * fast::clamp(_8.sample(_9, _238, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _254 = _12.sample(_13, _238, level(0.0));
@@ -194,8 +191,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _274 = _228.xyz + (_270 * 0.5);
float4 _275 = float4(_274.x, _274.y, _274.z, _228.w);
- _28 _276 = _229;
- _276._m0 = _275;
+ _77._m0 = _275;
float2 _285 = fast::clamp(_82 + (float3(-2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _297 = float3(_11._m5) * fast::clamp(_8.sample(_9, _285, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _301 = _12.sample(_13, _285, level(0.0));
@@ -210,8 +206,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _321 = _275.xyz + (_317 * 0.5);
float4 _322 = float4(_321.x, _321.y, _321.z, _275.w);
- _28 _323 = _276;
- _323._m0 = _322;
+ _77._m0 = _322;
float2 _332 = fast::clamp(_82 + (float3(-1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _344 = float3(_11._m5) * fast::clamp(_8.sample(_9, _332, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _348 = _12.sample(_13, _332, level(0.0));
@@ -226,8 +221,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _368 = _322.xyz + (_364 * 0.75);
float4 _369 = float4(_368.x, _368.y, _368.z, _322.w);
- _28 _370 = _323;
- _370._m0 = _369;
+ _77._m0 = _369;
float2 _379 = fast::clamp(_82 + (float3(0.0, 0.0, 1.0).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _391 = float3(_11._m5) * fast::clamp(_8.sample(_9, _379, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _395 = _12.sample(_13, _379, level(0.0));
@@ -242,8 +236,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _415 = _369.xyz + (_411 * 1.0);
float4 _416 = float4(_415.x, _415.y, _415.z, _369.w);
- _28 _417 = _370;
- _417._m0 = _416;
+ _77._m0 = _416;
float2 _426 = fast::clamp(_82 + (float3(1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _438 = float3(_11._m5) * fast::clamp(_8.sample(_9, _426, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _442 = _12.sample(_13, _426, level(0.0));
@@ -258,8 +251,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _462 = _416.xyz + (_458 * 0.75);
float4 _463 = float4(_462.x, _462.y, _462.z, _416.w);
- _28 _464 = _417;
- _464._m0 = _463;
+ _77._m0 = _463;
float2 _473 = fast::clamp(_82 + (float3(2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _485 = float3(_11._m5) * fast::clamp(_8.sample(_9, _473, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _489 = _12.sample(_13, _473, level(0.0));
@@ -274,8 +266,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _509 = _463.xyz + (_505 * 0.5);
float4 _510 = float4(_509.x, _509.y, _509.z, _463.w);
- _28 _511 = _464;
- _511._m0 = _510;
+ _77._m0 = _510;
float2 _520 = fast::clamp(_82 + (float3(-1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _532 = float3(_11._m5) * fast::clamp(_8.sample(_9, _520, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _536 = _12.sample(_13, _520, level(0.0));
@@ -290,8 +281,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _556 = _510.xyz + (_552 * 0.5);
float4 _557 = float4(_556.x, _556.y, _556.z, _510.w);
- _28 _558 = _511;
- _558._m0 = _557;
+ _77._m0 = _557;
float2 _567 = fast::clamp(_82 + (float3(0.0, 1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _579 = float3(_11._m5) * fast::clamp(_8.sample(_9, _567, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _583 = _12.sample(_13, _567, level(0.0));
@@ -306,8 +296,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _603 = _557.xyz + (_599 * 0.75);
float4 _604 = float4(_603.x, _603.y, _603.z, _557.w);
- _28 _605 = _558;
- _605._m0 = _604;
+ _77._m0 = _604;
float2 _614 = fast::clamp(_82 + (float3(1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _626 = float3(_11._m5) * fast::clamp(_8.sample(_9, _614, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _630 = _12.sample(_13, _614, level(0.0));
@@ -322,8 +311,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _650 = _604.xyz + (_646 * 0.5);
float4 _651 = float4(_650.x, _650.y, _650.z, _604.w);
- _28 _652 = _605;
- _652._m0 = _651;
+ _77._m0 = _651;
float2 _661 = fast::clamp(_82 + (float3(0.0, 2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
float3 _673 = float3(_11._m5) * fast::clamp(_8.sample(_9, _661, level(0.0)).w * _7._m1, 0.0, 1.0);
float4 _677 = _12.sample(_13, _661, level(0.0));
@@ -338,14 +326,11 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff
}
float3 _697 = _651.xyz + (_693 * 0.5);
float4 _698 = float4(_697.x, _697.y, _697.z, _651.w);
- _28 _699 = _652;
- _699._m0 = _698;
+ _77._m0 = _698;
float3 _702 = _698.xyz / float3(((((((((((((0.0 + 0.5) + 0.5) + 0.75) + 0.5) + 0.5) + 0.75) + 1.0) + 0.75) + 0.5) + 0.5) + 0.75) + 0.5) + 0.5);
- _28 _704 = _699;
- _704._m0 = float4(_702.x, _702.y, _702.z, _698.w);
- _28 _705 = _704;
- _705._m0.w = 1.0;
- out.m_5 = _705._m0;
+ _77._m0 = float4(_702.x, _702.y, _702.z, _698.w);
+ _77._m0.w = 1.0;
+ out.m_5 = _77._m0;
return out;
}
diff --git a/reference/shaders-msl/frag/texture-proj-shadow.frag b/reference/shaders-msl/frag/texture-proj-shadow.frag
index 52d4a026..1ef450a2 100644
--- a/reference/shaders-msl/frag/texture-proj-shadow.frag
+++ b/reference/shaders-msl/frag/texture-proj-shadow.frag
@@ -18,9 +18,10 @@ struct main0_in
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow2D [[texture(0)]], texture1d<float> uSampler1D [[texture(1)]], texture2d<float> uSampler2D [[texture(2)]], texture3d<float> uSampler3D [[texture(3)]], sampler uShadow2DSmplr [[sampler(0)]], sampler uSampler1DSmplr [[sampler(1)]], sampler uSampler2DSmplr [[sampler(2)]], sampler uSampler3DSmplr [[sampler(3)]])
{
main0_out out = {};
- float4 _20 = in.vClip4;
- _20.z = in.vClip4.w;
- out.FragColor = uShadow2D.sample_compare(uShadow2DSmplr, _20.xy / _20.z, in.vClip4.z / _20.z);
+ float4 _17 = in.vClip4;
+ float4 _20 = _17;
+ _20.z = _17.w;
+ out.FragColor = uShadow2D.sample_compare(uShadow2DSmplr, _20.xy / _20.z, _17.z / _20.z);
out.FragColor = uSampler1D.sample(uSampler1DSmplr, in.vClip2.x / in.vClip2.y).x;
out.FragColor = uSampler2D.sample(uSampler2DSmplr, in.vClip3.xy / in.vClip3.z).x;
out.FragColor = uSampler3D.sample(uSampler3DSmplr, in.vClip4.xyz / in.vClip4.w).x;
diff --git a/reference/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag b/reference/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag
index ff9c122f..88b94d8c 100644
--- a/reference/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag
+++ b/reference/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag
@@ -97,36 +97,24 @@ vec4 _297;
void main()
{
- VertexOutput _128 = _121;
+ VertexOutput _128;
_128.HPosition = gl_FragCoord;
- VertexOutput _130 = _128;
- _130.Uv_EdgeDistance1 = IN_Uv_EdgeDistance1;
- VertexOutput _132 = _130;
- _132.UvStuds_EdgeDistance2 = IN_UvStuds_EdgeDistance2;
- VertexOutput _134 = _132;
- _134.Color = IN_Color;
- VertexOutput _136 = _134;
- _136.LightPosition_Fog = IN_LightPosition_Fog;
- VertexOutput _138 = _136;
- _138.View_Depth = IN_View_Depth;
- VertexOutput _140 = _138;
- _140.Normal_SpecPower = IN_Normal_SpecPower;
- VertexOutput _142 = _140;
- _142.Tangent = IN_Tangent;
- VertexOutput _144 = _142;
- _144.PosLightSpace_Reflectance = IN_PosLightSpace_Reflectance;
- VertexOutput _146 = _144;
- _146.studIndex = IN_studIndex;
- SurfaceInput _147 = _122;
+ _128.Uv_EdgeDistance1 = IN_Uv_EdgeDistance1;
+ _128.UvStuds_EdgeDistance2 = IN_UvStuds_EdgeDistance2;
+ _128.Color = IN_Color;
+ _128.LightPosition_Fog = IN_LightPosition_Fog;
+ _128.View_Depth = IN_View_Depth;
+ _128.Normal_SpecPower = IN_Normal_SpecPower;
+ _128.Tangent = IN_Tangent;
+ _128.PosLightSpace_Reflectance = IN_PosLightSpace_Reflectance;
+ _128.studIndex = IN_studIndex;
+ SurfaceInput _147;
_147.Color = IN_Color;
- SurfaceInput _149 = _147;
- _149.Uv = IN_Uv_EdgeDistance1.xy;
- SurfaceInput _151 = _149;
- _151.UvStuds = IN_UvStuds_EdgeDistance2.xy;
- SurfaceInput _156 = _151;
- _156.UvStuds.y = (fract(_151.UvStuds.y) + IN_studIndex) * 0.25;
- float _160 = clamp(1.0 - (_146.View_Depth.w * 0.00333332992158830165863037109375), 0.0, 1.0);
- float _163 = _146.View_Depth.w * _19.CB0.RefractionBias_FadeDistance_GlowFactor.y;
+ _147.Uv = IN_Uv_EdgeDistance1.xy;
+ _147.UvStuds = IN_UvStuds_EdgeDistance2.xy;
+ _147.UvStuds.y = (fract(_147.UvStuds.y) + IN_studIndex) * 0.25;
+ float _160 = clamp(1.0 - (_128.View_Depth.w * 0.00333332992158830165863037109375), 0.0, 1.0);
+ float _163 = _128.View_Depth.w * _19.CB0.RefractionBias_FadeDistance_GlowFactor.y;
float _165 = clamp(1.0 - _163, 0.0, 1.0);
vec2 _166 = IN_Uv_EdgeDistance1.xy * 1.0;
bool _173;
@@ -174,7 +162,7 @@ void main()
vec3 _253 = vec3(_252.x, _252.y, _232.z);
vec2 _255 = _253.xy * _165;
vec3 _256 = vec3(_255.x, _255.y, _253.z);
- vec4 _268 = texture(SPIRV_Cross_CombinedStudsMapTextureStudsMapSampler, _156.UvStuds);
+ vec4 _268 = texture(SPIRV_Cross_CombinedStudsMapTextureStudsMapSampler, _147.UvStuds);
vec3 _271 = ((IN_Color.xyz * (_193 * 1.0).xyz) * (1.0 + (_256.x * 0.300000011920928955078125))) * (_268.x * 2.0);
vec4 _298;
for (;;)
@@ -194,21 +182,17 @@ void main()
break;
}
vec2 _303 = mix(vec2(0.800000011920928955078125, 120.0), (_298.xy * vec2(2.0, 256.0)) + vec2(0.0, 0.00999999977648258209228515625), vec2(_165));
- Surface _304 = _125;
+ Surface _304;
_304.albedo = _271;
- Surface _305 = _304;
- _305.normal = _256;
+ _304.normal = _256;
float _306 = _303.x;
- Surface _307 = _305;
- _307.specular = _306;
+ _304.specular = _306;
float _308 = _303.y;
- Surface _309 = _307;
- _309.gloss = _308;
+ _304.gloss = _308;
float _312 = (_298.xy.y * _165) * 0.0;
- Surface _313 = _309;
- _313.reflectance = _312;
- vec4 _318 = vec4(_271, _146.Color.w);
- vec3 _329 = normalize(((IN_Tangent * _313.normal.x) + (cross(IN_Normal_SpecPower.xyz, IN_Tangent) * _313.normal.y)) + (IN_Normal_SpecPower.xyz * _313.normal.z));
+ _304.reflectance = _312;
+ vec4 _318 = vec4(_271, _128.Color.w);
+ vec3 _329 = normalize(((IN_Tangent * _304.normal.x) + (cross(IN_Normal_SpecPower.xyz, IN_Tangent) * _304.normal.y)) + (IN_Normal_SpecPower.xyz * _304.normal.z));
vec3 _332 = -_19.CB0.Lamp0Dir;
float _333 = dot(_329, _332);
float _357 = clamp(dot(step(_19.CB0.LightConfig3.xyz, abs(IN_LightPosition_Fog.xyz - _19.CB0.LightConfig2.xyz)), vec3(1.0)), 0.0, 1.0);
@@ -217,13 +201,13 @@ void main()
float _392 = (1.0 - (((step(_376.x, IN_PosLightSpace_Reflectance.xyz.z) * clamp(9.0 - (20.0 * abs(IN_PosLightSpace_Reflectance.xyz.z - 0.5)), 0.0, 1.0)) * _376.y) * _19.CB0.OutlineBrightness_ShadowInfo.w)) * _368.w;
vec3 _403 = mix(_318.xyz, texture(SPIRV_Cross_CombinedEnvironmentMapTextureEnvironmentMapSampler, reflect(-IN_View_Depth.xyz, _329)).xyz, vec3(_312));
vec3 _422 = (((_19.CB0.AmbientColor + (((_19.CB0.Lamp0Color * clamp(_333, 0.0, 1.0)) + (_19.CB0.Lamp1Color * max(-_333, 0.0))) * _392)) + _368.xyz) * vec4(_403.x, _403.y, _403.z, _318.w).xyz) + (_19.CB0.Lamp0Color * (((step(0.0, _333) * _306) * _392) * pow(clamp(dot(_329, normalize(_332 + normalize(IN_View_Depth.xyz))), 0.0, 1.0), _308)));
- vec4 _425 = vec4(_422.x, _422.y, _422.z, _124.w);
- _425.w = vec4(_403.x, _403.y, _403.z, _318.w).w;
+ vec4 _423 = vec4(_422.x, _422.y, _422.z, _124.w);
+ _423.w = vec4(_403.x, _403.y, _403.z, _318.w).w;
vec2 _435 = min(IN_Uv_EdgeDistance1.wz, IN_UvStuds_EdgeDistance2.wz);
float _439 = min(_435.x, _435.y) / _163;
- vec3 _445 = _425.xyz * clamp((clamp((_163 * _19.CB0.OutlineBrightness_ShadowInfo.x) + _19.CB0.OutlineBrightness_ShadowInfo.y, 0.0, 1.0) * (1.5 - _439)) + _439, 0.0, 1.0);
- vec4 _446 = vec4(_445.x, _445.y, _445.z, _425.w);
- vec3 _453 = mix(_19.CB0.FogColor, _446.xyz, vec3(clamp(_146.LightPosition_Fog.w, 0.0, 1.0)));
+ vec3 _445 = _423.xyz * clamp((clamp((_163 * _19.CB0.OutlineBrightness_ShadowInfo.x) + _19.CB0.OutlineBrightness_ShadowInfo.y, 0.0, 1.0) * (1.5 - _439)) + _439, 0.0, 1.0);
+ vec4 _446 = vec4(_445.x, _445.y, _445.z, _423.w);
+ vec3 _453 = mix(_19.CB0.FogColor, _446.xyz, vec3(clamp(_128.LightPosition_Fog.w, 0.0, 1.0)));
_entryPointOutput = vec4(_453.x, _453.y, _453.z, _446.w);
}
diff --git a/reference/shaders-no-opt/asm/frag/switch-single-case-multiple-exit-cfg.asm.frag b/reference/shaders-no-opt/asm/frag/switch-single-case-multiple-exit-cfg.asm.frag
index 2f7fee64..2ec47169 100644
--- a/reference/shaders-no-opt/asm/frag/switch-single-case-multiple-exit-cfg.asm.frag
+++ b/reference/shaders-no-opt/asm/frag/switch-single-case-multiple-exit-cfg.asm.frag
@@ -16,7 +16,7 @@ void main()
_30 = _19;
break;
}
- highp vec2 _29 = _19;
+ highp vec2 _29;
_29.y = _19.y;
_30 = _29;
break;
diff --git a/reference/shaders-no-opt/legacy/frag/switch-single-case-multiple-exit-cfg.legacy.asm.frag b/reference/shaders-no-opt/legacy/frag/switch-single-case-multiple-exit-cfg.legacy.asm.frag
index be41ceef..f46bc2fd 100644
--- a/reference/shaders-no-opt/legacy/frag/switch-single-case-multiple-exit-cfg.legacy.asm.frag
+++ b/reference/shaders-no-opt/legacy/frag/switch-single-case-multiple-exit-cfg.legacy.asm.frag
@@ -14,7 +14,7 @@ void main()
_30 = _19;
break;
}
- highp vec2 _29 = _19;
+ highp vec2 _29;
_29.y = _19.y;
_30 = _29;
break;
diff --git a/reference/shaders-ue4-no-opt/asm/frag/accesschain-invalid-expression.asm.invalid.frag b/reference/shaders-ue4-no-opt/asm/frag/accesschain-invalid-expression.asm.invalid.frag
index 0f9cd547..429bbf73 100644
--- a/reference/shaders-ue4-no-opt/asm/frag/accesschain-invalid-expression.asm.invalid.frag
+++ b/reference/shaders-ue4-no-opt/asm/frag/accesschain-invalid-expression.asm.invalid.frag
@@ -262,40 +262,32 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[bu
float2 _311 = _303.xy * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.xy;
float2 _312 = fract(_311);
float2 _313 = floor(_311);
- float3 _320 = _139;
+ float3 _320;
_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;
+ _320.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, -0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ _320.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 = _139;
+ float3 _339 = fast::clamp((_320 * _335) - _337, float3(0.0), float3(1.0));
+ float3 _345;
_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 = _139;
+ _345.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ _345.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5, 0.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _360 = fast::clamp((_345 * _335) - _337, float3(0.0), float3(1.0));
+ float3 _366;
_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));
+ _366.y = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(0.5, 1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ _366.z = MobileDirectionalLight_DirectionalLightShadowTexture.sample(MobileDirectionalLight_DirectionalLightShadowSampler, ((_313 + float2(1.5)) * MobileDirectionalLight.MobileDirectionalLight_DirectionalLightShadowSize.zw), level(0.0)).x;
+ float3 _381 = fast::clamp((_366 * _335) - _337, float3(0.0), float3(1.0));
float _383 = _312.x;
float _384 = 1.0 - _383;
- float3 _399 = _136;
+ float3 _399;
_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);
+ _399.y = ((_360.x * _384) + _360.y) + (_360.z * _383);
+ _399.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);
+ _423 = mix(fast::clamp(0.25 * dot(_399, float3(1.0 - _408, 1.0, _408)), 0.0, 1.0), 1.0, _420 * _420);
}
else
{
@@ -361,9 +353,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[bu
}
}
float3 _567 = (mix(_488 + fast::max(float3(0.0), float3(0.0)), _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;
+ float4 _568 = float4(_567.x, _567.y, _567.z, _137.w);
+ _568.w = fast::min(in.in_var_TEXCOORD8.w, 65500.0);
+ out.out_var_SV_Target0 = _568;
return out;
}
diff --git a/reference/shaders-ue4/asm/frag/depth-compare.asm.frag b/reference/shaders-ue4/asm/frag/depth-compare.asm.frag
index 5f336c3d..0a6c9841 100644
--- a/reference/shaders-ue4/asm/frag/depth-compare.asm.frag
+++ b/reference/shaders-ue4/asm/frag/depth-compare.asm.frag
@@ -244,8 +244,9 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
}
float _213 = fast::clamp(((_207 - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
float _218 = sqrt(mix(1.0, _213 * _213, _Globals.ShadowFadeFraction));
- float4 _219 = _107;
+ float4 _219;
_219.z = _218;
+ float4 _220 = float4(float3(1.0).x, float3(1.0).y, _219.z, float3(1.0).z);
float3 _236 = fast::normalize((SceneTexturesStruct_GBufferATexture.sample(SceneTexturesStruct_GBufferATextureSampler, _114, level(0.0)).xyz * float3(2.0)) - float3(1.0));
uint _240 = uint(round(SceneTexturesStruct_GBufferBTexture.sample(SceneTexturesStruct_GBufferBTextureSampler, _114, level(0.0)).w * 255.0));
bool _248 = (_240 & 15u) == 5u;
@@ -307,9 +308,8 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
{
_448 = 1.0;
}
- float4 _451 = float4(float3(1.0).x, float3(1.0).y, _219.z, float3(1.0).z);
- _451.w = _248 ? sqrt(_448) : _218;
- out.out_var_SV_Target0 = _451;
+ _220.w = _248 ? sqrt(_448) : _218;
+ out.out_var_SV_Target0 = _220;
return out;
}
diff --git a/reference/shaders-ue4/asm/frag/global-constant-arrays.asm.frag b/reference/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
index f189d1d2..a741c434 100644
--- a/reference/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
+++ b/reference/shaders-ue4/asm/frag/global-constant-arrays.asm.frag
@@ -182,21 +182,17 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float _674 = ((2.0 * _665) - (8.0 * _669)) + 4.0;
float2 _680 = select(float2(_616, ((((-3.0) * _616) * _616) + (2.86999988555908203125 * _616)) - 0.2750000059604644775390625), _653, bool2(_Globals.WhiteTemp < 4000.0)) + (float2((3.0 * _665) / _674, (2.0 * _669) / _674) - _653);
float _683 = fast::max(_680.y, 1.0000000133514319600180897396058e-10);
- float3 _685 = _391;
+ float3 _685;
_685.x = _680.x / _683;
- float3 _686 = _685;
- _686.y = 1.0;
- float3 _690 = _686;
- _690.z = ((1.0 - _680.x) - _680.y) / _683;
+ _685.y = 1.0;
+ _685.z = ((1.0 - _680.x) - _680.y) / _683;
float _691 = fast::max(0.328999996185302734375, 1.0000000133514319600180897396058e-10);
- float3 _693 = _391;
+ float3 _693;
_693.x = 0.3127000033855438232421875 / _691;
- float3 _694 = _693;
- _694.y = 1.0;
- float3 _696 = _694;
- _696.z = 0.3582999706268310546875 / _691;
- float3 _697 = _690 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
- float3 _698 = _696 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ _693.y = 1.0;
+ _693.z = 0.3582999706268310546875 / _691;
+ float3 _697 = _685 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _698 = _693 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
float3 _717 = (_599 * ((float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * ((float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875)) * float3x3(float3(_698.x / _697.x, 0.0, 0.0), float3(0.0, _698.y / _697.y, 0.0), float3(0.0, 0.0, _698.z / _697.z))) * float3x3(float3(0.986992895603179931640625, -0.14705429971218109130859375, 0.15996269881725311279296875), float3(0.4323053061962127685546875, 0.518360316753387451171875, 0.049291200935840606689453125), float3(-0.00852870009839534759521484375, 0.0400427989661693572998046875, 0.968486726284027099609375)))) * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875)))) * _547;
float3 _745;
if (_Globals.ColorShadow_Tint2.w != 0.0)
@@ -293,9 +289,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1001 = _996;
}
float _1005 = smoothstep(0.0, 1.0, 1.0 - abs(_1001 * 0.01481481455266475677490234375));
- float3 _1012 = _972;
- _1012.x = _973 + ((((_1005 * _1005) * _928) * (0.02999999932944774627685546875 - _973)) * 0.180000007152557373046875);
- float3 _1014 = fast::max(float3(0.0), _1012 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
+ _972.x = _973 + ((((_1005 * _1005) * _928) * (0.02999999932944774627685546875 - _973)) * 0.180000007152557373046875);
+ float3 _1014 = fast::max(float3(0.0), _972 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
float _1023 = (1.0 + _Globals.FilmBlackClip) - _Globals.FilmToe;
float _1026 = 1.0 + _Globals.FilmWhiteClip;
float _1029 = _1026 - _Globals.FilmShoulder;
@@ -324,13 +319,11 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float3 _1189;
if (_Globals.ColorShadow_Tint2.w == 0.0)
{
- float3 _1131 = _391;
+ float3 _1131;
_1131.x = dot(_906, _Globals.ColorMatrixR_ColorCurveCd1.xyz);
- float3 _1136 = _1131;
- _1136.y = dot(_906, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
- float3 _1141 = _1136;
- _1141.z = dot(_906, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
- float3 _1157 = fast::max(float3(0.0), _1141 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_906, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
+ _1131.y = dot(_906, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
+ _1131.z = dot(_906, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
+ float3 _1157 = fast::max(float3(0.0), _1131 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_906, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
float3 _1162 = fast::max(float3(0.0), _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx - _1157);
float3 _1164 = fast::max(_1157, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz);
_1189 = ((((_1164 * _Globals.ColorCurve_Ch1_Ch2.xxx) + _Globals.ColorCurve_Ch1_Ch2.yyy) * (float3(1.0) / (_1164 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.www))) + ((fast::clamp(_1157, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz) * _Globals.ColorMatrixB_ColorCurveCm2.www) + (((_1162 * _Globals.ColorMatrixR_ColorCurveCd1.www) * (float3(1.0) / (_1162 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.yyy))) + _Globals.ColorMatrixG_ColorCurveCd3Cm3.www))) - float3(0.00200000009499490261077880859375);
@@ -505,9 +498,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_2235 = 0.0;
}
- float3 _2242 = _2156;
- _2242.x = _2157 + ((((_2235 * 1.5) * _2112) * (0.02999999932944774627685546875 - _2157)) * 0.180000007152557373046875);
- float3 _2245 = fast::clamp(fast::clamp(_2242, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ _2156.x = _2157 + ((((_2235 * 1.5) * _2112) * (0.02999999932944774627685546875 - _2157)) * 0.180000007152557373046875);
+ float3 _2245 = fast::clamp(fast::clamp(_2156, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
float3 _2248 = mix(float3(dot(_2245, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _2245, float3(0.959999978542327880859375));
float _2249 = _2248.x;
float _2253 = 0.17999999225139617919921875 * exp2(18.0);
@@ -549,7 +541,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2327 = _2324;
}
- float3 _2329 = _391;
+ float3 _2329;
_2329.x = pow(10.0, _2327);
float _2330 = _2248.y;
float _2334 = log((_2330 <= 0.0) ? _2255 : _2330) / _1065;
@@ -588,8 +580,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2401 = _2398;
}
- float3 _2403 = _2329;
- _2403.y = pow(10.0, _2401);
+ _2329.y = pow(10.0, _2401);
float _2404 = _2248.z;
float _2408 = log((_2404 <= 0.0) ? _2255 : _2404) / _1065;
float _2475;
@@ -627,9 +618,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2475 = _2472;
}
- float3 _2477 = _2403;
- _2477.z = pow(10.0, _2475);
- float3 _2479 = (_2477 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ _2329.z = pow(10.0, _2475);
+ float3 _2479 = (_2329 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _2481 = 0.17999999225139617919921875 * pow(2.0, -12.0);
float _2485 = log((_2481 <= 0.0) ? _2255 : _2481) / _1065;
float _2552;
@@ -777,7 +767,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2768 = _2760;
}
- float3 _2770 = _391;
+ float3 _2770;
_2770.x = pow(10.0, _2768);
float _2771 = _2479.y;
float _2775 = log((_2771 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2771) / _1065;
@@ -817,8 +807,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2852 = _2844;
}
- float3 _2854 = _2770;
- _2854.y = pow(10.0, _2852);
+ _2770.y = pow(10.0, _2852);
float _2855 = _2479.z;
float _2859 = log((_2855 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2855) / _1065;
float _2936;
@@ -857,9 +846,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2936 = _2928;
}
- float3 _2938 = _2854;
- _2938.z = pow(10.0, _2936);
- float3 _2942 = pow(((_2938 - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2770.z = pow(10.0, _2936);
+ float3 _2942 = pow(((_2770 - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2950 = pow((float3(0.8359375) + (float3(18.8515625) * _2942)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2942))), float3(78.84375));
}
else
@@ -978,9 +966,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_1398 = 0.0;
}
- float3 _1405 = _1319;
- _1405.x = _1320 + ((((_1398 * 1.5) * _1275) * (0.02999999932944774627685546875 - _1320)) * 0.180000007152557373046875);
- float3 _1408 = fast::clamp(fast::clamp(_1405, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ _1319.x = _1320 + ((((_1398 * 1.5) * _1275) * (0.02999999932944774627685546875 - _1320)) * 0.180000007152557373046875);
+ float3 _1408 = fast::clamp(fast::clamp(_1319, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
float3 _1411 = mix(float3(dot(_1408, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1408, float3(0.959999978542327880859375));
float _1412 = _1411.x;
float _1416 = 0.17999999225139617919921875 * exp2(18.0);
@@ -1022,7 +1009,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1490 = _1487;
}
- float3 _1492 = _391;
+ float3 _1492;
_1492.x = pow(10.0, _1490);
float _1493 = _1411.y;
float _1497 = log((_1493 <= 0.0) ? _1418 : _1493) / _1065;
@@ -1061,8 +1048,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1564 = _1561;
}
- float3 _1566 = _1492;
- _1566.y = pow(10.0, _1564);
+ _1492.y = pow(10.0, _1564);
float _1567 = _1411.z;
float _1571 = log((_1567 <= 0.0) ? _1418 : _1567) / _1065;
float _1638;
@@ -1100,9 +1086,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1638 = _1635;
}
- float3 _1640 = _1566;
- _1640.z = pow(10.0, _1638);
- float3 _1642 = (_1640 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ _1492.z = pow(10.0, _1638);
+ float3 _1642 = (_1492 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _1644 = 0.17999999225139617919921875 * pow(2.0, -12.0);
float _1648 = log((_1644 <= 0.0) ? _1418 : _1644) / _1065;
float _1715;
@@ -1249,7 +1234,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1926 = _1923;
}
- float3 _1928 = _391;
+ float3 _1928;
_1928.x = pow(10.0, _1926);
float _1929 = _1642.y;
float _1933 = log((_1929 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1929) / _1065;
@@ -1289,8 +1274,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2005 = _2002;
}
- float3 _2007 = _1928;
- _2007.y = pow(10.0, _2005);
+ _1928.y = pow(10.0, _2005);
float _2008 = _1642.z;
float _2012 = log((_2008 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2008) / _1065;
float _2084;
@@ -1329,9 +1313,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2084 = _2081;
}
- float3 _2086 = _2007;
- _2086.z = pow(10.0, _2084);
- float3 _2089 = pow((_2086 * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _1928.z = pow(10.0, _2084);
+ float3 _2089 = pow((_1928 * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2097 = pow((float3(0.8359375) + (float3(18.8515625) * _2089)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2089))), float3(78.84375));
}
else
@@ -1355,9 +1338,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3001 = _2960;
}
float3 _3002 = _3001 * float3(0.95238101482391357421875);
- float4 _3004 = float4(_3002.x, _3002.y, _3002.z, float4(0.0).w);
- _3004.w = 0.0;
- out.out_var_SV_Target0 = _3004;
+ float4 _3003 = float4(_3002.x, _3002.y, _3002.z, float4(0.0).w);
+ _3003.w = 0.0;
+ out.out_var_SV_Target0 = _3003;
return out;
}
diff --git a/reference/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag b/reference/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
index e3d3f546..08bf7609 100644
--- a/reference/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
+++ b/reference/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag
@@ -184,21 +184,17 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float _700 = ((2.0 * _691) - (8.0 * _695)) + 4.0;
float2 _706 = select(float2(_642, ((((-3.0) * _642) * _642) + (2.86999988555908203125 * _642)) - 0.2750000059604644775390625), _679, bool2(_Globals.WhiteTemp < 4000.0)) + (float2((3.0 * _691) / _700, (2.0 * _695) / _700) - _679);
float _709 = fast::max(_706.y, 1.0000000133514319600180897396058e-10);
- float3 _711 = _523;
+ float3 _711;
_711.x = _706.x / _709;
- float3 _712 = _711;
- _712.y = 1.0;
- float3 _716 = _712;
- _716.z = ((1.0 - _706.x) - _706.y) / _709;
+ _711.y = 1.0;
+ _711.z = ((1.0 - _706.x) - _706.y) / _709;
float _717 = fast::max(0.328999996185302734375, 1.0000000133514319600180897396058e-10);
- float3 _719 = _523;
+ float3 _719;
_719.x = 0.3127000033855438232421875 / _717;
- float3 _720 = _719;
- _720.y = 1.0;
- float3 _722 = _720;
- _722.z = 0.3582999706268310546875 / _717;
- float3 _723 = _716 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
- float3 _724 = _722 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ _719.y = 1.0;
+ _719.z = 0.3582999706268310546875 / _717;
+ float3 _723 = _711 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
+ float3 _724 = _719 * float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875));
float3 _743 = (_625 * ((float3x3(float3(0.41245639324188232421875, 0.3575761020183563232421875, 0.180437505245208740234375), float3(0.21267290413379669189453125, 0.715152204036712646484375, 0.072175003588199615478515625), float3(0.01933390088379383087158203125, 0.119191996753215789794921875, 0.950304090976715087890625)) * ((float3x3(float3(0.89509999752044677734375, 0.2664000093936920166015625, -0.16140000522136688232421875), float3(-0.750199973583221435546875, 1.71350002288818359375, 0.0366999991238117218017578125), float3(0.0388999991118907928466796875, -0.06849999725818634033203125, 1.02960002422332763671875)) * float3x3(float3(_724.x / _723.x, 0.0, 0.0), float3(0.0, _724.y / _723.y, 0.0), float3(0.0, 0.0, _724.z / _723.z))) * float3x3(float3(0.986992895603179931640625, -0.14705429971218109130859375, 0.15996269881725311279296875), float3(0.4323053061962127685546875, 0.518360316753387451171875, 0.049291200935840606689453125), float3(-0.00852870009839534759521484375, 0.0400427989661693572998046875, 0.968486726284027099609375)))) * float3x3(float3(3.2409698963165283203125, -1.53738319873809814453125, -0.4986107647418975830078125), float3(-0.96924364566802978515625, 1.875967502593994140625, 0.0415550582110881805419921875), float3(0.055630080401897430419921875, -0.2039769589900970458984375, 1.05697154998779296875)))) * _573;
float3 _771;
if (_Globals.ColorShadow_Tint2.w != 0.0)
@@ -295,9 +291,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1027 = _1022;
}
float _1031 = smoothstep(0.0, 1.0, 1.0 - abs(_1027 * 0.01481481455266475677490234375));
- float3 _1038 = _998;
- _1038.x = _999 + ((((_1031 * _1031) * _954) * (0.02999999932944774627685546875 - _999)) * 0.180000007152557373046875);
- float3 _1040 = fast::max(float3(0.0), _1038 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
+ _998.x = _999 + ((((_1031 * _1031) * _954) * (0.02999999932944774627685546875 - _999)) * 0.180000007152557373046875);
+ float3 _1040 = fast::max(float3(0.0), _998 * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)));
float _1049 = (1.0 + _Globals.FilmBlackClip) - _Globals.FilmToe;
float _1052 = 1.0 + _Globals.FilmWhiteClip;
float _1055 = _1052 - _Globals.FilmShoulder;
@@ -326,13 +321,11 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float3 _1215;
if (_Globals.ColorShadow_Tint2.w == 0.0)
{
- float3 _1157 = _525;
+ float3 _1157;
_1157.x = dot(_932, _Globals.ColorMatrixR_ColorCurveCd1.xyz);
- float3 _1162 = _1157;
- _1162.y = dot(_932, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
- float3 _1167 = _1162;
- _1167.z = dot(_932, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
- float3 _1183 = fast::max(float3(0.0), _1167 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_932, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
+ _1157.y = dot(_932, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz);
+ _1157.z = dot(_932, _Globals.ColorMatrixB_ColorCurveCm2.xyz);
+ float3 _1183 = fast::max(float3(0.0), _1157 * (_Globals.ColorShadow_Tint1.xyz + (_Globals.ColorShadow_Tint2.xyz * float3(1.0 / (dot(_932, _Globals.ColorShadow_Luma.xyz) + 1.0)))));
float3 _1188 = fast::max(float3(0.0), _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx - _1183);
float3 _1190 = fast::max(_1183, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz);
_1215 = ((((_1190 * _Globals.ColorCurve_Ch1_Ch2.xxx) + _Globals.ColorCurve_Ch1_Ch2.yyy) * (float3(1.0) / (_1190 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.www))) + ((fast::clamp(_1183, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.xxx, _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.zzz) * _Globals.ColorMatrixB_ColorCurveCm2.www) + (((_1188 * _Globals.ColorMatrixR_ColorCurveCd1.www) * (float3(1.0) / (_1188 + _Globals.ColorCurve_Cm0Cd0_Cd2_Ch0Cm1_Ch3.yyy))) + _Globals.ColorMatrixG_ColorCurveCd3Cm3.www))) - float3(0.00200000009499490261077880859375);
@@ -551,9 +544,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_2339 = 0.0;
}
- float3 _2346 = _2260;
- _2346.x = _2261 + ((((_2339 * 1.5) * _2216) * (0.02999999932944774627685546875 - _2261)) * 0.180000007152557373046875);
- float3 _2349 = fast::clamp(fast::clamp(_2346, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ _2260.x = _2261 + ((((_2339 * 1.5) * _2216) * (0.02999999932944774627685546875 - _2261)) * 0.180000007152557373046875);
+ float3 _2349 = fast::clamp(fast::clamp(_2260, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
float3 _2352 = mix(float3(dot(_2349, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _2349, float3(0.959999978542327880859375));
float _2353 = _2352.x;
float _2357 = 0.17999999225139617919921875 * exp2(18.0);
@@ -595,7 +587,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2431 = _2428;
}
- float3 _2433 = _523;
+ float3 _2433;
_2433.x = pow(10.0, _2431);
float _2434 = _2352.y;
float _2438 = log((_2434 <= 0.0) ? _2359 : _2434) / _1091;
@@ -634,8 +626,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2505 = _2502;
}
- float3 _2507 = _2433;
- _2507.y = pow(10.0, _2505);
+ _2433.y = pow(10.0, _2505);
float _2508 = _2352.z;
float _2512 = log((_2508 <= 0.0) ? _2359 : _2508) / _1091;
float _2579;
@@ -673,9 +664,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2579 = _2576;
}
- float3 _2581 = _2507;
- _2581.z = pow(10.0, _2579);
- float3 _2583 = (_2581 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ _2433.z = pow(10.0, _2579);
+ float3 _2583 = (_2433 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _2585 = 0.17999999225139617919921875 * pow(2.0, -12.0);
float _2589 = log((_2585 <= 0.0) ? _2359 : _2585) / _1091;
float _2656;
@@ -823,7 +813,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2870 = _2862;
}
- float3 _2872 = _523;
+ float3 _2872;
_2872.x = pow(10.0, _2870);
float _2873 = _2583.y;
float _2877 = log((_2873 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2873) / _1091;
@@ -863,8 +853,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2954 = _2946;
}
- float3 _2956 = _2872;
- _2956.y = pow(10.0, _2954);
+ _2872.y = pow(10.0, _2954);
float _2957 = _2583.z;
float _2961 = log((_2957 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2957) / _1091;
float _3038;
@@ -903,9 +892,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_3038 = _3030;
}
- float3 _3040 = _2956;
- _3040.z = pow(10.0, _3038);
- float3 _3044 = pow(((_3040 - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2872.z = pow(10.0, _3038);
+ float3 _3044 = pow(((_2872 - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_3052 = pow((float3(0.8359375) + (float3(18.8515625) * _3044)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _3044))), float3(78.84375));
}
else
@@ -1024,9 +1012,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_1504 = 0.0;
}
- float3 _1511 = _1425;
- _1511.x = _1426 + ((((_1504 * 1.5) * _1381) * (0.02999999932944774627685546875 - _1426)) * 0.180000007152557373046875);
- float3 _1514 = fast::clamp(fast::clamp(_1511, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
+ _1425.x = _1426 + ((((_1504 * 1.5) * _1381) * (0.02999999932944774627685546875 - _1426)) * 0.180000007152557373046875);
+ float3 _1514 = fast::clamp(fast::clamp(_1425, float3(0.0), float3(65535.0)) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)), float3(0.0), float3(65535.0));
float3 _1517 = mix(float3(dot(_1514, float3(0.272228717803955078125, 0.674081742763519287109375, 0.053689517080783843994140625))), _1514, float3(0.959999978542327880859375));
float _1518 = _1517.x;
float _1522 = 0.17999999225139617919921875 * exp2(18.0);
@@ -1068,7 +1055,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1596 = _1593;
}
- float3 _1598 = _523;
+ float3 _1598;
_1598.x = pow(10.0, _1596);
float _1599 = _1517.y;
float _1603 = log((_1599 <= 0.0) ? _1524 : _1599) / _1091;
@@ -1107,8 +1094,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1670 = _1667;
}
- float3 _1672 = _1598;
- _1672.y = pow(10.0, _1670);
+ _1598.y = pow(10.0, _1670);
float _1673 = _1517.z;
float _1677 = log((_1673 <= 0.0) ? _1524 : _1673) / _1091;
float _1744;
@@ -1146,9 +1132,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1744 = _1741;
}
- float3 _1746 = _1672;
- _1746.z = pow(10.0, _1744);
- float3 _1748 = (_1746 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
+ _1598.z = pow(10.0, _1744);
+ float3 _1748 = (_1598 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _1750 = 0.17999999225139617919921875 * pow(2.0, -12.0);
float _1754 = log((_1750 <= 0.0) ? _1524 : _1750) / _1091;
float _1821;
@@ -1295,7 +1280,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2030 = _2027;
}
- float3 _2032 = _523;
+ float3 _2032;
_2032.x = pow(10.0, _2030);
float _2033 = _1748.y;
float _2037 = log((_2033 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2033) / _1091;
@@ -1335,8 +1320,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2109 = _2106;
}
- float3 _2111 = _2032;
- _2111.y = pow(10.0, _2109);
+ _2032.y = pow(10.0, _2109);
float _2112 = _1748.z;
float _2116 = log((_2112 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2112) / _1091;
float _2188;
@@ -1375,9 +1359,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2188 = _2185;
}
- float3 _2190 = _2111;
- _2190.z = pow(10.0, _2188);
- float3 _2193 = pow((_2190 * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
+ _2032.z = pow(10.0, _2188);
+ float3 _2193 = pow((_2032 * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2201 = pow((float3(0.8359375) + (float3(18.8515625) * _2193)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2193))), float3(78.84375));
}
else
@@ -1401,9 +1384,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3103 = _3062;
}
float3 _3104 = _3103 * float3(0.95238101482391357421875);
- float4 _3106 = float4(_3104.x, _3104.y, _3104.z, float4(0.0).w);
- _3106.w = 0.0;
- out.out_var_SV_Target0 = _3106;
+ float4 _3105 = float4(_3104.x, _3104.y, _3104.z, float4(0.0).w);
+ _3105.w = 0.0;
+ out.out_var_SV_Target0 = _3105;
return out;
}
diff --git a/reference/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag b/reference/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
index 834517a8..72a9c58a 100644
--- a/reference/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
+++ b/reference/shaders-ue4/asm/frag/sample-mask-not-array.asm.frag
@@ -482,18 +482,18 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[bu
{
_246 = _216;
}
- float4 _256 = float4((_246 * float3(_215.w)) + _215.xyz, _108);
- _256.w = 1.0;
+ float4 _255 = float4((_246 * float3(_215.w)) + _215.xyz, _108);
+ _255.w = 1.0;
float4 _268;
uint _269;
if (View.View_NumSceneColorMSAASamples > 1)
{
- _268 = _256 * float4(float(View.View_NumSceneColorMSAASamples) * 0.25);
+ _268 = _255 * float4(float(View.View_NumSceneColorMSAASamples) * 0.25);
_269 = gl_SampleMaskIn & 15u;
}
else
{
- _268 = _256;
+ _268 = _255;
_269 = gl_SampleMaskIn;
}
out.out_var_SV_Target0 = _268;
diff --git a/reference/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag b/reference/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
index 8bffca17..5017be6c 100644
--- a/reference/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
+++ b/reference/shaders-ue4/asm/frag/subpass-input.ios.framebuffer-fetch.asm.frag
@@ -206,9 +206,9 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
float4 _82 = _Globals.ScreenToShadowMatrix * float4((((gl_FragCoord.xy * View.View_BufferSizeAndInvSize.zw) - View.View_ScreenPositionScaleBias.wz) / View.View_ScreenPositionScaleBias.xy) * float2(_68), _68, 1.0);
float _118 = fast::clamp(((fast::clamp((ShadowDepthTexture.sample(ShadowDepthTextureSampler, (((_82.xyz / float3(_82.w)).xy * _Globals.ShadowTileOffsetAndSize.zw).xy + _Globals.ShadowTileOffsetAndSize.xy).xy, level(0.0)).xxx * float3(_Globals.SoftTransitionScale.z)) - float3((fast::min(_82.z, 0.999989986419677734375) * _Globals.SoftTransitionScale.z) - 1.0), float3(0.0), float3(1.0)).x - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
float3 _127 = mix(_Globals.ModulatedShadowColor.xyz, float3(1.0), float3(mix(1.0, _118 * _118, _Globals.ShadowFadeFraction)));
- float4 _129 = float4(_127.x, _127.y, _127.z, _58.w);
- _129.w = 0.0;
- out.out_var_SV_Target0 = _129;
+ float4 _128 = float4(_127.x, _127.y, _127.z, _58.w);
+ _128.w = 0.0;
+ out.out_var_SV_Target0 = _128;
return out;
}
diff --git a/reference/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag b/reference/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag
index 8bffca17..5017be6c 100644
--- a/reference/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag
+++ b/reference/shaders-ue4/asm/frag/subpass-input.msl23.framebuffer-fetch.asm.frag
@@ -206,9 +206,9 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
float4 _82 = _Globals.ScreenToShadowMatrix * float4((((gl_FragCoord.xy * View.View_BufferSizeAndInvSize.zw) - View.View_ScreenPositionScaleBias.wz) / View.View_ScreenPositionScaleBias.xy) * float2(_68), _68, 1.0);
float _118 = fast::clamp(((fast::clamp((ShadowDepthTexture.sample(ShadowDepthTextureSampler, (((_82.xyz / float3(_82.w)).xy * _Globals.ShadowTileOffsetAndSize.zw).xy + _Globals.ShadowTileOffsetAndSize.xy).xy, level(0.0)).xxx * float3(_Globals.SoftTransitionScale.z)) - float3((fast::min(_82.z, 0.999989986419677734375) * _Globals.SoftTransitionScale.z) - 1.0), float3(0.0), float3(1.0)).x - 0.5) * _Globals.ShadowSharpen) + 0.5, 0.0, 1.0);
float3 _127 = mix(_Globals.ModulatedShadowColor.xyz, float3(1.0), float3(mix(1.0, _118 * _118, _Globals.ShadowFadeFraction)));
- float4 _129 = float4(_127.x, _127.y, _127.z, _58.w);
- _129.w = 0.0;
- out.out_var_SV_Target0 = _129;
+ float4 _128 = float4(_127.x, _127.y, _127.z, _58.w);
+ _128.w = 0.0;
+ out.out_var_SV_Target0 = _128;
return out;
}
diff --git a/reference/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag b/reference/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag
index 938bd982..50516507 100644
--- a/reference/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag
+++ b/reference/shaders-ue4/asm/frag/texture-atomics.asm.argument.msl2.frag
@@ -86,11 +86,11 @@ fragment main0_out main0(main0_in in [[stage_in]], constant spvDescriptorSetBuff
float2 _93 = float2((*spvDescriptorSet0._Globals).ShadowTileListGroupSize);
float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
- float3 _102 = float3(_100.x, _100.y, _70.z);
- _102.z = 1.0;
+ float3 _101 = float3(_100.x, _100.y, _70.z);
+ _101.z = 1.0;
uint _103 = in.in_var_TEXCOORD0 * 5u;
uint _107 = _103 + 1u;
- if (all((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_107].xy > _96.xy) && all((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_103].xyz < _102))
+ if (all((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_107].xy > _96.xy) && all((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_103].xyz < _101))
{
float3 _121 = float3(0.5) * ((*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_103].xyz + (*spvDescriptorSet0.CulledObjectBoxBounds)._m0[_107].xyz);
float _122 = _96.x;
diff --git a/reference/shaders-ue4/asm/frag/texture-atomics.asm.frag b/reference/shaders-ue4/asm/frag/texture-atomics.asm.frag
index d73c30cb..0918dfbf 100644
--- a/reference/shaders-ue4/asm/frag/texture-atomics.asm.frag
+++ b/reference/shaders-ue4/asm/frag/texture-atomics.asm.frag
@@ -78,11 +78,11 @@ fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredB
float2 _93 = float2(_Globals.ShadowTileListGroupSize);
float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
- float3 _102 = float3(_100.x, _100.y, _70.z);
- _102.z = 1.0;
+ float3 _101 = float3(_100.x, _100.y, _70.z);
+ _101.z = 1.0;
uint _103 = in.in_var_TEXCOORD0 * 5u;
uint _107 = _103 + 1u;
- if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102))
+ if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _101))
{
float3 _121 = float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz);
float _122 = _96.x;
diff --git a/reference/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag b/reference/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
index d73c30cb..0918dfbf 100644
--- a/reference/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
+++ b/reference/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag
@@ -78,11 +78,11 @@ fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredB
float2 _93 = float2(_Globals.ShadowTileListGroupSize);
float2 _96 = ((_91 / _93) * float2(2.0)) - float2(1.0);
float2 _100 = (((_91 + float2(1.0)) / _93) * float2(2.0)) - float2(1.0);
- float3 _102 = float3(_100.x, _100.y, _70.z);
- _102.z = 1.0;
+ float3 _101 = float3(_100.x, _100.y, _70.z);
+ _101.z = 1.0;
uint _103 = in.in_var_TEXCOORD0 * 5u;
uint _107 = _103 + 1u;
- if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102))
+ if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _101))
{
float3 _121 = float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz);
float _122 = _96.x;
diff --git a/reference/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc b/reference/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc
index 2748b497..1d021259 100644
--- a/reference/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc
+++ b/reference/shaders-ue4/asm/tesc/hs-incorrect-base-type.invalid.asm.tesc
@@ -346,14 +346,11 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
if (gl_InvocationID == 0u)
{
float4 _450 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
- float4 _463 = _142;
+ float4 _463;
_463.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _469 = _463;
- _469.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
- float4 _474 = _469;
- _474.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
- float4 _481 = _474;
- _481.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ _463.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ _463.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ _463.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
float4 _589;
for (;;)
{
@@ -383,12 +380,12 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
float _573 = sqrt(dot(_559, _559) / dot(_566, _566));
float _577 = sqrt(dot(_560, _560) / dot(_569, _569));
float _581 = sqrt(dot(_558, _558) / dot(_563, _563));
- float4 _586 = float4(_573, _577, _581, 1.0);
- _586.w = 0.333000004291534423828125 * ((_573 + _577) + _581);
- _589 = float4(View.View_AdaptiveTessellationFactor) * _586;
+ float4 _582 = float4(_573, _577, _581, 1.0);
+ _582.w = 0.333000004291534423828125 * ((_573 + _577) + _581);
+ _589 = float4(View.View_AdaptiveTessellationFactor) * _582;
break;
}
- float4 _591 = fast::clamp(_481 * _589, float4(1.0), float4(15.0));
+ float4 _591 = fast::clamp(_463 * _589, float4(1.0), float4(15.0));
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_591.x);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_591.y);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_591.z);
diff --git a/reference/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc b/reference/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc
index 6aadcefe..f72e5d3b 100644
--- a/reference/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc
+++ b/reference/shaders-ue4/asm/tesc/hs-input-array-access.invalid.asm.tesc
@@ -414,14 +414,11 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
if (gl_InvocationID == 0u)
{
float4 _461 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
- float4 _474 = _140;
+ float4 _474;
_474.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _480 = _474;
- _480.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
- float4 _485 = _480;
- _485.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
- float4 _492 = _485;
- _492.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ _474.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ _474.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ _474.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
float4 _600;
for (;;)
{
@@ -451,12 +448,12 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
float _584 = sqrt(dot(_570, _570) / dot(_577, _577));
float _588 = sqrt(dot(_571, _571) / dot(_580, _580));
float _592 = sqrt(dot(_569, _569) / dot(_574, _574));
- float4 _597 = float4(_584, _588, _592, 1.0);
- _597.w = 0.333000004291534423828125 * ((_584 + _588) + _592);
- _600 = float4(View.View_AdaptiveTessellationFactor) * _597;
+ float4 _593 = float4(_584, _588, _592, 1.0);
+ _593.w = 0.333000004291534423828125 * ((_584 + _588) + _592);
+ _600 = float4(View.View_AdaptiveTessellationFactor) * _593;
break;
}
- float4 _602 = fast::clamp(_492 * _600, float4(1.0), float4(15.0));
+ float4 _602 = fast::clamp(_474 * _600, float4(1.0), float4(15.0));
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_602.x);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_602.y);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_602.z);
diff --git a/reference/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc b/reference/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc
index 8c8ebf55..5d4e320b 100644
--- a/reference/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc
+++ b/reference/shaders-ue4/asm/tesc/hs-texcoord-array.invalid.asm.tesc
@@ -358,14 +358,11 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
if (gl_InvocationID == 0u)
{
float4 _385 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875);
- float4 _398 = _127;
+ float4 _398;
_398.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _404 = _398;
- _404.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
- float4 _409 = _404;
- _409.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
- float4 _416 = _409;
- _416.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ _398.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ _398.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ _398.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
float4 _524;
for (;;)
{
@@ -395,12 +392,12 @@ kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)
float _508 = sqrt(dot(_494, _494) / dot(_501, _501));
float _512 = sqrt(dot(_495, _495) / dot(_504, _504));
float _516 = sqrt(dot(_493, _493) / dot(_498, _498));
- float4 _521 = float4(_508, _512, _516, 1.0);
- _521.w = 0.333000004291534423828125 * ((_508 + _512) + _516);
- _524 = float4(View.View_AdaptiveTessellationFactor) * _521;
+ float4 _517 = float4(_508, _512, _516, 1.0);
+ _517.w = 0.333000004291534423828125 * ((_508 + _512) + _516);
+ _524 = float4(View.View_AdaptiveTessellationFactor) * _517;
break;
}
- float4 _526 = fast::clamp(_416 * _524, float4(1.0), float4(15.0));
+ float4 _526 = fast::clamp(_398 * _524, float4(1.0), float4(15.0));
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_526.x);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_526.y);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_526.z);
diff --git a/reference/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc b/reference/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc
index 04f5a1d3..9ae81e40 100644
--- a/reference/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc
+++ b/reference/shaders-ue4/asm/tesc/tess-factor-must-be-threadgroup.invalid.asm.tesc
@@ -160,15 +160,12 @@ kernel void main0(main0_in in [[stage_in]], constant type_Primitive& Primitive [
threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup);
if (gl_InvocationID == 0u)
{
- float4 _154 = _88;
+ float4 _154;
_154.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _160 = _154;
- _160.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
- float4 _165 = _160;
- _165.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
- float4 _172 = _165;
- _172.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
- float4 _173 = fast::clamp(_172, float4(1.0), float4(15.0));
+ _154.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier);
+ _154.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier);
+ _154.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier);
+ float4 _173 = fast::clamp(_154, float4(1.0), float4(15.0));
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_173.x);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_173.y);
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_173.z);
diff --git a/reference/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese b/reference/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
index b2e5ecca..61210060 100644
--- a/reference/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
+++ b/reference/shaders-ue4/asm/tese/ds-double-gl-in-deref.asm.tese
@@ -396,9 +396,8 @@ struct main0_patchIn
{
float4 _279 = _270;
_279.z = 9.9999999747524270787835121154785e-07;
- float4 _280 = _279;
- _280.w = 1.0;
- _281 = _280;
+ _279.w = 1.0;
+ _281 = _279;
}
else
{
diff --git a/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese b/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
index 3c063c93..f1b74aac 100644
--- a/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
+++ b/reference/shaders-ue4/asm/tese/ds-patch-input-fixes.asm.tese
@@ -403,9 +403,8 @@ struct main0_patchIn
}
float3 _565 = _264 + ((_398[2] * float3(fast::min(_547 + Material.Material_ScalarExpressions[0].z, 0.0) * Material.Material_ScalarExpressions[0].w)) * float3(((_137[0] * gl_TessCoord.x) + (_137[1] * gl_TessCoord.y)) + (_137[2] * gl_TessCoord.z)));
float4 _574 = View.View_TranslatedWorldToClip * float4(_565.x, _565.y, _565.z, _235.w);
- float4 _579 = _574;
- _579.z = _574.z + (0.001000000047497451305389404296875 * _574.w);
- out.gl_Position = _579;
+ _574.z = _574.z + (0.001000000047497451305389404296875 * _574.w);
+ out.gl_Position = _574;
out.out_var_TEXCOORD6 = ((_120[0] * _198) + (_120[1] * _202)) + (_120[2] * _207);
out.out_var_TEXCOORD7 = ((_121[0] * _198) + (_121[1] * _202)) + (_121[2] * _207);
out.out_var_TEXCOORD10_centroid = float4(_256.x, _256.y, _256.z, _118.w);
diff --git a/reference/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese b/reference/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
index d0b6fbdd..26b2e4b0 100644
--- a/reference/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
+++ b/reference/shaders-ue4/asm/tese/ds-patch-inputs.asm.tese
@@ -196,9 +196,8 @@ struct main0_patchIn
{
float4 _198 = _189;
_198.z = 9.9999999747524270787835121154785e-07;
- float4 _199 = _198;
- _199.w = 1.0;
- _200 = _199;
+ _198.w = 1.0;
+ _200 = _198;
}
else
{
diff --git a/reference/shaders-ue4/asm/vert/texture-buffer.asm.vert b/reference/shaders-ue4/asm/vert/texture-buffer.asm.vert
index ea7db420..5398fec3 100644
--- a/reference/shaders-ue4/asm/vert/texture-buffer.asm.vert
+++ b/reference/shaders-ue4/asm/vert/texture-buffer.asm.vert
@@ -371,9 +371,8 @@ vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buff
{
float4 _384 = _375;
_384.z = 9.9999999747524270787835121154785e-07;
- float4 _385 = _384;
- _385.w = 1.0;
- _386 = _385;
+ _384.w = 1.0;
+ _386 = _384;
}
else
{
diff --git a/reference/shaders/asm/frag/vector-shuffle-oom.asm.frag b/reference/shaders/asm/frag/vector-shuffle-oom.asm.frag
index 039d4d13..e84fb894 100644
--- a/reference/shaders/asm/frag/vector-shuffle-oom.asm.frag
+++ b/reference/shaders/asm/frag/vector-shuffle-oom.asm.frag
@@ -106,7 +106,7 @@ _28 _74;
void main()
{
- _28 _77 = _74;
+ _28 _77;
_77._m0 = vec4(0.0);
vec2 _82 = gl_FragCoord.xy * _19._m23.xy;
vec4 _88 = _7._m2 * _7._m0.xyxy;
@@ -125,8 +125,7 @@ void main()
}
vec3 _133 = vec4(0.0).xyz + (_129 * 0.5);
vec4 _134 = vec4(_133.x, _133.y, _133.z, vec4(0.0).w);
- _28 _135 = _77;
- _135._m0 = _134;
+ _77._m0 = _134;
vec2 _144 = clamp(_82 + (vec3(-1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _156 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _144, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _160 = textureLod(SPIRV_Cross_Combined_1, _144, 0.0);
@@ -142,8 +141,7 @@ void main()
}
vec3 _180 = _134.xyz + (_176 * 0.5);
vec4 _181 = vec4(_180.x, _180.y, _180.z, _134.w);
- _28 _182 = _135;
- _182._m0 = _181;
+ _77._m0 = _181;
vec2 _191 = clamp(_82 + (vec3(0.0, -1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _203 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _191, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _207 = textureLod(SPIRV_Cross_Combined_1, _191, 0.0);
@@ -159,8 +157,7 @@ void main()
}
vec3 _227 = _181.xyz + (_223 * 0.75);
vec4 _228 = vec4(_227.x, _227.y, _227.z, _181.w);
- _28 _229 = _182;
- _229._m0 = _228;
+ _77._m0 = _228;
vec2 _238 = clamp(_82 + (vec3(1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _250 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _238, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _254 = textureLod(SPIRV_Cross_Combined_1, _238, 0.0);
@@ -176,8 +173,7 @@ void main()
}
vec3 _274 = _228.xyz + (_270 * 0.5);
vec4 _275 = vec4(_274.x, _274.y, _274.z, _228.w);
- _28 _276 = _229;
- _276._m0 = _275;
+ _77._m0 = _275;
vec2 _285 = clamp(_82 + (vec3(-2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _297 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _285, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _301 = textureLod(SPIRV_Cross_Combined_1, _285, 0.0);
@@ -193,8 +189,7 @@ void main()
}
vec3 _321 = _275.xyz + (_317 * 0.5);
vec4 _322 = vec4(_321.x, _321.y, _321.z, _275.w);
- _28 _323 = _276;
- _323._m0 = _322;
+ _77._m0 = _322;
vec2 _332 = clamp(_82 + (vec3(-1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _344 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _332, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _348 = textureLod(SPIRV_Cross_Combined_1, _332, 0.0);
@@ -210,8 +205,7 @@ void main()
}
vec3 _368 = _322.xyz + (_364 * 0.75);
vec4 _369 = vec4(_368.x, _368.y, _368.z, _322.w);
- _28 _370 = _323;
- _370._m0 = _369;
+ _77._m0 = _369;
vec2 _379 = clamp(_82 + (vec3(0.0, 0.0, 1.0).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _391 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _379, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _395 = textureLod(SPIRV_Cross_Combined_1, _379, 0.0);
@@ -227,8 +221,7 @@ void main()
}
vec3 _415 = _369.xyz + (_411 * 1.0);
vec4 _416 = vec4(_415.x, _415.y, _415.z, _369.w);
- _28 _417 = _370;
- _417._m0 = _416;
+ _77._m0 = _416;
vec2 _426 = clamp(_82 + (vec3(1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _438 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _426, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _442 = textureLod(SPIRV_Cross_Combined_1, _426, 0.0);
@@ -244,8 +237,7 @@ void main()
}
vec3 _462 = _416.xyz + (_458 * 0.75);
vec4 _463 = vec4(_462.x, _462.y, _462.z, _416.w);
- _28 _464 = _417;
- _464._m0 = _463;
+ _77._m0 = _463;
vec2 _473 = clamp(_82 + (vec3(2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _485 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _473, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _489 = textureLod(SPIRV_Cross_Combined_1, _473, 0.0);
@@ -261,8 +253,7 @@ void main()
}
vec3 _509 = _463.xyz + (_505 * 0.5);
vec4 _510 = vec4(_509.x, _509.y, _509.z, _463.w);
- _28 _511 = _464;
- _511._m0 = _510;
+ _77._m0 = _510;
vec2 _520 = clamp(_82 + (vec3(-1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _532 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _520, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _536 = textureLod(SPIRV_Cross_Combined_1, _520, 0.0);
@@ -278,8 +269,7 @@ void main()
}
vec3 _556 = _510.xyz + (_552 * 0.5);
vec4 _557 = vec4(_556.x, _556.y, _556.z, _510.w);
- _28 _558 = _511;
- _558._m0 = _557;
+ _77._m0 = _557;
vec2 _567 = clamp(_82 + (vec3(0.0, 1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _579 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _567, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _583 = textureLod(SPIRV_Cross_Combined_1, _567, 0.0);
@@ -295,8 +285,7 @@ void main()
}
vec3 _603 = _557.xyz + (_599 * 0.75);
vec4 _604 = vec4(_603.x, _603.y, _603.z, _557.w);
- _28 _605 = _558;
- _605._m0 = _604;
+ _77._m0 = _604;
vec2 _614 = clamp(_82 + (vec3(1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _626 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _614, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _630 = textureLod(SPIRV_Cross_Combined_1, _614, 0.0);
@@ -312,8 +301,7 @@ void main()
}
vec3 _650 = _604.xyz + (_646 * 0.5);
vec4 _651 = vec4(_650.x, _650.y, _650.z, _604.w);
- _28 _652 = _605;
- _652._m0 = _651;
+ _77._m0 = _651;
vec2 _661 = clamp(_82 + (vec3(0.0, 2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw);
vec3 _673 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _661, 0.0).w * _7._m1, 0.0, 1.0);
vec4 _677 = textureLod(SPIRV_Cross_Combined_1, _661, 0.0);
@@ -329,13 +317,10 @@ void main()
}
vec3 _697 = _651.xyz + (_693 * 0.5);
vec4 _698 = vec4(_697.x, _697.y, _697.z, _651.w);
- _28 _699 = _652;
- _699._m0 = _698;
+ _77._m0 = _698;
vec3 _702 = _698.xyz / vec3(((((((((((((0.0 + 0.5) + 0.5) + 0.75) + 0.5) + 0.5) + 0.75) + 1.0) + 0.75) + 0.5) + 0.5) + 0.75) + 0.5) + 0.5);
- _28 _704 = _699;
- _704._m0 = vec4(_702.x, _702.y, _702.z, _698.w);
- _28 _705 = _704;
- _705._m0.w = 1.0;
- _5 = _705._m0;
+ _77._m0 = vec4(_702.x, _702.y, _702.z, _698.w);
+ _77._m0.w = 1.0;
+ _5 = _77._m0;
}
diff --git a/reference/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag b/reference/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag
index d5e45bda..60c45908 100644
--- a/reference/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag
+++ b/reference/shaders/desktop-only/frag/texture-proj-shadow.desktop.frag
@@ -13,12 +13,14 @@ layout(location = 0) in vec3 vClip3;
void main()
{
- vec4 _20 = vClip4;
- _20.y = vClip4.w;
- FragColor = textureProj(uShadow1D, vec4(_20.x, 0.0, vClip4.z, _20.y));
- vec4 _30 = vClip4;
- _30.z = vClip4.w;
- FragColor = textureProj(uShadow2D, vec4(_30.xy, vClip4.z, _30.z));
+ vec4 _17 = vClip4;
+ vec4 _20 = _17;
+ _20.y = _17.w;
+ FragColor = textureProj(uShadow1D, vec4(_20.x, 0.0, _17.z, _20.y));
+ vec4 _27 = vClip4;
+ vec4 _30 = _27;
+ _30.z = _27.w;
+ FragColor = textureProj(uShadow2D, vec4(_30.xy, _27.z, _30.z));
FragColor = textureProj(uSampler1D, vClip2).x;
FragColor = textureProj(uSampler2D, vClip3).x;
FragColor = textureProj(uSampler3D, vClip4).x;
diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp
index 5ed8c80b..8c2d2d19 100644
--- a/spirv_glsl.cpp
+++ b/spirv_glsl.cpp
@@ -316,6 +316,7 @@ void CompilerGLSL::reset(uint32_t iteration_count)
// Clear invalid expression tracking.
invalid_expressions.clear();
+ composite_insert_overwritten.clear();
current_function = nullptr;
// Clear temporary usage tracking.
@@ -4382,6 +4383,11 @@ void CompilerGLSL::handle_invalid_expression(uint32_t id)
// This means we need another pass at compilation, but next time,
// force temporary variables so that they cannot be invalidated.
force_temporary_and_recompile(id);
+
+ // If the invalid expression happened as a result of a CompositeInsert
+ // overwrite, we must block this from happening next iteration.
+ if (composite_insert_overwritten.count(id))
+ block_composite_insert_overwrite.insert(id);
}
// Converts the format of the current expression from packed to unpacked,
@@ -11108,11 +11114,61 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
flush_variable_declaration(composite);
- // Make a copy, then use access chain to store the variable.
- statement(declare_temporary(result_type, id), to_expression(composite), ";");
- set<SPIRExpression>(id, to_name(id), result_type, true);
- auto chain = access_chain_internal(id, elems, length, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr);
- statement(chain, " = ", to_unpacked_expression(obj), ";");
+ // CompositeInsert requires a copy + modification, but this is very awkward code in HLL.
+ // Speculate that the input composite is no longer used, and we can modify it in-place.
+ // There are various scenarios where this is not possible to satisfy.
+ bool can_modify_in_place = true;
+ forced_temporaries.insert(id);
+
+ // Cannot safely RMW PHI variables since they have no way to be invalidated,
+ // forcing temporaries is not going to help.
+ // This is similar for Constant and Undef inputs.
+ // The only safe thing to RMW is SPIRExpression.
+ if (invalid_expressions.count(composite) ||
+ block_composite_insert_overwrite.count(composite) ||
+ maybe_get<SPIRExpression>(composite) == nullptr)
+ {
+ can_modify_in_place = false;
+ }
+ else if (backend.requires_relaxed_precision_analysis &&
+ has_decoration(composite, DecorationRelaxedPrecision) !=
+ has_decoration(id, DecorationRelaxedPrecision) &&
+ get<SPIRType>(result_type).basetype != SPIRType::Struct)
+ {
+ // Similarly, if precision does not match for input and output,
+ // we cannot alias them. If we write a composite into a relaxed precision
+ // ID, we might get a false truncation.
+ can_modify_in_place = false;
+ }
+
+ if (can_modify_in_place)
+ {
+ // Have to make sure the modified SSA value is bound to a temporary so we can modify it in-place.
+ if (!forced_temporaries.count(composite))
+ force_temporary_and_recompile(composite);
+
+ auto chain = access_chain_internal(composite, elems, length, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr);
+ statement(chain, " = ", to_unpacked_expression(obj), ";");
+ set<SPIRExpression>(id, to_expression(composite), result_type, true);
+ invalid_expressions.insert(composite);
+ composite_insert_overwritten.insert(composite);
+ }
+ else
+ {
+ if (maybe_get<SPIRUndef>(composite) != nullptr)
+ {
+ emit_uninitialized_temporary_expression(result_type, id);
+ }
+ else
+ {
+ // Make a copy, then use access chain to store the variable.
+ statement(declare_temporary(result_type, id), to_expression(composite), ";");
+ set<SPIRExpression>(id, to_name(id), result_type, true);
+ }
+
+ auto chain = access_chain_internal(id, elems, length, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr);
+ statement(chain, " = ", to_unpacked_expression(obj), ";");
+ }
break;
}
diff --git a/spirv_glsl.hpp b/spirv_glsl.hpp
index 8d1c7131..c4396991 100644
--- a/spirv_glsl.hpp
+++ b/spirv_glsl.hpp
@@ -915,6 +915,8 @@ protected:
uint32_t consume_temporary_in_precision_context(uint32_t type_id, uint32_t id, Options::Precision precision);
std::unordered_map<uint32_t, uint32_t> temporary_to_mirror_precision_alias;
+ std::unordered_set<uint32_t> composite_insert_overwritten;
+ std::unordered_set<uint32_t> block_composite_insert_overwrite;
std::string emit_for_loop_initializers(const SPIRBlock &block);
void emit_while_loop_initializers(const SPIRBlock &block);