diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-05-18 13:26:20 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-05-18 17:37:33 +0300 |
commit | 23662668ddc143da50ee0ccef9a020d81800c9b5 (patch) | |
tree | 704638beccb72b67d8033dfe068a729b0c3a1e87 /reference/shaders-ue4/asm/frag/depth-compare.asm.frag | |
parent | d0c8dc30450351321e611b2888a48f8410226a4c (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.
Diffstat (limited to 'reference/shaders-ue4/asm/frag/depth-compare.asm.frag')
-rw-r--r-- | reference/shaders-ue4/asm/frag/depth-compare.asm.frag | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |