diff --git a/src/games/unrealengine/addon.cpp b/src/games/unrealengine/addon.cpp index a7a631e7..c8fa9565 100644 --- a/src/games/unrealengine/addon.cpp +++ b/src/games/unrealengine/addon.cpp @@ -50,6 +50,10 @@ renodx::mods::shader::CustomShaders custom_shaders = { TracedShaderEntry(0x00E9C5FE), TracedShaderEntry(0xE9343033), + // Persona 3 Reload + TracedShaderEntry(0xCB9976C8), + TracedShaderEntry(0xBFE48347), + // SM5 LUT Builder TracedShaderEntry(0x1DF6036B), TracedShaderEntry(0x20EAC9B6), @@ -81,6 +85,9 @@ renodx::mods::shader::CustomShaders custom_shaders = { TracedShaderEntry(0xE6EB2840), TracedShaderEntry(0xF6AA7756), TracedShaderEntry(0xFBB78F9F), + TracedShaderEntry(0x6E6FC244), + TracedShaderEntry(0x8D3D2FA0), + TracedShaderEntry(0x97BAC8AF), // SM6 LUT Builder @@ -96,6 +103,7 @@ renodx::mods::shader::CustomShaders custom_shaders = { TracedShaderEntry(0xB530B36A), TracedShaderEntry(0xB6CA5FD9), TracedShaderEntry(0xBAA27141), + TracedShaderEntry(0xEBB3E98C), }; ShaderInjectData shader_injection; @@ -727,6 +735,9 @@ void AddShaders() { {0xE6EB2840, __0xE6EB2840}, {0xF6AA7756, __0xF6AA7756}, {0xFBB78F9F, __0xFBB78F9F}, + {0x6E6FC244, __0x6E6FC244}, + {0x8D3D2FA0, __0x8D3D2FA0}, + {0x97BAC8AF, __0x97BAC8AF}, }, true, true, {reshade::api::device_api::d3d11}); @@ -766,6 +777,9 @@ void AddShaders() { {0xE6EB2840, __lutbuilder_0xE6EB2840_dx12}, {0xF6AA7756, __lutbuilder_0xF6AA7756_dx12}, {0xFBB78F9F, __lutbuilder_0xFBB78F9F_dx12}, + {0x6E6FC244, __lutbuilder_0x6E6FC244_dx12}, + {0x8D3D2FA0, __lutbuilder_0x8D3D2FA0_dx12}, + {0x97BAC8AF, __lutbuilder_0x97BAC8AF_dx12}, {0x269E94C1, __0x269E94C1}, {0x3028EBE7, __0x3028EBE7}, @@ -779,6 +793,11 @@ void AddShaders() { {0xB530B36A, __0xB530B36A}, {0xB6CA5FD9, __0xB6CA5FD9}, {0xBAA27141, __0xBAA27141}, + {0xEBB3E98C, __0xEBB3E98C}, + + // P3 Reload + {0xCB9976C8, __0xCB9976C8}, + {0xBFE48347, __0xBFE48347}, }, true, true, {reshade::api::device_api::d3d12}); } diff --git a/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x6E6FC244.ps_5_0.hlsl b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x6E6FC244.ps_5_0.hlsl new file mode 100644 index 00000000..0c56bb12 --- /dev/null +++ b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x6E6FC244.ps_5_0.hlsl @@ -0,0 +1,1543 @@ +#include "../../common.hlsl" + +// ---- Created with 3Dmigoto v1.3.16 on Wed Jan 1 15:35:38 2025 +Texture2D t3 : register(t3); + +Texture2D t2 : register(t2); + +Texture2D t1 : register(t1); + +Texture2D t0 : register(t0); + +SamplerState s3_s : register(s3); + +SamplerState s2_s : register(s2); + +SamplerState s1_s : register(s1); + +SamplerState s0_s : register(s0); + +cbuffer cb0 : register(b0) { + float4 cb0[67]; +} + +// 3Dmigoto declarations +#define cmp - + +void main( + linear noperspective float2 v0: TEXCOORD0, + float4 v1: SV_POSITION0, + uint v2: SV_RenderTargetArrayIndex0, + out float4 o0: SV_Target0) { + const float4 icb[] = { { -4.000000, -0.718548, -4.970622, 0.808913 }, + { -4.000000, 2.081031, -3.029378, 1.191087 }, + { -3.157377, 3.668124, -2.126200, 1.568300 }, + { -0.485250, 4.000000, -1.510500, 1.948300 }, + { 1.847732, 4.000000, -1.057800, 2.308300 }, + { 1.847732, 4.000000, -0.466800, 2.638400 }, + { -2.301030, 0.801995, 0.119380, 2.859500 }, + { -2.301030, 1.198005, 0.708813, 2.987261 }, + { -1.931200, 1.594300, 1.291187, 3.012739 }, + { -1.520500, 1.997300, 1.291187, 3.012739 }, + { -1.057800, 2.378300, 0, 0 }, + { -0.466800, 2.768400, 0, 0 }, + { 0.119380, 3.051500, 0, 0 }, + { 0.708813, 3.274629, 0, 0 }, + { 1.291187, 3.327431, 0, 0 }, + { 1.291187, 3.327431, 0, 0 } }; + float4 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12; + uint4 bitmask, uiDest; + float4 fDest; + + r0.xy = float2(-0.015625, -0.015625) + v0.xy; + r0.xy = float2(1.03225803, 1.03225803) * r0.xy; + r0.z = (uint)v2.x; + r1.z = 0.0322580636 * r0.z; + r0.z = cmp(asuint(cb0[65].z) >= 3); + r2.xy = log2(r0.xy); + r2.z = log2(r1.z); + r0.xyw = float3(0.0126833133, 0.0126833133, 0.0126833133) * r2.xyz; + r0.xyw = exp2(r0.xyw); + r2.xyz = float3(-0.8359375, -0.8359375, -0.8359375) + r0.xyw; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r0.xyw = -r0.xyw * float3(18.6875, 18.6875, 18.6875) + float3(18.8515625, 18.8515625, 18.8515625); + r0.xyw = r2.xyz / r0.xyw; + r0.xyw = log2(r0.xyw); + r0.xyw = float3(6.27739477, 6.27739477, 6.27739477) * r0.xyw; + r0.xyw = exp2(r0.xyw); + r0.xyw = float3(100, 100, 100) * r0.xyw; + r1.xy = v0.xy * float2(1.03225803, 1.03225803) + float2(-0.0161290318, -0.0161290318); + r1.xyz = float3(-0.434017599, -0.434017599, -0.434017599) + r1.xyz; + r1.xyz = float3(14, 14, 14) * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = r1.xyz * float3(0.180000007, 0.180000007, 0.180000007) + float3(-0.00266771927, -0.00266771927, -0.00266771927); + r0.xyz = r0.zzz ? r0.xyw : r1.xyz; + r0.w = 1.00055635 * cb0[44].y; + r1.x = cmp(6996.10791 >= cb0[44].y); + r1.yz = float2(4.60700006e+09, 2.0064e+09) / r0.ww; + r1.yz = float2(2967800, 1901800) + -r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(99.1100006, 247.479996) + r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(0.244063005, 0.237039998) + r1.yz; + r1.x = r1.x ? r1.y : r1.z; + r0.w = r1.x * r1.x; + r1.z = 2.86999989 * r1.x; + r0.w = r0.w * -3 + r1.z; + r1.y = -0.275000006 + r0.w; + r2.xyz = cb0[44].yyy * float3(0.000154118257, 0.00084242021, 4.22806261e-05) + float3(0.860117733, 1, 0.317398727); + r0.w = cb0[44].y * cb0[44].y; + r2.xyz = r0.www * float3(1.28641219e-07, 7.08145137e-07, 4.20481676e-08) + r2.xyz; + r2.x = r2.x / r2.y; + r1.z = -cb0[44].y * 2.8974182e-05 + 1; + r0.w = r0.w * 1.61456057e-07 + r1.z; + r2.y = r2.z / r0.w; + r1.zw = r2.xy + r2.xy; + r0.w = 3 * r2.x; + r1.z = -r2.y * 8 + r1.z; + r1.z = 4 + r1.z; + r3.x = r0.w / r1.z; + r3.y = r1.w / r1.z; + r0.w = cmp(cb0[44].y < 4000); + r1.xy = r0.ww ? r3.xy : r1.xy; + r0.w = dot(r2.xy, r2.xy); + r0.w = rsqrt(r0.w); + r1.zw = r2.xy * r0.ww; + r0.w = cb0[44].z * -r1.w; + r0.w = r0.w * 0.0500000007 + r2.x; + r1.z = cb0[44].z * r1.z; + r1.z = r1.z * 0.0500000007 + r2.y; + r1.w = 3 * r0.w; + r0.w = r0.w + r0.w; + r0.w = -r1.z * 8 + r0.w; + r0.w = 4 + r0.w; + r1.z = r1.z + r1.z; + r2.xy = r1.wz / r0.ww; + r1.zw = r2.xy + -r3.xy; + r1.xy = r1.xy + r1.zw; + r0.w = max(1.00000001e-10, r1.y); + r2.x = r1.x / r0.w; + r1.x = 1 + -r1.x; + r1.x = r1.x + -r1.y; + r2.z = r1.x / r0.w; + r2.y = 1; + r0.w = dot(float3(0.895099998, 0.266400009, -0.161400005), r2.xyz); + r1.x = dot(float3(-0.750199974, 1.71350002, 0.0366999991), r2.xyz); + r1.y = dot(float3(0.0388999991, -0.0684999973, 1.02960002), r2.xyz); + r0.w = 0.941379249 / r0.w; + r1.xy = float2(1.04043639, 1.0897665) / r1.xy; + r2.xyz = float3(0.895099998, 0.266400009, -0.161400005) * r0.www; + r1.xzw = float3(-0.750199974, 1.71350002, 0.0366999991) * r1.xxx; + r3.xyz = float3(0.0388999991, -0.0684999973, 1.02960002) * r1.yyy; + r4.x = r2.x; + r4.y = r1.x; + r4.z = r3.x; + r5.x = dot(float3(0.986992896, -0.1470543, 0.159962699), r4.xyz); + r6.x = r2.y; + r6.y = r1.z; + r6.z = r3.y; + r5.y = dot(float3(0.986992896, -0.1470543, 0.159962699), r6.xyz); + r3.x = r2.z; + r3.y = r1.w; + r5.z = dot(float3(0.986992896, -0.1470543, 0.159962699), r3.xyz); + r1.x = dot(float3(0.432305306, 0.518360317, 0.0492912009), r4.xyz); + r1.y = dot(float3(0.432305306, 0.518360317, 0.0492912009), r6.xyz); + r1.z = dot(float3(0.432305306, 0.518360317, 0.0492912009), r3.xyz); + r2.x = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r4.xyz); + r2.y = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r6.xyz); + r2.z = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r3.xyz); + r3.x = dot(r5.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.x = dot(r5.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.x = dot(r5.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r3.y = dot(r1.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.y = dot(r1.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.y = dot(r1.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r3.z = dot(r2.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.z = dot(r2.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.z = dot(r2.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r1.x = dot(float3(3.2409699, -1.5373832, -0.498610765), r3.xyz); + r1.y = dot(float3(3.2409699, -1.5373832, -0.498610765), r4.xyz); + r1.z = dot(float3(3.2409699, -1.5373832, -0.498610765), r5.xyz); + r2.x = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r3.xyz); + r2.y = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r4.xyz); + r2.z = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r5.xyz); + r3.x = dot(float3(0.0556300804, -0.203976959, 1.05697155), r3.xyz); + r3.y = dot(float3(0.0556300804, -0.203976959, 1.05697155), r4.xyz); + r3.z = dot(float3(0.0556300804, -0.203976959, 1.05697155), r5.xyz); + r1.x = dot(r1.xyz, r0.xyz); + r1.y = dot(r2.xyz, r0.xyz); + r1.z = dot(r3.xyz, r0.xyz); + r0.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r1.xyz); + r0.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r1.xyz); + r0.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r1.xyz); + r0.w = dot(r0.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r1.xyz = r0.xyz / r0.www; + r1.xyz = float3(-1, -1, -1) + r1.xyz; + r1.x = dot(r1.xyz, r1.xyz); + r1.x = -4 * r1.x; + r1.x = exp2(r1.x); + r1.x = 1 + -r1.x; + r0.w = r0.w * r0.w; + r0.w = cb0[66].y * r0.w; + r0.w = -4 * r0.w; + r0.w = exp2(r0.w); + r0.w = 1 + -r0.w; + r0.w = r1.x * r0.w; + r1.x = dot(float3(1.37041271, -0.329291314, -0.0636827648), r0.xyz); + r1.y = dot(float3(-0.0834341869, 1.09709096, -0.0108615728), r0.xyz); + r1.z = dot(float3(-0.0257932581, -0.0986256376, 1.20369434), r0.xyz); + r1.xyz = r1.xyz + -r0.xyz; + r1.xyz = r0.www * r1.xyz + r0.xyz; + r0.xyz = cb0[44].xxx ? r0.xyz : r1.xyz; + r0.w = dot(r0.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r1.xyzw = cb0[50].xyzw * cb0[45].xyzw; + r2.xyzw = cb0[51].xyzw * cb0[46].xyzw; + r3.xyzw = cb0[52].xyzw * cb0[47].xyzw; + r4.xyzw = cb0[53].xyzw * cb0[48].xyzw; + r5.xyzw = cb0[54].xyzw + cb0[49].xyzw; + r1.xyz = r1.xyz * r1.www; + r0.xyz = r0.xyz + -r0.www; + r1.xyz = r1.xyz * r0.xyz + r0.www; + r1.xyz = max(float3(0, 0, 0), r1.xyz); + r1.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r1.xyz; + r2.xyz = r2.xyz * r2.www; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r1.xyz; + r2.xyz = r3.xyz * r3.www; + r2.xyz = float3(1, 1, 1) / r2.xyz; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r2.xyz = r4.xyz * r4.www; + r3.xyz = r5.xyz + r5.www; + r1.xyz = r1.xyz * r2.xyz + r3.xyz; + r1.w = 1 / cb0[65].x; + r1.w = saturate(r1.w * r0.w); + r2.x = r1.w * -2 + 3; + r1.w = r1.w * r1.w; + r1.w = -r2.x * r1.w + 1; + r2.xyzw = cb0[60].xyzw * cb0[45].xyzw; + r3.xyzw = cb0[61].xyzw * cb0[46].xyzw; + r4.xyzw = cb0[62].xyzw * cb0[47].xyzw; + r5.xyzw = cb0[63].xyzw * cb0[48].xyzw; + r6.xyzw = cb0[64].xyzw + cb0[49].xyzw; + r2.xyz = r2.xyz * r2.www; + r2.xyz = r2.xyz * r0.xyz + r0.www; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r2.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r2.xyz; + r3.xyz = r3.xyz * r3.www; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r2.xyz; + r3.xyz = r4.xyz * r4.www; + r3.xyz = float3(1, 1, 1) / r3.xyz; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r3.xyz = r5.xyz * r5.www; + r4.xyz = r6.xyz + r6.www; + r2.xyz = r2.xyz * r3.xyz + r4.xyz; + r2.w = 1 + -cb0[65].y; + r3.x = -cb0[65].y + r0.w; + r2.w = 1 / r2.w; + r2.w = saturate(r3.x * r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r3.y = r3.x * r2.w; + r4.xyzw = cb0[55].xyzw * cb0[45].xyzw; + r5.xyzw = cb0[56].xyzw * cb0[46].xyzw; + r6.xyzw = cb0[57].xyzw * cb0[47].xyzw; + r7.xyzw = cb0[58].xyzw * cb0[48].xyzw; + r8.xyzw = cb0[59].xyzw + cb0[49].xyzw; + r4.xyz = r4.xyz * r4.www; + r0.xyz = r4.xyz * r0.xyz + r0.www; + r0.xyz = max(float3(0, 0, 0), r0.xyz); + r0.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r0.xyz; + r4.xyz = r5.xyz * r5.www; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r0.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r0.xyz; + r4.xyz = r6.xyz * r6.www; + r4.xyz = float3(1, 1, 1) / r4.xyz; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r4.xyz = r7.xyz * r7.www; + r5.xyz = r8.xyz + r8.www; + r0.xyz = r0.xyz * r4.xyz + r5.xyz; + r0.w = 1 + -r1.w; + r0.w = -r3.x * r2.w + r0.w; + r0.xyz = r0.xyz * r0.www; + r0.xyz = r1.xyz * r1.www + r0.xyz; + r0.xyz = r2.xyz * r3.yyy + r0.xyz; + + float3 untonemapped_ap1 = r0.xyz; + + r1.x = dot(float3(1.70505154, -0.621790707, -0.0832583979), r0.xyz); + r1.y = dot(float3(-0.130257145, 1.14080286, -0.0105485283), r0.xyz); + r1.z = dot(float3(-0.0240032747, -0.128968775, 1.15297174), r0.xyz); + if (cb0[44].x != 0) { + r2.x = dot(r1.xyz, cb0[28].xyz); + r2.y = dot(r1.xyz, cb0[29].xyz); + r2.z = dot(r1.xyz, cb0[30].xyz); + r0.w = dot(r1.xyz, cb0[33].xyz); + r0.w = 1 + r0.w; + r0.w = rcp(r0.w); + r3.xyz = cb0[35].xyz * r0.www + cb0[34].xyz; + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r3.xyz = cb0[31].xxx + -r2.xyz; + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r4.xyz = max(cb0[31].zzz, r2.xyz); + r2.xyz = max(cb0[31].xxx, r2.xyz); + r2.xyz = min(cb0[31].zzz, r2.xyz); + r5.xyz = r4.xyz * cb0[32].xxx + cb0[32].yyy; + r4.xyz = cb0[31].www + r4.xyz; + r4.xyz = rcp(r4.xyz); + r6.xyz = cb0[28].www * r3.xyz; + r3.xyz = cb0[31].yyy + r3.xyz; + r3.xyz = rcp(r3.xyz); + r3.xyz = r6.xyz * r3.xyz + cb0[29].www; + r2.xyz = r2.xyz * cb0[30].www + r3.xyz; + r2.xyz = r5.xyz * r4.xyz + r2.xyz; + r2.xyz = float3(-0.00200000009, -0.00200000009, -0.00200000009) + r2.xyz; + } else { + r3.x = dot(float3(0.938639402, 1.02359565e-10, 0.0613606237), r0.xyz); + r3.y = dot(float3(8.36008554e-11, 0.830794156, 0.169205874), r0.xyz); + r3.z = dot(float3(2.13187367e-12, -5.63307213e-12, 1), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.y = dot(float3(0.695452213, 0.140678704, 0.163869068), r0.xyz); + r3.z = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r0.xyz); + r3.w = dot(float3(-0.00552588236, 0.00402521016, 1.00150073), r0.xyz); + r0.w = min(r3.y, r3.z); + r0.w = min(r0.w, r3.w); + r1.w = max(r3.y, r3.z); + r1.w = max(r1.w, r3.w); + r4.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r4.x + -r0.w; + r0.w = r0.w / r4.y; + r4.xyz = r3.wzy + -r3.zyw; + r4.xy = r4.xy * r3.wz; + r1.w = r4.x + r4.y; + r1.w = r3.y * r4.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r3.w + r3.z; + r2.w = r2.w + r3.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.x = -0.400000006 + r0.w; + r4.x = 2.5 * r3.x; + r4.x = 1 + -abs(r4.x); + r4.x = max(0, r4.x); + r4.y = cmp(0 < r3.x); + r3.x = cmp(r3.x < 0); + r3.x = (int)-r4.y + (int)r3.x; + r3.x = (int)r3.x; + r4.x = -r4.x * r4.x + 1; + r3.x = r3.x * r4.x + 1; + r3.x = 0.0250000004 * r3.x; + r4.x = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.x * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.x ? r3.x : r1.w; + r1.w = 1 + r1.w; + r4.yzw = r3.yzw * r1.www; + r5.xy = cmp(r4.zw == r4.yz); + r2.w = r5.y ? r5.x : 0; + r3.x = r3.z * r1.w + -r4.w; + r3.x = 1.73205078 * r3.x; + r3.z = r4.y * 2 + -r4.z; + r3.z = -r3.w * r1.w + r3.z; + r3.w = min(abs(r3.x), abs(r3.z)); + r5.x = max(abs(r3.x), abs(r3.z)); + r5.x = 1 / r5.x; + r3.w = r5.x * r3.w; + r5.x = r3.w * r3.w; + r5.y = r5.x * 0.0208350997 + -0.0851330012; + r5.y = r5.x * r5.y + 0.180141002; + r5.y = r5.x * r5.y + -0.330299497; + r5.x = r5.x * r5.y + 0.999866009; + r5.y = r5.x * r3.w; + r5.z = cmp(abs(r3.z) < abs(r3.x)); + r5.y = r5.y * -2 + 1.57079637; + r5.y = r5.z ? r5.y : 0; + r3.w = r3.w * r5.x + r5.y; + r5.x = cmp(r3.z < -r3.z); + r5.x = r5.x ? -3.141593 : 0; + r3.w = r5.x + r3.w; + r5.x = min(r3.x, r3.z); + r3.x = max(r3.x, r3.z); + r3.z = cmp(r5.x < -r5.x); + r3.x = cmp(r3.x >= -r3.x); + r3.x = r3.x ? r3.z : 0; + r3.x = r3.x ? -r3.w : r3.w; + r3.x = 57.2957802 * r3.x; + r2.w = r2.w ? 0 : r3.x; + r3.x = cmp(r2.w < 0); + r3.z = 360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.x = cmp(180 < r2.w); + r3.z = -360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = 0.0148148146 * r2.w; + r2.w = 1 + -abs(r2.w); + r2.w = max(0, r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r2.w = r3.x * r2.w; + r2.w = r2.w * r2.w; + r0.w = r2.w * r0.w; + r1.w = -r3.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r4.x = r0.w * 0.180000007 + r4.y; + r3.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r4.xzw); + r3.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r4.xzw); + r3.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r4.xzw); + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r0.w = dot(r3.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r4.xy = float2(1, 0.180000007) + cb0[36].ww; + r0.w = -cb0[36].y + r4.x; + r1.w = 1 + cb0[37].x; + r2.w = -cb0[36].z + r1.w; + r3.w = cmp(0.800000012 < cb0[36].y); + r4.xz = float2(0.819999993, 1) + -cb0[36].yy; + r4.xz = r4.xz / cb0[36].xx; + r4.y = r4.y / r0.w; + r4.xw = float2(-0.744727492, -1) + r4.xy; + r4.w = 1 + -r4.w; + r4.y = r4.y / r4.w; + r4.y = log2(r4.y); + r4.y = 0.346573591 * r4.y; + r4.w = r0.w / cb0[36].x; + r4.y = -r4.y * r4.w + -0.744727492; + r3.w = r3.w ? r4.x : r4.y; + r4.x = r4.z + -r3.w; + r4.y = cb0[36].z / cb0[36].x; + r4.y = r4.y + -r4.x; + r3.xyz = log2(r3.xyz); + r5.xyz = float3(0.30103001, 0.30103001, 0.30103001) * r3.xyz; + r4.xzw = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + r4.xxx; + r4.xzw = cb0[36].xxx * r4.xzw; + r5.w = r0.w + r0.w; + r6.x = -2 * cb0[36].x; + r0.w = r6.x / r0.w; + r6.xyz = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + -r3.www; + r7.xyz = r6.xyz * r0.www; + r7.xyz = float3(1.44269502, 1.44269502, 1.44269502) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = float3(1, 1, 1) + r7.xyz; + r7.xyz = r5.www / r7.xyz; + r7.xyz = -cb0[36].www + r7.xyz; + r0.w = r2.w + r2.w; + r5.w = cb0[36].x + cb0[36].x; + r2.w = r5.w / r2.w; + r3.xyz = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + -r4.yyy; + r3.xyz = r3.xyz * r2.www; + r3.xyz = float3(1.44269502, 1.44269502, 1.44269502) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r3.xyz = float3(1, 1, 1) + r3.xyz; + r3.xyz = r0.www / r3.xyz; + r3.xyz = -r3.xyz + r1.www; + r8.xyz = cmp(r5.xyz < r3.www); + r7.xyz = r8.xyz ? r7.xyz : r4.xzw; + r5.xyz = cmp(r4.yyy < r5.xyz); + r3.xyz = r5.xyz ? r3.xyz : r4.xzw; + r0.w = r4.y + -r3.w; + r4.xzw = saturate(r6.xyz / r0.www); + r0.w = cmp(r4.y < r3.w); + r5.xyz = float3(1, 1, 1) + -r4.xzw; + r4.xyz = r0.www ? r5.xyz : r4.xzw; + r5.xyz = -r4.xyz * float3(2, 2, 2) + float3(3, 3, 3); + r4.xyz = r4.xyz * r4.xyz; + r4.xyz = r4.xyz * r5.xyz; + r3.xyz = r3.xyz + -r7.xyz; + r3.xyz = r4.xyz * r3.xyz + r7.xyz; + r0.w = dot(r3.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.930000007, 0.930000007, 0.930000007) + r0.www; + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].zzz * r3.xyz + r0.xyz; + r3.x = dot(float3(1.06537485, 1.44678506e-06, -0.0653710067), r0.xyz); + r3.y = dot(float3(-3.45525592e-07, 1.20366347, -0.203667715), r0.xyz); + r3.z = dot(float3(1.9865448e-08, 2.12079581e-08, 0.999999583), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.x = dot(float3(1.70505154, -0.621790707, -0.0832583979), r0.xyz); + r3.y = dot(float3(-0.130257145, 1.14080286, -0.0105485283), r0.xyz); + r3.z = dot(float3(-0.0240032747, -0.128968775, 1.15297174), r0.xyz); + r2.xyz = max(float3(0, 0, 0), r3.xyz); + } + r2.xyz = saturate(r2.xyz); + r0.xyz = float3(12.9200001, 12.9200001, 12.9200001) * r2.xyz; + r3.xyz = cmp(r2.xyz >= float3(0.00313066994, 0.00313066994, 0.00313066994)); + r2.xyz = log2(r2.xyz); + r2.xyz = float3(0.416666657, 0.416666657, 0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995, 1.05499995, 1.05499995) + float3(-0.0549999997, -0.0549999997, -0.0549999997); + r0.xyz = r3.xyz ? r2.xyz : r0.xyz; + r2.yzw = r0.xyz * float3(0.9375, 0.9375, 0.9375) + float3(0.03125, 0.03125, 0.03125); + r0.w = r2.w * 16 + -0.5; + r1.w = floor(r0.w); + r0.w = -r1.w + r0.w; + r1.w = r2.y + r1.w; + r2.x = 0.0625 * r1.w; + r3.xyz = t0.Sample(s0_s, r2.xz).xyz; + r2.yw = float2(0.0625, 0) + r2.xz; + r4.xyz = t0.Sample(s0_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r3.xyz = cb0[39].xxx * r3.xyz; + r0.xyz = cb0[38].xxx * r0.xyz + r3.xyz; + r3.xyz = t1.Sample(s1_s, r2.xz).xyz; + r4.xyz = t1.Sample(s1_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r0.xyz = cb0[40].xxx * r3.xyz + r0.xyz; + r3.xyz = t2.Sample(s2_s, r2.xz).xyz; + r4.xyz = t2.Sample(s2_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r0.xyz = cb0[41].xxx * r3.xyz + r0.xyz; + r3.xyz = t3.Sample(s3_s, r2.xz).xyz; + r2.xyz = t3.Sample(s3_s, r2.yw).xyz; + r2.xyz = r2.xyz + -r3.xyz; + r2.xyz = r0.www * r2.xyz + r3.xyz; + r0.xyz = cb0[42].xxx * r2.xyz + r0.xyz; + r0.xyz = max(float3(6.10351999e-05, 6.10351999e-05, 6.10351999e-05), r0.xyz); + r2.xyz = cmp(float3(0.0404499993, 0.0404499993, 0.0404499993) < r0.xyz); + r3.xyz = r0.xyz * float3(0.947867274, 0.947867274, 0.947867274) + float3(0.0521326996, 0.0521326996, 0.0521326996); + r3.xyz = log2(r3.xyz); + r3.xyz = float3(2.4000001, 2.4000001, 2.4000001) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = float3(0.0773993805, 0.0773993805, 0.0773993805) * r0.xyz; + r0.xyz = r2.xyz ? r3.xyz : r0.xyz; + r2.xyz = r0.xyz * r0.xyz; + r0.xyz = cb0[26].yyy * r0.xyz; + r0.xyz = cb0[26].xxx * r2.xyz + r0.xyz; + r0.xyz = cb0[26].zzz + r0.xyz; + r2.xyz = cb0[42].yzw * r0.xyz; + r0.xyz = -r0.xyz * cb0[42].yzw + cb0[43].xyz; + r0.xyz = cb0[43].www * r0.xyz + r2.xyz; + r2.xyz = max(float3(0, 0, 0), r0.xyz); + r2.xyz = log2(r2.xyz); + r2.xyz = cb0[27].yyy * r2.xyz; + r3.xyz = exp2(r2.xyz); + + if (injectedData.toneMapType != 0) { + o0 = LutBuilderToneMap(untonemapped_ap1, r3.xyz); + return; + } + + if (cb0[65].z == 0) { + r4.xyz = float3(12.9200001, 12.9200001, 12.9200001) * r3.xyz; + r5.xyz = cmp(r3.xyz >= float3(0.00313066994, 0.00313066994, 0.00313066994)); + r2.xyz = float3(0.416666657, 0.416666657, 0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995, 1.05499995, 1.05499995) + float3(-0.0549999997, -0.0549999997, -0.0549999997); + r2.xyz = r5.xyz ? r2.xyz : r4.xyz; + } else { + r4.xyzw = cmp(asint(cb0[65].wwww) == int4(1, 2, 3, 4)); + r5.xyz = r4.www ? float3(1, 0, 0) : float3(1.70505154, -0.621790707, -0.0832583979); + r6.xyz = r4.www ? float3(0, 1, 0) : float3(-0.130257145, 1.14080286, -0.0105485283); + r7.xyz = r4.www ? float3(0, 0, 1) : float3(-0.0240032747, -0.128968775, 1.15297174); + r5.xyz = r4.zzz ? float3(0.695452213, 0.140678704, 0.163869068) : r5.xyz; + r6.xyz = r4.zzz ? float3(0.0447945632, 0.859671116, 0.0955343172) : r6.xyz; + r7.xyz = r4.zzz ? float3(-0.00552588282, 0.00402521016, 1.00150073) : r7.xyz; + r5.xyz = r4.yyy ? float3(1.02579927, -0.0200525094, -0.00577136781) : r5.xyz; + r6.xyz = r4.yyy ? float3(-0.00223502493, 1.00458264, -0.00235231337) : r6.xyz; + r4.yzw = r4.yyy ? float3(-0.00501400325, -0.0252933875, 1.03044021) : r7.xyz; + r5.xyz = r4.xxx ? float3(1.37915885, -0.308850735, -0.0703467429) : r5.xyz; + r6.xyz = r4.xxx ? float3(-0.0693352968, 1.08229232, -0.0129620517) : r6.xyz; + r4.xyz = r4.xxx ? float3(-0.00215925858, -0.0454653986, 1.04775953) : r4.yzw; + r0.w = cmp(asint(cb0[65].z) == 1); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r3.xyz); + r7.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r3.xyz); + r7.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r3.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = max(float3(6.10351999e-05, 6.10351999e-05, 6.10351999e-05), r8.xyz); + r8.xyz = float3(4.5, 4.5, 4.5) * r7.xyz; + r7.xyz = max(float3(0.0179999992, 0.0179999992, 0.0179999992), r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.449999988, 0.449999988, 0.449999988) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = r7.xyz * float3(1.09899998, 1.09899998, 1.09899998) + float3(-0.0989999995, -0.0989999995, -0.0989999995); + r2.xyz = min(r8.xyz, r7.xyz); + } else { + r7.xyz = cb0[42].yzw * r1.xyz; + r1.xyz = -r1.xyz * cb0[42].yzw + cb0[43].xyz; + r1.xyz = cb0[43].www * r1.xyz + r7.xyz; + r7.xy = cmp(asint(cb0[65].zz) == int2(3, 5)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5, 1.5, 1.5) * r1.xyz; + r8.y = dot(float3(0.439700812, 0.382978052, 0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037, 0.813423157, 0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864, 0.111544058, 0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672, -0.5, 0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5, 0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5, 0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3, 2, 1)); + r8.xz = float2(0.166666672, 0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0, 0, 0), r7.xzw); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r8.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r7.xyz = max(float3(0, 0, 0), r8.xyz); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r8.xyz = cmp(float3(0, 0, 0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14, -14, -14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323, -17.4739323, -17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r8.x + 0].x; + r10.z = icb[r8.w + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r7.x + 0].y; + r10.z = icb[r7.w + 0].y; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].x; + r11.y = icb[r7.x + 0].x; + r11.z = icb[r7.w + 0].x; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].y; + r11.y = icb[r7.x + 0].y; + r11.z = icb[r7.y + 0].y; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r7.x + 0].x; + r10.z = icb[r7.y + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r8.x + 0].y; + r10.z = icb[r8.y + 0].y; + r8.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r10.xy, float2(-1, 1)); + r8.z = dot(r10.xy, float2(0.5, 0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213, 0.140678704, 0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282, 0.00402521016, 1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = r0.w * 0.90309 + 7.54498291; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 0].z; + r9.y = icb[r8.x + 0].z; + r9.z = icb[r8.y + 0].z; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.1373367); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.3549509 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.3549509 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 0].w; + r9.y = icb[r8.x + 0].w; + r9.z = icb[r8.y + 0].w; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 0].z; + r10.y = icb[r9.x + 0].z; + r10.z = icb[r9.y + 0].z; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.1373367); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.3549509 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.3549509 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 0].w; + r10.y = icb[r9.x + 0].w; + r10.z = icb[r9.y + 0].w; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 0].z; + r10.y = icb[r9.x + 0].z; + r10.z = icb[r9.y + 0].z; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.1373367); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.3549509 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.3549509 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 0].w; + r10.y = icb[r9.x + 0].w; + r10.z = icb[r9.y + 0].w; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r7.xyz = float3(-3.50738446e-05, -3.50738446e-05, -3.50738446e-05) + r7.xyz; + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(4, 6)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5, 1.5, 1.5) * r1.xyz; + r8.y = dot(float3(0.439700812, 0.382978052, 0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037, 0.813423157, 0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864, 0.111544058, 0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672, -0.5, 0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5, 0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5, 0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3, 2, 1)); + r8.xz = float2(0.166666672, 0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0, 0, 0), r7.xzw); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r8.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r7.xyz = max(float3(0, 0, 0), r8.xyz); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r8.xyz = cmp(float3(0, 0, 0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14, -14, -14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323, -17.4739323, -17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r8.x + 0].x; + r10.z = icb[r8.w + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r7.x + 0].y; + r10.z = icb[r7.w + 0].y; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].x; + r11.y = icb[r7.x + 0].x; + r11.z = icb[r7.w + 0].x; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].y; + r11.y = icb[r7.x + 0].y; + r11.z = icb[r7.y + 0].y; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r7.x + 0].x; + r10.z = icb[r7.y + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r8.x + 0].y; + r10.z = icb[r8.y + 0].y; + r8.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r10.xy, float2(-1, 1)); + r8.z = dot(r10.xy, float2(0.5, 0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213, 0.140678704, 0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282, 0.00402521016, 1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = -2.30102992; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 6].x; + r9.y = icb[r8.x + 6].x; + r9.z = icb[r8.y + 6].x; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.4948215); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.27267218 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.27267218 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 6].y; + r9.y = icb[r8.x + 6].y; + r9.z = icb[r8.y + 6].y; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 6].x; + r10.y = icb[r9.x + 6].x; + r10.z = icb[r9.y + 6].x; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.4948215); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.27267218 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.27267218 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 6].y; + r10.y = icb[r9.x + 6].y; + r10.z = icb[r9.y + 6].y; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 6].x; + r10.y = icb[r9.x + 6].x; + r10.z = icb[r9.y + 6].x; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.4948215); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.27267218 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.27267218 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 6].y; + r10.y = icb[r9.x + 6].y; + r10.z = icb[r9.y + 6].y; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r0.w = cmp(asint(cb0[65].z) == 7); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r1.xyz); + r7.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r1.xyz); + r7.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r1.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(8, 9)); + r8.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r0.xyz); + r8.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r0.xyz); + r8.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r0.xyz); + r0.x = dot(r5.xyz, r8.xyz); + r0.y = dot(r6.xyz, r8.xyz); + r0.z = dot(r4.xyz, r8.xyz); + r8.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r3.xyz); + r8.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r3.xyz); + r8.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r3.xyz); + r0.w = dot(r5.xyz, r8.xyz); + r1.w = dot(r6.xyz, r8.xyz); + r2.w = dot(r4.xyz, r8.xyz); + r3.x = log2(r0.w); + r3.y = log2(r1.w); + r3.z = log2(r2.w); + r3.xyz = cb0[27].zzz * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = r7.yyy ? r0.xyz : r3.xyz; + r2.xyz = r7.xxx ? r1.xyz : r0.xyz; + } + } + } + } + } + o0.xyz = float3(0.952381015, 0.952381015, 0.952381015) * r2.xyz; + o0.w = 0; + return; +} diff --git a/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x6E6FC244_dx12.ps_5_1.hlsl b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x6E6FC244_dx12.ps_5_1.hlsl new file mode 100644 index 00000000..0c56bb12 --- /dev/null +++ b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x6E6FC244_dx12.ps_5_1.hlsl @@ -0,0 +1,1543 @@ +#include "../../common.hlsl" + +// ---- Created with 3Dmigoto v1.3.16 on Wed Jan 1 15:35:38 2025 +Texture2D t3 : register(t3); + +Texture2D t2 : register(t2); + +Texture2D t1 : register(t1); + +Texture2D t0 : register(t0); + +SamplerState s3_s : register(s3); + +SamplerState s2_s : register(s2); + +SamplerState s1_s : register(s1); + +SamplerState s0_s : register(s0); + +cbuffer cb0 : register(b0) { + float4 cb0[67]; +} + +// 3Dmigoto declarations +#define cmp - + +void main( + linear noperspective float2 v0: TEXCOORD0, + float4 v1: SV_POSITION0, + uint v2: SV_RenderTargetArrayIndex0, + out float4 o0: SV_Target0) { + const float4 icb[] = { { -4.000000, -0.718548, -4.970622, 0.808913 }, + { -4.000000, 2.081031, -3.029378, 1.191087 }, + { -3.157377, 3.668124, -2.126200, 1.568300 }, + { -0.485250, 4.000000, -1.510500, 1.948300 }, + { 1.847732, 4.000000, -1.057800, 2.308300 }, + { 1.847732, 4.000000, -0.466800, 2.638400 }, + { -2.301030, 0.801995, 0.119380, 2.859500 }, + { -2.301030, 1.198005, 0.708813, 2.987261 }, + { -1.931200, 1.594300, 1.291187, 3.012739 }, + { -1.520500, 1.997300, 1.291187, 3.012739 }, + { -1.057800, 2.378300, 0, 0 }, + { -0.466800, 2.768400, 0, 0 }, + { 0.119380, 3.051500, 0, 0 }, + { 0.708813, 3.274629, 0, 0 }, + { 1.291187, 3.327431, 0, 0 }, + { 1.291187, 3.327431, 0, 0 } }; + float4 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12; + uint4 bitmask, uiDest; + float4 fDest; + + r0.xy = float2(-0.015625, -0.015625) + v0.xy; + r0.xy = float2(1.03225803, 1.03225803) * r0.xy; + r0.z = (uint)v2.x; + r1.z = 0.0322580636 * r0.z; + r0.z = cmp(asuint(cb0[65].z) >= 3); + r2.xy = log2(r0.xy); + r2.z = log2(r1.z); + r0.xyw = float3(0.0126833133, 0.0126833133, 0.0126833133) * r2.xyz; + r0.xyw = exp2(r0.xyw); + r2.xyz = float3(-0.8359375, -0.8359375, -0.8359375) + r0.xyw; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r0.xyw = -r0.xyw * float3(18.6875, 18.6875, 18.6875) + float3(18.8515625, 18.8515625, 18.8515625); + r0.xyw = r2.xyz / r0.xyw; + r0.xyw = log2(r0.xyw); + r0.xyw = float3(6.27739477, 6.27739477, 6.27739477) * r0.xyw; + r0.xyw = exp2(r0.xyw); + r0.xyw = float3(100, 100, 100) * r0.xyw; + r1.xy = v0.xy * float2(1.03225803, 1.03225803) + float2(-0.0161290318, -0.0161290318); + r1.xyz = float3(-0.434017599, -0.434017599, -0.434017599) + r1.xyz; + r1.xyz = float3(14, 14, 14) * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = r1.xyz * float3(0.180000007, 0.180000007, 0.180000007) + float3(-0.00266771927, -0.00266771927, -0.00266771927); + r0.xyz = r0.zzz ? r0.xyw : r1.xyz; + r0.w = 1.00055635 * cb0[44].y; + r1.x = cmp(6996.10791 >= cb0[44].y); + r1.yz = float2(4.60700006e+09, 2.0064e+09) / r0.ww; + r1.yz = float2(2967800, 1901800) + -r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(99.1100006, 247.479996) + r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(0.244063005, 0.237039998) + r1.yz; + r1.x = r1.x ? r1.y : r1.z; + r0.w = r1.x * r1.x; + r1.z = 2.86999989 * r1.x; + r0.w = r0.w * -3 + r1.z; + r1.y = -0.275000006 + r0.w; + r2.xyz = cb0[44].yyy * float3(0.000154118257, 0.00084242021, 4.22806261e-05) + float3(0.860117733, 1, 0.317398727); + r0.w = cb0[44].y * cb0[44].y; + r2.xyz = r0.www * float3(1.28641219e-07, 7.08145137e-07, 4.20481676e-08) + r2.xyz; + r2.x = r2.x / r2.y; + r1.z = -cb0[44].y * 2.8974182e-05 + 1; + r0.w = r0.w * 1.61456057e-07 + r1.z; + r2.y = r2.z / r0.w; + r1.zw = r2.xy + r2.xy; + r0.w = 3 * r2.x; + r1.z = -r2.y * 8 + r1.z; + r1.z = 4 + r1.z; + r3.x = r0.w / r1.z; + r3.y = r1.w / r1.z; + r0.w = cmp(cb0[44].y < 4000); + r1.xy = r0.ww ? r3.xy : r1.xy; + r0.w = dot(r2.xy, r2.xy); + r0.w = rsqrt(r0.w); + r1.zw = r2.xy * r0.ww; + r0.w = cb0[44].z * -r1.w; + r0.w = r0.w * 0.0500000007 + r2.x; + r1.z = cb0[44].z * r1.z; + r1.z = r1.z * 0.0500000007 + r2.y; + r1.w = 3 * r0.w; + r0.w = r0.w + r0.w; + r0.w = -r1.z * 8 + r0.w; + r0.w = 4 + r0.w; + r1.z = r1.z + r1.z; + r2.xy = r1.wz / r0.ww; + r1.zw = r2.xy + -r3.xy; + r1.xy = r1.xy + r1.zw; + r0.w = max(1.00000001e-10, r1.y); + r2.x = r1.x / r0.w; + r1.x = 1 + -r1.x; + r1.x = r1.x + -r1.y; + r2.z = r1.x / r0.w; + r2.y = 1; + r0.w = dot(float3(0.895099998, 0.266400009, -0.161400005), r2.xyz); + r1.x = dot(float3(-0.750199974, 1.71350002, 0.0366999991), r2.xyz); + r1.y = dot(float3(0.0388999991, -0.0684999973, 1.02960002), r2.xyz); + r0.w = 0.941379249 / r0.w; + r1.xy = float2(1.04043639, 1.0897665) / r1.xy; + r2.xyz = float3(0.895099998, 0.266400009, -0.161400005) * r0.www; + r1.xzw = float3(-0.750199974, 1.71350002, 0.0366999991) * r1.xxx; + r3.xyz = float3(0.0388999991, -0.0684999973, 1.02960002) * r1.yyy; + r4.x = r2.x; + r4.y = r1.x; + r4.z = r3.x; + r5.x = dot(float3(0.986992896, -0.1470543, 0.159962699), r4.xyz); + r6.x = r2.y; + r6.y = r1.z; + r6.z = r3.y; + r5.y = dot(float3(0.986992896, -0.1470543, 0.159962699), r6.xyz); + r3.x = r2.z; + r3.y = r1.w; + r5.z = dot(float3(0.986992896, -0.1470543, 0.159962699), r3.xyz); + r1.x = dot(float3(0.432305306, 0.518360317, 0.0492912009), r4.xyz); + r1.y = dot(float3(0.432305306, 0.518360317, 0.0492912009), r6.xyz); + r1.z = dot(float3(0.432305306, 0.518360317, 0.0492912009), r3.xyz); + r2.x = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r4.xyz); + r2.y = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r6.xyz); + r2.z = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r3.xyz); + r3.x = dot(r5.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.x = dot(r5.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.x = dot(r5.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r3.y = dot(r1.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.y = dot(r1.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.y = dot(r1.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r3.z = dot(r2.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.z = dot(r2.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.z = dot(r2.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r1.x = dot(float3(3.2409699, -1.5373832, -0.498610765), r3.xyz); + r1.y = dot(float3(3.2409699, -1.5373832, -0.498610765), r4.xyz); + r1.z = dot(float3(3.2409699, -1.5373832, -0.498610765), r5.xyz); + r2.x = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r3.xyz); + r2.y = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r4.xyz); + r2.z = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r5.xyz); + r3.x = dot(float3(0.0556300804, -0.203976959, 1.05697155), r3.xyz); + r3.y = dot(float3(0.0556300804, -0.203976959, 1.05697155), r4.xyz); + r3.z = dot(float3(0.0556300804, -0.203976959, 1.05697155), r5.xyz); + r1.x = dot(r1.xyz, r0.xyz); + r1.y = dot(r2.xyz, r0.xyz); + r1.z = dot(r3.xyz, r0.xyz); + r0.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r1.xyz); + r0.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r1.xyz); + r0.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r1.xyz); + r0.w = dot(r0.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r1.xyz = r0.xyz / r0.www; + r1.xyz = float3(-1, -1, -1) + r1.xyz; + r1.x = dot(r1.xyz, r1.xyz); + r1.x = -4 * r1.x; + r1.x = exp2(r1.x); + r1.x = 1 + -r1.x; + r0.w = r0.w * r0.w; + r0.w = cb0[66].y * r0.w; + r0.w = -4 * r0.w; + r0.w = exp2(r0.w); + r0.w = 1 + -r0.w; + r0.w = r1.x * r0.w; + r1.x = dot(float3(1.37041271, -0.329291314, -0.0636827648), r0.xyz); + r1.y = dot(float3(-0.0834341869, 1.09709096, -0.0108615728), r0.xyz); + r1.z = dot(float3(-0.0257932581, -0.0986256376, 1.20369434), r0.xyz); + r1.xyz = r1.xyz + -r0.xyz; + r1.xyz = r0.www * r1.xyz + r0.xyz; + r0.xyz = cb0[44].xxx ? r0.xyz : r1.xyz; + r0.w = dot(r0.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r1.xyzw = cb0[50].xyzw * cb0[45].xyzw; + r2.xyzw = cb0[51].xyzw * cb0[46].xyzw; + r3.xyzw = cb0[52].xyzw * cb0[47].xyzw; + r4.xyzw = cb0[53].xyzw * cb0[48].xyzw; + r5.xyzw = cb0[54].xyzw + cb0[49].xyzw; + r1.xyz = r1.xyz * r1.www; + r0.xyz = r0.xyz + -r0.www; + r1.xyz = r1.xyz * r0.xyz + r0.www; + r1.xyz = max(float3(0, 0, 0), r1.xyz); + r1.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r1.xyz; + r2.xyz = r2.xyz * r2.www; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r1.xyz; + r2.xyz = r3.xyz * r3.www; + r2.xyz = float3(1, 1, 1) / r2.xyz; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r2.xyz = r4.xyz * r4.www; + r3.xyz = r5.xyz + r5.www; + r1.xyz = r1.xyz * r2.xyz + r3.xyz; + r1.w = 1 / cb0[65].x; + r1.w = saturate(r1.w * r0.w); + r2.x = r1.w * -2 + 3; + r1.w = r1.w * r1.w; + r1.w = -r2.x * r1.w + 1; + r2.xyzw = cb0[60].xyzw * cb0[45].xyzw; + r3.xyzw = cb0[61].xyzw * cb0[46].xyzw; + r4.xyzw = cb0[62].xyzw * cb0[47].xyzw; + r5.xyzw = cb0[63].xyzw * cb0[48].xyzw; + r6.xyzw = cb0[64].xyzw + cb0[49].xyzw; + r2.xyz = r2.xyz * r2.www; + r2.xyz = r2.xyz * r0.xyz + r0.www; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r2.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r2.xyz; + r3.xyz = r3.xyz * r3.www; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r2.xyz; + r3.xyz = r4.xyz * r4.www; + r3.xyz = float3(1, 1, 1) / r3.xyz; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r3.xyz = r5.xyz * r5.www; + r4.xyz = r6.xyz + r6.www; + r2.xyz = r2.xyz * r3.xyz + r4.xyz; + r2.w = 1 + -cb0[65].y; + r3.x = -cb0[65].y + r0.w; + r2.w = 1 / r2.w; + r2.w = saturate(r3.x * r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r3.y = r3.x * r2.w; + r4.xyzw = cb0[55].xyzw * cb0[45].xyzw; + r5.xyzw = cb0[56].xyzw * cb0[46].xyzw; + r6.xyzw = cb0[57].xyzw * cb0[47].xyzw; + r7.xyzw = cb0[58].xyzw * cb0[48].xyzw; + r8.xyzw = cb0[59].xyzw + cb0[49].xyzw; + r4.xyz = r4.xyz * r4.www; + r0.xyz = r4.xyz * r0.xyz + r0.www; + r0.xyz = max(float3(0, 0, 0), r0.xyz); + r0.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r0.xyz; + r4.xyz = r5.xyz * r5.www; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r0.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r0.xyz; + r4.xyz = r6.xyz * r6.www; + r4.xyz = float3(1, 1, 1) / r4.xyz; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r4.xyz = r7.xyz * r7.www; + r5.xyz = r8.xyz + r8.www; + r0.xyz = r0.xyz * r4.xyz + r5.xyz; + r0.w = 1 + -r1.w; + r0.w = -r3.x * r2.w + r0.w; + r0.xyz = r0.xyz * r0.www; + r0.xyz = r1.xyz * r1.www + r0.xyz; + r0.xyz = r2.xyz * r3.yyy + r0.xyz; + + float3 untonemapped_ap1 = r0.xyz; + + r1.x = dot(float3(1.70505154, -0.621790707, -0.0832583979), r0.xyz); + r1.y = dot(float3(-0.130257145, 1.14080286, -0.0105485283), r0.xyz); + r1.z = dot(float3(-0.0240032747, -0.128968775, 1.15297174), r0.xyz); + if (cb0[44].x != 0) { + r2.x = dot(r1.xyz, cb0[28].xyz); + r2.y = dot(r1.xyz, cb0[29].xyz); + r2.z = dot(r1.xyz, cb0[30].xyz); + r0.w = dot(r1.xyz, cb0[33].xyz); + r0.w = 1 + r0.w; + r0.w = rcp(r0.w); + r3.xyz = cb0[35].xyz * r0.www + cb0[34].xyz; + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r3.xyz = cb0[31].xxx + -r2.xyz; + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r4.xyz = max(cb0[31].zzz, r2.xyz); + r2.xyz = max(cb0[31].xxx, r2.xyz); + r2.xyz = min(cb0[31].zzz, r2.xyz); + r5.xyz = r4.xyz * cb0[32].xxx + cb0[32].yyy; + r4.xyz = cb0[31].www + r4.xyz; + r4.xyz = rcp(r4.xyz); + r6.xyz = cb0[28].www * r3.xyz; + r3.xyz = cb0[31].yyy + r3.xyz; + r3.xyz = rcp(r3.xyz); + r3.xyz = r6.xyz * r3.xyz + cb0[29].www; + r2.xyz = r2.xyz * cb0[30].www + r3.xyz; + r2.xyz = r5.xyz * r4.xyz + r2.xyz; + r2.xyz = float3(-0.00200000009, -0.00200000009, -0.00200000009) + r2.xyz; + } else { + r3.x = dot(float3(0.938639402, 1.02359565e-10, 0.0613606237), r0.xyz); + r3.y = dot(float3(8.36008554e-11, 0.830794156, 0.169205874), r0.xyz); + r3.z = dot(float3(2.13187367e-12, -5.63307213e-12, 1), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.y = dot(float3(0.695452213, 0.140678704, 0.163869068), r0.xyz); + r3.z = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r0.xyz); + r3.w = dot(float3(-0.00552588236, 0.00402521016, 1.00150073), r0.xyz); + r0.w = min(r3.y, r3.z); + r0.w = min(r0.w, r3.w); + r1.w = max(r3.y, r3.z); + r1.w = max(r1.w, r3.w); + r4.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r4.x + -r0.w; + r0.w = r0.w / r4.y; + r4.xyz = r3.wzy + -r3.zyw; + r4.xy = r4.xy * r3.wz; + r1.w = r4.x + r4.y; + r1.w = r3.y * r4.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r3.w + r3.z; + r2.w = r2.w + r3.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.x = -0.400000006 + r0.w; + r4.x = 2.5 * r3.x; + r4.x = 1 + -abs(r4.x); + r4.x = max(0, r4.x); + r4.y = cmp(0 < r3.x); + r3.x = cmp(r3.x < 0); + r3.x = (int)-r4.y + (int)r3.x; + r3.x = (int)r3.x; + r4.x = -r4.x * r4.x + 1; + r3.x = r3.x * r4.x + 1; + r3.x = 0.0250000004 * r3.x; + r4.x = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.x * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.x ? r3.x : r1.w; + r1.w = 1 + r1.w; + r4.yzw = r3.yzw * r1.www; + r5.xy = cmp(r4.zw == r4.yz); + r2.w = r5.y ? r5.x : 0; + r3.x = r3.z * r1.w + -r4.w; + r3.x = 1.73205078 * r3.x; + r3.z = r4.y * 2 + -r4.z; + r3.z = -r3.w * r1.w + r3.z; + r3.w = min(abs(r3.x), abs(r3.z)); + r5.x = max(abs(r3.x), abs(r3.z)); + r5.x = 1 / r5.x; + r3.w = r5.x * r3.w; + r5.x = r3.w * r3.w; + r5.y = r5.x * 0.0208350997 + -0.0851330012; + r5.y = r5.x * r5.y + 0.180141002; + r5.y = r5.x * r5.y + -0.330299497; + r5.x = r5.x * r5.y + 0.999866009; + r5.y = r5.x * r3.w; + r5.z = cmp(abs(r3.z) < abs(r3.x)); + r5.y = r5.y * -2 + 1.57079637; + r5.y = r5.z ? r5.y : 0; + r3.w = r3.w * r5.x + r5.y; + r5.x = cmp(r3.z < -r3.z); + r5.x = r5.x ? -3.141593 : 0; + r3.w = r5.x + r3.w; + r5.x = min(r3.x, r3.z); + r3.x = max(r3.x, r3.z); + r3.z = cmp(r5.x < -r5.x); + r3.x = cmp(r3.x >= -r3.x); + r3.x = r3.x ? r3.z : 0; + r3.x = r3.x ? -r3.w : r3.w; + r3.x = 57.2957802 * r3.x; + r2.w = r2.w ? 0 : r3.x; + r3.x = cmp(r2.w < 0); + r3.z = 360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.x = cmp(180 < r2.w); + r3.z = -360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = 0.0148148146 * r2.w; + r2.w = 1 + -abs(r2.w); + r2.w = max(0, r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r2.w = r3.x * r2.w; + r2.w = r2.w * r2.w; + r0.w = r2.w * r0.w; + r1.w = -r3.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r4.x = r0.w * 0.180000007 + r4.y; + r3.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r4.xzw); + r3.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r4.xzw); + r3.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r4.xzw); + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r0.w = dot(r3.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r4.xy = float2(1, 0.180000007) + cb0[36].ww; + r0.w = -cb0[36].y + r4.x; + r1.w = 1 + cb0[37].x; + r2.w = -cb0[36].z + r1.w; + r3.w = cmp(0.800000012 < cb0[36].y); + r4.xz = float2(0.819999993, 1) + -cb0[36].yy; + r4.xz = r4.xz / cb0[36].xx; + r4.y = r4.y / r0.w; + r4.xw = float2(-0.744727492, -1) + r4.xy; + r4.w = 1 + -r4.w; + r4.y = r4.y / r4.w; + r4.y = log2(r4.y); + r4.y = 0.346573591 * r4.y; + r4.w = r0.w / cb0[36].x; + r4.y = -r4.y * r4.w + -0.744727492; + r3.w = r3.w ? r4.x : r4.y; + r4.x = r4.z + -r3.w; + r4.y = cb0[36].z / cb0[36].x; + r4.y = r4.y + -r4.x; + r3.xyz = log2(r3.xyz); + r5.xyz = float3(0.30103001, 0.30103001, 0.30103001) * r3.xyz; + r4.xzw = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + r4.xxx; + r4.xzw = cb0[36].xxx * r4.xzw; + r5.w = r0.w + r0.w; + r6.x = -2 * cb0[36].x; + r0.w = r6.x / r0.w; + r6.xyz = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + -r3.www; + r7.xyz = r6.xyz * r0.www; + r7.xyz = float3(1.44269502, 1.44269502, 1.44269502) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = float3(1, 1, 1) + r7.xyz; + r7.xyz = r5.www / r7.xyz; + r7.xyz = -cb0[36].www + r7.xyz; + r0.w = r2.w + r2.w; + r5.w = cb0[36].x + cb0[36].x; + r2.w = r5.w / r2.w; + r3.xyz = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + -r4.yyy; + r3.xyz = r3.xyz * r2.www; + r3.xyz = float3(1.44269502, 1.44269502, 1.44269502) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r3.xyz = float3(1, 1, 1) + r3.xyz; + r3.xyz = r0.www / r3.xyz; + r3.xyz = -r3.xyz + r1.www; + r8.xyz = cmp(r5.xyz < r3.www); + r7.xyz = r8.xyz ? r7.xyz : r4.xzw; + r5.xyz = cmp(r4.yyy < r5.xyz); + r3.xyz = r5.xyz ? r3.xyz : r4.xzw; + r0.w = r4.y + -r3.w; + r4.xzw = saturate(r6.xyz / r0.www); + r0.w = cmp(r4.y < r3.w); + r5.xyz = float3(1, 1, 1) + -r4.xzw; + r4.xyz = r0.www ? r5.xyz : r4.xzw; + r5.xyz = -r4.xyz * float3(2, 2, 2) + float3(3, 3, 3); + r4.xyz = r4.xyz * r4.xyz; + r4.xyz = r4.xyz * r5.xyz; + r3.xyz = r3.xyz + -r7.xyz; + r3.xyz = r4.xyz * r3.xyz + r7.xyz; + r0.w = dot(r3.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.930000007, 0.930000007, 0.930000007) + r0.www; + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].zzz * r3.xyz + r0.xyz; + r3.x = dot(float3(1.06537485, 1.44678506e-06, -0.0653710067), r0.xyz); + r3.y = dot(float3(-3.45525592e-07, 1.20366347, -0.203667715), r0.xyz); + r3.z = dot(float3(1.9865448e-08, 2.12079581e-08, 0.999999583), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.x = dot(float3(1.70505154, -0.621790707, -0.0832583979), r0.xyz); + r3.y = dot(float3(-0.130257145, 1.14080286, -0.0105485283), r0.xyz); + r3.z = dot(float3(-0.0240032747, -0.128968775, 1.15297174), r0.xyz); + r2.xyz = max(float3(0, 0, 0), r3.xyz); + } + r2.xyz = saturate(r2.xyz); + r0.xyz = float3(12.9200001, 12.9200001, 12.9200001) * r2.xyz; + r3.xyz = cmp(r2.xyz >= float3(0.00313066994, 0.00313066994, 0.00313066994)); + r2.xyz = log2(r2.xyz); + r2.xyz = float3(0.416666657, 0.416666657, 0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995, 1.05499995, 1.05499995) + float3(-0.0549999997, -0.0549999997, -0.0549999997); + r0.xyz = r3.xyz ? r2.xyz : r0.xyz; + r2.yzw = r0.xyz * float3(0.9375, 0.9375, 0.9375) + float3(0.03125, 0.03125, 0.03125); + r0.w = r2.w * 16 + -0.5; + r1.w = floor(r0.w); + r0.w = -r1.w + r0.w; + r1.w = r2.y + r1.w; + r2.x = 0.0625 * r1.w; + r3.xyz = t0.Sample(s0_s, r2.xz).xyz; + r2.yw = float2(0.0625, 0) + r2.xz; + r4.xyz = t0.Sample(s0_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r3.xyz = cb0[39].xxx * r3.xyz; + r0.xyz = cb0[38].xxx * r0.xyz + r3.xyz; + r3.xyz = t1.Sample(s1_s, r2.xz).xyz; + r4.xyz = t1.Sample(s1_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r0.xyz = cb0[40].xxx * r3.xyz + r0.xyz; + r3.xyz = t2.Sample(s2_s, r2.xz).xyz; + r4.xyz = t2.Sample(s2_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r0.xyz = cb0[41].xxx * r3.xyz + r0.xyz; + r3.xyz = t3.Sample(s3_s, r2.xz).xyz; + r2.xyz = t3.Sample(s3_s, r2.yw).xyz; + r2.xyz = r2.xyz + -r3.xyz; + r2.xyz = r0.www * r2.xyz + r3.xyz; + r0.xyz = cb0[42].xxx * r2.xyz + r0.xyz; + r0.xyz = max(float3(6.10351999e-05, 6.10351999e-05, 6.10351999e-05), r0.xyz); + r2.xyz = cmp(float3(0.0404499993, 0.0404499993, 0.0404499993) < r0.xyz); + r3.xyz = r0.xyz * float3(0.947867274, 0.947867274, 0.947867274) + float3(0.0521326996, 0.0521326996, 0.0521326996); + r3.xyz = log2(r3.xyz); + r3.xyz = float3(2.4000001, 2.4000001, 2.4000001) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = float3(0.0773993805, 0.0773993805, 0.0773993805) * r0.xyz; + r0.xyz = r2.xyz ? r3.xyz : r0.xyz; + r2.xyz = r0.xyz * r0.xyz; + r0.xyz = cb0[26].yyy * r0.xyz; + r0.xyz = cb0[26].xxx * r2.xyz + r0.xyz; + r0.xyz = cb0[26].zzz + r0.xyz; + r2.xyz = cb0[42].yzw * r0.xyz; + r0.xyz = -r0.xyz * cb0[42].yzw + cb0[43].xyz; + r0.xyz = cb0[43].www * r0.xyz + r2.xyz; + r2.xyz = max(float3(0, 0, 0), r0.xyz); + r2.xyz = log2(r2.xyz); + r2.xyz = cb0[27].yyy * r2.xyz; + r3.xyz = exp2(r2.xyz); + + if (injectedData.toneMapType != 0) { + o0 = LutBuilderToneMap(untonemapped_ap1, r3.xyz); + return; + } + + if (cb0[65].z == 0) { + r4.xyz = float3(12.9200001, 12.9200001, 12.9200001) * r3.xyz; + r5.xyz = cmp(r3.xyz >= float3(0.00313066994, 0.00313066994, 0.00313066994)); + r2.xyz = float3(0.416666657, 0.416666657, 0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995, 1.05499995, 1.05499995) + float3(-0.0549999997, -0.0549999997, -0.0549999997); + r2.xyz = r5.xyz ? r2.xyz : r4.xyz; + } else { + r4.xyzw = cmp(asint(cb0[65].wwww) == int4(1, 2, 3, 4)); + r5.xyz = r4.www ? float3(1, 0, 0) : float3(1.70505154, -0.621790707, -0.0832583979); + r6.xyz = r4.www ? float3(0, 1, 0) : float3(-0.130257145, 1.14080286, -0.0105485283); + r7.xyz = r4.www ? float3(0, 0, 1) : float3(-0.0240032747, -0.128968775, 1.15297174); + r5.xyz = r4.zzz ? float3(0.695452213, 0.140678704, 0.163869068) : r5.xyz; + r6.xyz = r4.zzz ? float3(0.0447945632, 0.859671116, 0.0955343172) : r6.xyz; + r7.xyz = r4.zzz ? float3(-0.00552588282, 0.00402521016, 1.00150073) : r7.xyz; + r5.xyz = r4.yyy ? float3(1.02579927, -0.0200525094, -0.00577136781) : r5.xyz; + r6.xyz = r4.yyy ? float3(-0.00223502493, 1.00458264, -0.00235231337) : r6.xyz; + r4.yzw = r4.yyy ? float3(-0.00501400325, -0.0252933875, 1.03044021) : r7.xyz; + r5.xyz = r4.xxx ? float3(1.37915885, -0.308850735, -0.0703467429) : r5.xyz; + r6.xyz = r4.xxx ? float3(-0.0693352968, 1.08229232, -0.0129620517) : r6.xyz; + r4.xyz = r4.xxx ? float3(-0.00215925858, -0.0454653986, 1.04775953) : r4.yzw; + r0.w = cmp(asint(cb0[65].z) == 1); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r3.xyz); + r7.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r3.xyz); + r7.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r3.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = max(float3(6.10351999e-05, 6.10351999e-05, 6.10351999e-05), r8.xyz); + r8.xyz = float3(4.5, 4.5, 4.5) * r7.xyz; + r7.xyz = max(float3(0.0179999992, 0.0179999992, 0.0179999992), r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.449999988, 0.449999988, 0.449999988) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = r7.xyz * float3(1.09899998, 1.09899998, 1.09899998) + float3(-0.0989999995, -0.0989999995, -0.0989999995); + r2.xyz = min(r8.xyz, r7.xyz); + } else { + r7.xyz = cb0[42].yzw * r1.xyz; + r1.xyz = -r1.xyz * cb0[42].yzw + cb0[43].xyz; + r1.xyz = cb0[43].www * r1.xyz + r7.xyz; + r7.xy = cmp(asint(cb0[65].zz) == int2(3, 5)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5, 1.5, 1.5) * r1.xyz; + r8.y = dot(float3(0.439700812, 0.382978052, 0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037, 0.813423157, 0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864, 0.111544058, 0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672, -0.5, 0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5, 0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5, 0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3, 2, 1)); + r8.xz = float2(0.166666672, 0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0, 0, 0), r7.xzw); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r8.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r7.xyz = max(float3(0, 0, 0), r8.xyz); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r8.xyz = cmp(float3(0, 0, 0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14, -14, -14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323, -17.4739323, -17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r8.x + 0].x; + r10.z = icb[r8.w + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r7.x + 0].y; + r10.z = icb[r7.w + 0].y; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].x; + r11.y = icb[r7.x + 0].x; + r11.z = icb[r7.w + 0].x; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].y; + r11.y = icb[r7.x + 0].y; + r11.z = icb[r7.y + 0].y; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r7.x + 0].x; + r10.z = icb[r7.y + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r8.x + 0].y; + r10.z = icb[r8.y + 0].y; + r8.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r10.xy, float2(-1, 1)); + r8.z = dot(r10.xy, float2(0.5, 0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213, 0.140678704, 0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282, 0.00402521016, 1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = r0.w * 0.90309 + 7.54498291; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 0].z; + r9.y = icb[r8.x + 0].z; + r9.z = icb[r8.y + 0].z; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.1373367); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.3549509 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.3549509 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 0].w; + r9.y = icb[r8.x + 0].w; + r9.z = icb[r8.y + 0].w; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 0].z; + r10.y = icb[r9.x + 0].z; + r10.z = icb[r9.y + 0].z; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.1373367); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.3549509 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.3549509 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 0].w; + r10.y = icb[r9.x + 0].w; + r10.z = icb[r9.y + 0].w; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 0].z; + r10.y = icb[r9.x + 0].z; + r10.z = icb[r9.y + 0].z; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.1373367); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.3549509 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.3549509 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 0].w; + r10.y = icb[r9.x + 0].w; + r10.z = icb[r9.y + 0].w; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r7.xyz = float3(-3.50738446e-05, -3.50738446e-05, -3.50738446e-05) + r7.xyz; + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(4, 6)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5, 1.5, 1.5) * r1.xyz; + r8.y = dot(float3(0.439700812, 0.382978052, 0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037, 0.813423157, 0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864, 0.111544058, 0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672, -0.5, 0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5, 0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5, 0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3, 2, 1)); + r8.xz = float2(0.166666672, 0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0, 0, 0), r7.xzw); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r8.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r7.xyz = max(float3(0, 0, 0), r8.xyz); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r8.xyz = cmp(float3(0, 0, 0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14, -14, -14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323, -17.4739323, -17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r8.x + 0].x; + r10.z = icb[r8.w + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r7.x + 0].y; + r10.z = icb[r7.w + 0].y; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].x; + r11.y = icb[r7.x + 0].x; + r11.z = icb[r7.w + 0].x; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].y; + r11.y = icb[r7.x + 0].y; + r11.z = icb[r7.y + 0].y; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r7.x + 0].x; + r10.z = icb[r7.y + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r8.x + 0].y; + r10.z = icb[r8.y + 0].y; + r8.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r10.xy, float2(-1, 1)); + r8.z = dot(r10.xy, float2(0.5, 0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213, 0.140678704, 0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282, 0.00402521016, 1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = -2.30102992; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 6].x; + r9.y = icb[r8.x + 6].x; + r9.z = icb[r8.y + 6].x; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.4948215); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.27267218 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.27267218 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 6].y; + r9.y = icb[r8.x + 6].y; + r9.z = icb[r8.y + 6].y; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 6].x; + r10.y = icb[r9.x + 6].x; + r10.z = icb[r9.y + 6].x; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.4948215); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.27267218 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.27267218 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 6].y; + r10.y = icb[r9.x + 6].y; + r10.z = icb[r9.y + 6].y; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 6].x; + r10.y = icb[r9.x + 6].x; + r10.z = icb[r9.y + 6].x; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.4948215); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.27267218 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.27267218 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 6].y; + r10.y = icb[r9.x + 6].y; + r10.z = icb[r9.y + 6].y; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r0.w = cmp(asint(cb0[65].z) == 7); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r1.xyz); + r7.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r1.xyz); + r7.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r1.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(8, 9)); + r8.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r0.xyz); + r8.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r0.xyz); + r8.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r0.xyz); + r0.x = dot(r5.xyz, r8.xyz); + r0.y = dot(r6.xyz, r8.xyz); + r0.z = dot(r4.xyz, r8.xyz); + r8.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r3.xyz); + r8.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r3.xyz); + r8.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r3.xyz); + r0.w = dot(r5.xyz, r8.xyz); + r1.w = dot(r6.xyz, r8.xyz); + r2.w = dot(r4.xyz, r8.xyz); + r3.x = log2(r0.w); + r3.y = log2(r1.w); + r3.z = log2(r2.w); + r3.xyz = cb0[27].zzz * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = r7.yyy ? r0.xyz : r3.xyz; + r2.xyz = r7.xxx ? r1.xyz : r0.xyz; + } + } + } + } + } + o0.xyz = float3(0.952381015, 0.952381015, 0.952381015) * r2.xyz; + o0.w = 0; + return; +} diff --git a/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x8D3D2FA0.ps_5_0.hlsl b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x8D3D2FA0.ps_5_0.hlsl new file mode 100644 index 00000000..58ff4aa0 --- /dev/null +++ b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x8D3D2FA0.ps_5_0.hlsl @@ -0,0 +1,1540 @@ +#include "../../common.hlsl" + +// ---- Created with 3Dmigoto v1.3.16 on Wed Jan 1 15:35:38 2025 +Texture2D t2 : register(t2); + +Texture2D t1 : register(t1); + +Texture2D t0 : register(t0); + +SamplerState s2_s : register(s2); + +SamplerState s1_s : register(s1); + +SamplerState s0_s : register(s0); + +cbuffer cb0 : register(b0) +{ + float4 cb0[67]; +} + + + + +// 3Dmigoto declarations +#define cmp - + + +void main( + linear noperspective float2 v0 : TEXCOORD0, + float4 v1 : SV_POSITION0, + uint v2 : SV_RenderTargetArrayIndex0, + out float4 o0 : SV_Target0) +{ + const float4 icb[] = { { -4.000000, -0.718548, -4.970622, 0.808913}, + { -4.000000, 2.081031, -3.029378, 1.191087}, + { -3.157377, 3.668124, -2.126200, 1.568300}, + { -0.485250, 4.000000, -1.510500, 1.948300}, + { 1.847732, 4.000000, -1.057800, 2.308300}, + { 1.847732, 4.000000, -0.466800, 2.638400}, + { -2.301030, 0.801995, 0.119380, 2.859500}, + { -2.301030, 1.198005, 0.708813, 2.987261}, + { -1.931200, 1.594300, 1.291187, 3.012739}, + { -1.520500, 1.997300, 1.291187, 3.012739}, + { -1.057800, 2.378300, 0, 0}, + { -0.466800, 2.768400, 0, 0}, + { 0.119380, 3.051500, 0, 0}, + { 0.708813, 3.274629, 0, 0}, + { 1.291187, 3.327431, 0, 0}, + { 1.291187, 3.327431, 0, 0} }; + float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12; + uint4 bitmask, uiDest; + float4 fDest; + + r0.xy = float2(-0.015625,-0.015625) + v0.xy; + r0.xy = float2(1.03225803,1.03225803) * r0.xy; + r0.z = (uint)v2.x; + r1.z = 0.0322580636 * r0.z; + r0.z = cmp(asuint(cb0[65].z) >= 3); + r2.xy = log2(r0.xy); + r2.z = log2(r1.z); + r0.xyw = float3(0.0126833133,0.0126833133,0.0126833133) * r2.xyz; + r0.xyw = exp2(r0.xyw); + r2.xyz = float3(-0.8359375,-0.8359375,-0.8359375) + r0.xyw; + r2.xyz = max(float3(0,0,0), r2.xyz); + r0.xyw = -r0.xyw * float3(18.6875,18.6875,18.6875) + float3(18.8515625,18.8515625,18.8515625); + r0.xyw = r2.xyz / r0.xyw; + r0.xyw = log2(r0.xyw); + r0.xyw = float3(6.27739477,6.27739477,6.27739477) * r0.xyw; + r0.xyw = exp2(r0.xyw); + r0.xyw = float3(100,100,100) * r0.xyw; + r1.xy = v0.xy * float2(1.03225803,1.03225803) + float2(-0.0161290318,-0.0161290318); + r1.xyz = float3(-0.434017599,-0.434017599,-0.434017599) + r1.xyz; + r1.xyz = float3(14,14,14) * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = r1.xyz * float3(0.180000007,0.180000007,0.180000007) + float3(-0.00266771927,-0.00266771927,-0.00266771927); + r0.xyz = r0.zzz ? r0.xyw : r1.xyz; + r0.w = 1.00055635 * cb0[44].y; + r1.x = cmp(6996.10791 >= cb0[44].y); + r1.yz = float2(4.60700006e+09,2.0064e+09) / r0.ww; + r1.yz = float2(2967800,1901800) + -r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(99.1100006,247.479996) + r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(0.244063005,0.237039998) + r1.yz; + r1.x = r1.x ? r1.y : r1.z; + r0.w = r1.x * r1.x; + r1.z = 2.86999989 * r1.x; + r0.w = r0.w * -3 + r1.z; + r1.y = -0.275000006 + r0.w; + r2.xyz = cb0[44].yyy * float3(0.000154118257,0.00084242021,4.22806261e-05) + float3(0.860117733,1,0.317398727); + r0.w = cb0[44].y * cb0[44].y; + r2.xyz = r0.www * float3(1.28641219e-07,7.08145137e-07,4.20481676e-08) + r2.xyz; + r2.x = r2.x / r2.y; + r1.z = -cb0[44].y * 2.8974182e-05 + 1; + r0.w = r0.w * 1.61456057e-07 + r1.z; + r2.y = r2.z / r0.w; + r1.zw = r2.xy + r2.xy; + r0.w = 3 * r2.x; + r1.z = -r2.y * 8 + r1.z; + r1.z = 4 + r1.z; + r3.x = r0.w / r1.z; + r3.y = r1.w / r1.z; + r0.w = cmp(cb0[44].y < 4000); + r1.xy = r0.ww ? r3.xy : r1.xy; + r0.w = dot(r2.xy, r2.xy); + r0.w = rsqrt(r0.w); + r1.zw = r2.xy * r0.ww; + r0.w = cb0[44].z * -r1.w; + r0.w = r0.w * 0.0500000007 + r2.x; + r1.z = cb0[44].z * r1.z; + r1.z = r1.z * 0.0500000007 + r2.y; + r1.w = 3 * r0.w; + r0.w = r0.w + r0.w; + r0.w = -r1.z * 8 + r0.w; + r0.w = 4 + r0.w; + r1.z = r1.z + r1.z; + r2.xy = r1.wz / r0.ww; + r1.zw = r2.xy + -r3.xy; + r1.xy = r1.xy + r1.zw; + r0.w = max(1.00000001e-10, r1.y); + r2.x = r1.x / r0.w; + r1.x = 1 + -r1.x; + r1.x = r1.x + -r1.y; + r2.z = r1.x / r0.w; + r2.y = 1; + r0.w = dot(float3(0.895099998,0.266400009,-0.161400005), r2.xyz); + r1.x = dot(float3(-0.750199974,1.71350002,0.0366999991), r2.xyz); + r1.y = dot(float3(0.0388999991,-0.0684999973,1.02960002), r2.xyz); + r0.w = 0.941379249 / r0.w; + r1.xy = float2(1.04043639,1.0897665) / r1.xy; + r2.xyz = float3(0.895099998,0.266400009,-0.161400005) * r0.www; + r1.xzw = float3(-0.750199974,1.71350002,0.0366999991) * r1.xxx; + r3.xyz = float3(0.0388999991,-0.0684999973,1.02960002) * r1.yyy; + r4.x = r2.x; + r4.y = r1.x; + r4.z = r3.x; + r5.x = dot(float3(0.986992896,-0.1470543,0.159962699), r4.xyz); + r6.x = r2.y; + r6.y = r1.z; + r6.z = r3.y; + r5.y = dot(float3(0.986992896,-0.1470543,0.159962699), r6.xyz); + r3.x = r2.z; + r3.y = r1.w; + r5.z = dot(float3(0.986992896,-0.1470543,0.159962699), r3.xyz); + r1.x = dot(float3(0.432305306,0.518360317,0.0492912009), r4.xyz); + r1.y = dot(float3(0.432305306,0.518360317,0.0492912009), r6.xyz); + r1.z = dot(float3(0.432305306,0.518360317,0.0492912009), r3.xyz); + r2.x = dot(float3(-0.0085287001,0.040042799,0.968486726), r4.xyz); + r2.y = dot(float3(-0.0085287001,0.040042799,0.968486726), r6.xyz); + r2.z = dot(float3(-0.0085287001,0.040042799,0.968486726), r3.xyz); + r3.x = dot(r5.xyz, float3(0.412456393,0.212672904,0.0193339009)); + r4.x = dot(r5.xyz, float3(0.357576102,0.715152204,0.119191997)); + r5.x = dot(r5.xyz, float3(0.180437505,0.0721750036,0.950304091)); + r3.y = dot(r1.xyz, float3(0.412456393,0.212672904,0.0193339009)); + r4.y = dot(r1.xyz, float3(0.357576102,0.715152204,0.119191997)); + r5.y = dot(r1.xyz, float3(0.180437505,0.0721750036,0.950304091)); + r3.z = dot(r2.xyz, float3(0.412456393,0.212672904,0.0193339009)); + r4.z = dot(r2.xyz, float3(0.357576102,0.715152204,0.119191997)); + r5.z = dot(r2.xyz, float3(0.180437505,0.0721750036,0.950304091)); + r1.x = dot(float3(3.2409699,-1.5373832,-0.498610765), r3.xyz); + r1.y = dot(float3(3.2409699,-1.5373832,-0.498610765), r4.xyz); + r1.z = dot(float3(3.2409699,-1.5373832,-0.498610765), r5.xyz); + r2.x = dot(float3(-0.969243646,1.8759675,0.0415550582), r3.xyz); + r2.y = dot(float3(-0.969243646,1.8759675,0.0415550582), r4.xyz); + r2.z = dot(float3(-0.969243646,1.8759675,0.0415550582), r5.xyz); + r3.x = dot(float3(0.0556300804,-0.203976959,1.05697155), r3.xyz); + r3.y = dot(float3(0.0556300804,-0.203976959,1.05697155), r4.xyz); + r3.z = dot(float3(0.0556300804,-0.203976959,1.05697155), r5.xyz); + r1.x = dot(r1.xyz, r0.xyz); + r1.y = dot(r2.xyz, r0.xyz); + r1.z = dot(r3.xyz, r0.xyz); + r0.x = dot(float3(0.613191485,0.33951208,0.0473663323), r1.xyz); + r0.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r1.xyz); + r0.z = dot(float3(0.0206188709,0.109567292,0.869606733), r1.xyz); + r0.w = dot(r0.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r1.xyz = r0.xyz / r0.www; + r1.xyz = float3(-1,-1,-1) + r1.xyz; + r1.x = dot(r1.xyz, r1.xyz); + r1.x = -4 * r1.x; + r1.x = exp2(r1.x); + r1.x = 1 + -r1.x; + r0.w = r0.w * r0.w; + r0.w = cb0[66].y * r0.w; + r0.w = -4 * r0.w; + r0.w = exp2(r0.w); + r0.w = 1 + -r0.w; + r0.w = r1.x * r0.w; + r1.x = dot(float3(1.37041271,-0.329291314,-0.0636827648), r0.xyz); + r1.y = dot(float3(-0.0834341869,1.09709096,-0.0108615728), r0.xyz); + r1.z = dot(float3(-0.0257932581,-0.0986256376,1.20369434), r0.xyz); + r1.xyz = r1.xyz + -r0.xyz; + r1.xyz = r0.www * r1.xyz + r0.xyz; + r0.xyz = cb0[44].xxx ? r0.xyz : r1.xyz; + r0.w = dot(r0.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r1.xyzw = cb0[50].xyzw * cb0[45].xyzw; + r2.xyzw = cb0[51].xyzw * cb0[46].xyzw; + r3.xyzw = cb0[52].xyzw * cb0[47].xyzw; + r4.xyzw = cb0[53].xyzw * cb0[48].xyzw; + r5.xyzw = cb0[54].xyzw + cb0[49].xyzw; + r1.xyz = r1.xyz * r1.www; + r0.xyz = r0.xyz + -r0.www; + r1.xyz = r1.xyz * r0.xyz + r0.www; + r1.xyz = max(float3(0,0,0), r1.xyz); + r1.xyz = float3(5.55555534,5.55555534,5.55555534) * r1.xyz; + r2.xyz = r2.xyz * r2.www; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = float3(0.180000007,0.180000007,0.180000007) * r1.xyz; + r2.xyz = r3.xyz * r3.www; + r2.xyz = float3(1,1,1) / r2.xyz; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r2.xyz = r4.xyz * r4.www; + r3.xyz = r5.xyz + r5.www; + r1.xyz = r1.xyz * r2.xyz + r3.xyz; + r1.w = 1 / cb0[65].x; + r1.w = saturate(r1.w * r0.w); + r2.x = r1.w * -2 + 3; + r1.w = r1.w * r1.w; + r1.w = -r2.x * r1.w + 1; + r2.xyzw = cb0[60].xyzw * cb0[45].xyzw; + r3.xyzw = cb0[61].xyzw * cb0[46].xyzw; + r4.xyzw = cb0[62].xyzw * cb0[47].xyzw; + r5.xyzw = cb0[63].xyzw * cb0[48].xyzw; + r6.xyzw = cb0[64].xyzw + cb0[49].xyzw; + r2.xyz = r2.xyz * r2.www; + r2.xyz = r2.xyz * r0.xyz + r0.www; + r2.xyz = max(float3(0,0,0), r2.xyz); + r2.xyz = float3(5.55555534,5.55555534,5.55555534) * r2.xyz; + r3.xyz = r3.xyz * r3.www; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = float3(0.180000007,0.180000007,0.180000007) * r2.xyz; + r3.xyz = r4.xyz * r4.www; + r3.xyz = float3(1,1,1) / r3.xyz; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r3.xyz = r5.xyz * r5.www; + r4.xyz = r6.xyz + r6.www; + r2.xyz = r2.xyz * r3.xyz + r4.xyz; + r2.w = 1 + -cb0[65].y; + r3.x = -cb0[65].y + r0.w; + r2.w = 1 / r2.w; + r2.w = saturate(r3.x * r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r3.y = r3.x * r2.w; + r4.xyzw = cb0[55].xyzw * cb0[45].xyzw; + r5.xyzw = cb0[56].xyzw * cb0[46].xyzw; + r6.xyzw = cb0[57].xyzw * cb0[47].xyzw; + r7.xyzw = cb0[58].xyzw * cb0[48].xyzw; + r8.xyzw = cb0[59].xyzw + cb0[49].xyzw; + r4.xyz = r4.xyz * r4.www; + r0.xyz = r4.xyz * r0.xyz + r0.www; + r0.xyz = max(float3(0,0,0), r0.xyz); + r0.xyz = float3(5.55555534,5.55555534,5.55555534) * r0.xyz; + r4.xyz = r5.xyz * r5.www; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r0.xyz = float3(0.180000007,0.180000007,0.180000007) * r0.xyz; + r4.xyz = r6.xyz * r6.www; + r4.xyz = float3(1,1,1) / r4.xyz; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r4.xyz = r7.xyz * r7.www; + r5.xyz = r8.xyz + r8.www; + r0.xyz = r0.xyz * r4.xyz + r5.xyz; + r0.w = 1 + -r1.w; + r0.w = -r3.x * r2.w + r0.w; + r0.xyz = r0.xyz * r0.www; + r0.xyz = r1.xyz * r1.www + r0.xyz; + r0.xyz = r2.xyz * r3.yyy + r0.xyz; + + float3 untonemapped_ap1 = r0.xyz; + + r1.x = dot(float3(1.70505154,-0.621790707,-0.0832583979), r0.xyz); + r1.y = dot(float3(-0.130257145,1.14080286,-0.0105485283), r0.xyz); + r1.z = dot(float3(-0.0240032747,-0.128968775,1.15297174), r0.xyz); + if (cb0[44].x != 0) { + r2.x = dot(r1.xyz, cb0[28].xyz); + r2.y = dot(r1.xyz, cb0[29].xyz); + r2.z = dot(r1.xyz, cb0[30].xyz); + r0.w = dot(r1.xyz, cb0[33].xyz); + r0.w = 1 + r0.w; + r0.w = rcp(r0.w); + r3.xyz = cb0[35].xyz * r0.www + cb0[34].xyz; + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = max(float3(0,0,0), r2.xyz); + r3.xyz = cb0[31].xxx + -r2.xyz; + r3.xyz = max(float3(0,0,0), r3.xyz); + r4.xyz = max(cb0[31].zzz, r2.xyz); + r2.xyz = max(cb0[31].xxx, r2.xyz); + r2.xyz = min(cb0[31].zzz, r2.xyz); + r5.xyz = r4.xyz * cb0[32].xxx + cb0[32].yyy; + r4.xyz = cb0[31].www + r4.xyz; + r4.xyz = rcp(r4.xyz); + r6.xyz = cb0[28].www * r3.xyz; + r3.xyz = cb0[31].yyy + r3.xyz; + r3.xyz = rcp(r3.xyz); + r3.xyz = r6.xyz * r3.xyz + cb0[29].www; + r2.xyz = r2.xyz * cb0[30].www + r3.xyz; + r2.xyz = r5.xyz * r4.xyz + r2.xyz; + r2.xyz = float3(-0.00200000009,-0.00200000009,-0.00200000009) + r2.xyz; + } else { + r3.x = dot(float3(0.938639402,1.02359565e-10,0.0613606237), r0.xyz); + r3.y = dot(float3(8.36008554e-11,0.830794156,0.169205874), r0.xyz); + r3.z = dot(float3(2.13187367e-12,-5.63307213e-12,1), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.y = dot(float3(0.695452213,0.140678704,0.163869068), r0.xyz); + r3.z = dot(float3(0.0447945632,0.859671116,0.0955343172), r0.xyz); + r3.w = dot(float3(-0.00552588236,0.00402521016,1.00150073), r0.xyz); + r0.w = min(r3.y, r3.z); + r0.w = min(r0.w, r3.w); + r1.w = max(r3.y, r3.z); + r1.w = max(r1.w, r3.w); + r4.xy = max(float2(1.00000001e-10,0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r4.x + -r0.w; + r0.w = r0.w / r4.y; + r4.xyz = r3.wzy + -r3.zyw; + r4.xy = r4.xy * r3.wz; + r1.w = r4.x + r4.y; + r1.w = r3.y * r4.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r3.w + r3.z; + r2.w = r2.w + r3.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.x = -0.400000006 + r0.w; + r4.x = 2.5 * r3.x; + r4.x = 1 + -abs(r4.x); + r4.x = max(0, r4.x); + r4.y = cmp(0 < r3.x); + r3.x = cmp(r3.x < 0); + r3.x = (int)-r4.y + (int)r3.x; + r3.x = (int)r3.x; + r4.x = -r4.x * r4.x + 1; + r3.x = r3.x * r4.x + 1; + r3.x = 0.0250000004 * r3.x; + r4.x = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.x * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.x ? r3.x : r1.w; + r1.w = 1 + r1.w; + r4.yzw = r3.yzw * r1.www; + r5.xy = cmp(r4.zw == r4.yz); + r2.w = r5.y ? r5.x : 0; + r3.x = r3.z * r1.w + -r4.w; + r3.x = 1.73205078 * r3.x; + r3.z = r4.y * 2 + -r4.z; + r3.z = -r3.w * r1.w + r3.z; + r3.w = min(abs(r3.x), abs(r3.z)); + r5.x = max(abs(r3.x), abs(r3.z)); + r5.x = 1 / r5.x; + r3.w = r5.x * r3.w; + r5.x = r3.w * r3.w; + r5.y = r5.x * 0.0208350997 + -0.0851330012; + r5.y = r5.x * r5.y + 0.180141002; + r5.y = r5.x * r5.y + -0.330299497; + r5.x = r5.x * r5.y + 0.999866009; + r5.y = r5.x * r3.w; + r5.z = cmp(abs(r3.z) < abs(r3.x)); + r5.y = r5.y * -2 + 1.57079637; + r5.y = r5.z ? r5.y : 0; + r3.w = r3.w * r5.x + r5.y; + r5.x = cmp(r3.z < -r3.z); + r5.x = r5.x ? -3.141593 : 0; + r3.w = r5.x + r3.w; + r5.x = min(r3.x, r3.z); + r3.x = max(r3.x, r3.z); + r3.z = cmp(r5.x < -r5.x); + r3.x = cmp(r3.x >= -r3.x); + r3.x = r3.x ? r3.z : 0; + r3.x = r3.x ? -r3.w : r3.w; + r3.x = 57.2957802 * r3.x; + r2.w = r2.w ? 0 : r3.x; + r3.x = cmp(r2.w < 0); + r3.z = 360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.x = cmp(180 < r2.w); + r3.z = -360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = 0.0148148146 * r2.w; + r2.w = 1 + -abs(r2.w); + r2.w = max(0, r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r2.w = r3.x * r2.w; + r2.w = r2.w * r2.w; + r0.w = r2.w * r0.w; + r1.w = -r3.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r4.x = r0.w * 0.180000007 + r4.y; + r3.x = dot(float3(1.45143926,-0.236510754,-0.214928567), r4.xzw); + r3.y = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r4.xzw); + r3.z = dot(float3(0.00831614807,-0.00603244966,0.997716308), r4.xzw); + r3.xyz = max(float3(0,0,0), r3.xyz); + r0.w = dot(r3.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.959999979,0.959999979,0.959999979) + r0.www; + r4.xy = float2(1,0.180000007) + cb0[36].ww; + r0.w = -cb0[36].y + r4.x; + r1.w = 1 + cb0[37].x; + r2.w = -cb0[36].z + r1.w; + r3.w = cmp(0.800000012 < cb0[36].y); + r4.xz = float2(0.819999993,1) + -cb0[36].yy; + r4.xz = r4.xz / cb0[36].xx; + r4.y = r4.y / r0.w; + r4.xw = float2(-0.744727492,-1) + r4.xy; + r4.w = 1 + -r4.w; + r4.y = r4.y / r4.w; + r4.y = log2(r4.y); + r4.y = 0.346573591 * r4.y; + r4.w = r0.w / cb0[36].x; + r4.y = -r4.y * r4.w + -0.744727492; + r3.w = r3.w ? r4.x : r4.y; + r4.x = r4.z + -r3.w; + r4.y = cb0[36].z / cb0[36].x; + r4.y = r4.y + -r4.x; + r3.xyz = log2(r3.xyz); + r5.xyz = float3(0.30103001,0.30103001,0.30103001) * r3.xyz; + r4.xzw = r3.xyz * float3(0.30103001,0.30103001,0.30103001) + r4.xxx; + r4.xzw = cb0[36].xxx * r4.xzw; + r5.w = r0.w + r0.w; + r6.x = -2 * cb0[36].x; + r0.w = r6.x / r0.w; + r6.xyz = r3.xyz * float3(0.30103001,0.30103001,0.30103001) + -r3.www; + r7.xyz = r6.xyz * r0.www; + r7.xyz = float3(1.44269502,1.44269502,1.44269502) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = float3(1,1,1) + r7.xyz; + r7.xyz = r5.www / r7.xyz; + r7.xyz = -cb0[36].www + r7.xyz; + r0.w = r2.w + r2.w; + r5.w = cb0[36].x + cb0[36].x; + r2.w = r5.w / r2.w; + r3.xyz = r3.xyz * float3(0.30103001,0.30103001,0.30103001) + -r4.yyy; + r3.xyz = r3.xyz * r2.www; + r3.xyz = float3(1.44269502,1.44269502,1.44269502) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r3.xyz = float3(1,1,1) + r3.xyz; + r3.xyz = r0.www / r3.xyz; + r3.xyz = -r3.xyz + r1.www; + r8.xyz = cmp(r5.xyz < r3.www); + r7.xyz = r8.xyz ? r7.xyz : r4.xzw; + r5.xyz = cmp(r4.yyy < r5.xyz); + r3.xyz = r5.xyz ? r3.xyz : r4.xzw; + r0.w = r4.y + -r3.w; + r4.xzw = saturate(r6.xyz / r0.www); + r0.w = cmp(r4.y < r3.w); + r5.xyz = float3(1,1,1) + -r4.xzw; + r4.xyz = r0.www ? r5.xyz : r4.xzw; + r5.xyz = -r4.xyz * float3(2,2,2) + float3(3,3,3); + r4.xyz = r4.xyz * r4.xyz; + r4.xyz = r4.xyz * r5.xyz; + r3.xyz = r3.xyz + -r7.xyz; + r3.xyz = r4.xyz * r3.xyz + r7.xyz; + r0.w = dot(r3.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.930000007,0.930000007,0.930000007) + r0.www; + r3.xyz = max(float3(0,0,0), r3.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].zzz * r3.xyz + r0.xyz; + r3.x = dot(float3(1.06537485,1.44678506e-06,-0.0653710067), r0.xyz); + r3.y = dot(float3(-3.45525592e-07,1.20366347,-0.203667715), r0.xyz); + r3.z = dot(float3(1.9865448e-08,2.12079581e-08,0.999999583), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.x = dot(float3(1.70505154,-0.621790707,-0.0832583979), r0.xyz); + r3.y = dot(float3(-0.130257145,1.14080286,-0.0105485283), r0.xyz); + r3.z = dot(float3(-0.0240032747,-0.128968775,1.15297174), r0.xyz); + r2.xyz = max(float3(0,0,0), r3.xyz); + } + r2.xyz = saturate(r2.xyz); + r0.xyz = float3(12.9200001,12.9200001,12.9200001) * r2.xyz; + r3.xyz = cmp(r2.xyz >= float3(0.00313066994,0.00313066994,0.00313066994)); + r2.xyz = log2(r2.xyz); + r2.xyz = float3(0.416666657,0.416666657,0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995,1.05499995,1.05499995) + float3(-0.0549999997,-0.0549999997,-0.0549999997); + r0.xyz = r3.xyz ? r2.xyz : r0.xyz; + r2.yzw = r0.xyz * float3(0.9375,0.9375,0.9375) + float3(0.03125,0.03125,0.03125); + r0.w = r2.w * 16 + -0.5; + r1.w = floor(r0.w); + r0.w = -r1.w + r0.w; + r1.w = r2.y + r1.w; + r2.x = 0.0625 * r1.w; + r3.xyz = t0.Sample(s0_s, r2.xz).xyz; + r2.yw = float2(0.0625,0) + r2.xz; + r4.xyz = t0.Sample(s0_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r3.xyz = cb0[39].xxx * r3.xyz; + r0.xyz = cb0[38].xxx * r0.xyz + r3.xyz; + r3.xyz = t1.Sample(s1_s, r2.xz).xyz; + r4.xyz = t1.Sample(s1_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r0.xyz = cb0[40].xxx * r3.xyz + r0.xyz; + r3.xyz = t2.Sample(s2_s, r2.xz).xyz; + r2.xyz = t2.Sample(s2_s, r2.yw).xyz; + r2.xyz = r2.xyz + -r3.xyz; + r2.xyz = r0.www * r2.xyz + r3.xyz; + r0.xyz = cb0[41].xxx * r2.xyz + r0.xyz; + r0.xyz = max(float3(6.10351999e-05,6.10351999e-05,6.10351999e-05), r0.xyz); + r2.xyz = cmp(float3(0.0404499993,0.0404499993,0.0404499993) < r0.xyz); + r3.xyz = r0.xyz * float3(0.947867274,0.947867274,0.947867274) + float3(0.0521326996,0.0521326996,0.0521326996); + r3.xyz = log2(r3.xyz); + r3.xyz = float3(2.4000001,2.4000001,2.4000001) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = float3(0.0773993805,0.0773993805,0.0773993805) * r0.xyz; + r0.xyz = r2.xyz ? r3.xyz : r0.xyz; + r2.xyz = r0.xyz * r0.xyz; + r0.xyz = cb0[26].yyy * r0.xyz; + r0.xyz = cb0[26].xxx * r2.xyz + r0.xyz; + r0.xyz = cb0[26].zzz + r0.xyz; + r2.xyz = cb0[42].yzw * r0.xyz; + r0.xyz = -r0.xyz * cb0[42].yzw + cb0[43].xyz; + r0.xyz = cb0[43].www * r0.xyz + r2.xyz; + r2.xyz = max(float3(0,0,0), r0.xyz); + r2.xyz = log2(r2.xyz); + r2.xyz = cb0[27].yyy * r2.xyz; + r3.xyz = exp2(r2.xyz); + + if (injectedData.toneMapType != 0) { + o0 = LutBuilderToneMap(untonemapped_ap1, r3.xyz); + return; + } + + if (cb0[65].z == 0) { + r4.xyz = float3(12.9200001,12.9200001,12.9200001) * r3.xyz; + r5.xyz = cmp(r3.xyz >= float3(0.00313066994,0.00313066994,0.00313066994)); + r2.xyz = float3(0.416666657,0.416666657,0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995,1.05499995,1.05499995) + float3(-0.0549999997,-0.0549999997,-0.0549999997); + r2.xyz = r5.xyz ? r2.xyz : r4.xyz; + } else { + r4.xyzw = cmp(asint(cb0[65].wwww) == int4(1,2,3,4)); + r5.xyz = r4.www ? float3(1,0,0) : float3(1.70505154,-0.621790707,-0.0832583979); + r6.xyz = r4.www ? float3(0,1,0) : float3(-0.130257145,1.14080286,-0.0105485283); + r7.xyz = r4.www ? float3(0,0,1) : float3(-0.0240032747,-0.128968775,1.15297174); + r5.xyz = r4.zzz ? float3(0.695452213,0.140678704,0.163869068) : r5.xyz; + r6.xyz = r4.zzz ? float3(0.0447945632,0.859671116,0.0955343172) : r6.xyz; + r7.xyz = r4.zzz ? float3(-0.00552588282,0.00402521016,1.00150073) : r7.xyz; + r5.xyz = r4.yyy ? float3(1.02579927,-0.0200525094,-0.00577136781) : r5.xyz; + r6.xyz = r4.yyy ? float3(-0.00223502493,1.00458264,-0.00235231337) : r6.xyz; + r4.yzw = r4.yyy ? float3(-0.00501400325,-0.0252933875,1.03044021) : r7.xyz; + r5.xyz = r4.xxx ? float3(1.37915885,-0.308850735,-0.0703467429) : r5.xyz; + r6.xyz = r4.xxx ? float3(-0.0693352968,1.08229232,-0.0129620517) : r6.xyz; + r4.xyz = r4.xxx ? float3(-0.00215925858,-0.0454653986,1.04775953) : r4.yzw; + r0.w = cmp(asint(cb0[65].z) == 1); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485,0.33951208,0.0473663323), r3.xyz); + r7.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r3.xyz); + r7.z = dot(float3(0.0206188709,0.109567292,0.869606733), r3.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = max(float3(6.10351999e-05,6.10351999e-05,6.10351999e-05), r8.xyz); + r8.xyz = float3(4.5,4.5,4.5) * r7.xyz; + r7.xyz = max(float3(0.0179999992,0.0179999992,0.0179999992), r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.449999988,0.449999988,0.449999988) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = r7.xyz * float3(1.09899998,1.09899998,1.09899998) + float3(-0.0989999995,-0.0989999995,-0.0989999995); + r2.xyz = min(r8.xyz, r7.xyz); + } else { + r7.xyz = cb0[42].yzw * r1.xyz; + r1.xyz = -r1.xyz * cb0[42].yzw + cb0[43].xyz; + r1.xyz = cb0[43].www * r1.xyz + r7.xyz; + r7.xy = cmp(asint(cb0[65].zz) == int2(3,5)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5,1.5,1.5) * r1.xyz; + r8.y = dot(float3(0.439700812,0.382978052,0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037,0.813423157,0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864,0.111544058,0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10,0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672,-0.5,0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5,0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5,0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3,2,1)); + r8.xz = float2(0.166666672,0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0,0,0), r7.xzw); + r7.xyz = min(float3(65535,65535,65535), r7.xyz); + r8.x = dot(float3(1.45143926,-0.236510754,-0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807,-0.00603244966,0.997716308), r7.xyz); + r7.xyz = max(float3(0,0,0), r8.xyz); + r7.xyz = min(float3(65535,65535,65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979,0.959999979,0.959999979) + r0.www; + r8.xyz = cmp(float3(0,0,0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14,-14,-14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323,-17.4739323,-17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1,2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w+0].x; + r10.y = icb[r8.x+0].x; + r10.z = icb[r8.w+0].x; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1,2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w+0].y; + r10.y = icb[r7.x+0].y; + r10.z = icb[r7.w+0].y; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1,2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w+0].x; + r11.y = icb[r7.x+0].x; + r11.z = icb[r7.w+0].x; + r12.x = dot(r11.xzy, float3(0.5,0.5,-1)); + r12.y = dot(r11.xy, float2(-1,1)); + r12.z = dot(r11.xy, float2(0.5,0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1,2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w+0].y; + r11.y = icb[r7.x+0].y; + r11.z = icb[r7.y+0].y; + r12.x = dot(r11.xzy, float3(0.5,0.5,-1)); + r12.y = dot(r11.xy, float2(-1,1)); + r12.z = dot(r11.xy, float2(0.5,0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w+0].x; + r10.y = icb[r7.x+0].x; + r10.z = icb[r7.y+0].x; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1,2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w+0].y; + r10.y = icb[r8.x+0].y; + r10.z = icb[r8.y+0].y; + r8.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r10.xy, float2(-1,1)); + r8.z = dot(r10.xy, float2(0.5,0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213,0.140678704,0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632,0.859671116,0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282,0.00402521016,1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926,-0.236510754,-0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807,-0.00603244966,0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = r0.w * 0.90309 + 7.54498291; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1,2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w+0].z; + r9.y = icb[r8.x+0].z; + r9.z = icb[r8.y+0].z; + r8.x = dot(r9.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r9.xy, float2(-1,1)); + r8.z = dot(r9.xy, float2(0.5,0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.1373367); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.3549509 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.3549509 + -r5.w; + r8.xy = (int2)r6.ww + int2(1,2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w+0].w; + r9.y = icb[r8.x+0].w; + r9.z = icb[r8.y+0].w; + r8.x = dot(r9.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r9.xy, float2(-1,1)); + r8.z = dot(r9.xy, float2(0.5,0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w+0].z; + r10.y = icb[r9.x+0].z; + r10.z = icb[r9.y+0].z; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.1373367); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.3549509 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.3549509 + -r4.w; + r9.xy = (int2)r5.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w+0].w; + r10.y = icb[r9.x+0].w; + r10.z = icb[r9.y+0].w; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w+0].z; + r10.y = icb[r9.x+0].z; + r10.z = icb[r9.y+0].z; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.1373367); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.3549509 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.3549509 + -r3.w; + r9.xy = (int2)r4.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w+0].w; + r10.y = icb[r9.x+0].w; + r10.z = icb[r9.y+0].w; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r7.xyz = float3(-3.50738446e-05,-3.50738446e-05,-3.50738446e-05) + r7.xyz; + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05,9.99999975e-05,9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758,0.159301758,0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625,18.8515625,18.8515625) + float3(0.8359375,0.8359375,0.8359375); + r7.xyz = r7.xyz * float3(18.6875,18.6875,18.6875) + float3(1,1,1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375,78.84375,78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(4,6)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5,1.5,1.5) * r1.xyz; + r8.y = dot(float3(0.439700812,0.382978052,0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037,0.813423157,0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864,0.111544058,0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10,0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672,-0.5,0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5,0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5,0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3,2,1)); + r8.xz = float2(0.166666672,0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0,0,0), r7.xzw); + r7.xyz = min(float3(65535,65535,65535), r7.xyz); + r8.x = dot(float3(1.45143926,-0.236510754,-0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807,-0.00603244966,0.997716308), r7.xyz); + r7.xyz = max(float3(0,0,0), r8.xyz); + r7.xyz = min(float3(65535,65535,65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979,0.959999979,0.959999979) + r0.www; + r8.xyz = cmp(float3(0,0,0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14,-14,-14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323,-17.4739323,-17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1,2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w+0].x; + r10.y = icb[r8.x+0].x; + r10.z = icb[r8.w+0].x; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1,2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w+0].y; + r10.y = icb[r7.x+0].y; + r10.z = icb[r7.w+0].y; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1,2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w+0].x; + r11.y = icb[r7.x+0].x; + r11.z = icb[r7.w+0].x; + r12.x = dot(r11.xzy, float3(0.5,0.5,-1)); + r12.y = dot(r11.xy, float2(-1,1)); + r12.z = dot(r11.xy, float2(0.5,0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1,2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w+0].y; + r11.y = icb[r7.x+0].y; + r11.z = icb[r7.y+0].y; + r12.x = dot(r11.xzy, float3(0.5,0.5,-1)); + r12.y = dot(r11.xy, float2(-1,1)); + r12.z = dot(r11.xy, float2(0.5,0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w+0].x; + r10.y = icb[r7.x+0].x; + r10.z = icb[r7.y+0].x; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1,2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w+0].y; + r10.y = icb[r8.x+0].y; + r10.z = icb[r8.y+0].y; + r8.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r10.xy, float2(-1,1)); + r8.z = dot(r10.xy, float2(0.5,0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213,0.140678704,0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632,0.859671116,0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282,0.00402521016,1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926,-0.236510754,-0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807,-0.00603244966,0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = -2.30102992; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1,2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w+6].x; + r9.y = icb[r8.x+6].x; + r9.z = icb[r8.y+6].x; + r8.x = dot(r9.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r9.xy, float2(-1,1)); + r8.z = dot(r9.xy, float2(0.5,0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.4948215); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.27267218 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.27267218 + -r5.w; + r8.xy = (int2)r6.ww + int2(1,2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w+6].y; + r9.y = icb[r8.x+6].y; + r9.z = icb[r8.y+6].y; + r8.x = dot(r9.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r9.xy, float2(-1,1)); + r8.z = dot(r9.xy, float2(0.5,0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w+6].x; + r10.y = icb[r9.x+6].x; + r10.z = icb[r9.y+6].x; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.4948215); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.27267218 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.27267218 + -r4.w; + r9.xy = (int2)r5.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w+6].y; + r10.y = icb[r9.x+6].y; + r10.z = icb[r9.y+6].y; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w+6].x; + r10.y = icb[r9.x+6].x; + r10.z = icb[r9.y+6].x; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.4948215); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.27267218 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.27267218 + -r3.w; + r9.xy = (int2)r4.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w+6].y; + r10.y = icb[r9.x+6].y; + r10.z = icb[r9.y+6].y; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05,9.99999975e-05,9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758,0.159301758,0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625,18.8515625,18.8515625) + float3(0.8359375,0.8359375,0.8359375); + r7.xyz = r7.xyz * float3(18.6875,18.6875,18.6875) + float3(1,1,1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375,78.84375,78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r0.w = cmp(asint(cb0[65].z) == 7); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485,0.33951208,0.0473663323), r1.xyz); + r7.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r1.xyz); + r7.z = dot(float3(0.0206188709,0.109567292,0.869606733), r1.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05,9.99999975e-05,9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758,0.159301758,0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625,18.8515625,18.8515625) + float3(0.8359375,0.8359375,0.8359375); + r7.xyz = r7.xyz * float3(18.6875,18.6875,18.6875) + float3(1,1,1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375,78.84375,78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(8,9)); + r8.x = dot(float3(0.613191485,0.33951208,0.0473663323), r0.xyz); + r8.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r0.xyz); + r8.z = dot(float3(0.0206188709,0.109567292,0.869606733), r0.xyz); + r0.x = dot(r5.xyz, r8.xyz); + r0.y = dot(r6.xyz, r8.xyz); + r0.z = dot(r4.xyz, r8.xyz); + r8.x = dot(float3(0.613191485,0.33951208,0.0473663323), r3.xyz); + r8.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r3.xyz); + r8.z = dot(float3(0.0206188709,0.109567292,0.869606733), r3.xyz); + r0.w = dot(r5.xyz, r8.xyz); + r1.w = dot(r6.xyz, r8.xyz); + r2.w = dot(r4.xyz, r8.xyz); + r3.x = log2(r0.w); + r3.y = log2(r1.w); + r3.z = log2(r2.w); + r3.xyz = cb0[27].zzz * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = r7.yyy ? r0.xyz : r3.xyz; + r2.xyz = r7.xxx ? r1.xyz : r0.xyz; + } + } + } + } + } + o0.xyz = float3(0.952381015,0.952381015,0.952381015) * r2.xyz; + o0.w = 0; + return; +} \ No newline at end of file diff --git a/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x8D3D2FA0_dx12.ps_5_1.hlsl b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x8D3D2FA0_dx12.ps_5_1.hlsl new file mode 100644 index 00000000..58ff4aa0 --- /dev/null +++ b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x8D3D2FA0_dx12.ps_5_1.hlsl @@ -0,0 +1,1540 @@ +#include "../../common.hlsl" + +// ---- Created with 3Dmigoto v1.3.16 on Wed Jan 1 15:35:38 2025 +Texture2D t2 : register(t2); + +Texture2D t1 : register(t1); + +Texture2D t0 : register(t0); + +SamplerState s2_s : register(s2); + +SamplerState s1_s : register(s1); + +SamplerState s0_s : register(s0); + +cbuffer cb0 : register(b0) +{ + float4 cb0[67]; +} + + + + +// 3Dmigoto declarations +#define cmp - + + +void main( + linear noperspective float2 v0 : TEXCOORD0, + float4 v1 : SV_POSITION0, + uint v2 : SV_RenderTargetArrayIndex0, + out float4 o0 : SV_Target0) +{ + const float4 icb[] = { { -4.000000, -0.718548, -4.970622, 0.808913}, + { -4.000000, 2.081031, -3.029378, 1.191087}, + { -3.157377, 3.668124, -2.126200, 1.568300}, + { -0.485250, 4.000000, -1.510500, 1.948300}, + { 1.847732, 4.000000, -1.057800, 2.308300}, + { 1.847732, 4.000000, -0.466800, 2.638400}, + { -2.301030, 0.801995, 0.119380, 2.859500}, + { -2.301030, 1.198005, 0.708813, 2.987261}, + { -1.931200, 1.594300, 1.291187, 3.012739}, + { -1.520500, 1.997300, 1.291187, 3.012739}, + { -1.057800, 2.378300, 0, 0}, + { -0.466800, 2.768400, 0, 0}, + { 0.119380, 3.051500, 0, 0}, + { 0.708813, 3.274629, 0, 0}, + { 1.291187, 3.327431, 0, 0}, + { 1.291187, 3.327431, 0, 0} }; + float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12; + uint4 bitmask, uiDest; + float4 fDest; + + r0.xy = float2(-0.015625,-0.015625) + v0.xy; + r0.xy = float2(1.03225803,1.03225803) * r0.xy; + r0.z = (uint)v2.x; + r1.z = 0.0322580636 * r0.z; + r0.z = cmp(asuint(cb0[65].z) >= 3); + r2.xy = log2(r0.xy); + r2.z = log2(r1.z); + r0.xyw = float3(0.0126833133,0.0126833133,0.0126833133) * r2.xyz; + r0.xyw = exp2(r0.xyw); + r2.xyz = float3(-0.8359375,-0.8359375,-0.8359375) + r0.xyw; + r2.xyz = max(float3(0,0,0), r2.xyz); + r0.xyw = -r0.xyw * float3(18.6875,18.6875,18.6875) + float3(18.8515625,18.8515625,18.8515625); + r0.xyw = r2.xyz / r0.xyw; + r0.xyw = log2(r0.xyw); + r0.xyw = float3(6.27739477,6.27739477,6.27739477) * r0.xyw; + r0.xyw = exp2(r0.xyw); + r0.xyw = float3(100,100,100) * r0.xyw; + r1.xy = v0.xy * float2(1.03225803,1.03225803) + float2(-0.0161290318,-0.0161290318); + r1.xyz = float3(-0.434017599,-0.434017599,-0.434017599) + r1.xyz; + r1.xyz = float3(14,14,14) * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = r1.xyz * float3(0.180000007,0.180000007,0.180000007) + float3(-0.00266771927,-0.00266771927,-0.00266771927); + r0.xyz = r0.zzz ? r0.xyw : r1.xyz; + r0.w = 1.00055635 * cb0[44].y; + r1.x = cmp(6996.10791 >= cb0[44].y); + r1.yz = float2(4.60700006e+09,2.0064e+09) / r0.ww; + r1.yz = float2(2967800,1901800) + -r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(99.1100006,247.479996) + r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(0.244063005,0.237039998) + r1.yz; + r1.x = r1.x ? r1.y : r1.z; + r0.w = r1.x * r1.x; + r1.z = 2.86999989 * r1.x; + r0.w = r0.w * -3 + r1.z; + r1.y = -0.275000006 + r0.w; + r2.xyz = cb0[44].yyy * float3(0.000154118257,0.00084242021,4.22806261e-05) + float3(0.860117733,1,0.317398727); + r0.w = cb0[44].y * cb0[44].y; + r2.xyz = r0.www * float3(1.28641219e-07,7.08145137e-07,4.20481676e-08) + r2.xyz; + r2.x = r2.x / r2.y; + r1.z = -cb0[44].y * 2.8974182e-05 + 1; + r0.w = r0.w * 1.61456057e-07 + r1.z; + r2.y = r2.z / r0.w; + r1.zw = r2.xy + r2.xy; + r0.w = 3 * r2.x; + r1.z = -r2.y * 8 + r1.z; + r1.z = 4 + r1.z; + r3.x = r0.w / r1.z; + r3.y = r1.w / r1.z; + r0.w = cmp(cb0[44].y < 4000); + r1.xy = r0.ww ? r3.xy : r1.xy; + r0.w = dot(r2.xy, r2.xy); + r0.w = rsqrt(r0.w); + r1.zw = r2.xy * r0.ww; + r0.w = cb0[44].z * -r1.w; + r0.w = r0.w * 0.0500000007 + r2.x; + r1.z = cb0[44].z * r1.z; + r1.z = r1.z * 0.0500000007 + r2.y; + r1.w = 3 * r0.w; + r0.w = r0.w + r0.w; + r0.w = -r1.z * 8 + r0.w; + r0.w = 4 + r0.w; + r1.z = r1.z + r1.z; + r2.xy = r1.wz / r0.ww; + r1.zw = r2.xy + -r3.xy; + r1.xy = r1.xy + r1.zw; + r0.w = max(1.00000001e-10, r1.y); + r2.x = r1.x / r0.w; + r1.x = 1 + -r1.x; + r1.x = r1.x + -r1.y; + r2.z = r1.x / r0.w; + r2.y = 1; + r0.w = dot(float3(0.895099998,0.266400009,-0.161400005), r2.xyz); + r1.x = dot(float3(-0.750199974,1.71350002,0.0366999991), r2.xyz); + r1.y = dot(float3(0.0388999991,-0.0684999973,1.02960002), r2.xyz); + r0.w = 0.941379249 / r0.w; + r1.xy = float2(1.04043639,1.0897665) / r1.xy; + r2.xyz = float3(0.895099998,0.266400009,-0.161400005) * r0.www; + r1.xzw = float3(-0.750199974,1.71350002,0.0366999991) * r1.xxx; + r3.xyz = float3(0.0388999991,-0.0684999973,1.02960002) * r1.yyy; + r4.x = r2.x; + r4.y = r1.x; + r4.z = r3.x; + r5.x = dot(float3(0.986992896,-0.1470543,0.159962699), r4.xyz); + r6.x = r2.y; + r6.y = r1.z; + r6.z = r3.y; + r5.y = dot(float3(0.986992896,-0.1470543,0.159962699), r6.xyz); + r3.x = r2.z; + r3.y = r1.w; + r5.z = dot(float3(0.986992896,-0.1470543,0.159962699), r3.xyz); + r1.x = dot(float3(0.432305306,0.518360317,0.0492912009), r4.xyz); + r1.y = dot(float3(0.432305306,0.518360317,0.0492912009), r6.xyz); + r1.z = dot(float3(0.432305306,0.518360317,0.0492912009), r3.xyz); + r2.x = dot(float3(-0.0085287001,0.040042799,0.968486726), r4.xyz); + r2.y = dot(float3(-0.0085287001,0.040042799,0.968486726), r6.xyz); + r2.z = dot(float3(-0.0085287001,0.040042799,0.968486726), r3.xyz); + r3.x = dot(r5.xyz, float3(0.412456393,0.212672904,0.0193339009)); + r4.x = dot(r5.xyz, float3(0.357576102,0.715152204,0.119191997)); + r5.x = dot(r5.xyz, float3(0.180437505,0.0721750036,0.950304091)); + r3.y = dot(r1.xyz, float3(0.412456393,0.212672904,0.0193339009)); + r4.y = dot(r1.xyz, float3(0.357576102,0.715152204,0.119191997)); + r5.y = dot(r1.xyz, float3(0.180437505,0.0721750036,0.950304091)); + r3.z = dot(r2.xyz, float3(0.412456393,0.212672904,0.0193339009)); + r4.z = dot(r2.xyz, float3(0.357576102,0.715152204,0.119191997)); + r5.z = dot(r2.xyz, float3(0.180437505,0.0721750036,0.950304091)); + r1.x = dot(float3(3.2409699,-1.5373832,-0.498610765), r3.xyz); + r1.y = dot(float3(3.2409699,-1.5373832,-0.498610765), r4.xyz); + r1.z = dot(float3(3.2409699,-1.5373832,-0.498610765), r5.xyz); + r2.x = dot(float3(-0.969243646,1.8759675,0.0415550582), r3.xyz); + r2.y = dot(float3(-0.969243646,1.8759675,0.0415550582), r4.xyz); + r2.z = dot(float3(-0.969243646,1.8759675,0.0415550582), r5.xyz); + r3.x = dot(float3(0.0556300804,-0.203976959,1.05697155), r3.xyz); + r3.y = dot(float3(0.0556300804,-0.203976959,1.05697155), r4.xyz); + r3.z = dot(float3(0.0556300804,-0.203976959,1.05697155), r5.xyz); + r1.x = dot(r1.xyz, r0.xyz); + r1.y = dot(r2.xyz, r0.xyz); + r1.z = dot(r3.xyz, r0.xyz); + r0.x = dot(float3(0.613191485,0.33951208,0.0473663323), r1.xyz); + r0.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r1.xyz); + r0.z = dot(float3(0.0206188709,0.109567292,0.869606733), r1.xyz); + r0.w = dot(r0.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r1.xyz = r0.xyz / r0.www; + r1.xyz = float3(-1,-1,-1) + r1.xyz; + r1.x = dot(r1.xyz, r1.xyz); + r1.x = -4 * r1.x; + r1.x = exp2(r1.x); + r1.x = 1 + -r1.x; + r0.w = r0.w * r0.w; + r0.w = cb0[66].y * r0.w; + r0.w = -4 * r0.w; + r0.w = exp2(r0.w); + r0.w = 1 + -r0.w; + r0.w = r1.x * r0.w; + r1.x = dot(float3(1.37041271,-0.329291314,-0.0636827648), r0.xyz); + r1.y = dot(float3(-0.0834341869,1.09709096,-0.0108615728), r0.xyz); + r1.z = dot(float3(-0.0257932581,-0.0986256376,1.20369434), r0.xyz); + r1.xyz = r1.xyz + -r0.xyz; + r1.xyz = r0.www * r1.xyz + r0.xyz; + r0.xyz = cb0[44].xxx ? r0.xyz : r1.xyz; + r0.w = dot(r0.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r1.xyzw = cb0[50].xyzw * cb0[45].xyzw; + r2.xyzw = cb0[51].xyzw * cb0[46].xyzw; + r3.xyzw = cb0[52].xyzw * cb0[47].xyzw; + r4.xyzw = cb0[53].xyzw * cb0[48].xyzw; + r5.xyzw = cb0[54].xyzw + cb0[49].xyzw; + r1.xyz = r1.xyz * r1.www; + r0.xyz = r0.xyz + -r0.www; + r1.xyz = r1.xyz * r0.xyz + r0.www; + r1.xyz = max(float3(0,0,0), r1.xyz); + r1.xyz = float3(5.55555534,5.55555534,5.55555534) * r1.xyz; + r2.xyz = r2.xyz * r2.www; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = float3(0.180000007,0.180000007,0.180000007) * r1.xyz; + r2.xyz = r3.xyz * r3.www; + r2.xyz = float3(1,1,1) / r2.xyz; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r2.xyz = r4.xyz * r4.www; + r3.xyz = r5.xyz + r5.www; + r1.xyz = r1.xyz * r2.xyz + r3.xyz; + r1.w = 1 / cb0[65].x; + r1.w = saturate(r1.w * r0.w); + r2.x = r1.w * -2 + 3; + r1.w = r1.w * r1.w; + r1.w = -r2.x * r1.w + 1; + r2.xyzw = cb0[60].xyzw * cb0[45].xyzw; + r3.xyzw = cb0[61].xyzw * cb0[46].xyzw; + r4.xyzw = cb0[62].xyzw * cb0[47].xyzw; + r5.xyzw = cb0[63].xyzw * cb0[48].xyzw; + r6.xyzw = cb0[64].xyzw + cb0[49].xyzw; + r2.xyz = r2.xyz * r2.www; + r2.xyz = r2.xyz * r0.xyz + r0.www; + r2.xyz = max(float3(0,0,0), r2.xyz); + r2.xyz = float3(5.55555534,5.55555534,5.55555534) * r2.xyz; + r3.xyz = r3.xyz * r3.www; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = float3(0.180000007,0.180000007,0.180000007) * r2.xyz; + r3.xyz = r4.xyz * r4.www; + r3.xyz = float3(1,1,1) / r3.xyz; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r3.xyz = r5.xyz * r5.www; + r4.xyz = r6.xyz + r6.www; + r2.xyz = r2.xyz * r3.xyz + r4.xyz; + r2.w = 1 + -cb0[65].y; + r3.x = -cb0[65].y + r0.w; + r2.w = 1 / r2.w; + r2.w = saturate(r3.x * r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r3.y = r3.x * r2.w; + r4.xyzw = cb0[55].xyzw * cb0[45].xyzw; + r5.xyzw = cb0[56].xyzw * cb0[46].xyzw; + r6.xyzw = cb0[57].xyzw * cb0[47].xyzw; + r7.xyzw = cb0[58].xyzw * cb0[48].xyzw; + r8.xyzw = cb0[59].xyzw + cb0[49].xyzw; + r4.xyz = r4.xyz * r4.www; + r0.xyz = r4.xyz * r0.xyz + r0.www; + r0.xyz = max(float3(0,0,0), r0.xyz); + r0.xyz = float3(5.55555534,5.55555534,5.55555534) * r0.xyz; + r4.xyz = r5.xyz * r5.www; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r0.xyz = float3(0.180000007,0.180000007,0.180000007) * r0.xyz; + r4.xyz = r6.xyz * r6.www; + r4.xyz = float3(1,1,1) / r4.xyz; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r4.xyz = r7.xyz * r7.www; + r5.xyz = r8.xyz + r8.www; + r0.xyz = r0.xyz * r4.xyz + r5.xyz; + r0.w = 1 + -r1.w; + r0.w = -r3.x * r2.w + r0.w; + r0.xyz = r0.xyz * r0.www; + r0.xyz = r1.xyz * r1.www + r0.xyz; + r0.xyz = r2.xyz * r3.yyy + r0.xyz; + + float3 untonemapped_ap1 = r0.xyz; + + r1.x = dot(float3(1.70505154,-0.621790707,-0.0832583979), r0.xyz); + r1.y = dot(float3(-0.130257145,1.14080286,-0.0105485283), r0.xyz); + r1.z = dot(float3(-0.0240032747,-0.128968775,1.15297174), r0.xyz); + if (cb0[44].x != 0) { + r2.x = dot(r1.xyz, cb0[28].xyz); + r2.y = dot(r1.xyz, cb0[29].xyz); + r2.z = dot(r1.xyz, cb0[30].xyz); + r0.w = dot(r1.xyz, cb0[33].xyz); + r0.w = 1 + r0.w; + r0.w = rcp(r0.w); + r3.xyz = cb0[35].xyz * r0.www + cb0[34].xyz; + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = max(float3(0,0,0), r2.xyz); + r3.xyz = cb0[31].xxx + -r2.xyz; + r3.xyz = max(float3(0,0,0), r3.xyz); + r4.xyz = max(cb0[31].zzz, r2.xyz); + r2.xyz = max(cb0[31].xxx, r2.xyz); + r2.xyz = min(cb0[31].zzz, r2.xyz); + r5.xyz = r4.xyz * cb0[32].xxx + cb0[32].yyy; + r4.xyz = cb0[31].www + r4.xyz; + r4.xyz = rcp(r4.xyz); + r6.xyz = cb0[28].www * r3.xyz; + r3.xyz = cb0[31].yyy + r3.xyz; + r3.xyz = rcp(r3.xyz); + r3.xyz = r6.xyz * r3.xyz + cb0[29].www; + r2.xyz = r2.xyz * cb0[30].www + r3.xyz; + r2.xyz = r5.xyz * r4.xyz + r2.xyz; + r2.xyz = float3(-0.00200000009,-0.00200000009,-0.00200000009) + r2.xyz; + } else { + r3.x = dot(float3(0.938639402,1.02359565e-10,0.0613606237), r0.xyz); + r3.y = dot(float3(8.36008554e-11,0.830794156,0.169205874), r0.xyz); + r3.z = dot(float3(2.13187367e-12,-5.63307213e-12,1), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.y = dot(float3(0.695452213,0.140678704,0.163869068), r0.xyz); + r3.z = dot(float3(0.0447945632,0.859671116,0.0955343172), r0.xyz); + r3.w = dot(float3(-0.00552588236,0.00402521016,1.00150073), r0.xyz); + r0.w = min(r3.y, r3.z); + r0.w = min(r0.w, r3.w); + r1.w = max(r3.y, r3.z); + r1.w = max(r1.w, r3.w); + r4.xy = max(float2(1.00000001e-10,0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r4.x + -r0.w; + r0.w = r0.w / r4.y; + r4.xyz = r3.wzy + -r3.zyw; + r4.xy = r4.xy * r3.wz; + r1.w = r4.x + r4.y; + r1.w = r3.y * r4.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r3.w + r3.z; + r2.w = r2.w + r3.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.x = -0.400000006 + r0.w; + r4.x = 2.5 * r3.x; + r4.x = 1 + -abs(r4.x); + r4.x = max(0, r4.x); + r4.y = cmp(0 < r3.x); + r3.x = cmp(r3.x < 0); + r3.x = (int)-r4.y + (int)r3.x; + r3.x = (int)r3.x; + r4.x = -r4.x * r4.x + 1; + r3.x = r3.x * r4.x + 1; + r3.x = 0.0250000004 * r3.x; + r4.x = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.x * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.x ? r3.x : r1.w; + r1.w = 1 + r1.w; + r4.yzw = r3.yzw * r1.www; + r5.xy = cmp(r4.zw == r4.yz); + r2.w = r5.y ? r5.x : 0; + r3.x = r3.z * r1.w + -r4.w; + r3.x = 1.73205078 * r3.x; + r3.z = r4.y * 2 + -r4.z; + r3.z = -r3.w * r1.w + r3.z; + r3.w = min(abs(r3.x), abs(r3.z)); + r5.x = max(abs(r3.x), abs(r3.z)); + r5.x = 1 / r5.x; + r3.w = r5.x * r3.w; + r5.x = r3.w * r3.w; + r5.y = r5.x * 0.0208350997 + -0.0851330012; + r5.y = r5.x * r5.y + 0.180141002; + r5.y = r5.x * r5.y + -0.330299497; + r5.x = r5.x * r5.y + 0.999866009; + r5.y = r5.x * r3.w; + r5.z = cmp(abs(r3.z) < abs(r3.x)); + r5.y = r5.y * -2 + 1.57079637; + r5.y = r5.z ? r5.y : 0; + r3.w = r3.w * r5.x + r5.y; + r5.x = cmp(r3.z < -r3.z); + r5.x = r5.x ? -3.141593 : 0; + r3.w = r5.x + r3.w; + r5.x = min(r3.x, r3.z); + r3.x = max(r3.x, r3.z); + r3.z = cmp(r5.x < -r5.x); + r3.x = cmp(r3.x >= -r3.x); + r3.x = r3.x ? r3.z : 0; + r3.x = r3.x ? -r3.w : r3.w; + r3.x = 57.2957802 * r3.x; + r2.w = r2.w ? 0 : r3.x; + r3.x = cmp(r2.w < 0); + r3.z = 360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.x = cmp(180 < r2.w); + r3.z = -360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = 0.0148148146 * r2.w; + r2.w = 1 + -abs(r2.w); + r2.w = max(0, r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r2.w = r3.x * r2.w; + r2.w = r2.w * r2.w; + r0.w = r2.w * r0.w; + r1.w = -r3.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r4.x = r0.w * 0.180000007 + r4.y; + r3.x = dot(float3(1.45143926,-0.236510754,-0.214928567), r4.xzw); + r3.y = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r4.xzw); + r3.z = dot(float3(0.00831614807,-0.00603244966,0.997716308), r4.xzw); + r3.xyz = max(float3(0,0,0), r3.xyz); + r0.w = dot(r3.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.959999979,0.959999979,0.959999979) + r0.www; + r4.xy = float2(1,0.180000007) + cb0[36].ww; + r0.w = -cb0[36].y + r4.x; + r1.w = 1 + cb0[37].x; + r2.w = -cb0[36].z + r1.w; + r3.w = cmp(0.800000012 < cb0[36].y); + r4.xz = float2(0.819999993,1) + -cb0[36].yy; + r4.xz = r4.xz / cb0[36].xx; + r4.y = r4.y / r0.w; + r4.xw = float2(-0.744727492,-1) + r4.xy; + r4.w = 1 + -r4.w; + r4.y = r4.y / r4.w; + r4.y = log2(r4.y); + r4.y = 0.346573591 * r4.y; + r4.w = r0.w / cb0[36].x; + r4.y = -r4.y * r4.w + -0.744727492; + r3.w = r3.w ? r4.x : r4.y; + r4.x = r4.z + -r3.w; + r4.y = cb0[36].z / cb0[36].x; + r4.y = r4.y + -r4.x; + r3.xyz = log2(r3.xyz); + r5.xyz = float3(0.30103001,0.30103001,0.30103001) * r3.xyz; + r4.xzw = r3.xyz * float3(0.30103001,0.30103001,0.30103001) + r4.xxx; + r4.xzw = cb0[36].xxx * r4.xzw; + r5.w = r0.w + r0.w; + r6.x = -2 * cb0[36].x; + r0.w = r6.x / r0.w; + r6.xyz = r3.xyz * float3(0.30103001,0.30103001,0.30103001) + -r3.www; + r7.xyz = r6.xyz * r0.www; + r7.xyz = float3(1.44269502,1.44269502,1.44269502) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = float3(1,1,1) + r7.xyz; + r7.xyz = r5.www / r7.xyz; + r7.xyz = -cb0[36].www + r7.xyz; + r0.w = r2.w + r2.w; + r5.w = cb0[36].x + cb0[36].x; + r2.w = r5.w / r2.w; + r3.xyz = r3.xyz * float3(0.30103001,0.30103001,0.30103001) + -r4.yyy; + r3.xyz = r3.xyz * r2.www; + r3.xyz = float3(1.44269502,1.44269502,1.44269502) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r3.xyz = float3(1,1,1) + r3.xyz; + r3.xyz = r0.www / r3.xyz; + r3.xyz = -r3.xyz + r1.www; + r8.xyz = cmp(r5.xyz < r3.www); + r7.xyz = r8.xyz ? r7.xyz : r4.xzw; + r5.xyz = cmp(r4.yyy < r5.xyz); + r3.xyz = r5.xyz ? r3.xyz : r4.xzw; + r0.w = r4.y + -r3.w; + r4.xzw = saturate(r6.xyz / r0.www); + r0.w = cmp(r4.y < r3.w); + r5.xyz = float3(1,1,1) + -r4.xzw; + r4.xyz = r0.www ? r5.xyz : r4.xzw; + r5.xyz = -r4.xyz * float3(2,2,2) + float3(3,3,3); + r4.xyz = r4.xyz * r4.xyz; + r4.xyz = r4.xyz * r5.xyz; + r3.xyz = r3.xyz + -r7.xyz; + r3.xyz = r4.xyz * r3.xyz + r7.xyz; + r0.w = dot(r3.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.930000007,0.930000007,0.930000007) + r0.www; + r3.xyz = max(float3(0,0,0), r3.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].zzz * r3.xyz + r0.xyz; + r3.x = dot(float3(1.06537485,1.44678506e-06,-0.0653710067), r0.xyz); + r3.y = dot(float3(-3.45525592e-07,1.20366347,-0.203667715), r0.xyz); + r3.z = dot(float3(1.9865448e-08,2.12079581e-08,0.999999583), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.x = dot(float3(1.70505154,-0.621790707,-0.0832583979), r0.xyz); + r3.y = dot(float3(-0.130257145,1.14080286,-0.0105485283), r0.xyz); + r3.z = dot(float3(-0.0240032747,-0.128968775,1.15297174), r0.xyz); + r2.xyz = max(float3(0,0,0), r3.xyz); + } + r2.xyz = saturate(r2.xyz); + r0.xyz = float3(12.9200001,12.9200001,12.9200001) * r2.xyz; + r3.xyz = cmp(r2.xyz >= float3(0.00313066994,0.00313066994,0.00313066994)); + r2.xyz = log2(r2.xyz); + r2.xyz = float3(0.416666657,0.416666657,0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995,1.05499995,1.05499995) + float3(-0.0549999997,-0.0549999997,-0.0549999997); + r0.xyz = r3.xyz ? r2.xyz : r0.xyz; + r2.yzw = r0.xyz * float3(0.9375,0.9375,0.9375) + float3(0.03125,0.03125,0.03125); + r0.w = r2.w * 16 + -0.5; + r1.w = floor(r0.w); + r0.w = -r1.w + r0.w; + r1.w = r2.y + r1.w; + r2.x = 0.0625 * r1.w; + r3.xyz = t0.Sample(s0_s, r2.xz).xyz; + r2.yw = float2(0.0625,0) + r2.xz; + r4.xyz = t0.Sample(s0_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r3.xyz = cb0[39].xxx * r3.xyz; + r0.xyz = cb0[38].xxx * r0.xyz + r3.xyz; + r3.xyz = t1.Sample(s1_s, r2.xz).xyz; + r4.xyz = t1.Sample(s1_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r0.xyz = cb0[40].xxx * r3.xyz + r0.xyz; + r3.xyz = t2.Sample(s2_s, r2.xz).xyz; + r2.xyz = t2.Sample(s2_s, r2.yw).xyz; + r2.xyz = r2.xyz + -r3.xyz; + r2.xyz = r0.www * r2.xyz + r3.xyz; + r0.xyz = cb0[41].xxx * r2.xyz + r0.xyz; + r0.xyz = max(float3(6.10351999e-05,6.10351999e-05,6.10351999e-05), r0.xyz); + r2.xyz = cmp(float3(0.0404499993,0.0404499993,0.0404499993) < r0.xyz); + r3.xyz = r0.xyz * float3(0.947867274,0.947867274,0.947867274) + float3(0.0521326996,0.0521326996,0.0521326996); + r3.xyz = log2(r3.xyz); + r3.xyz = float3(2.4000001,2.4000001,2.4000001) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = float3(0.0773993805,0.0773993805,0.0773993805) * r0.xyz; + r0.xyz = r2.xyz ? r3.xyz : r0.xyz; + r2.xyz = r0.xyz * r0.xyz; + r0.xyz = cb0[26].yyy * r0.xyz; + r0.xyz = cb0[26].xxx * r2.xyz + r0.xyz; + r0.xyz = cb0[26].zzz + r0.xyz; + r2.xyz = cb0[42].yzw * r0.xyz; + r0.xyz = -r0.xyz * cb0[42].yzw + cb0[43].xyz; + r0.xyz = cb0[43].www * r0.xyz + r2.xyz; + r2.xyz = max(float3(0,0,0), r0.xyz); + r2.xyz = log2(r2.xyz); + r2.xyz = cb0[27].yyy * r2.xyz; + r3.xyz = exp2(r2.xyz); + + if (injectedData.toneMapType != 0) { + o0 = LutBuilderToneMap(untonemapped_ap1, r3.xyz); + return; + } + + if (cb0[65].z == 0) { + r4.xyz = float3(12.9200001,12.9200001,12.9200001) * r3.xyz; + r5.xyz = cmp(r3.xyz >= float3(0.00313066994,0.00313066994,0.00313066994)); + r2.xyz = float3(0.416666657,0.416666657,0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995,1.05499995,1.05499995) + float3(-0.0549999997,-0.0549999997,-0.0549999997); + r2.xyz = r5.xyz ? r2.xyz : r4.xyz; + } else { + r4.xyzw = cmp(asint(cb0[65].wwww) == int4(1,2,3,4)); + r5.xyz = r4.www ? float3(1,0,0) : float3(1.70505154,-0.621790707,-0.0832583979); + r6.xyz = r4.www ? float3(0,1,0) : float3(-0.130257145,1.14080286,-0.0105485283); + r7.xyz = r4.www ? float3(0,0,1) : float3(-0.0240032747,-0.128968775,1.15297174); + r5.xyz = r4.zzz ? float3(0.695452213,0.140678704,0.163869068) : r5.xyz; + r6.xyz = r4.zzz ? float3(0.0447945632,0.859671116,0.0955343172) : r6.xyz; + r7.xyz = r4.zzz ? float3(-0.00552588282,0.00402521016,1.00150073) : r7.xyz; + r5.xyz = r4.yyy ? float3(1.02579927,-0.0200525094,-0.00577136781) : r5.xyz; + r6.xyz = r4.yyy ? float3(-0.00223502493,1.00458264,-0.00235231337) : r6.xyz; + r4.yzw = r4.yyy ? float3(-0.00501400325,-0.0252933875,1.03044021) : r7.xyz; + r5.xyz = r4.xxx ? float3(1.37915885,-0.308850735,-0.0703467429) : r5.xyz; + r6.xyz = r4.xxx ? float3(-0.0693352968,1.08229232,-0.0129620517) : r6.xyz; + r4.xyz = r4.xxx ? float3(-0.00215925858,-0.0454653986,1.04775953) : r4.yzw; + r0.w = cmp(asint(cb0[65].z) == 1); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485,0.33951208,0.0473663323), r3.xyz); + r7.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r3.xyz); + r7.z = dot(float3(0.0206188709,0.109567292,0.869606733), r3.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = max(float3(6.10351999e-05,6.10351999e-05,6.10351999e-05), r8.xyz); + r8.xyz = float3(4.5,4.5,4.5) * r7.xyz; + r7.xyz = max(float3(0.0179999992,0.0179999992,0.0179999992), r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.449999988,0.449999988,0.449999988) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = r7.xyz * float3(1.09899998,1.09899998,1.09899998) + float3(-0.0989999995,-0.0989999995,-0.0989999995); + r2.xyz = min(r8.xyz, r7.xyz); + } else { + r7.xyz = cb0[42].yzw * r1.xyz; + r1.xyz = -r1.xyz * cb0[42].yzw + cb0[43].xyz; + r1.xyz = cb0[43].www * r1.xyz + r7.xyz; + r7.xy = cmp(asint(cb0[65].zz) == int2(3,5)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5,1.5,1.5) * r1.xyz; + r8.y = dot(float3(0.439700812,0.382978052,0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037,0.813423157,0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864,0.111544058,0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10,0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672,-0.5,0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5,0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5,0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3,2,1)); + r8.xz = float2(0.166666672,0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0,0,0), r7.xzw); + r7.xyz = min(float3(65535,65535,65535), r7.xyz); + r8.x = dot(float3(1.45143926,-0.236510754,-0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807,-0.00603244966,0.997716308), r7.xyz); + r7.xyz = max(float3(0,0,0), r8.xyz); + r7.xyz = min(float3(65535,65535,65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979,0.959999979,0.959999979) + r0.www; + r8.xyz = cmp(float3(0,0,0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14,-14,-14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323,-17.4739323,-17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1,2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w+0].x; + r10.y = icb[r8.x+0].x; + r10.z = icb[r8.w+0].x; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1,2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w+0].y; + r10.y = icb[r7.x+0].y; + r10.z = icb[r7.w+0].y; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1,2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w+0].x; + r11.y = icb[r7.x+0].x; + r11.z = icb[r7.w+0].x; + r12.x = dot(r11.xzy, float3(0.5,0.5,-1)); + r12.y = dot(r11.xy, float2(-1,1)); + r12.z = dot(r11.xy, float2(0.5,0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1,2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w+0].y; + r11.y = icb[r7.x+0].y; + r11.z = icb[r7.y+0].y; + r12.x = dot(r11.xzy, float3(0.5,0.5,-1)); + r12.y = dot(r11.xy, float2(-1,1)); + r12.z = dot(r11.xy, float2(0.5,0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w+0].x; + r10.y = icb[r7.x+0].x; + r10.z = icb[r7.y+0].x; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1,2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w+0].y; + r10.y = icb[r8.x+0].y; + r10.z = icb[r8.y+0].y; + r8.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r10.xy, float2(-1,1)); + r8.z = dot(r10.xy, float2(0.5,0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213,0.140678704,0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632,0.859671116,0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282,0.00402521016,1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926,-0.236510754,-0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807,-0.00603244966,0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = r0.w * 0.90309 + 7.54498291; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1,2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w+0].z; + r9.y = icb[r8.x+0].z; + r9.z = icb[r8.y+0].z; + r8.x = dot(r9.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r9.xy, float2(-1,1)); + r8.z = dot(r9.xy, float2(0.5,0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.1373367); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.3549509 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.3549509 + -r5.w; + r8.xy = (int2)r6.ww + int2(1,2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w+0].w; + r9.y = icb[r8.x+0].w; + r9.z = icb[r8.y+0].w; + r8.x = dot(r9.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r9.xy, float2(-1,1)); + r8.z = dot(r9.xy, float2(0.5,0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w+0].z; + r10.y = icb[r9.x+0].z; + r10.z = icb[r9.y+0].z; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.1373367); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.3549509 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.3549509 + -r4.w; + r9.xy = (int2)r5.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w+0].w; + r10.y = icb[r9.x+0].w; + r10.z = icb[r9.y+0].w; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w+0].z; + r10.y = icb[r9.x+0].z; + r10.z = icb[r9.y+0].z; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.1373367); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.3549509 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.3549509 + -r3.w; + r9.xy = (int2)r4.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w+0].w; + r10.y = icb[r9.x+0].w; + r10.z = icb[r9.y+0].w; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r7.xyz = float3(-3.50738446e-05,-3.50738446e-05,-3.50738446e-05) + r7.xyz; + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05,9.99999975e-05,9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758,0.159301758,0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625,18.8515625,18.8515625) + float3(0.8359375,0.8359375,0.8359375); + r7.xyz = r7.xyz * float3(18.6875,18.6875,18.6875) + float3(1,1,1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375,78.84375,78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(4,6)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5,1.5,1.5) * r1.xyz; + r8.y = dot(float3(0.439700812,0.382978052,0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037,0.813423157,0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864,0.111544058,0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10,0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672,-0.5,0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5,0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5,0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3,2,1)); + r8.xz = float2(0.166666672,0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0,0,0), r7.xzw); + r7.xyz = min(float3(65535,65535,65535), r7.xyz); + r8.x = dot(float3(1.45143926,-0.236510754,-0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807,-0.00603244966,0.997716308), r7.xyz); + r7.xyz = max(float3(0,0,0), r8.xyz); + r7.xyz = min(float3(65535,65535,65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718,0.674081743,0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979,0.959999979,0.959999979) + r0.www; + r8.xyz = cmp(float3(0,0,0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14,-14,-14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323,-17.4739323,-17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1,2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w+0].x; + r10.y = icb[r8.x+0].x; + r10.z = icb[r8.w+0].x; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1,2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w+0].y; + r10.y = icb[r7.x+0].y; + r10.z = icb[r7.w+0].y; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1,2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w+0].x; + r11.y = icb[r7.x+0].x; + r11.z = icb[r7.w+0].x; + r12.x = dot(r11.xzy, float3(0.5,0.5,-1)); + r12.y = dot(r11.xy, float2(-1,1)); + r12.z = dot(r11.xy, float2(0.5,0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1,2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w+0].y; + r11.y = icb[r7.x+0].y; + r11.z = icb[r7.y+0].y; + r12.x = dot(r11.xzy, float3(0.5,0.5,-1)); + r12.y = dot(r11.xy, float2(-1,1)); + r12.z = dot(r11.xy, float2(0.5,0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w+0].x; + r10.y = icb[r7.x+0].x; + r10.z = icb[r7.y+0].x; + r11.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r11.y = dot(r10.xy, float2(-1,1)); + r11.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1,2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w+0].y; + r10.y = icb[r8.x+0].y; + r10.z = icb[r8.y+0].y; + r8.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r10.xy, float2(-1,1)); + r8.z = dot(r10.xy, float2(0.5,0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213,0.140678704,0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632,0.859671116,0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282,0.00402521016,1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926,-0.236510754,-0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769,1.17622972,-0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807,-0.00603244966,0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = -2.30102992; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1,2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w+6].x; + r9.y = icb[r8.x+6].x; + r9.z = icb[r8.y+6].x; + r8.x = dot(r9.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r9.xy, float2(-1,1)); + r8.z = dot(r9.xy, float2(0.5,0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.4948215); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.27267218 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.27267218 + -r5.w; + r8.xy = (int2)r6.ww + int2(1,2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w+6].y; + r9.y = icb[r8.x+6].y; + r9.z = icb[r8.y+6].y; + r8.x = dot(r9.xzy, float3(0.5,0.5,-1)); + r8.y = dot(r9.xy, float2(-1,1)); + r8.z = dot(r9.xy, float2(0.5,0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w+6].x; + r10.y = icb[r9.x+6].x; + r10.z = icb[r9.y+6].x; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.4948215); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.27267218 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.27267218 + -r4.w; + r9.xy = (int2)r5.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w+6].y; + r10.y = icb[r9.x+6].y; + r10.z = icb[r9.y+6].y; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w+6].x; + r10.y = icb[r9.x+6].x; + r10.z = icb[r9.y+6].x; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.4948215); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.27267218 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.27267218 + -r3.w; + r9.xy = (int2)r4.ww + int2(1,2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w+6].y; + r10.y = icb[r9.x+6].y; + r10.z = icb[r9.y+6].y; + r9.x = dot(r10.xzy, float3(0.5,0.5,-1)); + r9.y = dot(r10.xy, float2(-1,1)); + r9.z = dot(r10.xy, float2(0.5,0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05,9.99999975e-05,9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758,0.159301758,0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625,18.8515625,18.8515625) + float3(0.8359375,0.8359375,0.8359375); + r7.xyz = r7.xyz * float3(18.6875,18.6875,18.6875) + float3(1,1,1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375,78.84375,78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r0.w = cmp(asint(cb0[65].z) == 7); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485,0.33951208,0.0473663323), r1.xyz); + r7.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r1.xyz); + r7.z = dot(float3(0.0206188709,0.109567292,0.869606733), r1.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05,9.99999975e-05,9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758,0.159301758,0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625,18.8515625,18.8515625) + float3(0.8359375,0.8359375,0.8359375); + r7.xyz = r7.xyz * float3(18.6875,18.6875,18.6875) + float3(1,1,1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375,78.84375,78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(8,9)); + r8.x = dot(float3(0.613191485,0.33951208,0.0473663323), r0.xyz); + r8.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r0.xyz); + r8.z = dot(float3(0.0206188709,0.109567292,0.869606733), r0.xyz); + r0.x = dot(r5.xyz, r8.xyz); + r0.y = dot(r6.xyz, r8.xyz); + r0.z = dot(r4.xyz, r8.xyz); + r8.x = dot(float3(0.613191485,0.33951208,0.0473663323), r3.xyz); + r8.y = dot(float3(0.0702069029,0.916335821,0.0134500116), r3.xyz); + r8.z = dot(float3(0.0206188709,0.109567292,0.869606733), r3.xyz); + r0.w = dot(r5.xyz, r8.xyz); + r1.w = dot(r6.xyz, r8.xyz); + r2.w = dot(r4.xyz, r8.xyz); + r3.x = log2(r0.w); + r3.y = log2(r1.w); + r3.z = log2(r2.w); + r3.xyz = cb0[27].zzz * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = r7.yyy ? r0.xyz : r3.xyz; + r2.xyz = r7.xxx ? r1.xyz : r0.xyz; + } + } + } + } + } + o0.xyz = float3(0.952381015,0.952381015,0.952381015) * r2.xyz; + o0.w = 0; + return; +} \ No newline at end of file diff --git a/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x97BAC8AF.ps_5_0.hlsl b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x97BAC8AF.ps_5_0.hlsl new file mode 100644 index 00000000..61caa14d --- /dev/null +++ b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x97BAC8AF.ps_5_0.hlsl @@ -0,0 +1,1525 @@ +#include "../../common.hlsl" + +// ---- Created with 3Dmigoto v1.3.16 on Wed Jan 1 15:35:38 2025 +Texture2D t1 : register(t1); + +Texture2D t0 : register(t0); + +SamplerState s1_s : register(s1); + +SamplerState s0_s : register(s0); + +cbuffer cb0 : register(b0) { + float4 cb0[67]; +} + +// 3Dmigoto declarations +#define cmp - + +void main( + linear noperspective float2 v0: TEXCOORD0, + float4 v1: SV_POSITION0, + uint v2: SV_RenderTargetArrayIndex0, + out float4 o0: SV_Target0) { + const float4 icb[] = { { -4.000000, -0.718548, -4.970622, 0.808913 }, + { -4.000000, 2.081031, -3.029378, 1.191087 }, + { -3.157377, 3.668124, -2.126200, 1.568300 }, + { -0.485250, 4.000000, -1.510500, 1.948300 }, + { 1.847732, 4.000000, -1.057800, 2.308300 }, + { 1.847732, 4.000000, -0.466800, 2.638400 }, + { -2.301030, 0.801995, 0.119380, 2.859500 }, + { -2.301030, 1.198005, 0.708813, 2.987261 }, + { -1.931200, 1.594300, 1.291187, 3.012739 }, + { -1.520500, 1.997300, 1.291187, 3.012739 }, + { -1.057800, 2.378300, 0, 0 }, + { -0.466800, 2.768400, 0, 0 }, + { 0.119380, 3.051500, 0, 0 }, + { 0.708813, 3.274629, 0, 0 }, + { 1.291187, 3.327431, 0, 0 }, + { 1.291187, 3.327431, 0, 0 } }; + float4 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12; + uint4 bitmask, uiDest; + float4 fDest; + + r0.xy = float2(-0.015625, -0.015625) + v0.xy; + r0.xy = float2(1.03225803, 1.03225803) * r0.xy; + r0.z = (uint)v2.x; + r1.z = 0.0322580636 * r0.z; + r0.z = cmp(asuint(cb0[65].z) >= 3); + r2.xy = log2(r0.xy); + r2.z = log2(r1.z); + r0.xyw = float3(0.0126833133, 0.0126833133, 0.0126833133) * r2.xyz; + r0.xyw = exp2(r0.xyw); + r2.xyz = float3(-0.8359375, -0.8359375, -0.8359375) + r0.xyw; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r0.xyw = -r0.xyw * float3(18.6875, 18.6875, 18.6875) + float3(18.8515625, 18.8515625, 18.8515625); + r0.xyw = r2.xyz / r0.xyw; + r0.xyw = log2(r0.xyw); + r0.xyw = float3(6.27739477, 6.27739477, 6.27739477) * r0.xyw; + r0.xyw = exp2(r0.xyw); + r0.xyw = float3(100, 100, 100) * r0.xyw; + r1.xy = v0.xy * float2(1.03225803, 1.03225803) + float2(-0.0161290318, -0.0161290318); + r1.xyz = float3(-0.434017599, -0.434017599, -0.434017599) + r1.xyz; + r1.xyz = float3(14, 14, 14) * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = r1.xyz * float3(0.180000007, 0.180000007, 0.180000007) + float3(-0.00266771927, -0.00266771927, -0.00266771927); + r0.xyz = r0.zzz ? r0.xyw : r1.xyz; + r0.w = 1.00055635 * cb0[44].y; + r1.x = cmp(6996.10791 >= cb0[44].y); + r1.yz = float2(4.60700006e+09, 2.0064e+09) / r0.ww; + r1.yz = float2(2967800, 1901800) + -r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(99.1100006, 247.479996) + r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(0.244063005, 0.237039998) + r1.yz; + r1.x = r1.x ? r1.y : r1.z; + r0.w = r1.x * r1.x; + r1.z = 2.86999989 * r1.x; + r0.w = r0.w * -3 + r1.z; + r1.y = -0.275000006 + r0.w; + r2.xyz = cb0[44].yyy * float3(0.000154118257, 0.00084242021, 4.22806261e-05) + float3(0.860117733, 1, 0.317398727); + r0.w = cb0[44].y * cb0[44].y; + r2.xyz = r0.www * float3(1.28641219e-07, 7.08145137e-07, 4.20481676e-08) + r2.xyz; + r2.x = r2.x / r2.y; + r1.z = -cb0[44].y * 2.8974182e-05 + 1; + r0.w = r0.w * 1.61456057e-07 + r1.z; + r2.y = r2.z / r0.w; + r1.zw = r2.xy + r2.xy; + r0.w = 3 * r2.x; + r1.z = -r2.y * 8 + r1.z; + r1.z = 4 + r1.z; + r3.x = r0.w / r1.z; + r3.y = r1.w / r1.z; + r0.w = cmp(cb0[44].y < 4000); + r1.xy = r0.ww ? r3.xy : r1.xy; + r0.w = dot(r2.xy, r2.xy); + r0.w = rsqrt(r0.w); + r1.zw = r2.xy * r0.ww; + r0.w = cb0[44].z * -r1.w; + r0.w = r0.w * 0.0500000007 + r2.x; + r1.z = cb0[44].z * r1.z; + r1.z = r1.z * 0.0500000007 + r2.y; + r1.w = 3 * r0.w; + r0.w = r0.w + r0.w; + r0.w = -r1.z * 8 + r0.w; + r0.w = 4 + r0.w; + r1.z = r1.z + r1.z; + r2.xy = r1.wz / r0.ww; + r1.zw = r2.xy + -r3.xy; + r1.xy = r1.xy + r1.zw; + r0.w = max(1.00000001e-10, r1.y); + r2.x = r1.x / r0.w; + r1.x = 1 + -r1.x; + r1.x = r1.x + -r1.y; + r2.z = r1.x / r0.w; + r2.y = 1; + r0.w = dot(float3(0.895099998, 0.266400009, -0.161400005), r2.xyz); + r1.x = dot(float3(-0.750199974, 1.71350002, 0.0366999991), r2.xyz); + r1.y = dot(float3(0.0388999991, -0.0684999973, 1.02960002), r2.xyz); + r0.w = 0.941379249 / r0.w; + r1.xy = float2(1.04043639, 1.0897665) / r1.xy; + r2.xyz = float3(0.895099998, 0.266400009, -0.161400005) * r0.www; + r1.xzw = float3(-0.750199974, 1.71350002, 0.0366999991) * r1.xxx; + r3.xyz = float3(0.0388999991, -0.0684999973, 1.02960002) * r1.yyy; + r4.x = r2.x; + r4.y = r1.x; + r4.z = r3.x; + r5.x = dot(float3(0.986992896, -0.1470543, 0.159962699), r4.xyz); + r6.x = r2.y; + r6.y = r1.z; + r6.z = r3.y; + r5.y = dot(float3(0.986992896, -0.1470543, 0.159962699), r6.xyz); + r3.x = r2.z; + r3.y = r1.w; + r5.z = dot(float3(0.986992896, -0.1470543, 0.159962699), r3.xyz); + r1.x = dot(float3(0.432305306, 0.518360317, 0.0492912009), r4.xyz); + r1.y = dot(float3(0.432305306, 0.518360317, 0.0492912009), r6.xyz); + r1.z = dot(float3(0.432305306, 0.518360317, 0.0492912009), r3.xyz); + r2.x = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r4.xyz); + r2.y = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r6.xyz); + r2.z = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r3.xyz); + r3.x = dot(r5.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.x = dot(r5.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.x = dot(r5.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r3.y = dot(r1.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.y = dot(r1.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.y = dot(r1.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r3.z = dot(r2.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.z = dot(r2.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.z = dot(r2.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r1.x = dot(float3(3.2409699, -1.5373832, -0.498610765), r3.xyz); + r1.y = dot(float3(3.2409699, -1.5373832, -0.498610765), r4.xyz); + r1.z = dot(float3(3.2409699, -1.5373832, -0.498610765), r5.xyz); + r2.x = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r3.xyz); + r2.y = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r4.xyz); + r2.z = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r5.xyz); + r3.x = dot(float3(0.0556300804, -0.203976959, 1.05697155), r3.xyz); + r3.y = dot(float3(0.0556300804, -0.203976959, 1.05697155), r4.xyz); + r3.z = dot(float3(0.0556300804, -0.203976959, 1.05697155), r5.xyz); + r1.x = dot(r1.xyz, r0.xyz); + r1.y = dot(r2.xyz, r0.xyz); + r1.z = dot(r3.xyz, r0.xyz); + r0.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r1.xyz); + r0.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r1.xyz); + r0.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r1.xyz); + r0.w = dot(r0.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r1.xyz = r0.xyz / r0.www; + r1.xyz = float3(-1, -1, -1) + r1.xyz; + r1.x = dot(r1.xyz, r1.xyz); + r1.x = -4 * r1.x; + r1.x = exp2(r1.x); + r1.x = 1 + -r1.x; + r0.w = r0.w * r0.w; + r0.w = cb0[66].y * r0.w; + r0.w = -4 * r0.w; + r0.w = exp2(r0.w); + r0.w = 1 + -r0.w; + r0.w = r1.x * r0.w; + r1.x = dot(float3(1.37041271, -0.329291314, -0.0636827648), r0.xyz); + r1.y = dot(float3(-0.0834341869, 1.09709096, -0.0108615728), r0.xyz); + r1.z = dot(float3(-0.0257932581, -0.0986256376, 1.20369434), r0.xyz); + r1.xyz = r1.xyz + -r0.xyz; + r1.xyz = r0.www * r1.xyz + r0.xyz; + r0.xyz = cb0[44].xxx ? r0.xyz : r1.xyz; + r0.w = dot(r0.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r1.xyzw = cb0[50].xyzw * cb0[45].xyzw; + r2.xyzw = cb0[51].xyzw * cb0[46].xyzw; + r3.xyzw = cb0[52].xyzw * cb0[47].xyzw; + r4.xyzw = cb0[53].xyzw * cb0[48].xyzw; + r5.xyzw = cb0[54].xyzw + cb0[49].xyzw; + r1.xyz = r1.xyz * r1.www; + r0.xyz = r0.xyz + -r0.www; + r1.xyz = r1.xyz * r0.xyz + r0.www; + r1.xyz = max(float3(0, 0, 0), r1.xyz); + r1.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r1.xyz; + r2.xyz = r2.xyz * r2.www; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r1.xyz; + r2.xyz = r3.xyz * r3.www; + r2.xyz = float3(1, 1, 1) / r2.xyz; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r2.xyz = r4.xyz * r4.www; + r3.xyz = r5.xyz + r5.www; + r1.xyz = r1.xyz * r2.xyz + r3.xyz; + r1.w = 1 / cb0[65].x; + r1.w = saturate(r1.w * r0.w); + r2.x = r1.w * -2 + 3; + r1.w = r1.w * r1.w; + r1.w = -r2.x * r1.w + 1; + r2.xyzw = cb0[60].xyzw * cb0[45].xyzw; + r3.xyzw = cb0[61].xyzw * cb0[46].xyzw; + r4.xyzw = cb0[62].xyzw * cb0[47].xyzw; + r5.xyzw = cb0[63].xyzw * cb0[48].xyzw; + r6.xyzw = cb0[64].xyzw + cb0[49].xyzw; + r2.xyz = r2.xyz * r2.www; + r2.xyz = r2.xyz * r0.xyz + r0.www; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r2.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r2.xyz; + r3.xyz = r3.xyz * r3.www; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r2.xyz; + r3.xyz = r4.xyz * r4.www; + r3.xyz = float3(1, 1, 1) / r3.xyz; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r3.xyz = r5.xyz * r5.www; + r4.xyz = r6.xyz + r6.www; + r2.xyz = r2.xyz * r3.xyz + r4.xyz; + r2.w = 1 + -cb0[65].y; + r3.x = -cb0[65].y + r0.w; + r2.w = 1 / r2.w; + r2.w = saturate(r3.x * r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r3.y = r3.x * r2.w; + r4.xyzw = cb0[55].xyzw * cb0[45].xyzw; + r5.xyzw = cb0[56].xyzw * cb0[46].xyzw; + r6.xyzw = cb0[57].xyzw * cb0[47].xyzw; + r7.xyzw = cb0[58].xyzw * cb0[48].xyzw; + r8.xyzw = cb0[59].xyzw + cb0[49].xyzw; + r4.xyz = r4.xyz * r4.www; + r0.xyz = r4.xyz * r0.xyz + r0.www; + r0.xyz = max(float3(0, 0, 0), r0.xyz); + r0.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r0.xyz; + r4.xyz = r5.xyz * r5.www; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r0.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r0.xyz; + r4.xyz = r6.xyz * r6.www; + r4.xyz = float3(1, 1, 1) / r4.xyz; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r4.xyz = r7.xyz * r7.www; + r5.xyz = r8.xyz + r8.www; + r0.xyz = r0.xyz * r4.xyz + r5.xyz; + r0.w = 1 + -r1.w; + r0.w = -r3.x * r2.w + r0.w; + r0.xyz = r0.xyz * r0.www; + r0.xyz = r1.xyz * r1.www + r0.xyz; + r0.xyz = r2.xyz * r3.yyy + r0.xyz; + + float3 untonemapped_ap1 = r0.xyz; + + r1.x = dot(float3(1.70505154, -0.621790707, -0.0832583979), r0.xyz); + r1.y = dot(float3(-0.130257145, 1.14080286, -0.0105485283), r0.xyz); + r1.z = dot(float3(-0.0240032747, -0.128968775, 1.15297174), r0.xyz); + if (cb0[44].x != 0) { + r2.x = dot(r1.xyz, cb0[28].xyz); + r2.y = dot(r1.xyz, cb0[29].xyz); + r2.z = dot(r1.xyz, cb0[30].xyz); + r0.w = dot(r1.xyz, cb0[33].xyz); + r0.w = 1 + r0.w; + r0.w = rcp(r0.w); + r3.xyz = cb0[35].xyz * r0.www + cb0[34].xyz; + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r3.xyz = cb0[31].xxx + -r2.xyz; + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r4.xyz = max(cb0[31].zzz, r2.xyz); + r2.xyz = max(cb0[31].xxx, r2.xyz); + r2.xyz = min(cb0[31].zzz, r2.xyz); + r5.xyz = r4.xyz * cb0[32].xxx + cb0[32].yyy; + r4.xyz = cb0[31].www + r4.xyz; + r4.xyz = rcp(r4.xyz); + r6.xyz = cb0[28].www * r3.xyz; + r3.xyz = cb0[31].yyy + r3.xyz; + r3.xyz = rcp(r3.xyz); + r3.xyz = r6.xyz * r3.xyz + cb0[29].www; + r2.xyz = r2.xyz * cb0[30].www + r3.xyz; + r2.xyz = r5.xyz * r4.xyz + r2.xyz; + r2.xyz = float3(-0.00200000009, -0.00200000009, -0.00200000009) + r2.xyz; + } else { + r3.x = dot(float3(0.938639402, 1.02359565e-10, 0.0613606237), r0.xyz); + r3.y = dot(float3(8.36008554e-11, 0.830794156, 0.169205874), r0.xyz); + r3.z = dot(float3(2.13187367e-12, -5.63307213e-12, 1), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.y = dot(float3(0.695452213, 0.140678704, 0.163869068), r0.xyz); + r3.z = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r0.xyz); + r3.w = dot(float3(-0.00552588236, 0.00402521016, 1.00150073), r0.xyz); + r0.w = min(r3.y, r3.z); + r0.w = min(r0.w, r3.w); + r1.w = max(r3.y, r3.z); + r1.w = max(r1.w, r3.w); + r4.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r4.x + -r0.w; + r0.w = r0.w / r4.y; + r4.xyz = r3.wzy + -r3.zyw; + r4.xy = r4.xy * r3.wz; + r1.w = r4.x + r4.y; + r1.w = r3.y * r4.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r3.w + r3.z; + r2.w = r2.w + r3.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.x = -0.400000006 + r0.w; + r4.x = 2.5 * r3.x; + r4.x = 1 + -abs(r4.x); + r4.x = max(0, r4.x); + r4.y = cmp(0 < r3.x); + r3.x = cmp(r3.x < 0); + r3.x = (int)-r4.y + (int)r3.x; + r3.x = (int)r3.x; + r4.x = -r4.x * r4.x + 1; + r3.x = r3.x * r4.x + 1; + r3.x = 0.0250000004 * r3.x; + r4.x = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.x * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.x ? r3.x : r1.w; + r1.w = 1 + r1.w; + r4.yzw = r3.yzw * r1.www; + r5.xy = cmp(r4.zw == r4.yz); + r2.w = r5.y ? r5.x : 0; + r3.x = r3.z * r1.w + -r4.w; + r3.x = 1.73205078 * r3.x; + r3.z = r4.y * 2 + -r4.z; + r3.z = -r3.w * r1.w + r3.z; + r3.w = min(abs(r3.x), abs(r3.z)); + r5.x = max(abs(r3.x), abs(r3.z)); + r5.x = 1 / r5.x; + r3.w = r5.x * r3.w; + r5.x = r3.w * r3.w; + r5.y = r5.x * 0.0208350997 + -0.0851330012; + r5.y = r5.x * r5.y + 0.180141002; + r5.y = r5.x * r5.y + -0.330299497; + r5.x = r5.x * r5.y + 0.999866009; + r5.y = r5.x * r3.w; + r5.z = cmp(abs(r3.z) < abs(r3.x)); + r5.y = r5.y * -2 + 1.57079637; + r5.y = r5.z ? r5.y : 0; + r3.w = r3.w * r5.x + r5.y; + r5.x = cmp(r3.z < -r3.z); + r5.x = r5.x ? -3.141593 : 0; + r3.w = r5.x + r3.w; + r5.x = min(r3.x, r3.z); + r3.x = max(r3.x, r3.z); + r3.z = cmp(r5.x < -r5.x); + r3.x = cmp(r3.x >= -r3.x); + r3.x = r3.x ? r3.z : 0; + r3.x = r3.x ? -r3.w : r3.w; + r3.x = 57.2957802 * r3.x; + r2.w = r2.w ? 0 : r3.x; + r3.x = cmp(r2.w < 0); + r3.z = 360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.x = cmp(180 < r2.w); + r3.z = -360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = 0.0148148146 * r2.w; + r2.w = 1 + -abs(r2.w); + r2.w = max(0, r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r2.w = r3.x * r2.w; + r2.w = r2.w * r2.w; + r0.w = r2.w * r0.w; + r1.w = -r3.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r4.x = r0.w * 0.180000007 + r4.y; + r3.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r4.xzw); + r3.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r4.xzw); + r3.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r4.xzw); + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r0.w = dot(r3.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r4.xy = float2(1, 0.180000007) + cb0[36].ww; + r0.w = -cb0[36].y + r4.x; + r1.w = 1 + cb0[37].x; + r2.w = -cb0[36].z + r1.w; + r3.w = cmp(0.800000012 < cb0[36].y); + r4.xz = float2(0.819999993, 1) + -cb0[36].yy; + r4.xz = r4.xz / cb0[36].xx; + r4.y = r4.y / r0.w; + r4.xw = float2(-0.744727492, -1) + r4.xy; + r4.w = 1 + -r4.w; + r4.y = r4.y / r4.w; + r4.y = log2(r4.y); + r4.y = 0.346573591 * r4.y; + r4.w = r0.w / cb0[36].x; + r4.y = -r4.y * r4.w + -0.744727492; + r3.w = r3.w ? r4.x : r4.y; + r4.x = r4.z + -r3.w; + r4.y = cb0[36].z / cb0[36].x; + r4.y = r4.y + -r4.x; + r3.xyz = log2(r3.xyz); + r5.xyz = float3(0.30103001, 0.30103001, 0.30103001) * r3.xyz; + r4.xzw = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + r4.xxx; + r4.xzw = cb0[36].xxx * r4.xzw; + r5.w = r0.w + r0.w; + r6.x = -2 * cb0[36].x; + r0.w = r6.x / r0.w; + r6.xyz = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + -r3.www; + r7.xyz = r6.xyz * r0.www; + r7.xyz = float3(1.44269502, 1.44269502, 1.44269502) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = float3(1, 1, 1) + r7.xyz; + r7.xyz = r5.www / r7.xyz; + r7.xyz = -cb0[36].www + r7.xyz; + r0.w = r2.w + r2.w; + r5.w = cb0[36].x + cb0[36].x; + r2.w = r5.w / r2.w; + r3.xyz = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + -r4.yyy; + r3.xyz = r3.xyz * r2.www; + r3.xyz = float3(1.44269502, 1.44269502, 1.44269502) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r3.xyz = float3(1, 1, 1) + r3.xyz; + r3.xyz = r0.www / r3.xyz; + r3.xyz = -r3.xyz + r1.www; + r8.xyz = cmp(r5.xyz < r3.www); + r7.xyz = r8.xyz ? r7.xyz : r4.xzw; + r5.xyz = cmp(r4.yyy < r5.xyz); + r3.xyz = r5.xyz ? r3.xyz : r4.xzw; + r0.w = r4.y + -r3.w; + r4.xzw = saturate(r6.xyz / r0.www); + r0.w = cmp(r4.y < r3.w); + r5.xyz = float3(1, 1, 1) + -r4.xzw; + r4.xyz = r0.www ? r5.xyz : r4.xzw; + r5.xyz = -r4.xyz * float3(2, 2, 2) + float3(3, 3, 3); + r4.xyz = r4.xyz * r4.xyz; + r4.xyz = r4.xyz * r5.xyz; + r3.xyz = r3.xyz + -r7.xyz; + r3.xyz = r4.xyz * r3.xyz + r7.xyz; + r0.w = dot(r3.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.930000007, 0.930000007, 0.930000007) + r0.www; + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].zzz * r3.xyz + r0.xyz; + r3.x = dot(float3(1.06537485, 1.44678506e-06, -0.0653710067), r0.xyz); + r3.y = dot(float3(-3.45525592e-07, 1.20366347, -0.203667715), r0.xyz); + r3.z = dot(float3(1.9865448e-08, 2.12079581e-08, 0.999999583), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.x = dot(float3(1.70505154, -0.621790707, -0.0832583979), r0.xyz); + r3.y = dot(float3(-0.130257145, 1.14080286, -0.0105485283), r0.xyz); + r3.z = dot(float3(-0.0240032747, -0.128968775, 1.15297174), r0.xyz); + r2.xyz = max(float3(0, 0, 0), r3.xyz); + } + r2.xyz = saturate(r2.xyz); + r0.xyz = float3(12.9200001, 12.9200001, 12.9200001) * r2.xyz; + r3.xyz = cmp(r2.xyz >= float3(0.00313066994, 0.00313066994, 0.00313066994)); + r2.xyz = log2(r2.xyz); + r2.xyz = float3(0.416666657, 0.416666657, 0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995, 1.05499995, 1.05499995) + float3(-0.0549999997, -0.0549999997, -0.0549999997); + r0.xyz = r3.xyz ? r2.xyz : r0.xyz; + r2.yzw = r0.xyz * float3(0.9375, 0.9375, 0.9375) + float3(0.03125, 0.03125, 0.03125); + r0.w = r2.w * 16 + -0.5; + r1.w = floor(r0.w); + r0.w = -r1.w + r0.w; + r1.w = r2.y + r1.w; + r2.x = 0.0625 * r1.w; + r3.xyz = t0.Sample(s0_s, r2.xz).xyz; + r2.yw = float2(0.0625, 0) + r2.xz; + r4.xyz = t0.Sample(s0_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r3.xyz = cb0[39].xxx * r3.xyz; + r0.xyz = cb0[38].xxx * r0.xyz + r3.xyz; + r3.xyz = t1.Sample(s1_s, r2.xz).xyz; + r2.xyz = t1.Sample(s1_s, r2.yw).xyz; + r2.xyz = r2.xyz + -r3.xyz; + r2.xyz = r0.www * r2.xyz + r3.xyz; + r0.xyz = cb0[40].xxx * r2.xyz + r0.xyz; + r0.xyz = max(float3(6.10351999e-05, 6.10351999e-05, 6.10351999e-05), r0.xyz); + r2.xyz = cmp(float3(0.0404499993, 0.0404499993, 0.0404499993) < r0.xyz); + r3.xyz = r0.xyz * float3(0.947867274, 0.947867274, 0.947867274) + float3(0.0521326996, 0.0521326996, 0.0521326996); + r3.xyz = log2(r3.xyz); + r3.xyz = float3(2.4000001, 2.4000001, 2.4000001) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = float3(0.0773993805, 0.0773993805, 0.0773993805) * r0.xyz; + r0.xyz = r2.xyz ? r3.xyz : r0.xyz; + r2.xyz = r0.xyz * r0.xyz; + r0.xyz = cb0[26].yyy * r0.xyz; + r0.xyz = cb0[26].xxx * r2.xyz + r0.xyz; + r0.xyz = cb0[26].zzz + r0.xyz; + r2.xyz = cb0[42].yzw * r0.xyz; + r0.xyz = -r0.xyz * cb0[42].yzw + cb0[43].xyz; + r0.xyz = cb0[43].www * r0.xyz + r2.xyz; + r2.xyz = max(float3(0, 0, 0), r0.xyz); + r2.xyz = log2(r2.xyz); + r2.xyz = cb0[27].yyy * r2.xyz; + r3.xyz = exp2(r2.xyz); + + if (injectedData.toneMapType != 0) { + o0 = LutBuilderToneMap(untonemapped_ap1, r3.xyz); + return; + } + + if (cb0[65].z == 0) { + r4.xyz = float3(12.9200001, 12.9200001, 12.9200001) * r3.xyz; + r5.xyz = cmp(r3.xyz >= float3(0.00313066994, 0.00313066994, 0.00313066994)); + r2.xyz = float3(0.416666657, 0.416666657, 0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995, 1.05499995, 1.05499995) + float3(-0.0549999997, -0.0549999997, -0.0549999997); + r2.xyz = r5.xyz ? r2.xyz : r4.xyz; + } else { + r4.xyzw = cmp(asint(cb0[65].wwww) == int4(1, 2, 3, 4)); + r5.xyz = r4.www ? float3(1, 0, 0) : float3(1.70505154, -0.621790707, -0.0832583979); + r6.xyz = r4.www ? float3(0, 1, 0) : float3(-0.130257145, 1.14080286, -0.0105485283); + r7.xyz = r4.www ? float3(0, 0, 1) : float3(-0.0240032747, -0.128968775, 1.15297174); + r5.xyz = r4.zzz ? float3(0.695452213, 0.140678704, 0.163869068) : r5.xyz; + r6.xyz = r4.zzz ? float3(0.0447945632, 0.859671116, 0.0955343172) : r6.xyz; + r7.xyz = r4.zzz ? float3(-0.00552588282, 0.00402521016, 1.00150073) : r7.xyz; + r5.xyz = r4.yyy ? float3(1.02579927, -0.0200525094, -0.00577136781) : r5.xyz; + r6.xyz = r4.yyy ? float3(-0.00223502493, 1.00458264, -0.00235231337) : r6.xyz; + r4.yzw = r4.yyy ? float3(-0.00501400325, -0.0252933875, 1.03044021) : r7.xyz; + r5.xyz = r4.xxx ? float3(1.37915885, -0.308850735, -0.0703467429) : r5.xyz; + r6.xyz = r4.xxx ? float3(-0.0693352968, 1.08229232, -0.0129620517) : r6.xyz; + r4.xyz = r4.xxx ? float3(-0.00215925858, -0.0454653986, 1.04775953) : r4.yzw; + r0.w = cmp(asint(cb0[65].z) == 1); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r3.xyz); + r7.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r3.xyz); + r7.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r3.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = max(float3(6.10351999e-05, 6.10351999e-05, 6.10351999e-05), r8.xyz); + r8.xyz = float3(4.5, 4.5, 4.5) * r7.xyz; + r7.xyz = max(float3(0.0179999992, 0.0179999992, 0.0179999992), r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.449999988, 0.449999988, 0.449999988) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = r7.xyz * float3(1.09899998, 1.09899998, 1.09899998) + float3(-0.0989999995, -0.0989999995, -0.0989999995); + r2.xyz = min(r8.xyz, r7.xyz); + } else { + r7.xyz = cb0[42].yzw * r1.xyz; + r1.xyz = -r1.xyz * cb0[42].yzw + cb0[43].xyz; + r1.xyz = cb0[43].www * r1.xyz + r7.xyz; + r7.xy = cmp(asint(cb0[65].zz) == int2(3, 5)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5, 1.5, 1.5) * r1.xyz; + r8.y = dot(float3(0.439700812, 0.382978052, 0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037, 0.813423157, 0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864, 0.111544058, 0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672, -0.5, 0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5, 0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5, 0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3, 2, 1)); + r8.xz = float2(0.166666672, 0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0, 0, 0), r7.xzw); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r8.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r7.xyz = max(float3(0, 0, 0), r8.xyz); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r8.xyz = cmp(float3(0, 0, 0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14, -14, -14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323, -17.4739323, -17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r8.x + 0].x; + r10.z = icb[r8.w + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r7.x + 0].y; + r10.z = icb[r7.w + 0].y; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].x; + r11.y = icb[r7.x + 0].x; + r11.z = icb[r7.w + 0].x; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].y; + r11.y = icb[r7.x + 0].y; + r11.z = icb[r7.y + 0].y; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r7.x + 0].x; + r10.z = icb[r7.y + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r8.x + 0].y; + r10.z = icb[r8.y + 0].y; + r8.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r10.xy, float2(-1, 1)); + r8.z = dot(r10.xy, float2(0.5, 0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213, 0.140678704, 0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282, 0.00402521016, 1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = r0.w * 0.90309 + 7.54498291; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 0].z; + r9.y = icb[r8.x + 0].z; + r9.z = icb[r8.y + 0].z; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.1373367); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.3549509 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.3549509 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 0].w; + r9.y = icb[r8.x + 0].w; + r9.z = icb[r8.y + 0].w; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 0].z; + r10.y = icb[r9.x + 0].z; + r10.z = icb[r9.y + 0].z; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.1373367); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.3549509 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.3549509 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 0].w; + r10.y = icb[r9.x + 0].w; + r10.z = icb[r9.y + 0].w; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 0].z; + r10.y = icb[r9.x + 0].z; + r10.z = icb[r9.y + 0].z; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.1373367); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.3549509 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.3549509 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 0].w; + r10.y = icb[r9.x + 0].w; + r10.z = icb[r9.y + 0].w; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r7.xyz = float3(-3.50738446e-05, -3.50738446e-05, -3.50738446e-05) + r7.xyz; + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(4, 6)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5, 1.5, 1.5) * r1.xyz; + r8.y = dot(float3(0.439700812, 0.382978052, 0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037, 0.813423157, 0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864, 0.111544058, 0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672, -0.5, 0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5, 0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5, 0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3, 2, 1)); + r8.xz = float2(0.166666672, 0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0, 0, 0), r7.xzw); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r8.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r7.xyz = max(float3(0, 0, 0), r8.xyz); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r8.xyz = cmp(float3(0, 0, 0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14, -14, -14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323, -17.4739323, -17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r8.x + 0].x; + r10.z = icb[r8.w + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r7.x + 0].y; + r10.z = icb[r7.w + 0].y; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].x; + r11.y = icb[r7.x + 0].x; + r11.z = icb[r7.w + 0].x; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].y; + r11.y = icb[r7.x + 0].y; + r11.z = icb[r7.y + 0].y; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r7.x + 0].x; + r10.z = icb[r7.y + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r8.x + 0].y; + r10.z = icb[r8.y + 0].y; + r8.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r10.xy, float2(-1, 1)); + r8.z = dot(r10.xy, float2(0.5, 0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213, 0.140678704, 0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282, 0.00402521016, 1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = -2.30102992; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 6].x; + r9.y = icb[r8.x + 6].x; + r9.z = icb[r8.y + 6].x; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.4948215); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.27267218 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.27267218 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 6].y; + r9.y = icb[r8.x + 6].y; + r9.z = icb[r8.y + 6].y; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 6].x; + r10.y = icb[r9.x + 6].x; + r10.z = icb[r9.y + 6].x; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.4948215); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.27267218 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.27267218 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 6].y; + r10.y = icb[r9.x + 6].y; + r10.z = icb[r9.y + 6].y; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 6].x; + r10.y = icb[r9.x + 6].x; + r10.z = icb[r9.y + 6].x; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.4948215); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.27267218 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.27267218 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 6].y; + r10.y = icb[r9.x + 6].y; + r10.z = icb[r9.y + 6].y; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r0.w = cmp(asint(cb0[65].z) == 7); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r1.xyz); + r7.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r1.xyz); + r7.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r1.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(8, 9)); + r8.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r0.xyz); + r8.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r0.xyz); + r8.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r0.xyz); + r0.x = dot(r5.xyz, r8.xyz); + r0.y = dot(r6.xyz, r8.xyz); + r0.z = dot(r4.xyz, r8.xyz); + r8.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r3.xyz); + r8.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r3.xyz); + r8.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r3.xyz); + r0.w = dot(r5.xyz, r8.xyz); + r1.w = dot(r6.xyz, r8.xyz); + r2.w = dot(r4.xyz, r8.xyz); + r3.x = log2(r0.w); + r3.y = log2(r1.w); + r3.z = log2(r2.w); + r3.xyz = cb0[27].zzz * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = r7.yyy ? r0.xyz : r3.xyz; + r2.xyz = r7.xxx ? r1.xyz : r0.xyz; + } + } + } + } + } + o0.xyz = float3(0.952381015, 0.952381015, 0.952381015) * r2.xyz; + o0.w = 0; + return; +} diff --git a/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x97BAC8AF_dx12.ps_5_1.hlsl b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x97BAC8AF_dx12.ps_5_1.hlsl new file mode 100644 index 00000000..61caa14d --- /dev/null +++ b/src/games/unrealengine/lutbuilders/sm5/lutbuilder_0x97BAC8AF_dx12.ps_5_1.hlsl @@ -0,0 +1,1525 @@ +#include "../../common.hlsl" + +// ---- Created with 3Dmigoto v1.3.16 on Wed Jan 1 15:35:38 2025 +Texture2D t1 : register(t1); + +Texture2D t0 : register(t0); + +SamplerState s1_s : register(s1); + +SamplerState s0_s : register(s0); + +cbuffer cb0 : register(b0) { + float4 cb0[67]; +} + +// 3Dmigoto declarations +#define cmp - + +void main( + linear noperspective float2 v0: TEXCOORD0, + float4 v1: SV_POSITION0, + uint v2: SV_RenderTargetArrayIndex0, + out float4 o0: SV_Target0) { + const float4 icb[] = { { -4.000000, -0.718548, -4.970622, 0.808913 }, + { -4.000000, 2.081031, -3.029378, 1.191087 }, + { -3.157377, 3.668124, -2.126200, 1.568300 }, + { -0.485250, 4.000000, -1.510500, 1.948300 }, + { 1.847732, 4.000000, -1.057800, 2.308300 }, + { 1.847732, 4.000000, -0.466800, 2.638400 }, + { -2.301030, 0.801995, 0.119380, 2.859500 }, + { -2.301030, 1.198005, 0.708813, 2.987261 }, + { -1.931200, 1.594300, 1.291187, 3.012739 }, + { -1.520500, 1.997300, 1.291187, 3.012739 }, + { -1.057800, 2.378300, 0, 0 }, + { -0.466800, 2.768400, 0, 0 }, + { 0.119380, 3.051500, 0, 0 }, + { 0.708813, 3.274629, 0, 0 }, + { 1.291187, 3.327431, 0, 0 }, + { 1.291187, 3.327431, 0, 0 } }; + float4 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12; + uint4 bitmask, uiDest; + float4 fDest; + + r0.xy = float2(-0.015625, -0.015625) + v0.xy; + r0.xy = float2(1.03225803, 1.03225803) * r0.xy; + r0.z = (uint)v2.x; + r1.z = 0.0322580636 * r0.z; + r0.z = cmp(asuint(cb0[65].z) >= 3); + r2.xy = log2(r0.xy); + r2.z = log2(r1.z); + r0.xyw = float3(0.0126833133, 0.0126833133, 0.0126833133) * r2.xyz; + r0.xyw = exp2(r0.xyw); + r2.xyz = float3(-0.8359375, -0.8359375, -0.8359375) + r0.xyw; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r0.xyw = -r0.xyw * float3(18.6875, 18.6875, 18.6875) + float3(18.8515625, 18.8515625, 18.8515625); + r0.xyw = r2.xyz / r0.xyw; + r0.xyw = log2(r0.xyw); + r0.xyw = float3(6.27739477, 6.27739477, 6.27739477) * r0.xyw; + r0.xyw = exp2(r0.xyw); + r0.xyw = float3(100, 100, 100) * r0.xyw; + r1.xy = v0.xy * float2(1.03225803, 1.03225803) + float2(-0.0161290318, -0.0161290318); + r1.xyz = float3(-0.434017599, -0.434017599, -0.434017599) + r1.xyz; + r1.xyz = float3(14, 14, 14) * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = r1.xyz * float3(0.180000007, 0.180000007, 0.180000007) + float3(-0.00266771927, -0.00266771927, -0.00266771927); + r0.xyz = r0.zzz ? r0.xyw : r1.xyz; + r0.w = 1.00055635 * cb0[44].y; + r1.x = cmp(6996.10791 >= cb0[44].y); + r1.yz = float2(4.60700006e+09, 2.0064e+09) / r0.ww; + r1.yz = float2(2967800, 1901800) + -r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(99.1100006, 247.479996) + r1.yz; + r1.yz = r1.yz / r0.ww; + r1.yz = float2(0.244063005, 0.237039998) + r1.yz; + r1.x = r1.x ? r1.y : r1.z; + r0.w = r1.x * r1.x; + r1.z = 2.86999989 * r1.x; + r0.w = r0.w * -3 + r1.z; + r1.y = -0.275000006 + r0.w; + r2.xyz = cb0[44].yyy * float3(0.000154118257, 0.00084242021, 4.22806261e-05) + float3(0.860117733, 1, 0.317398727); + r0.w = cb0[44].y * cb0[44].y; + r2.xyz = r0.www * float3(1.28641219e-07, 7.08145137e-07, 4.20481676e-08) + r2.xyz; + r2.x = r2.x / r2.y; + r1.z = -cb0[44].y * 2.8974182e-05 + 1; + r0.w = r0.w * 1.61456057e-07 + r1.z; + r2.y = r2.z / r0.w; + r1.zw = r2.xy + r2.xy; + r0.w = 3 * r2.x; + r1.z = -r2.y * 8 + r1.z; + r1.z = 4 + r1.z; + r3.x = r0.w / r1.z; + r3.y = r1.w / r1.z; + r0.w = cmp(cb0[44].y < 4000); + r1.xy = r0.ww ? r3.xy : r1.xy; + r0.w = dot(r2.xy, r2.xy); + r0.w = rsqrt(r0.w); + r1.zw = r2.xy * r0.ww; + r0.w = cb0[44].z * -r1.w; + r0.w = r0.w * 0.0500000007 + r2.x; + r1.z = cb0[44].z * r1.z; + r1.z = r1.z * 0.0500000007 + r2.y; + r1.w = 3 * r0.w; + r0.w = r0.w + r0.w; + r0.w = -r1.z * 8 + r0.w; + r0.w = 4 + r0.w; + r1.z = r1.z + r1.z; + r2.xy = r1.wz / r0.ww; + r1.zw = r2.xy + -r3.xy; + r1.xy = r1.xy + r1.zw; + r0.w = max(1.00000001e-10, r1.y); + r2.x = r1.x / r0.w; + r1.x = 1 + -r1.x; + r1.x = r1.x + -r1.y; + r2.z = r1.x / r0.w; + r2.y = 1; + r0.w = dot(float3(0.895099998, 0.266400009, -0.161400005), r2.xyz); + r1.x = dot(float3(-0.750199974, 1.71350002, 0.0366999991), r2.xyz); + r1.y = dot(float3(0.0388999991, -0.0684999973, 1.02960002), r2.xyz); + r0.w = 0.941379249 / r0.w; + r1.xy = float2(1.04043639, 1.0897665) / r1.xy; + r2.xyz = float3(0.895099998, 0.266400009, -0.161400005) * r0.www; + r1.xzw = float3(-0.750199974, 1.71350002, 0.0366999991) * r1.xxx; + r3.xyz = float3(0.0388999991, -0.0684999973, 1.02960002) * r1.yyy; + r4.x = r2.x; + r4.y = r1.x; + r4.z = r3.x; + r5.x = dot(float3(0.986992896, -0.1470543, 0.159962699), r4.xyz); + r6.x = r2.y; + r6.y = r1.z; + r6.z = r3.y; + r5.y = dot(float3(0.986992896, -0.1470543, 0.159962699), r6.xyz); + r3.x = r2.z; + r3.y = r1.w; + r5.z = dot(float3(0.986992896, -0.1470543, 0.159962699), r3.xyz); + r1.x = dot(float3(0.432305306, 0.518360317, 0.0492912009), r4.xyz); + r1.y = dot(float3(0.432305306, 0.518360317, 0.0492912009), r6.xyz); + r1.z = dot(float3(0.432305306, 0.518360317, 0.0492912009), r3.xyz); + r2.x = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r4.xyz); + r2.y = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r6.xyz); + r2.z = dot(float3(-0.0085287001, 0.040042799, 0.968486726), r3.xyz); + r3.x = dot(r5.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.x = dot(r5.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.x = dot(r5.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r3.y = dot(r1.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.y = dot(r1.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.y = dot(r1.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r3.z = dot(r2.xyz, float3(0.412456393, 0.212672904, 0.0193339009)); + r4.z = dot(r2.xyz, float3(0.357576102, 0.715152204, 0.119191997)); + r5.z = dot(r2.xyz, float3(0.180437505, 0.0721750036, 0.950304091)); + r1.x = dot(float3(3.2409699, -1.5373832, -0.498610765), r3.xyz); + r1.y = dot(float3(3.2409699, -1.5373832, -0.498610765), r4.xyz); + r1.z = dot(float3(3.2409699, -1.5373832, -0.498610765), r5.xyz); + r2.x = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r3.xyz); + r2.y = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r4.xyz); + r2.z = dot(float3(-0.969243646, 1.8759675, 0.0415550582), r5.xyz); + r3.x = dot(float3(0.0556300804, -0.203976959, 1.05697155), r3.xyz); + r3.y = dot(float3(0.0556300804, -0.203976959, 1.05697155), r4.xyz); + r3.z = dot(float3(0.0556300804, -0.203976959, 1.05697155), r5.xyz); + r1.x = dot(r1.xyz, r0.xyz); + r1.y = dot(r2.xyz, r0.xyz); + r1.z = dot(r3.xyz, r0.xyz); + r0.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r1.xyz); + r0.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r1.xyz); + r0.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r1.xyz); + r0.w = dot(r0.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r1.xyz = r0.xyz / r0.www; + r1.xyz = float3(-1, -1, -1) + r1.xyz; + r1.x = dot(r1.xyz, r1.xyz); + r1.x = -4 * r1.x; + r1.x = exp2(r1.x); + r1.x = 1 + -r1.x; + r0.w = r0.w * r0.w; + r0.w = cb0[66].y * r0.w; + r0.w = -4 * r0.w; + r0.w = exp2(r0.w); + r0.w = 1 + -r0.w; + r0.w = r1.x * r0.w; + r1.x = dot(float3(1.37041271, -0.329291314, -0.0636827648), r0.xyz); + r1.y = dot(float3(-0.0834341869, 1.09709096, -0.0108615728), r0.xyz); + r1.z = dot(float3(-0.0257932581, -0.0986256376, 1.20369434), r0.xyz); + r1.xyz = r1.xyz + -r0.xyz; + r1.xyz = r0.www * r1.xyz + r0.xyz; + r0.xyz = cb0[44].xxx ? r0.xyz : r1.xyz; + r0.w = dot(r0.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r1.xyzw = cb0[50].xyzw * cb0[45].xyzw; + r2.xyzw = cb0[51].xyzw * cb0[46].xyzw; + r3.xyzw = cb0[52].xyzw * cb0[47].xyzw; + r4.xyzw = cb0[53].xyzw * cb0[48].xyzw; + r5.xyzw = cb0[54].xyzw + cb0[49].xyzw; + r1.xyz = r1.xyz * r1.www; + r0.xyz = r0.xyz + -r0.www; + r1.xyz = r1.xyz * r0.xyz + r0.www; + r1.xyz = max(float3(0, 0, 0), r1.xyz); + r1.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r1.xyz; + r2.xyz = r2.xyz * r2.www; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r1.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r1.xyz; + r2.xyz = r3.xyz * r3.www; + r2.xyz = float3(1, 1, 1) / r2.xyz; + r1.xyz = log2(r1.xyz); + r1.xyz = r2.xyz * r1.xyz; + r1.xyz = exp2(r1.xyz); + r2.xyz = r4.xyz * r4.www; + r3.xyz = r5.xyz + r5.www; + r1.xyz = r1.xyz * r2.xyz + r3.xyz; + r1.w = 1 / cb0[65].x; + r1.w = saturate(r1.w * r0.w); + r2.x = r1.w * -2 + 3; + r1.w = r1.w * r1.w; + r1.w = -r2.x * r1.w + 1; + r2.xyzw = cb0[60].xyzw * cb0[45].xyzw; + r3.xyzw = cb0[61].xyzw * cb0[46].xyzw; + r4.xyzw = cb0[62].xyzw * cb0[47].xyzw; + r5.xyzw = cb0[63].xyzw * cb0[48].xyzw; + r6.xyzw = cb0[64].xyzw + cb0[49].xyzw; + r2.xyz = r2.xyz * r2.www; + r2.xyz = r2.xyz * r0.xyz + r0.www; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r2.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r2.xyz; + r3.xyz = r3.xyz * r3.www; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r2.xyz; + r3.xyz = r4.xyz * r4.www; + r3.xyz = float3(1, 1, 1) / r3.xyz; + r2.xyz = log2(r2.xyz); + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = exp2(r2.xyz); + r3.xyz = r5.xyz * r5.www; + r4.xyz = r6.xyz + r6.www; + r2.xyz = r2.xyz * r3.xyz + r4.xyz; + r2.w = 1 + -cb0[65].y; + r3.x = -cb0[65].y + r0.w; + r2.w = 1 / r2.w; + r2.w = saturate(r3.x * r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r3.y = r3.x * r2.w; + r4.xyzw = cb0[55].xyzw * cb0[45].xyzw; + r5.xyzw = cb0[56].xyzw * cb0[46].xyzw; + r6.xyzw = cb0[57].xyzw * cb0[47].xyzw; + r7.xyzw = cb0[58].xyzw * cb0[48].xyzw; + r8.xyzw = cb0[59].xyzw + cb0[49].xyzw; + r4.xyz = r4.xyz * r4.www; + r0.xyz = r4.xyz * r0.xyz + r0.www; + r0.xyz = max(float3(0, 0, 0), r0.xyz); + r0.xyz = float3(5.55555534, 5.55555534, 5.55555534) * r0.xyz; + r4.xyz = r5.xyz * r5.www; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r0.xyz = float3(0.180000007, 0.180000007, 0.180000007) * r0.xyz; + r4.xyz = r6.xyz * r6.www; + r4.xyz = float3(1, 1, 1) / r4.xyz; + r0.xyz = log2(r0.xyz); + r0.xyz = r4.xyz * r0.xyz; + r0.xyz = exp2(r0.xyz); + r4.xyz = r7.xyz * r7.www; + r5.xyz = r8.xyz + r8.www; + r0.xyz = r0.xyz * r4.xyz + r5.xyz; + r0.w = 1 + -r1.w; + r0.w = -r3.x * r2.w + r0.w; + r0.xyz = r0.xyz * r0.www; + r0.xyz = r1.xyz * r1.www + r0.xyz; + r0.xyz = r2.xyz * r3.yyy + r0.xyz; + + float3 untonemapped_ap1 = r0.xyz; + + r1.x = dot(float3(1.70505154, -0.621790707, -0.0832583979), r0.xyz); + r1.y = dot(float3(-0.130257145, 1.14080286, -0.0105485283), r0.xyz); + r1.z = dot(float3(-0.0240032747, -0.128968775, 1.15297174), r0.xyz); + if (cb0[44].x != 0) { + r2.x = dot(r1.xyz, cb0[28].xyz); + r2.y = dot(r1.xyz, cb0[29].xyz); + r2.z = dot(r1.xyz, cb0[30].xyz); + r0.w = dot(r1.xyz, cb0[33].xyz); + r0.w = 1 + r0.w; + r0.w = rcp(r0.w); + r3.xyz = cb0[35].xyz * r0.www + cb0[34].xyz; + r2.xyz = r3.xyz * r2.xyz; + r2.xyz = max(float3(0, 0, 0), r2.xyz); + r3.xyz = cb0[31].xxx + -r2.xyz; + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r4.xyz = max(cb0[31].zzz, r2.xyz); + r2.xyz = max(cb0[31].xxx, r2.xyz); + r2.xyz = min(cb0[31].zzz, r2.xyz); + r5.xyz = r4.xyz * cb0[32].xxx + cb0[32].yyy; + r4.xyz = cb0[31].www + r4.xyz; + r4.xyz = rcp(r4.xyz); + r6.xyz = cb0[28].www * r3.xyz; + r3.xyz = cb0[31].yyy + r3.xyz; + r3.xyz = rcp(r3.xyz); + r3.xyz = r6.xyz * r3.xyz + cb0[29].www; + r2.xyz = r2.xyz * cb0[30].www + r3.xyz; + r2.xyz = r5.xyz * r4.xyz + r2.xyz; + r2.xyz = float3(-0.00200000009, -0.00200000009, -0.00200000009) + r2.xyz; + } else { + r3.x = dot(float3(0.938639402, 1.02359565e-10, 0.0613606237), r0.xyz); + r3.y = dot(float3(8.36008554e-11, 0.830794156, 0.169205874), r0.xyz); + r3.z = dot(float3(2.13187367e-12, -5.63307213e-12, 1), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.y = dot(float3(0.695452213, 0.140678704, 0.163869068), r0.xyz); + r3.z = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r0.xyz); + r3.w = dot(float3(-0.00552588236, 0.00402521016, 1.00150073), r0.xyz); + r0.w = min(r3.y, r3.z); + r0.w = min(r0.w, r3.w); + r1.w = max(r3.y, r3.z); + r1.w = max(r1.w, r3.w); + r4.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r4.x + -r0.w; + r0.w = r0.w / r4.y; + r4.xyz = r3.wzy + -r3.zyw; + r4.xy = r4.xy * r3.wz; + r1.w = r4.x + r4.y; + r1.w = r3.y * r4.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r3.w + r3.z; + r2.w = r2.w + r3.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.x = -0.400000006 + r0.w; + r4.x = 2.5 * r3.x; + r4.x = 1 + -abs(r4.x); + r4.x = max(0, r4.x); + r4.y = cmp(0 < r3.x); + r3.x = cmp(r3.x < 0); + r3.x = (int)-r4.y + (int)r3.x; + r3.x = (int)r3.x; + r4.x = -r4.x * r4.x + 1; + r3.x = r3.x * r4.x + 1; + r3.x = 0.0250000004 * r3.x; + r4.x = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.x * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.x ? r3.x : r1.w; + r1.w = 1 + r1.w; + r4.yzw = r3.yzw * r1.www; + r5.xy = cmp(r4.zw == r4.yz); + r2.w = r5.y ? r5.x : 0; + r3.x = r3.z * r1.w + -r4.w; + r3.x = 1.73205078 * r3.x; + r3.z = r4.y * 2 + -r4.z; + r3.z = -r3.w * r1.w + r3.z; + r3.w = min(abs(r3.x), abs(r3.z)); + r5.x = max(abs(r3.x), abs(r3.z)); + r5.x = 1 / r5.x; + r3.w = r5.x * r3.w; + r5.x = r3.w * r3.w; + r5.y = r5.x * 0.0208350997 + -0.0851330012; + r5.y = r5.x * r5.y + 0.180141002; + r5.y = r5.x * r5.y + -0.330299497; + r5.x = r5.x * r5.y + 0.999866009; + r5.y = r5.x * r3.w; + r5.z = cmp(abs(r3.z) < abs(r3.x)); + r5.y = r5.y * -2 + 1.57079637; + r5.y = r5.z ? r5.y : 0; + r3.w = r3.w * r5.x + r5.y; + r5.x = cmp(r3.z < -r3.z); + r5.x = r5.x ? -3.141593 : 0; + r3.w = r5.x + r3.w; + r5.x = min(r3.x, r3.z); + r3.x = max(r3.x, r3.z); + r3.z = cmp(r5.x < -r5.x); + r3.x = cmp(r3.x >= -r3.x); + r3.x = r3.x ? r3.z : 0; + r3.x = r3.x ? -r3.w : r3.w; + r3.x = 57.2957802 * r3.x; + r2.w = r2.w ? 0 : r3.x; + r3.x = cmp(r2.w < 0); + r3.z = 360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.x = cmp(180 < r2.w); + r3.z = -360 + r2.w; + r2.w = r3.x ? r3.z : r2.w; + r2.w = 0.0148148146 * r2.w; + r2.w = 1 + -abs(r2.w); + r2.w = max(0, r2.w); + r3.x = r2.w * -2 + 3; + r2.w = r2.w * r2.w; + r2.w = r3.x * r2.w; + r2.w = r2.w * r2.w; + r0.w = r2.w * r0.w; + r1.w = -r3.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r4.x = r0.w * 0.180000007 + r4.y; + r3.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r4.xzw); + r3.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r4.xzw); + r3.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r4.xzw); + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r0.w = dot(r3.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r4.xy = float2(1, 0.180000007) + cb0[36].ww; + r0.w = -cb0[36].y + r4.x; + r1.w = 1 + cb0[37].x; + r2.w = -cb0[36].z + r1.w; + r3.w = cmp(0.800000012 < cb0[36].y); + r4.xz = float2(0.819999993, 1) + -cb0[36].yy; + r4.xz = r4.xz / cb0[36].xx; + r4.y = r4.y / r0.w; + r4.xw = float2(-0.744727492, -1) + r4.xy; + r4.w = 1 + -r4.w; + r4.y = r4.y / r4.w; + r4.y = log2(r4.y); + r4.y = 0.346573591 * r4.y; + r4.w = r0.w / cb0[36].x; + r4.y = -r4.y * r4.w + -0.744727492; + r3.w = r3.w ? r4.x : r4.y; + r4.x = r4.z + -r3.w; + r4.y = cb0[36].z / cb0[36].x; + r4.y = r4.y + -r4.x; + r3.xyz = log2(r3.xyz); + r5.xyz = float3(0.30103001, 0.30103001, 0.30103001) * r3.xyz; + r4.xzw = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + r4.xxx; + r4.xzw = cb0[36].xxx * r4.xzw; + r5.w = r0.w + r0.w; + r6.x = -2 * cb0[36].x; + r0.w = r6.x / r0.w; + r6.xyz = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + -r3.www; + r7.xyz = r6.xyz * r0.www; + r7.xyz = float3(1.44269502, 1.44269502, 1.44269502) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = float3(1, 1, 1) + r7.xyz; + r7.xyz = r5.www / r7.xyz; + r7.xyz = -cb0[36].www + r7.xyz; + r0.w = r2.w + r2.w; + r5.w = cb0[36].x + cb0[36].x; + r2.w = r5.w / r2.w; + r3.xyz = r3.xyz * float3(0.30103001, 0.30103001, 0.30103001) + -r4.yyy; + r3.xyz = r3.xyz * r2.www; + r3.xyz = float3(1.44269502, 1.44269502, 1.44269502) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r3.xyz = float3(1, 1, 1) + r3.xyz; + r3.xyz = r0.www / r3.xyz; + r3.xyz = -r3.xyz + r1.www; + r8.xyz = cmp(r5.xyz < r3.www); + r7.xyz = r8.xyz ? r7.xyz : r4.xzw; + r5.xyz = cmp(r4.yyy < r5.xyz); + r3.xyz = r5.xyz ? r3.xyz : r4.xzw; + r0.w = r4.y + -r3.w; + r4.xzw = saturate(r6.xyz / r0.www); + r0.w = cmp(r4.y < r3.w); + r5.xyz = float3(1, 1, 1) + -r4.xzw; + r4.xyz = r0.www ? r5.xyz : r4.xzw; + r5.xyz = -r4.xyz * float3(2, 2, 2) + float3(3, 3, 3); + r4.xyz = r4.xyz * r4.xyz; + r4.xyz = r4.xyz * r5.xyz; + r3.xyz = r3.xyz + -r7.xyz; + r3.xyz = r4.xyz * r3.xyz + r7.xyz; + r0.w = dot(r3.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r3.xyz = r3.xyz + -r0.www; + r3.xyz = r3.xyz * float3(0.930000007, 0.930000007, 0.930000007) + r0.www; + r3.xyz = max(float3(0, 0, 0), r3.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].zzz * r3.xyz + r0.xyz; + r3.x = dot(float3(1.06537485, 1.44678506e-06, -0.0653710067), r0.xyz); + r3.y = dot(float3(-3.45525592e-07, 1.20366347, -0.203667715), r0.xyz); + r3.z = dot(float3(1.9865448e-08, 2.12079581e-08, 0.999999583), r0.xyz); + r3.xyz = r3.xyz + -r0.xyz; + r0.xyz = cb0[66].xxx * r3.xyz + r0.xyz; + r3.x = dot(float3(1.70505154, -0.621790707, -0.0832583979), r0.xyz); + r3.y = dot(float3(-0.130257145, 1.14080286, -0.0105485283), r0.xyz); + r3.z = dot(float3(-0.0240032747, -0.128968775, 1.15297174), r0.xyz); + r2.xyz = max(float3(0, 0, 0), r3.xyz); + } + r2.xyz = saturate(r2.xyz); + r0.xyz = float3(12.9200001, 12.9200001, 12.9200001) * r2.xyz; + r3.xyz = cmp(r2.xyz >= float3(0.00313066994, 0.00313066994, 0.00313066994)); + r2.xyz = log2(r2.xyz); + r2.xyz = float3(0.416666657, 0.416666657, 0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995, 1.05499995, 1.05499995) + float3(-0.0549999997, -0.0549999997, -0.0549999997); + r0.xyz = r3.xyz ? r2.xyz : r0.xyz; + r2.yzw = r0.xyz * float3(0.9375, 0.9375, 0.9375) + float3(0.03125, 0.03125, 0.03125); + r0.w = r2.w * 16 + -0.5; + r1.w = floor(r0.w); + r0.w = -r1.w + r0.w; + r1.w = r2.y + r1.w; + r2.x = 0.0625 * r1.w; + r3.xyz = t0.Sample(s0_s, r2.xz).xyz; + r2.yw = float2(0.0625, 0) + r2.xz; + r4.xyz = t0.Sample(s0_s, r2.yw).xyz; + r4.xyz = r4.xyz + -r3.xyz; + r3.xyz = r0.www * r4.xyz + r3.xyz; + r3.xyz = cb0[39].xxx * r3.xyz; + r0.xyz = cb0[38].xxx * r0.xyz + r3.xyz; + r3.xyz = t1.Sample(s1_s, r2.xz).xyz; + r2.xyz = t1.Sample(s1_s, r2.yw).xyz; + r2.xyz = r2.xyz + -r3.xyz; + r2.xyz = r0.www * r2.xyz + r3.xyz; + r0.xyz = cb0[40].xxx * r2.xyz + r0.xyz; + r0.xyz = max(float3(6.10351999e-05, 6.10351999e-05, 6.10351999e-05), r0.xyz); + r2.xyz = cmp(float3(0.0404499993, 0.0404499993, 0.0404499993) < r0.xyz); + r3.xyz = r0.xyz * float3(0.947867274, 0.947867274, 0.947867274) + float3(0.0521326996, 0.0521326996, 0.0521326996); + r3.xyz = log2(r3.xyz); + r3.xyz = float3(2.4000001, 2.4000001, 2.4000001) * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = float3(0.0773993805, 0.0773993805, 0.0773993805) * r0.xyz; + r0.xyz = r2.xyz ? r3.xyz : r0.xyz; + r2.xyz = r0.xyz * r0.xyz; + r0.xyz = cb0[26].yyy * r0.xyz; + r0.xyz = cb0[26].xxx * r2.xyz + r0.xyz; + r0.xyz = cb0[26].zzz + r0.xyz; + r2.xyz = cb0[42].yzw * r0.xyz; + r0.xyz = -r0.xyz * cb0[42].yzw + cb0[43].xyz; + r0.xyz = cb0[43].www * r0.xyz + r2.xyz; + r2.xyz = max(float3(0, 0, 0), r0.xyz); + r2.xyz = log2(r2.xyz); + r2.xyz = cb0[27].yyy * r2.xyz; + r3.xyz = exp2(r2.xyz); + + if (injectedData.toneMapType != 0) { + o0 = LutBuilderToneMap(untonemapped_ap1, r3.xyz); + return; + } + + if (cb0[65].z == 0) { + r4.xyz = float3(12.9200001, 12.9200001, 12.9200001) * r3.xyz; + r5.xyz = cmp(r3.xyz >= float3(0.00313066994, 0.00313066994, 0.00313066994)); + r2.xyz = float3(0.416666657, 0.416666657, 0.416666657) * r2.xyz; + r2.xyz = exp2(r2.xyz); + r2.xyz = r2.xyz * float3(1.05499995, 1.05499995, 1.05499995) + float3(-0.0549999997, -0.0549999997, -0.0549999997); + r2.xyz = r5.xyz ? r2.xyz : r4.xyz; + } else { + r4.xyzw = cmp(asint(cb0[65].wwww) == int4(1, 2, 3, 4)); + r5.xyz = r4.www ? float3(1, 0, 0) : float3(1.70505154, -0.621790707, -0.0832583979); + r6.xyz = r4.www ? float3(0, 1, 0) : float3(-0.130257145, 1.14080286, -0.0105485283); + r7.xyz = r4.www ? float3(0, 0, 1) : float3(-0.0240032747, -0.128968775, 1.15297174); + r5.xyz = r4.zzz ? float3(0.695452213, 0.140678704, 0.163869068) : r5.xyz; + r6.xyz = r4.zzz ? float3(0.0447945632, 0.859671116, 0.0955343172) : r6.xyz; + r7.xyz = r4.zzz ? float3(-0.00552588282, 0.00402521016, 1.00150073) : r7.xyz; + r5.xyz = r4.yyy ? float3(1.02579927, -0.0200525094, -0.00577136781) : r5.xyz; + r6.xyz = r4.yyy ? float3(-0.00223502493, 1.00458264, -0.00235231337) : r6.xyz; + r4.yzw = r4.yyy ? float3(-0.00501400325, -0.0252933875, 1.03044021) : r7.xyz; + r5.xyz = r4.xxx ? float3(1.37915885, -0.308850735, -0.0703467429) : r5.xyz; + r6.xyz = r4.xxx ? float3(-0.0693352968, 1.08229232, -0.0129620517) : r6.xyz; + r4.xyz = r4.xxx ? float3(-0.00215925858, -0.0454653986, 1.04775953) : r4.yzw; + r0.w = cmp(asint(cb0[65].z) == 1); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r3.xyz); + r7.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r3.xyz); + r7.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r3.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = max(float3(6.10351999e-05, 6.10351999e-05, 6.10351999e-05), r8.xyz); + r8.xyz = float3(4.5, 4.5, 4.5) * r7.xyz; + r7.xyz = max(float3(0.0179999992, 0.0179999992, 0.0179999992), r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.449999988, 0.449999988, 0.449999988) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r7.xyz = r7.xyz * float3(1.09899998, 1.09899998, 1.09899998) + float3(-0.0989999995, -0.0989999995, -0.0989999995); + r2.xyz = min(r8.xyz, r7.xyz); + } else { + r7.xyz = cb0[42].yzw * r1.xyz; + r1.xyz = -r1.xyz * cb0[42].yzw + cb0[43].xyz; + r1.xyz = cb0[43].www * r1.xyz + r7.xyz; + r7.xy = cmp(asint(cb0[65].zz) == int2(3, 5)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5, 1.5, 1.5) * r1.xyz; + r8.y = dot(float3(0.439700812, 0.382978052, 0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037, 0.813423157, 0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864, 0.111544058, 0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672, -0.5, 0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5, 0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5, 0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3, 2, 1)); + r8.xz = float2(0.166666672, 0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0, 0, 0), r7.xzw); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r8.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r7.xyz = max(float3(0, 0, 0), r8.xyz); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r8.xyz = cmp(float3(0, 0, 0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14, -14, -14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323, -17.4739323, -17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r8.x + 0].x; + r10.z = icb[r8.w + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r7.x + 0].y; + r10.z = icb[r7.w + 0].y; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].x; + r11.y = icb[r7.x + 0].x; + r11.z = icb[r7.w + 0].x; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].y; + r11.y = icb[r7.x + 0].y; + r11.z = icb[r7.y + 0].y; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r7.x + 0].x; + r10.z = icb[r7.y + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r8.x + 0].y; + r10.z = icb[r8.y + 0].y; + r8.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r10.xy, float2(-1, 1)); + r8.z = dot(r10.xy, float2(0.5, 0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213, 0.140678704, 0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282, 0.00402521016, 1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = r0.w * 0.90309 + 7.54498291; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 0].z; + r9.y = icb[r8.x + 0].z; + r9.z = icb[r8.y + 0].z; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.1373367); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.3549509 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.3549509 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 0].w; + r9.y = icb[r8.x + 0].w; + r9.z = icb[r8.y + 0].w; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 0].z; + r10.y = icb[r9.x + 0].z; + r10.z = icb[r9.y + 0].z; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.1373367); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.3549509 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.3549509 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 0].w; + r10.y = icb[r9.x + 0].w; + r10.z = icb[r9.y + 0].w; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = r0.w * 0.90309 + 7.54498291; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 0].z; + r10.y = icb[r9.x + 0].z; + r10.z = icb[r9.y + 0].z; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.1373367); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.3549509 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.3549509 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 0].w; + r10.y = icb[r9.x + 0].w; + r10.z = icb[r9.y + 0].w; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0180617999 + 2.78077793; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r7.xyz = float3(-3.50738446e-05, -3.50738446e-05, -3.50738446e-05) + r7.xyz; + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(4, 6)); + r0.w = (int)r7.y | (int)r7.x; + if (r0.w != 0) { + r7.xyz = float3(1.5, 1.5, 1.5) * r1.xyz; + r8.y = dot(float3(0.439700812, 0.382978052, 0.1773348), r7.xyz); + r8.z = dot(float3(0.0897923037, 0.813423157, 0.096761629), r7.xyz); + r8.w = dot(float3(0.0175439864, 0.111544058, 0.870704114), r7.xyz); + r0.w = min(r8.y, r8.z); + r0.w = min(r0.w, r8.w); + r1.w = max(r8.y, r8.z); + r1.w = max(r1.w, r8.w); + r7.xy = max(float2(1.00000001e-10, 0.00999999978), r1.ww); + r0.w = max(1.00000001e-10, r0.w); + r0.w = r7.x + -r0.w; + r0.w = r0.w / r7.y; + r7.xyz = r8.wzy + -r8.zyw; + r7.xy = r8.wz * r7.xy; + r1.w = r7.x + r7.y; + r1.w = r8.y * r7.z + r1.w; + r1.w = sqrt(r1.w); + r2.w = r8.w + r8.z; + r2.w = r2.w + r8.y; + r1.w = r1.w * 1.75 + r2.w; + r2.w = 0.333333343 * r1.w; + r3.w = -0.400000006 + r0.w; + r4.w = 2.5 * r3.w; + r4.w = 1 + -abs(r4.w); + r4.w = max(0, r4.w); + r5.w = cmp(0 < r3.w); + r3.w = cmp(r3.w < 0); + r3.w = (int)-r5.w + (int)r3.w; + r3.w = (int)r3.w; + r4.w = -r4.w * r4.w + 1; + r3.w = r3.w * r4.w + 1; + r3.w = 0.0250000004 * r3.w; + r4.w = cmp(0.159999996 >= r1.w); + r1.w = cmp(r1.w >= 0.479999989); + r2.w = 0.0799999982 / r2.w; + r2.w = -0.5 + r2.w; + r2.w = r3.w * r2.w; + r1.w = r1.w ? 0 : r2.w; + r1.w = r4.w ? r3.w : r1.w; + r1.w = 1 + r1.w; + r7.yzw = r8.yzw * r1.www; + r9.xy = cmp(r7.zw == r7.yz); + r2.w = r9.y ? r9.x : 0; + r3.w = r8.z * r1.w + -r7.w; + r3.w = 1.73205078 * r3.w; + r4.w = r7.y * 2 + -r7.z; + r4.w = -r8.w * r1.w + r4.w; + r5.w = min(abs(r4.w), abs(r3.w)); + r6.w = max(abs(r4.w), abs(r3.w)); + r6.w = 1 / r6.w; + r5.w = r6.w * r5.w; + r6.w = r5.w * r5.w; + r8.x = r6.w * 0.0208350997 + -0.0851330012; + r8.x = r6.w * r8.x + 0.180141002; + r8.x = r6.w * r8.x + -0.330299497; + r6.w = r6.w * r8.x + 0.999866009; + r8.x = r6.w * r5.w; + r8.z = cmp(abs(r4.w) < abs(r3.w)); + r8.x = r8.x * -2 + 1.57079637; + r8.x = r8.z ? r8.x : 0; + r5.w = r5.w * r6.w + r8.x; + r6.w = cmp(r4.w < -r4.w); + r6.w = r6.w ? -3.141593 : 0; + r5.w = r6.w + r5.w; + r6.w = min(r4.w, r3.w); + r3.w = max(r4.w, r3.w); + r4.w = cmp(r6.w < -r6.w); + r3.w = cmp(r3.w >= -r3.w); + r3.w = r3.w ? r4.w : 0; + r3.w = r3.w ? -r5.w : r5.w; + r3.w = 57.2957802 * r3.w; + r2.w = r2.w ? 0 : r3.w; + r3.w = cmp(r2.w < 0); + r4.w = 360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r2.w = max(0, r2.w); + r2.w = min(360, r2.w); + r3.w = cmp(180 < r2.w); + r4.w = -360 + r2.w; + r2.w = r3.w ? r4.w : r2.w; + r3.w = cmp(-67.5 < r2.w); + r4.w = cmp(r2.w < 67.5); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r2.w = 67.5 + r2.w; + r3.w = 0.0296296291 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r2.w = r2.w * 0.0296296291 + -r3.w; + r3.w = r2.w * r2.w; + r5.w = r3.w * r2.w; + r8.xzw = float3(-0.166666672, -0.5, 0.166666672) * r5.www; + r8.xz = r3.ww * float2(0.5, 0.5) + r8.xz; + r8.xz = r2.ww * float2(-0.5, 0.5) + r8.xz; + r2.w = r5.w * 0.5 + -r3.w; + r2.w = 0.666666687 + r2.w; + r9.xyz = cmp((int3)r4.www == int3(3, 2, 1)); + r8.xz = float2(0.166666672, 0.166666672) + r8.xz; + r3.w = r4.w ? 0 : r8.w; + r3.w = r9.z ? r8.z : r3.w; + r2.w = r9.y ? r2.w : r3.w; + r2.w = r9.x ? r8.x : r2.w; + } else { + r2.w = 0; + } + r0.w = r2.w * r0.w; + r0.w = 1.5 * r0.w; + r1.w = -r8.y * r1.w + 0.0299999993; + r0.w = r1.w * r0.w; + r7.x = r0.w * 0.180000007 + r7.y; + r7.xyz = max(float3(0, 0, 0), r7.xzw); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r8.x = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r8.y = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r8.z = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r7.xyz = max(float3(0, 0, 0), r8.xyz); + r7.xyz = min(float3(65535, 65535, 65535), r7.xyz); + r0.w = dot(r7.xyz, float3(0.272228718, 0.674081743, 0.0536895171)); + r7.xyz = r7.xyz + -r0.www; + r7.xyz = r7.xyz * float3(0.959999979, 0.959999979, 0.959999979) + r0.www; + r8.xyz = cmp(float3(0, 0, 0) >= r7.xyz); + r7.xyz = log2(r7.xyz); + r7.xyz = r8.xyz ? float3(-14, -14, -14) : r7.xyz; + r8.xyz = cmp(float3(-17.4739323, -17.4739323, -17.4739323) >= r7.xyz); + if (r8.x != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.x); + r2.w = cmp(r7.x < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.664385557 + -r2.w; + r8.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r8.x + 0].x; + r10.z = icb[r8.w + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r1.w = cmp(r7.x >= -2.47393107); + r2.w = cmp(r7.x < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.x * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r9.y = r1.w * 0.553654671 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r9.x = r9.y * r9.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r7.x + 0].y; + r10.z = icb[r7.w + 0].y; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r9.z = 1; + r0.w = dot(r9.xyz, r11.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.x = exp2(r0.w); + if (r8.y != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.y); + r2.w = cmp(r7.y < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.664385557 + -r2.w; + r7.xw = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].x; + r11.y = icb[r7.x + 0].x; + r11.z = icb[r7.w + 0].x; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r1.w = cmp(r7.y >= -2.47393107); + r2.w = cmp(r7.y < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.y * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r10.y = r1.w * 0.553654671 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r10.x = r10.y * r10.y; + r11.x = icb[r3.w + 0].y; + r11.y = icb[r7.x + 0].y; + r11.z = icb[r7.y + 0].y; + r12.x = dot(r11.xzy, float3(0.5, 0.5, -1)); + r12.y = dot(r11.xy, float2(-1, 1)); + r12.z = dot(r11.xy, float2(0.5, 0.5)); + r10.z = 1; + r0.w = dot(r10.xyz, r12.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.y = exp2(r0.w); + if (r8.z != 0) { + r0.w = -4; + } else { + r1.w = cmp(-17.4739323 < r7.z); + r2.w = cmp(r7.z < -2.47393107); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 5.26017761; + r2.w = 0.664385557 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r8.y = r1.w * 0.664385557 + -r2.w; + r7.xy = (int2)r3.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r3.w + 0].x; + r10.y = icb[r7.x + 0].x; + r10.z = icb[r7.y + 0].x; + r11.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r11.y = dot(r10.xy, float2(-1, 1)); + r11.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r0.w = dot(r8.xyz, r11.xyz); + } else { + r1.w = cmp(r7.z >= -2.47393107); + r2.w = cmp(r7.z < 15.5260687); + r1.w = r1.w ? r2.w : 0; + if (r1.w != 0) { + r1.w = r7.z * 0.30103001 + 0.744727492; + r2.w = 0.553654671 * r1.w; + r3.w = (int)r2.w; + r2.w = trunc(r2.w); + r7.y = r1.w * 0.553654671 + -r2.w; + r8.xy = (int2)r3.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r10.x = icb[r3.w + 0].y; + r10.y = icb[r8.x + 0].y; + r10.z = icb[r8.y + 0].y; + r8.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r10.xy, float2(-1, 1)); + r8.z = dot(r10.xy, float2(0.5, 0.5)); + r7.z = 1; + r0.w = dot(r7.xyz, r8.xyz); + } else { + r0.w = 4; + } + } + } + r0.w = 3.32192802 * r0.w; + r9.z = exp2(r0.w); + r7.x = dot(float3(0.695452213, 0.140678704, 0.163869068), r9.xyz); + r7.y = dot(float3(0.0447945632, 0.859671116, 0.0955343172), r9.xyz); + r7.z = dot(float3(-0.00552588282, 0.00402521016, 1.00150073), r9.xyz); + r0.w = dot(float3(1.45143926, -0.236510754, -0.214928567), r7.xyz); + r1.w = dot(float3(-0.0765537769, 1.17622972, -0.0996759236), r7.xyz); + r2.w = dot(float3(0.00831614807, -0.00603244966, 0.997716308), r7.xyz); + r3.w = cmp(0 >= r0.w); + r0.w = log2(r0.w); + r0.w = r3.w ? -13.2877121 : r0.w; + r3.w = cmp(-12.7838678 >= r0.w); + if (r3.w != 0) { + r3.w = -2.30102992; + } else { + r4.w = cmp(-12.7838678 < r0.w); + r5.w = cmp(r0.w < 2.26303458); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + 3.84832764; + r5.w = 1.54540098 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 1.54540098 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 6].x; + r9.y = icb[r8.x + 6].x; + r9.z = icb[r8.y + 6].x; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r4.w = cmp(r0.w >= 2.26303458); + r5.w = cmp(r0.w < 12.4948215); + r4.w = r4.w ? r5.w : 0; + if (r4.w != 0) { + r4.w = r0.w * 0.30103001 + -0.681241274; + r5.w = 2.27267218 * r4.w; + r6.w = (int)r5.w; + r5.w = trunc(r5.w); + r7.y = r4.w * 2.27267218 + -r5.w; + r8.xy = (int2)r6.ww + int2(1, 2); + r7.x = r7.y * r7.y; + r9.x = icb[r6.w + 6].y; + r9.y = icb[r8.x + 6].y; + r9.z = icb[r8.y + 6].y; + r8.x = dot(r9.xzy, float3(0.5, 0.5, -1)); + r8.y = dot(r9.xy, float2(-1, 1)); + r8.z = dot(r9.xy, float2(0.5, 0.5)); + r7.z = 1; + r3.w = dot(r7.xyz, r8.xyz); + } else { + r3.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r3.w; + r7.x = exp2(r0.w); + r0.w = cmp(0 >= r1.w); + r1.w = log2(r1.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r3.w = cmp(-12.7838678 < r0.w); + r4.w = cmp(r0.w < 2.26303458); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + 3.84832764; + r4.w = 1.54540098 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 1.54540098 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 6].x; + r10.y = icb[r9.x + 6].x; + r10.z = icb[r9.y + 6].x; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r3.w = cmp(r0.w >= 2.26303458); + r4.w = cmp(r0.w < 12.4948215); + r3.w = r3.w ? r4.w : 0; + if (r3.w != 0) { + r3.w = r0.w * 0.30103001 + -0.681241274; + r4.w = 2.27267218 * r3.w; + r5.w = (int)r4.w; + r4.w = trunc(r4.w); + r8.y = r3.w * 2.27267218 + -r4.w; + r9.xy = (int2)r5.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r5.w + 6].y; + r10.y = icb[r9.x + 6].y; + r10.z = icb[r9.y + 6].y; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.y = exp2(r0.w); + r0.w = cmp(0 >= r2.w); + r1.w = log2(r2.w); + r0.w = r0.w ? -13.2877121 : r1.w; + r1.w = cmp(-12.7838678 >= r0.w); + if (r1.w != 0) { + r1.w = -2.30102992; + } else { + r2.w = cmp(-12.7838678 < r0.w); + r3.w = cmp(r0.w < 2.26303458); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + 3.84832764; + r3.w = 1.54540098 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 1.54540098 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 6].x; + r10.y = icb[r9.x + 6].x; + r10.z = icb[r9.y + 6].x; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r2.w = cmp(r0.w >= 2.26303458); + r3.w = cmp(r0.w < 12.4948215); + r2.w = r2.w ? r3.w : 0; + if (r2.w != 0) { + r2.w = r0.w * 0.30103001 + -0.681241274; + r3.w = 2.27267218 * r2.w; + r4.w = (int)r3.w; + r3.w = trunc(r3.w); + r8.y = r2.w * 2.27267218 + -r3.w; + r9.xy = (int2)r4.ww + int2(1, 2); + r8.x = r8.y * r8.y; + r10.x = icb[r4.w + 6].y; + r10.y = icb[r9.x + 6].y; + r10.z = icb[r9.y + 6].y; + r9.x = dot(r10.xzy, float3(0.5, 0.5, -1)); + r9.y = dot(r10.xy, float2(-1, 1)); + r9.z = dot(r10.xy, float2(0.5, 0.5)); + r8.z = 1; + r1.w = dot(r8.xyz, r9.xyz); + } else { + r1.w = r0.w * 0.0361235999 + 2.84967208; + } + } + } + r0.w = 3.32192802 * r1.w; + r7.z = exp2(r0.w); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r0.w = cmp(asint(cb0[65].z) == 7); + if (r0.w != 0) { + r7.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r1.xyz); + r7.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r1.xyz); + r7.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r1.xyz); + r8.x = dot(r5.xyz, r7.xyz); + r8.y = dot(r6.xyz, r7.xyz); + r8.z = dot(r4.xyz, r7.xyz); + r7.xyz = float3(9.99999975e-05, 9.99999975e-05, 9.99999975e-05) * r8.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(0.159301758, 0.159301758, 0.159301758) * r7.xyz; + r7.xyz = exp2(r7.xyz); + r8.xyz = r7.xyz * float3(18.8515625, 18.8515625, 18.8515625) + float3(0.8359375, 0.8359375, 0.8359375); + r7.xyz = r7.xyz * float3(18.6875, 18.6875, 18.6875) + float3(1, 1, 1); + r7.xyz = rcp(r7.xyz); + r7.xyz = r8.xyz * r7.xyz; + r7.xyz = log2(r7.xyz); + r7.xyz = float3(78.84375, 78.84375, 78.84375) * r7.xyz; + r2.xyz = exp2(r7.xyz); + } else { + r7.xy = cmp(asint(cb0[65].zz) == int2(8, 9)); + r8.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r0.xyz); + r8.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r0.xyz); + r8.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r0.xyz); + r0.x = dot(r5.xyz, r8.xyz); + r0.y = dot(r6.xyz, r8.xyz); + r0.z = dot(r4.xyz, r8.xyz); + r8.x = dot(float3(0.613191485, 0.33951208, 0.0473663323), r3.xyz); + r8.y = dot(float3(0.0702069029, 0.916335821, 0.0134500116), r3.xyz); + r8.z = dot(float3(0.0206188709, 0.109567292, 0.869606733), r3.xyz); + r0.w = dot(r5.xyz, r8.xyz); + r1.w = dot(r6.xyz, r8.xyz); + r2.w = dot(r4.xyz, r8.xyz); + r3.x = log2(r0.w); + r3.y = log2(r1.w); + r3.z = log2(r2.w); + r3.xyz = cb0[27].zzz * r3.xyz; + r3.xyz = exp2(r3.xyz); + r0.xyz = r7.yyy ? r0.xyz : r3.xyz; + r2.xyz = r7.xxx ? r1.xyz : r0.xyz; + } + } + } + } + } + o0.xyz = float3(0.952381015, 0.952381015, 0.952381015) * r2.xyz; + o0.w = 0; + return; +} diff --git a/src/games/unrealengine/lutbuilders/sm6/lutbuilder_0xEBB3E98C.ps_6_0.hlsl b/src/games/unrealengine/lutbuilders/sm6/lutbuilder_0xEBB3E98C.ps_6_0.hlsl new file mode 100644 index 00000000..031d3c71 --- /dev/null +++ b/src/games/unrealengine/lutbuilders/sm6/lutbuilder_0xEBB3E98C.ps_6_0.hlsl @@ -0,0 +1,1049 @@ +#include "../../common.hlsl" + +cbuffer cb0 : register(b0) { + float cb0_026x : packoffset(c026.x); + float cb0_026y : packoffset(c026.y); + float cb0_026z : packoffset(c026.z); + float cb0_027y : packoffset(c027.y); + float cb0_027z : packoffset(c027.z); + float cb0_028x : packoffset(c028.x); + float cb0_028y : packoffset(c028.y); + float cb0_028z : packoffset(c028.z); + float cb0_028w : packoffset(c028.w); + float cb0_029x : packoffset(c029.x); + float cb0_029y : packoffset(c029.y); + float cb0_029z : packoffset(c029.z); + float cb0_029w : packoffset(c029.w); + float cb0_030x : packoffset(c030.x); + float cb0_030y : packoffset(c030.y); + float cb0_030z : packoffset(c030.z); + float cb0_030w : packoffset(c030.w); + float cb0_031x : packoffset(c031.x); + float cb0_031y : packoffset(c031.y); + float cb0_031z : packoffset(c031.z); + float cb0_031w : packoffset(c031.w); + float cb0_032x : packoffset(c032.x); + float cb0_032y : packoffset(c032.y); + float cb0_033x : packoffset(c033.x); + float cb0_033y : packoffset(c033.y); + float cb0_033z : packoffset(c033.z); + float cb0_034x : packoffset(c034.x); + float cb0_034y : packoffset(c034.y); + float cb0_034z : packoffset(c034.z); + float cb0_035x : packoffset(c035.x); + float cb0_035y : packoffset(c035.y); + float cb0_035z : packoffset(c035.z); + float cb0_036x : packoffset(c036.x); + float cb0_036y : packoffset(c036.y); + float cb0_036z : packoffset(c036.z); + float cb0_036w : packoffset(c036.w); + float cb0_037x : packoffset(c037.x); + float cb0_042y : packoffset(c042.y); + float cb0_042z : packoffset(c042.z); + float cb0_042w : packoffset(c042.w); + float cb0_043x : packoffset(c043.x); + float cb0_043y : packoffset(c043.y); + float cb0_043z : packoffset(c043.z); + float cb0_043w : packoffset(c043.w); + uint cb0_044y : packoffset(c044.y); + float cb0_045x : packoffset(c045.x); + float cb0_045y : packoffset(c045.y); + float cb0_045z : packoffset(c045.z); + float cb0_045w : packoffset(c045.w); + float cb0_046x : packoffset(c046.x); + float cb0_046y : packoffset(c046.y); + float cb0_046z : packoffset(c046.z); + float cb0_046w : packoffset(c046.w); + float cb0_047x : packoffset(c047.x); + float cb0_047y : packoffset(c047.y); + float cb0_047z : packoffset(c047.z); + float cb0_047w : packoffset(c047.w); + float cb0_048x : packoffset(c048.x); + float cb0_048y : packoffset(c048.y); + float cb0_048z : packoffset(c048.z); + float cb0_048w : packoffset(c048.w); + float cb0_049x : packoffset(c049.x); + float cb0_049y : packoffset(c049.y); + float cb0_049z : packoffset(c049.z); + float cb0_049w : packoffset(c049.w); + float cb0_050x : packoffset(c050.x); + float cb0_050y : packoffset(c050.y); + float cb0_050z : packoffset(c050.z); + float cb0_050w : packoffset(c050.w); + float cb0_051x : packoffset(c051.x); + float cb0_051y : packoffset(c051.y); + float cb0_051z : packoffset(c051.z); + float cb0_051w : packoffset(c051.w); + float cb0_052x : packoffset(c052.x); + float cb0_052y : packoffset(c052.y); + float cb0_052z : packoffset(c052.z); + float cb0_052w : packoffset(c052.w); + float cb0_053x : packoffset(c053.x); + float cb0_053y : packoffset(c053.y); + float cb0_053z : packoffset(c053.z); + float cb0_053w : packoffset(c053.w); + float cb0_054x : packoffset(c054.x); + float cb0_054y : packoffset(c054.y); + float cb0_054z : packoffset(c054.z); + float cb0_054w : packoffset(c054.w); + float cb0_055x : packoffset(c055.x); + float cb0_055y : packoffset(c055.y); + float cb0_055z : packoffset(c055.z); + float cb0_055w : packoffset(c055.w); + float cb0_056x : packoffset(c056.x); + float cb0_056y : packoffset(c056.y); + float cb0_056z : packoffset(c056.z); + float cb0_056w : packoffset(c056.w); + float cb0_057x : packoffset(c057.x); + float cb0_057y : packoffset(c057.y); + float cb0_057z : packoffset(c057.z); + float cb0_057w : packoffset(c057.w); + float cb0_058x : packoffset(c058.x); + float cb0_058y : packoffset(c058.y); + float cb0_058z : packoffset(c058.z); + float cb0_058w : packoffset(c058.w); + float cb0_059x : packoffset(c059.x); + float cb0_059y : packoffset(c059.y); + float cb0_059z : packoffset(c059.z); + float cb0_059w : packoffset(c059.w); + float cb0_060x : packoffset(c060.x); + float cb0_060y : packoffset(c060.y); + float cb0_060z : packoffset(c060.z); + float cb0_060w : packoffset(c060.w); + float cb0_061x : packoffset(c061.x); + float cb0_061y : packoffset(c061.y); + float cb0_061z : packoffset(c061.z); + float cb0_061w : packoffset(c061.w); + float cb0_062x : packoffset(c062.x); + float cb0_062y : packoffset(c062.y); + float cb0_062z : packoffset(c062.z); + float cb0_062w : packoffset(c062.w); + float cb0_063x : packoffset(c063.x); + float cb0_063y : packoffset(c063.y); + float cb0_063z : packoffset(c063.z); + float cb0_063w : packoffset(c063.w); + float cb0_064x : packoffset(c064.x); + float cb0_064y : packoffset(c064.y); + float cb0_064z : packoffset(c064.z); + float cb0_064w : packoffset(c064.w); + float cb0_065x : packoffset(c065.x); + float cb0_065y : packoffset(c065.y); + uint cb0_065z : packoffset(c065.z); + uint cb0_065w : packoffset(c065.w); + float cb0_066x : packoffset(c066.x); + float cb0_066y : packoffset(c066.y); + float cb0_066z : packoffset(c066.z); +}; + +static const float _global_0[6] = { -4.0f, -4.0f, -3.157376527786255f, -0.48524999618530273f, 1.847732424736023f, 1.847732424736023f }; +static const float _global_1[6] = { -0.7185482382774353f, 2.0810306072235107f, 3.668124198913574f, 4.0f, 4.0f, 4.0f }; +static const float _global_2[10] = { -4.9706220626831055f, -3.0293781757354736f, -2.126199960708618f, -1.5104999542236328f, -1.057800054550171f, -0.4668000042438507f, 0.11937999725341797f, 0.7088134288787842f, 1.2911865711212158f, 1.2911865711212158f }; +static const float _global_3[10] = { 0.8089132308959961f, 1.191086769104004f, 1.5683000087738037f, 1.9483000040054321f, 2.308300018310547f, 2.638400077819824f, 2.859499931335449f, 2.9872608184814453f, 3.0127391815185547f, 3.0127391815185547f }; +static const float _global_4[10] = { -2.301029920578003f, -2.301029920578003f, -1.9312000274658203f, -1.5204999446868896f, -1.057800054550171f, -0.4668000042438507f, 0.11937999725341797f, 0.7088134288787842f, 1.2911865711212158f, 1.2911865711212158f }; +static const float _global_5[10] = { 0.8019952178001404f, 1.1980048418045044f, 1.5943000316619873f, 1.9973000288009644f, 2.3782999515533447f, 2.768399953842163f, 3.051500082015991f, 3.2746293544769287f, 3.3274307250976562f, 3.3274307250976562f }; + +float4 main( + noperspective float2 TEXCOORD : TEXCOORD, + noperspective float4 SV_Position : SV_Position, + nointerpolation uint SV_RenderTargetArrayIndex : SV_RenderTargetArrayIndex +) : SV_Target { + float4 SV_Target; + float _5 = (TEXCOORD.x) + -0.015625f; + float _6 = (TEXCOORD.y) + -0.015625f; + float _9 = float((uint)(SV_RenderTargetArrayIndex)); + float _30 = 1.379158854484558f; + float _31 = -0.3088507056236267f; + float _32 = -0.07034677267074585f; + float _33 = -0.06933528929948807f; + float _34 = 1.0822921991348267f; + float _35 = -0.012962047010660172f; + float _36 = -0.002159259282052517f; + float _37 = -0.045465391129255295f; + float _38 = 1.0477596521377563f; + float _95; + float _96; + float _97; + float _149; + float _150; + float _151; + float _605; + float _638; + float _652; + float _716; + float _994; + float _995; + float _996; + float _1072; + float _1083; + float _1205; + float _1238; + float _1252; + float _1291; + float _1384; + float _1443; + float _1502; + float _1585; + float _1650; + float _1715; + float _1832; + float _1865; + float _1879; + float _1918; + float _2011; + float _2070; + float _2129; + float _2209; + float _2271; + float _2333; + float _2497; + float _2498; + float _2499; + if (!((((uint)(cb0_065w)) == 1))) { + _30 = 1.02579927444458f; + _31 = -0.020052503794431686f; + _32 = -0.0057713985443115234f; + _33 = -0.0022350111976265907f; + _34 = 1.0045825242996216f; + _35 = -0.002352306619286537f; + _36 = -0.005014004185795784f; + _37 = -0.025293385609984398f; + _38 = 1.0304402112960815f; + if (!((((uint)(cb0_065w)) == 2))) { + _30 = 0.6954522132873535f; + _31 = 0.14067870378494263f; + _32 = 0.16386906802654266f; + _33 = 0.044794563204050064f; + _34 = 0.8596711158752441f; + _35 = 0.0955343171954155f; + _36 = -0.005525882821530104f; + _37 = 0.004025210160762072f; + _38 = 1.0015007257461548f; + if (!((((uint)(cb0_065w)) == 3))) { + bool _19 = (((uint)(cb0_065w)) == 4); + _30 = ((_19 ? 1.0f : 1.7050515413284302f)); + _31 = ((_19 ? 0.0f : -0.6217905879020691f)); + _32 = ((_19 ? 0.0f : -0.0832584798336029f)); + _33 = ((_19 ? 0.0f : -0.13025718927383423f)); + _34 = ((_19 ? 1.0f : 1.1408027410507202f)); + _35 = ((_19 ? 0.0f : -0.010548528283834457f)); + _36 = ((_19 ? 0.0f : -0.024003278464078903f)); + _37 = ((_19 ? 0.0f : -0.1289687603712082f)); + _38 = ((_19 ? 1.0f : 1.152971863746643f)); + } + } + } + if (((((uint)(cb0_065z)) > 2))) { + float _48 = exp2(((log2((_5 * 1.0322580337524414f))) * 0.012683313339948654f)); + float _49 = exp2(((log2((_6 * 1.0322580337524414f))) * 0.012683313339948654f)); + float _50 = exp2(((log2((_9 * 0.032258063554763794f))) * 0.012683313339948654f)); + _95 = ((exp2(((log2(((max(0.0f, (_48 + -0.8359375f))) / (18.8515625f - (_48 * 18.6875f))))) * 6.277394771575928f))) * 100.0f); + _96 = ((exp2(((log2(((max(0.0f, (_49 + -0.8359375f))) / (18.8515625f - (_49 * 18.6875f))))) * 6.277394771575928f))) * 100.0f); + _97 = ((exp2(((log2(((max(0.0f, (_50 + -0.8359375f))) / (18.8515625f - (_50 * 18.6875f))))) * 6.277394771575928f))) * 100.0f); + } else { + _95 = (((exp2(((_5 * 14.45161247253418f) + -6.07624626159668f))) * 0.18000000715255737f) + -0.002667719265446067f); + _96 = (((exp2(((_6 * 14.45161247253418f) + -6.07624626159668f))) * 0.18000000715255737f) + -0.002667719265446067f); + _97 = (((exp2(((_9 * 0.4516128897666931f) + -6.07624626159668f))) * 0.18000000715255737f) + -0.002667719265446067f); + } + float _100 = mad(0.04736635088920593f, _97, (mad(0.3395121395587921f, _96, (_95 * 0.613191545009613f)))); + float _103 = mad(0.01345000695437193f, _97, (mad(0.9163357615470886f, _96, (_95 * 0.07020691782236099f)))); + float _106 = mad(0.8696067929267883f, _97, (mad(0.1095672994852066f, _96, (_95 * 0.020618872717022896f)))); + bool _109 = (((uint)(cb0_044y)) == 0); + _149 = _100; + _150 = _103; + _151 = _106; + if (_109) { + float _111 = dot(float3(_100, _103, _106), float3(0.2722287178039551f, 0.6740817427635193f, 0.053689517080783844f)); + float _115 = (_100 / _111) + -1.0f; + float _116 = (_103 / _111) + -1.0f; + float _117 = (_106 / _111) + -1.0f; + float _129 = (1.0f - (exp2((((_111 * _111) * -4.0f) * (cb0_066y))))) * (1.0f - (exp2(((dot(float3(_115, _116, _117), float3(_115, _116, _117))) * -4.0f)))); + _149 = ((((mad(-0.06368283927440643f, _106, (mad(-0.32929131388664246f, _103, (_100 * 1.370412826538086f))))) - _100) * _129) + _100); + _150 = ((((mad(-0.010861567221581936f, _106, (mad(1.0970908403396606f, _103, (_100 * -0.08343426138162613f))))) - _103) * _129) + _103); + _151 = ((((mad(1.203694462776184f, _106, (mad(-0.09862564504146576f, _103, (_100 * -0.02579325996339321f))))) - _106) * _129) + _106); + } + float _152 = dot(float3(_149, _150, _151), float3(0.2722287178039551f, 0.6740817427635193f, 0.053689517080783844f)); + float _166 = (cb0_049w) + (cb0_054w); + float _180 = (cb0_048w) * (cb0_053w); + float _194 = (cb0_047w) * (cb0_052w); + float _208 = (cb0_046w) * (cb0_051w); + float _222 = (cb0_045w) * (cb0_050w); + float _226 = _149 - _152; + float _227 = _150 - _152; + float _228 = _151 - _152; + float _286 = saturate((_152 / (cb0_065x))); + float _290 = (_286 * _286) * (3.0f - (_286 * 2.0f)); + float _291 = 1.0f - _290; + float _300 = (cb0_049w) + (cb0_064w); + float _309 = (cb0_048w) * (cb0_063w); + float _318 = (cb0_047w) * (cb0_062w); + float _327 = (cb0_046w) * (cb0_061w); + float _336 = (cb0_045w) * (cb0_060w); + float _398 = saturate(((_152 - (cb0_065y)) / (1.0f - (cb0_065y)))); + float _402 = (_398 * _398) * (3.0f - (_398 * 2.0f)); + float _411 = (cb0_049w) + (cb0_059w); + float _420 = (cb0_048w) * (cb0_058w); + float _429 = (cb0_047w) * (cb0_057w); + float _438 = (cb0_046w) * (cb0_056w); + float _447 = (cb0_045w) * (cb0_055w); + float _505 = _290 - _402; + float _516 = ((_402 * ((((cb0_049x) + (cb0_064x)) + _300) + ((((cb0_048x) * (cb0_063x)) * _309) * (exp2(((log2(((exp2(((((cb0_046x) * (cb0_061x)) * _327) * (log2(((max(0.0f, (((((cb0_045x) * (cb0_060x)) * _336) * _226) + _152))) * 5.55555534362793f)))))) * 0.18000000715255737f))) * (1.0f / (((cb0_047x) * (cb0_062x)) * _318)))))))) + (_291 * ((((cb0_049x) + (cb0_054x)) + _166) + ((((cb0_048x) * (cb0_053x)) * _180) * (exp2(((log2(((exp2(((((cb0_046x) * (cb0_051x)) * _208) * (log2(((max(0.0f, (((((cb0_045x) * (cb0_050x)) * _222) * _226) + _152))) * 5.55555534362793f)))))) * 0.18000000715255737f))) * (1.0f / (((cb0_047x) * (cb0_052x)) * _194))))))))) + (((((cb0_049x) + (cb0_059x)) + _411) + ((((cb0_048x) * (cb0_058x)) * _420) * (exp2(((log2(((exp2(((((cb0_046x) * (cb0_056x)) * _438) * (log2(((max(0.0f, (((((cb0_045x) * (cb0_055x)) * _447) * _226) + _152))) * 5.55555534362793f)))))) * 0.18000000715255737f))) * (1.0f / (((cb0_047x) * (cb0_057x)) * _429))))))) * _505); + float _518 = ((_402 * ((((cb0_049y) + (cb0_064y)) + _300) + ((((cb0_048y) * (cb0_063y)) * _309) * (exp2(((log2(((exp2(((((cb0_046y) * (cb0_061y)) * _327) * (log2(((max(0.0f, (((((cb0_045y) * (cb0_060y)) * _336) * _227) + _152))) * 5.55555534362793f)))))) * 0.18000000715255737f))) * (1.0f / (((cb0_047y) * (cb0_062y)) * _318)))))))) + (_291 * ((((cb0_049y) + (cb0_054y)) + _166) + ((((cb0_048y) * (cb0_053y)) * _180) * (exp2(((log2(((exp2(((((cb0_046y) * (cb0_051y)) * _208) * (log2(((max(0.0f, (((((cb0_045y) * (cb0_050y)) * _222) * _227) + _152))) * 5.55555534362793f)))))) * 0.18000000715255737f))) * (1.0f / (((cb0_047y) * (cb0_052y)) * _194))))))))) + (((((cb0_049y) + (cb0_059y)) + _411) + ((((cb0_048y) * (cb0_058y)) * _420) * (exp2(((log2(((exp2(((((cb0_046y) * (cb0_056y)) * _438) * (log2(((max(0.0f, (((((cb0_045y) * (cb0_055y)) * _447) * _227) + _152))) * 5.55555534362793f)))))) * 0.18000000715255737f))) * (1.0f / (((cb0_047y) * (cb0_057y)) * _429))))))) * _505); + float _520 = ((_402 * ((((cb0_049z) + (cb0_064z)) + _300) + ((((cb0_048z) * (cb0_063z)) * _309) * (exp2(((log2(((exp2(((((cb0_046z) * (cb0_061z)) * _327) * (log2(((max(0.0f, (((((cb0_045z) * (cb0_060z)) * _336) * _228) + _152))) * 5.55555534362793f)))))) * 0.18000000715255737f))) * (1.0f / (((cb0_047z) * (cb0_062z)) * _318)))))))) + (_291 * ((((cb0_049z) + (cb0_054z)) + _166) + ((((cb0_048z) * (cb0_053z)) * _180) * (exp2(((log2(((exp2(((((cb0_046z) * (cb0_051z)) * _208) * (log2(((max(0.0f, (((((cb0_045z) * (cb0_050z)) * _222) * _228) + _152))) * 5.55555534362793f)))))) * 0.18000000715255737f))) * (1.0f / (((cb0_047z) * (cb0_052z)) * _194))))))))) + (((((cb0_049z) + (cb0_059z)) + _411) + ((((cb0_048z) * (cb0_058z)) * _420) * (exp2(((log2(((exp2(((((cb0_046z) * (cb0_056z)) * _438) * (log2(((max(0.0f, (((((cb0_045z) * (cb0_055z)) * _447) * _228) + _152))) * 5.55555534362793f)))))) * 0.18000000715255737f))) * (1.0f / (((cb0_047z) * (cb0_057z)) * _429))))))) * _505); + + float3 untonemapped_ap1 = float3(_516, _518, _520); // CustomEdit + + float _523 = mad(-0.0832584798336029f, _520, (mad(-0.6217905879020691f, _518, (_516 * 1.7050515413284302f)))); + float _526 = mad(-0.010548528283834457f, _520, (mad(1.1408027410507202f, _518, (_516 * -0.13025718927383423f)))); + float _529 = mad(1.152971863746643f, _520, (mad(-0.1289687603712082f, _518, (_516 * -0.024003278464078903f)))); + float _545 = (((mad(0.061360642313957214f, _520, (mad(-4.540197551250458e-09f, _518, (_516 * 0.9386394023895264f))))) - _516) * (cb0_066x)) + _516; + float _546 = (((mad(0.169205904006958f, _520, (mad(0.8307942152023315f, _518, (_516 * 6.775371730327606e-08f))))) - _518) * (cb0_066x)) + _518; + float _547 = ((mad(-2.3283064365386963e-10f, _518, (_516 * -9.313225746154785e-10f))) * (cb0_066x)) + _520; + float _550 = mad(0.16386905312538147f, _547, (mad(0.14067868888378143f, _546, (_545 * 0.6954522132873535f)))); + float _553 = mad(0.0955343246459961f, _547, (mad(0.8596711158752441f, _546, (_545 * 0.044794581830501556f)))); + float _556 = mad(1.0015007257461548f, _547, (mad(0.004025210160762072f, _546, (_545 * -0.005525882821530104f)))); + float _560 = max((max(_550, _553)), _556); + float _565 = ((max(_560, 1.000000013351432e-10f)) - (max((min((min(_550, _553)), _556)), 1.000000013351432e-10f))) / (max(_560, 0.009999999776482582f)); + float _578 = ((_553 + _550) + _556) + ((sqrt(((((_556 - _553) * _556) + ((_553 - _550) * _553)) + ((_550 - _556) * _550)))) * 1.75f); + float _579 = _578 * 0.3333333432674408f; + float _580 = _565 + -0.4000000059604645f; + float _581 = _580 * 5.0f; + float _585 = max((1.0f - (abs((_580 * 2.5f)))), 0.0f); + float _596 = (((float(((int(((bool)((_581 > 0.0f))))) - (int(((bool)((_581 < 0.0f)))))))) * (1.0f - (_585 * _585))) + 1.0f) * 0.02500000037252903f; + _605 = _596; + if ((!(_579 <= 0.0533333346247673f))) { + _605 = 0.0f; + if ((!(_579 >= 0.1599999964237213f))) { + _605 = (((0.23999999463558197f / _578) + -0.5f) * _596); + } + } + float _606 = _605 + 1.0f; + float _607 = _606 * _550; + float _608 = _606 * _553; + float _609 = _606 * _556; + _638 = 0.0f; + if (!(((bool)((_607 == _608))) && ((bool)((_608 == _609))))) { + float _616 = ((_607 * 2.0f) - _608) - _609; + float _619 = ((_553 - _556) * 1.7320507764816284f) * _606; + float _621 = atan((_619 / _616)); + bool _624 = (_616 < 0.0f); + bool _625 = (_616 == 0.0f); + bool _626 = (_619 >= 0.0f); + bool _627 = (_619 < 0.0f); + _638 = ((((bool)(_626 && _625)) ? 90.0f : ((((bool)(_627 && _625)) ? -90.0f : (((((bool)(_627 && _624)) ? (_621 + -3.1415927410125732f) : ((((bool)(_626 && _624)) ? (_621 + 3.1415927410125732f) : _621)))) * 57.2957763671875f))))); + } + float _643 = min((max(((((bool)((_638 < 0.0f))) ? (_638 + 360.0f) : _638)), 0.0f)), 360.0f); + if (((_643 < -180.0f))) { + _652 = (_643 + 360.0f); + } else { + _652 = _643; + if (((_643 > 180.0f))) { + _652 = (_643 + -360.0f); + } + } + float _656 = saturate((1.0f - (abs((_652 * 0.014814814552664757f))))); + float _660 = (_656 * _656) * (3.0f - (_656 * 2.0f)); + float _666 = ((_660 * _660) * ((_565 * 0.18000000715255737f) * (0.029999999329447746f - _607))) + _607; + float _676 = max(0.0f, (mad(-0.21492856740951538f, _609, (mad(-0.2365107536315918f, _608, (_666 * 1.4514392614364624f)))))); + float _677 = max(0.0f, (mad(-0.09967592358589172f, _609, (mad(1.17622971534729f, _608, (_666 * -0.07655377686023712f)))))); + float _678 = max(0.0f, (mad(0.9977163076400757f, _609, (mad(-0.006032449658960104f, _608, (_666 * 0.008316148072481155f)))))); + float _679 = dot(float3(_676, _677, _678), float3(0.2722287178039551f, 0.6740817427635193f, 0.053689517080783844f)); + float _693 = ((cb0_036w) + 1.0f) - (cb0_036y); + float _696 = (cb0_037x) + 1.0f; + float _698 = _696 - (cb0_036z); + if ((((cb0_036y) > 0.800000011920929f))) { + _716 = (((0.8199999928474426f - (cb0_036y)) / (cb0_036x)) + -0.7447274923324585f); + } else { + float _707 = ((cb0_036w) + 0.18000000715255737f) / _693; + _716 = (-0.7447274923324585f - (((log2((_707 / (2.0f - _707)))) * 0.3465735912322998f) * (_693 / (cb0_036x)))); + } + float _719 = ((1.0f - (cb0_036y)) / (cb0_036x)) - _716; + float _721 = ((cb0_036z) / (cb0_036x)) - _719; + float _725 = (log2((((_676 - _679) * 0.9599999785423279f) + _679))) * 0.3010300099849701f; + float _726 = (log2((((_677 - _679) * 0.9599999785423279f) + _679))) * 0.3010300099849701f; + float _727 = (log2((((_678 - _679) * 0.9599999785423279f) + _679))) * 0.3010300099849701f; + float _731 = (cb0_036x) * (_725 + _719); + float _732 = (cb0_036x) * (_726 + _719); + float _733 = (cb0_036x) * (_727 + _719); + float _734 = _693 * 2.0f; + float _736 = ((cb0_036x) * -2.0f) / _693; + float _737 = _725 - _716; + float _738 = _726 - _716; + float _739 = _727 - _716; + float _758 = _698 * 2.0f; + float _760 = ((cb0_036x) * 2.0f) / _698; + float _785 = (((bool)((_725 < _716))) ? ((_734 / ((exp2(((_737 * 1.4426950216293335f) * _736))) + 1.0f)) - (cb0_036w)) : _731); + float _786 = (((bool)((_726 < _716))) ? ((_734 / ((exp2(((_738 * 1.4426950216293335f) * _736))) + 1.0f)) - (cb0_036w)) : _732); + float _787 = (((bool)((_727 < _716))) ? ((_734 / ((exp2(((_739 * 1.4426950216293335f) * _736))) + 1.0f)) - (cb0_036w)) : _733); + float _794 = _721 - _716; + float _798 = saturate((_737 / _794)); + float _799 = saturate((_738 / _794)); + float _800 = saturate((_739 / _794)); + bool _801 = (_721 < _716); + float _805 = (_801 ? (1.0f - _798) : _798); + float _806 = (_801 ? (1.0f - _799) : _799); + float _807 = (_801 ? (1.0f - _800) : _800); + float _826 = (((_805 * _805) * (((((bool)((_725 > _721))) ? (_696 - (_758 / ((exp2((((_725 - _721) * 1.4426950216293335f) * _760))) + 1.0f))) : _731)) - _785)) * (3.0f - (_805 * 2.0f))) + _785; + float _827 = (((_806 * _806) * (((((bool)((_726 > _721))) ? (_696 - (_758 / ((exp2((((_726 - _721) * 1.4426950216293335f) * _760))) + 1.0f))) : _732)) - _786)) * (3.0f - (_806 * 2.0f))) + _786; + float _828 = (((_807 * _807) * (((((bool)((_727 > _721))) ? (_696 - (_758 / ((exp2((((_727 - _721) * 1.4426950216293335f) * _760))) + 1.0f))) : _733)) - _787)) * (3.0f - (_807 * 2.0f))) + _787; + float _829 = dot(float3(_826, _827, _828), float3(0.2722287178039551f, 0.6740817427635193f, 0.053689517080783844f)); + float _849 = ((cb0_066z) * ((max(0.0f, (((_826 - _829) * 0.9300000071525574f) + _829))) - _545)) + _545; + float _850 = ((cb0_066z) * ((max(0.0f, (((_827 - _829) * 0.9300000071525574f) + _829))) - _546)) + _546; + float _851 = ((cb0_066z) * ((max(0.0f, (((_828 - _829) * 0.9300000071525574f) + _829))) - _547)) + _547; + float _867 = (((mad(-0.06537103652954102f, _851, (mad(1.451815478503704e-06f, _850, (_849 * 1.065374732017517f))))) - _849) * (cb0_066x)) + _849; + float _868 = (((mad(-0.20366770029067993f, _851, (mad(1.2036634683609009f, _850, (_849 * -2.57161445915699e-07f))))) - _850) * (cb0_066x)) + _850; + float _869 = (((mad(0.9999996423721313f, _851, (mad(2.0954757928848267e-08f, _850, (_849 * 1.862645149230957e-08f))))) - _851) * (cb0_066x)) + _851; + _994 = (max(0.0f, (mad(-0.0832584798336029f, _869, (mad(-0.6217905879020691f, _868, (_867 * 1.7050515413284302f))))))); + _995 = (max(0.0f, (mad(-0.010548528283834457f, _869, (mad(1.1408027410507202f, _868, (_867 * -0.13025718927383423f))))))); + _996 = (max(0.0f, (mad(1.152971863746643f, _869, (mad(-0.1289687603712082f, _868, (_867 * -0.024003278464078903f))))))); + if (!_109) { + float _912 = 1.0f / ((dot(float3(_523, _526, _529), float3((cb0_033x), (cb0_033y), (cb0_033z)))) + 1.0f); + float _922 = max(0.0f, (((_912 * (cb0_035x)) + (cb0_034x)) * (dot(float3(_523, _526, _529), float3((cb0_028x), (cb0_028y), (cb0_028z)))))); + float _923 = max(0.0f, (((_912 * (cb0_035y)) + (cb0_034y)) * (dot(float3(_523, _526, _529), float3((cb0_029x), (cb0_029y), (cb0_029z)))))); + float _924 = max(0.0f, (((_912 * (cb0_035z)) + (cb0_034z)) * (dot(float3(_523, _526, _529), float3((cb0_030x), (cb0_030y), (cb0_030z)))))); + float _930 = max(0.0f, ((cb0_031x) - _922)); + float _931 = max(0.0f, ((cb0_031x) - _923)); + float _932 = max(0.0f, ((cb0_031x) - _924)); + float _934 = max(_922, (cb0_031z)); + float _935 = max(_923, (cb0_031z)); + float _936 = max(_924, (cb0_031z)); + _994 = ((((((((cb0_032x) * _934) + (cb0_032y)) * (1.0f / ((cb0_031w) + _934))) + -0.0020000000949949026f) + ((cb0_030w) * (min((max(_922, (cb0_031x))), (cb0_031z))))) + (((cb0_028w) * _930) * (1.0f / ((cb0_031y) + _930)))) + (cb0_029w)); + _995 = ((((((1.0f / ((cb0_031w) + _935)) * (((cb0_032x) * _935) + (cb0_032y))) + -0.0020000000949949026f) + ((cb0_030w) * (min((max(_923, (cb0_031x))), (cb0_031z))))) + (((cb0_028w) * _931) * (1.0f / ((cb0_031y) + _931)))) + (cb0_029w)); + _996 = ((((((1.0f / ((cb0_031w) + _936)) * (((cb0_032x) * _936) + (cb0_032y))) + -0.0020000000949949026f) + ((cb0_030w) * (min((max(_924, (cb0_031x))), (cb0_031z))))) + (((cb0_028w) * _932) * (1.0f / ((cb0_031y) + _932)))) + (cb0_029w)); + } + float _1022 = (cb0_042y) * ((((cb0_026y) + ((cb0_026x) * _994)) * _994) + (cb0_026z)); + float _1023 = (cb0_042z) * ((((cb0_026y) + ((cb0_026x) * _995)) * _995) + (cb0_026z)); + float _1024 = (cb0_042w) * ((((cb0_026y) + ((cb0_026x) * _996)) * _996) + (cb0_026z)); + float _1031 = (((cb0_043x) - _1022) * (cb0_043w)) + _1022; + float _1032 = (((cb0_043y) - _1023) * (cb0_043w)) + _1023; + float _1033 = (((cb0_043z) - _1024) * (cb0_043w)) + _1024; + float _1034 = (cb0_042y) * _523; + float _1035 = (cb0_042z) * _526; + float _1036 = (cb0_042w) * _529; + float _1043 = (((cb0_043x) - _1034) * (cb0_043w)) + _1034; + float _1044 = (((cb0_043y) - _1035) * (cb0_043w)) + _1035; + float _1045 = (((cb0_043z) - _1036) * (cb0_043w)) + _1036; + float _1057 = exp2(((log2((max(0.0f, _1031)))) * (cb0_027y))); + float _1058 = exp2(((log2((max(0.0f, _1032)))) * (cb0_027y))); + float _1059 = exp2(((log2((max(0.0f, _1033)))) * (cb0_027y))); + + if (injectedData.toneMapType != 0) { + return LutBuilderToneMap(untonemapped_ap1, float3(_1057, _1058, _1059)); + } + + if (((((uint)(cb0_065z)) == 0))) { + do { + if (((_1057 < 0.0031306699384003878f))) { + _1072 = (_1057 * 12.920000076293945f); + } else { + _1072 = (((exp2(((log2(_1057)) * 0.4166666567325592f))) * 1.0549999475479126f) + -0.054999999701976776f); + } + do { + if (((_1058 < 0.0031306699384003878f))) { + _1083 = (_1058 * 12.920000076293945f); + } else { + _1083 = (((exp2(((log2(_1058)) * 0.4166666567325592f))) * 1.0549999475479126f) + -0.054999999701976776f); + } + if (((_1059 < 0.0031306699384003878f))) { + _2497 = _1072; + _2498 = _1083; + _2499 = (_1059 * 12.920000076293945f); + } else { + _2497 = _1072; + _2498 = _1083; + _2499 = (((exp2(((log2(_1059)) * 0.4166666567325592f))) * 1.0549999475479126f) + -0.054999999701976776f); + } + } while (false); + } while (false); + } else { + if (((((uint)(cb0_065z)) == 1))) { + float _1098 = mad(0.04736635088920593f, _1059, (mad(0.3395121395587921f, _1058, (_1057 * 0.613191545009613f)))); + float _1101 = mad(0.01345000695437193f, _1059, (mad(0.9163357615470886f, _1058, (_1057 * 0.07020691782236099f)))); + float _1104 = mad(0.8696067929267883f, _1059, (mad(0.1095672994852066f, _1058, (_1057 * 0.020618872717022896f)))); + float _1114 = max(6.103519990574569e-05f, (mad(_32, _1104, (mad(_31, _1101, (_1098 * _30)))))); + float _1115 = max(6.103519990574569e-05f, (mad(_35, _1104, (mad(_34, _1101, (_1098 * _33)))))); + float _1116 = max(6.103519990574569e-05f, (mad(_38, _1104, (mad(_37, _1101, (_1098 * _36)))))); + _2497 = (min((_1114 * 4.5f), (((exp2(((log2((max(_1114, 0.017999999225139618f)))) * 0.44999998807907104f))) * 1.0989999771118164f) + -0.0989999994635582f))); + _2498 = (min((_1115 * 4.5f), (((exp2(((log2((max(_1115, 0.017999999225139618f)))) * 0.44999998807907104f))) * 1.0989999771118164f) + -0.0989999994635582f))); + _2499 = (min((_1116 * 4.5f), (((exp2(((log2((max(_1116, 0.017999999225139618f)))) * 0.44999998807907104f))) * 1.0989999771118164f) + -0.0989999994635582f))); + } else { + if ((((bool)((((uint)(cb0_065z)) == 3))) || ((bool)((((uint)(cb0_065z)) == 5))))) { + float _1146 = _1044 * 1.5f; + float _1147 = _1045 * 1.5f; + float _1150 = mad(0.17733481526374817f, _1147, (mad(0.38297808170318604f, _1146, (_1043 * 0.659551203250885f)))); + float _1153 = mad(0.09676162153482437f, _1147, (mad(0.8134231567382812f, _1146, (_1043 * 0.13468848168849945f)))); + float _1156 = mad(0.870704174041748f, _1147, (mad(0.11154405772686005f, _1146, (_1043 * 0.02631598338484764f)))); + float _1160 = max((max(_1150, _1153)), _1156); + float _1165 = ((max(_1160, 1.000000013351432e-10f)) - (max((min((min(_1150, _1153)), _1156)), 1.000000013351432e-10f))) / (max(_1160, 0.009999999776482582f)); + float _1178 = ((_1153 + _1150) + _1156) + ((sqrt(((((_1156 - _1153) * _1156) + ((_1153 - _1150) * _1153)) + ((_1150 - _1156) * _1150)))) * 1.75f); + float _1179 = _1178 * 0.3333333432674408f; + float _1180 = _1165 + -0.4000000059604645f; + float _1181 = _1180 * 5.0f; + float _1185 = max((1.0f - (abs((_1180 * 2.5f)))), 0.0f); + float _1196 = (((float(((int(((bool)((_1181 > 0.0f))))) - (int(((bool)((_1181 < 0.0f)))))))) * (1.0f - (_1185 * _1185))) + 1.0f) * 0.02500000037252903f; + _1205 = _1196; + do { + if ((!(_1179 <= 0.0533333346247673f))) { + _1205 = 0.0f; + if ((!(_1179 >= 0.1599999964237213f))) { + _1205 = (((0.23999999463558197f / _1178) + -0.5f) * _1196); + } + } + float _1206 = _1205 + 1.0f; + float _1207 = _1206 * _1150; + float _1208 = _1206 * _1153; + float _1209 = _1206 * _1156; + _1238 = 0.0f; + do { + if (!(((bool)((_1207 == _1208))) && ((bool)((_1208 == _1209))))) { + float _1216 = ((_1207 * 2.0f) - _1208) - _1209; + float _1219 = ((_1153 - _1156) * 1.7320507764816284f) * _1206; + float _1221 = atan((_1219 / _1216)); + bool _1224 = (_1216 < 0.0f); + bool _1225 = (_1216 == 0.0f); + bool _1226 = (_1219 >= 0.0f); + bool _1227 = (_1219 < 0.0f); + _1238 = ((((bool)(_1226 && _1225)) ? 90.0f : ((((bool)(_1227 && _1225)) ? -90.0f : (((((bool)(_1227 && _1224)) ? (_1221 + -3.1415927410125732f) : ((((bool)(_1226 && _1224)) ? (_1221 + 3.1415927410125732f) : _1221)))) * 57.2957763671875f))))); + } + float _1243 = min((max(((((bool)((_1238 < 0.0f))) ? (_1238 + 360.0f) : _1238)), 0.0f)), 360.0f); + do { + if (((_1243 < -180.0f))) { + _1252 = (_1243 + 360.0f); + } else { + _1252 = _1243; + if (((_1243 > 180.0f))) { + _1252 = (_1243 + -360.0f); + } + } + _1291 = 0.0f; + do { + if ((((bool)((_1252 > -67.5f))) && ((bool)((_1252 < 67.5f))))) { + float _1258 = (_1252 + 67.5f) * 0.029629629105329514f; + int _1259 = int(1259); + float _1261 = _1258 - (float(_1259)); + float _1262 = _1261 * _1261; + float _1263 = _1262 * _1261; + if (((_1259 == 3))) { + _1291 = (((0.1666666716337204f - (_1261 * 0.5f)) + (_1262 * 0.5f)) - (_1263 * 0.1666666716337204f)); + } else { + if (((_1259 == 2))) { + _1291 = ((0.6666666865348816f - _1262) + (_1263 * 0.5f)); + } else { + if (((_1259 == 1))) { + _1291 = (((_1263 * -0.5f) + 0.1666666716337204f) + ((_1262 + _1261) * 0.5f)); + } else { + _1291 = ((((bool)((_1259 == 0))) ? (_1263 * 0.1666666716337204f) : 0.0f)); + } + } + } + } + float _1300 = min((max(((((_1165 * 0.27000001072883606f) * (0.029999999329447746f - _1207)) * _1291) + _1207), 0.0f)), 65535.0f); + float _1301 = min((max(_1208, 0.0f)), 65535.0f); + float _1302 = min((max(_1209, 0.0f)), 65535.0f); + float _1315 = min((max((mad(-0.21492856740951538f, _1302, (mad(-0.2365107536315918f, _1301, (_1300 * 1.4514392614364624f))))), 0.0f)), 65535.0f); + float _1316 = min((max((mad(-0.09967592358589172f, _1302, (mad(1.17622971534729f, _1301, (_1300 * -0.07655377686023712f))))), 0.0f)), 65535.0f); + float _1317 = min((max((mad(0.9977163076400757f, _1302, (mad(-0.006032449658960104f, _1301, (_1300 * 0.008316148072481155f))))), 0.0f)), 65535.0f); + float _1318 = dot(float3(_1315, _1316, _1317), float3(0.2722287178039551f, 0.6740817427635193f, 0.053689517080783844f)); + float _1325 = ((_1315 - _1318) * 0.9599999785423279f) + _1318; + float _1326 = ((_1316 - _1318) * 0.9599999785423279f) + _1318; + float _1327 = ((_1317 - _1318) * 0.9599999785423279f) + _1318; + float _1330 = log2(((((bool)((_1325 <= 0.0f))) ? 6.103515625e-05f : _1325))); + float _1331 = _1330 * 0.3010300099849701f; + _1384 = -4.0f; + do { + if ((!(_1331 <= -5.2601776123046875f))) { + if ((((bool)((_1331 > -5.2601776123046875f))) && ((bool)((_1331 < -0.7447274923324585f))))) { + float _1339 = (_1330 * 0.19999998807907104f) + 3.494786262512207f; + int _1340 = int(1340); + float _1342 = _1339 - (float(_1340)); + float _1344 = _global_0[_1340]; + float _1347 = _global_0[(_1340 + 1)]; + float _1352 = _1344 * 0.5f; + _1384 = (dot(float3((_1342 * _1342), _1342, 1.0f), float3((mad((_global_0[(_1340 + 2)]), 0.5f, (mad(_1347, -1.0f, _1352)))), (_1347 - _1344), (mad(_1347, 0.5f, _1352))))); + } else { + _1384 = 4.0f; + if ((((bool)((_1331 >= -0.7447274923324585f))) && ((bool)((_1331 < 4.673812389373779f))))) { + float _1364 = (_1330 * 0.1666666567325592f) + 0.4123218357563019f; + int _1365 = int(1365); + float _1367 = _1364 - (float(_1365)); + float _1369 = _global_1[_1365]; + float _1372 = _global_1[(_1365 + 1)]; + float _1377 = _1369 * 0.5f; + _1384 = (dot(float3((_1367 * _1367), _1367, 1.0f), float3((mad((_global_1[(_1365 + 2)]), 0.5f, (mad(_1372, -1.0f, _1377)))), (_1372 - _1369), (mad(_1372, 0.5f, _1377))))); + } + } + } + float _1386 = exp2((_1384 * 3.321928024291992f)); + float _1389 = log2(((((bool)((_1326 <= 0.0f))) ? 6.103515625e-05f : _1326))); + float _1390 = _1389 * 0.3010300099849701f; + _1443 = -4.0f; + do { + if ((!(_1390 <= -5.2601776123046875f))) { + if ((((bool)((_1390 > -5.2601776123046875f))) && ((bool)((_1390 < -0.7447274923324585f))))) { + float _1398 = (_1389 * 0.19999998807907104f) + 3.494786262512207f; + int _1399 = int(1399); + float _1401 = _1398 - (float(_1399)); + float _1403 = _global_0[_1399]; + float _1406 = _global_0[(_1399 + 1)]; + float _1411 = _1403 * 0.5f; + _1443 = (dot(float3((_1401 * _1401), _1401, 1.0f), float3((mad((_global_0[(_1399 + 2)]), 0.5f, (mad(_1406, -1.0f, _1411)))), (_1406 - _1403), (mad(_1406, 0.5f, _1411))))); + } else { + _1443 = 4.0f; + if ((((bool)((_1390 >= -0.7447274923324585f))) && ((bool)((_1390 < 4.673812389373779f))))) { + float _1423 = (_1389 * 0.1666666567325592f) + 0.4123218357563019f; + int _1424 = int(1424); + float _1426 = _1423 - (float(_1424)); + float _1428 = _global_1[_1424]; + float _1431 = _global_1[(_1424 + 1)]; + float _1436 = _1428 * 0.5f; + _1443 = (dot(float3((_1426 * _1426), _1426, 1.0f), float3((mad((_global_1[(_1424 + 2)]), 0.5f, (mad(_1431, -1.0f, _1436)))), (_1431 - _1428), (mad(_1431, 0.5f, _1436))))); + } + } + } + float _1445 = exp2((_1443 * 3.321928024291992f)); + float _1448 = log2(((((bool)((_1327 <= 0.0f))) ? 6.103515625e-05f : _1327))); + float _1449 = _1448 * 0.3010300099849701f; + _1502 = -4.0f; + do { + if ((!(_1449 <= -5.2601776123046875f))) { + if ((((bool)((_1449 > -5.2601776123046875f))) && ((bool)((_1449 < -0.7447274923324585f))))) { + float _1457 = (_1448 * 0.19999998807907104f) + 3.494786262512207f; + int _1458 = int(1458); + float _1460 = _1457 - (float(_1458)); + float _1462 = _global_0[_1458]; + float _1465 = _global_0[(_1458 + 1)]; + float _1470 = _1462 * 0.5f; + _1502 = (dot(float3((_1460 * _1460), _1460, 1.0f), float3((mad((_global_0[(_1458 + 2)]), 0.5f, (mad(_1465, -1.0f, _1470)))), (_1465 - _1462), (mad(_1465, 0.5f, _1470))))); + } else { + _1502 = 4.0f; + if ((((bool)((_1449 >= -0.7447274923324585f))) && ((bool)((_1449 < 4.673812389373779f))))) { + float _1482 = (_1448 * 0.1666666567325592f) + 0.4123218357563019f; + int _1483 = int(1483); + float _1485 = _1482 - (float(_1483)); + float _1487 = _global_1[_1483]; + float _1490 = _global_1[(_1483 + 1)]; + float _1495 = _1487 * 0.5f; + _1502 = (dot(float3((_1485 * _1485), _1485, 1.0f), float3((mad((_global_1[(_1483 + 2)]), 0.5f, (mad(_1490, -1.0f, _1495)))), (_1490 - _1487), (mad(_1490, 0.5f, _1495))))); + } + } + } + float _1504 = exp2((_1502 * 3.321928024291992f)); + float _1507 = mad(0.16386906802654266f, _1504, (mad(0.14067870378494263f, _1445, (_1386 * 0.6954522132873535f)))); + float _1510 = mad(0.0955343171954155f, _1504, (mad(0.8596711158752441f, _1445, (_1386 * 0.044794563204050064f)))); + float _1513 = mad(1.0015007257461548f, _1504, (mad(0.004025210160762072f, _1445, (_1386 * -0.005525882821530104f)))); + float _1516 = mad(-0.21492856740951538f, _1513, (mad(-0.2365107536315918f, _1510, (_1507 * 1.4514392614364624f)))); + float _1519 = mad(-0.09967592358589172f, _1513, (mad(1.17622971534729f, _1510, (_1507 * -0.07655377686023712f)))); + float _1522 = mad(0.9977163076400757f, _1513, (mad(-0.006032449658960104f, _1510, (_1507 * 0.008316148072481155f)))); + float _1525 = log2(((((bool)((_1516 <= 0.0f))) ? 9.999999747378752e-05f : _1516))); + float _1526 = _1525 * 0.3010300099849701f; + do { + if (!(!(_1526 <= -3.848327875137329f))) { + _1585 = ((_1525 * 0.9030900001525879f) + 7.54498291015625f); + } else { + if ((((bool)((_1526 > -3.848327875137329f))) && ((bool)((_1526 < 0.6812411546707153f))))) { + float _1537 = (_1525 + 12.783867835998535f) * 0.46521204710006714f; + int _1538 = int(1538); + float _1540 = _1537 - (float(_1538)); + float _1542 = _global_2[_1538]; + float _1545 = _global_2[(_1538 + 1)]; + float _1550 = _1542 * 0.5f; + _1585 = (dot(float3((_1540 * _1540), _1540, 1.0f), float3((mad((_global_2[(_1538 + 2)]), 0.5f, (mad(_1545, -1.0f, _1550)))), (_1545 - _1542), (mad(_1545, 0.5f, _1550))))); + } else { + if ((((bool)((_1526 >= 0.6812411546707153f))) && ((bool)((_1526 < 3.653702974319458f))))) { + float _1562 = (_1525 + -2.2630341053009033f) * 0.7089107632637024f; + int _1563 = int(1563); + float _1565 = _1562 - (float(_1563)); + float _1567 = _global_3[_1563]; + float _1570 = _global_3[(_1563 + 1)]; + float _1575 = _1567 * 0.5f; + _1585 = (dot(float3((_1565 * _1565), _1565, 1.0f), float3((mad((_global_3[(_1563 + 2)]), 0.5f, (mad(_1570, -1.0f, _1575)))), (_1570 - _1567), (mad(_1570, 0.5f, _1575))))); + } else { + _1585 = ((_1525 * 0.018061799928545952f) + 2.780777931213379f); + } + } + } + float _1590 = log2(((((bool)((_1519 <= 0.0f))) ? 9.999999747378752e-05f : _1519))); + float _1591 = _1590 * 0.3010300099849701f; + do { + if (!(!(_1591 <= -3.848327875137329f))) { + _1650 = ((_1590 * 0.9030900001525879f) + 7.54498291015625f); + } else { + if ((((bool)((_1591 > -3.848327875137329f))) && ((bool)((_1591 < 0.6812411546707153f))))) { + float _1602 = (_1590 + 12.783867835998535f) * 0.46521204710006714f; + int _1603 = int(1603); + float _1605 = _1602 - (float(_1603)); + float _1607 = _global_2[_1603]; + float _1610 = _global_2[(_1603 + 1)]; + float _1615 = _1607 * 0.5f; + _1650 = (dot(float3((_1605 * _1605), _1605, 1.0f), float3((mad((_global_2[(_1603 + 2)]), 0.5f, (mad(_1610, -1.0f, _1615)))), (_1610 - _1607), (mad(_1610, 0.5f, _1615))))); + } else { + if ((((bool)((_1591 >= 0.6812411546707153f))) && ((bool)((_1591 < 3.653702974319458f))))) { + float _1627 = (_1590 + -2.2630341053009033f) * 0.7089107632637024f; + int _1628 = int(1628); + float _1630 = _1627 - (float(_1628)); + float _1632 = _global_3[_1628]; + float _1635 = _global_3[(_1628 + 1)]; + float _1640 = _1632 * 0.5f; + _1650 = (dot(float3((_1630 * _1630), _1630, 1.0f), float3((mad((_global_3[(_1628 + 2)]), 0.5f, (mad(_1635, -1.0f, _1640)))), (_1635 - _1632), (mad(_1635, 0.5f, _1640))))); + } else { + _1650 = ((_1590 * 0.018061799928545952f) + 2.780777931213379f); + } + } + } + float _1655 = log2(((((bool)((_1522 <= 0.0f))) ? 9.999999747378752e-05f : _1522))); + float _1656 = _1655 * 0.3010300099849701f; + do { + if (!(!(_1656 <= -3.848327875137329f))) { + _1715 = ((_1655 * 0.9030900001525879f) + 7.54498291015625f); + } else { + if ((((bool)((_1656 > -3.848327875137329f))) && ((bool)((_1656 < 0.6812411546707153f))))) { + float _1667 = (_1655 + 12.783867835998535f) * 0.46521204710006714f; + int _1668 = int(1668); + float _1670 = _1667 - (float(_1668)); + float _1672 = _global_2[_1668]; + float _1675 = _global_2[(_1668 + 1)]; + float _1680 = _1672 * 0.5f; + _1715 = (dot(float3((_1670 * _1670), _1670, 1.0f), float3((mad((_global_2[(_1668 + 2)]), 0.5f, (mad(_1675, -1.0f, _1680)))), (_1675 - _1672), (mad(_1675, 0.5f, _1680))))); + } else { + if ((((bool)((_1656 >= 0.6812411546707153f))) && ((bool)((_1656 < 3.653702974319458f))))) { + float _1692 = (_1655 + -2.2630341053009033f) * 0.7089107632637024f; + int _1693 = int(1693); + float _1695 = _1692 - (float(_1693)); + float _1697 = _global_3[_1693]; + float _1700 = _global_3[(_1693 + 1)]; + float _1705 = _1697 * 0.5f; + _1715 = (dot(float3((_1695 * _1695), _1695, 1.0f), float3((mad((_global_3[(_1693 + 2)]), 0.5f, (mad(_1700, -1.0f, _1705)))), (_1700 - _1697), (mad(_1700, 0.5f, _1705))))); + } else { + _1715 = ((_1655 * 0.018061799928545952f) + 2.780777931213379f); + } + } + } + float _1718 = (exp2((_1585 * 3.321928024291992f))) + -3.507384462864138e-05f; + float _1719 = (exp2((_1650 * 3.321928024291992f))) + -3.507384462864138e-05f; + float _1720 = (exp2((_1715 * 3.321928024291992f))) + -3.507384462864138e-05f; + float _1739 = exp2(((log2(((mad(_32, _1720, (mad(_31, _1719, (_1718 * _30))))) * 9.999999747378752e-05f))) * 0.1593017578125f)); + float _1740 = exp2(((log2(((mad(_35, _1720, (mad(_34, _1719, (_1718 * _33))))) * 9.999999747378752e-05f))) * 0.1593017578125f)); + float _1741 = exp2(((log2(((mad(_38, _1720, (mad(_37, _1719, (_1718 * _36))))) * 9.999999747378752e-05f))) * 0.1593017578125f)); + _2497 = (exp2(((log2(((1.0f / ((_1739 * 18.6875f) + 1.0f)) * ((_1739 * 18.8515625f) + 0.8359375f)))) * 78.84375f))); + _2498 = (exp2(((log2(((1.0f / ((_1740 * 18.6875f) + 1.0f)) * ((_1740 * 18.8515625f) + 0.8359375f)))) * 78.84375f))); + _2499 = (exp2(((log2(((1.0f / ((_1741 * 18.6875f) + 1.0f)) * ((_1741 * 18.8515625f) + 0.8359375f)))) * 78.84375f))); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } else { + if ((((((uint)(cb0_065z)) & -3) == 4))) { + float _1773 = _1044 * 1.5f; + float _1774 = _1045 * 1.5f; + float _1777 = mad(0.17733481526374817f, _1774, (mad(0.38297808170318604f, _1773, (_1043 * 0.659551203250885f)))); + float _1780 = mad(0.09676162153482437f, _1774, (mad(0.8134231567382812f, _1773, (_1043 * 0.13468848168849945f)))); + float _1783 = mad(0.870704174041748f, _1774, (mad(0.11154405772686005f, _1773, (_1043 * 0.02631598338484764f)))); + float _1787 = max((max(_1777, _1780)), _1783); + float _1792 = ((max(_1787, 1.000000013351432e-10f)) - (max((min((min(_1777, _1780)), _1783)), 1.000000013351432e-10f))) / (max(_1787, 0.009999999776482582f)); + float _1805 = ((_1780 + _1777) + _1783) + ((sqrt(((((_1783 - _1780) * _1783) + ((_1780 - _1777) * _1780)) + ((_1777 - _1783) * _1777)))) * 1.75f); + float _1806 = _1805 * 0.3333333432674408f; + float _1807 = _1792 + -0.4000000059604645f; + float _1808 = _1807 * 5.0f; + float _1812 = max((1.0f - (abs((_1807 * 2.5f)))), 0.0f); + float _1823 = (((float(((int(((bool)((_1808 > 0.0f))))) - (int(((bool)((_1808 < 0.0f)))))))) * (1.0f - (_1812 * _1812))) + 1.0f) * 0.02500000037252903f; + _1832 = _1823; + do { + if ((!(_1806 <= 0.0533333346247673f))) { + _1832 = 0.0f; + if ((!(_1806 >= 0.1599999964237213f))) { + _1832 = (((0.23999999463558197f / _1805) + -0.5f) * _1823); + } + } + float _1833 = _1832 + 1.0f; + float _1834 = _1833 * _1777; + float _1835 = _1833 * _1780; + float _1836 = _1833 * _1783; + _1865 = 0.0f; + do { + if (!(((bool)((_1834 == _1835))) && ((bool)((_1835 == _1836))))) { + float _1843 = ((_1834 * 2.0f) - _1835) - _1836; + float _1846 = ((_1780 - _1783) * 1.7320507764816284f) * _1833; + float _1848 = atan((_1846 / _1843)); + bool _1851 = (_1843 < 0.0f); + bool _1852 = (_1843 == 0.0f); + bool _1853 = (_1846 >= 0.0f); + bool _1854 = (_1846 < 0.0f); + _1865 = ((((bool)(_1853 && _1852)) ? 90.0f : ((((bool)(_1854 && _1852)) ? -90.0f : (((((bool)(_1854 && _1851)) ? (_1848 + -3.1415927410125732f) : ((((bool)(_1853 && _1851)) ? (_1848 + 3.1415927410125732f) : _1848)))) * 57.2957763671875f))))); + } + float _1870 = min((max(((((bool)((_1865 < 0.0f))) ? (_1865 + 360.0f) : _1865)), 0.0f)), 360.0f); + do { + if (((_1870 < -180.0f))) { + _1879 = (_1870 + 360.0f); + } else { + _1879 = _1870; + if (((_1870 > 180.0f))) { + _1879 = (_1870 + -360.0f); + } + } + _1918 = 0.0f; + do { + if ((((bool)((_1879 > -67.5f))) && ((bool)((_1879 < 67.5f))))) { + float _1885 = (_1879 + 67.5f) * 0.029629629105329514f; + int _1886 = int(1886); + float _1888 = _1885 - (float(_1886)); + float _1889 = _1888 * _1888; + float _1890 = _1889 * _1888; + if (((_1886 == 3))) { + _1918 = (((0.1666666716337204f - (_1888 * 0.5f)) + (_1889 * 0.5f)) - (_1890 * 0.1666666716337204f)); + } else { + if (((_1886 == 2))) { + _1918 = ((0.6666666865348816f - _1889) + (_1890 * 0.5f)); + } else { + if (((_1886 == 1))) { + _1918 = (((_1890 * -0.5f) + 0.1666666716337204f) + ((_1889 + _1888) * 0.5f)); + } else { + _1918 = ((((bool)((_1886 == 0))) ? (_1890 * 0.1666666716337204f) : 0.0f)); + } + } + } + } + float _1927 = min((max(((((_1792 * 0.27000001072883606f) * (0.029999999329447746f - _1834)) * _1918) + _1834), 0.0f)), 65535.0f); + float _1928 = min((max(_1835, 0.0f)), 65535.0f); + float _1929 = min((max(_1836, 0.0f)), 65535.0f); + float _1942 = min((max((mad(-0.21492856740951538f, _1929, (mad(-0.2365107536315918f, _1928, (_1927 * 1.4514392614364624f))))), 0.0f)), 65535.0f); + float _1943 = min((max((mad(-0.09967592358589172f, _1929, (mad(1.17622971534729f, _1928, (_1927 * -0.07655377686023712f))))), 0.0f)), 65535.0f); + float _1944 = min((max((mad(0.9977163076400757f, _1929, (mad(-0.006032449658960104f, _1928, (_1927 * 0.008316148072481155f))))), 0.0f)), 65535.0f); + float _1945 = dot(float3(_1942, _1943, _1944), float3(0.2722287178039551f, 0.6740817427635193f, 0.053689517080783844f)); + float _1952 = ((_1942 - _1945) * 0.9599999785423279f) + _1945; + float _1953 = ((_1943 - _1945) * 0.9599999785423279f) + _1945; + float _1954 = ((_1944 - _1945) * 0.9599999785423279f) + _1945; + float _1957 = log2(((((bool)((_1952 <= 0.0f))) ? 6.103515625e-05f : _1952))); + float _1958 = _1957 * 0.3010300099849701f; + _2011 = -4.0f; + do { + if ((!(_1958 <= -5.2601776123046875f))) { + if ((((bool)((_1958 > -5.2601776123046875f))) && ((bool)((_1958 < -0.7447274923324585f))))) { + float _1966 = (_1957 * 0.19999998807907104f) + 3.494786262512207f; + int _1967 = int(1967); + float _1969 = _1966 - (float(_1967)); + float _1971 = _global_0[_1967]; + float _1974 = _global_0[(_1967 + 1)]; + float _1979 = _1971 * 0.5f; + _2011 = (dot(float3((_1969 * _1969), _1969, 1.0f), float3((mad((_global_0[(_1967 + 2)]), 0.5f, (mad(_1974, -1.0f, _1979)))), (_1974 - _1971), (mad(_1974, 0.5f, _1979))))); + } else { + _2011 = 4.0f; + if ((((bool)((_1958 >= -0.7447274923324585f))) && ((bool)((_1958 < 4.673812389373779f))))) { + float _1991 = (_1957 * 0.1666666567325592f) + 0.4123218357563019f; + int _1992 = int(1992); + float _1994 = _1991 - (float(_1992)); + float _1996 = _global_1[_1992]; + float _1999 = _global_1[(_1992 + 1)]; + float _2004 = _1996 * 0.5f; + _2011 = (dot(float3((_1994 * _1994), _1994, 1.0f), float3((mad((_global_1[(_1992 + 2)]), 0.5f, (mad(_1999, -1.0f, _2004)))), (_1999 - _1996), (mad(_1999, 0.5f, _2004))))); + } + } + } + float _2013 = exp2((_2011 * 3.321928024291992f)); + float _2016 = log2(((((bool)((_1953 <= 0.0f))) ? 6.103515625e-05f : _1953))); + float _2017 = _2016 * 0.3010300099849701f; + _2070 = -4.0f; + do { + if ((!(_2017 <= -5.2601776123046875f))) { + if ((((bool)((_2017 > -5.2601776123046875f))) && ((bool)((_2017 < -0.7447274923324585f))))) { + float _2025 = (_2016 * 0.19999998807907104f) + 3.494786262512207f; + int _2026 = int(2026); + float _2028 = _2025 - (float(_2026)); + float _2030 = _global_0[_2026]; + float _2033 = _global_0[(_2026 + 1)]; + float _2038 = _2030 * 0.5f; + _2070 = (dot(float3((_2028 * _2028), _2028, 1.0f), float3((mad((_global_0[(_2026 + 2)]), 0.5f, (mad(_2033, -1.0f, _2038)))), (_2033 - _2030), (mad(_2033, 0.5f, _2038))))); + } else { + _2070 = 4.0f; + if ((((bool)((_2017 >= -0.7447274923324585f))) && ((bool)((_2017 < 4.673812389373779f))))) { + float _2050 = (_2016 * 0.1666666567325592f) + 0.4123218357563019f; + int _2051 = int(2051); + float _2053 = _2050 - (float(_2051)); + float _2055 = _global_1[_2051]; + float _2058 = _global_1[(_2051 + 1)]; + float _2063 = _2055 * 0.5f; + _2070 = (dot(float3((_2053 * _2053), _2053, 1.0f), float3((mad((_global_1[(_2051 + 2)]), 0.5f, (mad(_2058, -1.0f, _2063)))), (_2058 - _2055), (mad(_2058, 0.5f, _2063))))); + } + } + } + float _2072 = exp2((_2070 * 3.321928024291992f)); + float _2075 = log2(((((bool)((_1954 <= 0.0f))) ? 6.103515625e-05f : _1954))); + float _2076 = _2075 * 0.3010300099849701f; + _2129 = -4.0f; + do { + if ((!(_2076 <= -5.2601776123046875f))) { + if ((((bool)((_2076 > -5.2601776123046875f))) && ((bool)((_2076 < -0.7447274923324585f))))) { + float _2084 = (_2075 * 0.19999998807907104f) + 3.494786262512207f; + int _2085 = int(2085); + float _2087 = _2084 - (float(_2085)); + float _2089 = _global_0[_2085]; + float _2092 = _global_0[(_2085 + 1)]; + float _2097 = _2089 * 0.5f; + _2129 = (dot(float3((_2087 * _2087), _2087, 1.0f), float3((mad((_global_0[(_2085 + 2)]), 0.5f, (mad(_2092, -1.0f, _2097)))), (_2092 - _2089), (mad(_2092, 0.5f, _2097))))); + } else { + _2129 = 4.0f; + if ((((bool)((_2076 >= -0.7447274923324585f))) && ((bool)((_2076 < 4.673812389373779f))))) { + float _2109 = (_2075 * 0.1666666567325592f) + 0.4123218357563019f; + int _2110 = int(2110); + float _2112 = _2109 - (float(_2110)); + float _2114 = _global_1[_2110]; + float _2117 = _global_1[(_2110 + 1)]; + float _2122 = _2114 * 0.5f; + _2129 = (dot(float3((_2112 * _2112), _2112, 1.0f), float3((mad((_global_1[(_2110 + 2)]), 0.5f, (mad(_2117, -1.0f, _2122)))), (_2117 - _2114), (mad(_2117, 0.5f, _2122))))); + } + } + } + float _2131 = exp2((_2129 * 3.321928024291992f)); + float _2134 = mad(0.16386906802654266f, _2131, (mad(0.14067870378494263f, _2072, (_2013 * 0.6954522132873535f)))); + float _2137 = mad(0.0955343171954155f, _2131, (mad(0.8596711158752441f, _2072, (_2013 * 0.044794563204050064f)))); + float _2140 = mad(1.0015007257461548f, _2131, (mad(0.004025210160762072f, _2072, (_2013 * -0.005525882821530104f)))); + float _2143 = mad(-0.21492856740951538f, _2140, (mad(-0.2365107536315918f, _2137, (_2134 * 1.4514392614364624f)))); + float _2146 = mad(-0.09967592358589172f, _2140, (mad(1.17622971534729f, _2137, (_2134 * -0.07655377686023712f)))); + float _2149 = mad(0.9977163076400757f, _2140, (mad(-0.006032449658960104f, _2137, (_2134 * 0.008316148072481155f)))); + float _2152 = log2(((((bool)((_2143 <= 0.0f))) ? 9.999999747378752e-05f : _2143))); + float _2153 = _2152 * 0.3010300099849701f; + _2209 = -2.301030158996582f; + do { + if ((!(_2153 <= -3.848327875137329f))) { + if ((((bool)((_2153 > -3.848327875137329f))) && ((bool)((_2153 < 0.6812411546707153f))))) { + float _2161 = (_2152 + 12.783867835998535f) * 0.46521204710006714f; + int _2162 = int(2162); + float _2164 = _2161 - (float(_2162)); + float _2166 = _global_4[_2162]; + float _2169 = _global_4[(_2162 + 1)]; + float _2174 = _2166 * 0.5f; + _2209 = (dot(float3((_2164 * _2164), _2164, 1.0f), float3((mad((_global_4[(_2162 + 2)]), 0.5f, (mad(_2169, -1.0f, _2174)))), (_2169 - _2166), (mad(_2169, 0.5f, _2174))))); + } else { + if ((((bool)((_2153 >= 0.6812411546707153f))) && ((bool)((_2153 < 3.7613162994384766f))))) { + float _2186 = (_2152 + -2.2630341053009033f) * 0.6841424107551575f; + int _2187 = int(2187); + float _2189 = _2186 - (float(_2187)); + float _2191 = _global_5[_2187]; + float _2194 = _global_5[(_2187 + 1)]; + float _2199 = _2191 * 0.5f; + _2209 = (dot(float3((_2189 * _2189), _2189, 1.0f), float3((mad((_global_5[(_2187 + 2)]), 0.5f, (mad(_2194, -1.0f, _2199)))), (_2194 - _2191), (mad(_2194, 0.5f, _2199))))); + } else { + _2209 = ((_2152 * 0.036123599857091904f) + 2.849672317504883f); + } + } + } + float _2211 = exp2((_2209 * 3.321928024291992f)); + float _2214 = log2(((((bool)((_2146 <= 0.0f))) ? 9.999999747378752e-05f : _2146))); + float _2215 = _2214 * 0.3010300099849701f; + _2271 = -2.301030158996582f; + do { + if ((!(_2215 <= -3.848327875137329f))) { + if ((((bool)((_2215 > -3.848327875137329f))) && ((bool)((_2215 < 0.6812411546707153f))))) { + float _2223 = (_2214 + 12.783867835998535f) * 0.46521204710006714f; + int _2224 = int(2224); + float _2226 = _2223 - (float(_2224)); + float _2228 = _global_4[_2224]; + float _2231 = _global_4[(_2224 + 1)]; + float _2236 = _2228 * 0.5f; + _2271 = (dot(float3((_2226 * _2226), _2226, 1.0f), float3((mad((_global_4[(_2224 + 2)]), 0.5f, (mad(_2231, -1.0f, _2236)))), (_2231 - _2228), (mad(_2231, 0.5f, _2236))))); + } else { + if ((((bool)((_2215 >= 0.6812411546707153f))) && ((bool)((_2215 < 3.7613162994384766f))))) { + float _2248 = (_2214 + -2.2630341053009033f) * 0.6841424107551575f; + int _2249 = int(2249); + float _2251 = _2248 - (float(_2249)); + float _2253 = _global_5[_2249]; + float _2256 = _global_5[(_2249 + 1)]; + float _2261 = _2253 * 0.5f; + _2271 = (dot(float3((_2251 * _2251), _2251, 1.0f), float3((mad((_global_5[(_2249 + 2)]), 0.5f, (mad(_2256, -1.0f, _2261)))), (_2256 - _2253), (mad(_2256, 0.5f, _2261))))); + } else { + _2271 = ((_2214 * 0.036123599857091904f) + 2.849672317504883f); + } + } + } + float _2273 = exp2((_2271 * 3.321928024291992f)); + float _2276 = log2(((((bool)((_2149 <= 0.0f))) ? 9.999999747378752e-05f : _2149))); + float _2277 = _2276 * 0.3010300099849701f; + _2333 = -2.301030158996582f; + do { + if ((!(_2277 <= -3.848327875137329f))) { + if ((((bool)((_2277 > -3.848327875137329f))) && ((bool)((_2277 < 0.6812411546707153f))))) { + float _2285 = (_2276 + 12.783867835998535f) * 0.46521204710006714f; + int _2286 = int(2286); + float _2288 = _2285 - (float(_2286)); + float _2290 = _global_4[_2286]; + float _2293 = _global_4[(_2286 + 1)]; + float _2298 = _2290 * 0.5f; + _2333 = (dot(float3((_2288 * _2288), _2288, 1.0f), float3((mad((_global_4[(_2286 + 2)]), 0.5f, (mad(_2293, -1.0f, _2298)))), (_2293 - _2290), (mad(_2293, 0.5f, _2298))))); + } else { + if ((((bool)((_2277 >= 0.6812411546707153f))) && ((bool)((_2277 < 3.7613162994384766f))))) { + float _2310 = (_2276 + -2.2630341053009033f) * 0.6841424107551575f; + int _2311 = int(2311); + float _2313 = _2310 - (float(_2311)); + float _2315 = _global_5[_2311]; + float _2318 = _global_5[(_2311 + 1)]; + float _2323 = _2315 * 0.5f; + _2333 = (dot(float3((_2313 * _2313), _2313, 1.0f), float3((mad((_global_5[(_2311 + 2)]), 0.5f, (mad(_2318, -1.0f, _2323)))), (_2318 - _2315), (mad(_2318, 0.5f, _2323))))); + } else { + _2333 = ((_2276 * 0.036123599857091904f) + 2.849672317504883f); + } + } + } + float _2335 = exp2((_2333 * 3.321928024291992f)); + float _2354 = exp2(((log2(((mad(_32, _2335, (mad(_31, _2273, (_2211 * _30))))) * 9.999999747378752e-05f))) * 0.1593017578125f)); + float _2355 = exp2(((log2(((mad(_35, _2335, (mad(_34, _2273, (_2211 * _33))))) * 9.999999747378752e-05f))) * 0.1593017578125f)); + float _2356 = exp2(((log2(((mad(_38, _2335, (mad(_37, _2273, (_2211 * _36))))) * 9.999999747378752e-05f))) * 0.1593017578125f)); + _2497 = (exp2(((log2(((1.0f / ((_2354 * 18.6875f) + 1.0f)) * ((_2354 * 18.8515625f) + 0.8359375f)))) * 78.84375f))); + _2498 = (exp2(((log2(((1.0f / ((_2355 * 18.6875f) + 1.0f)) * ((_2355 * 18.8515625f) + 0.8359375f)))) * 78.84375f))); + _2499 = (exp2(((log2(((1.0f / ((_2356 * 18.6875f) + 1.0f)) * ((_2356 * 18.8515625f) + 0.8359375f)))) * 78.84375f))); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } while (false); + } else { + if (((((uint)(cb0_065z)) == 7))) { + float _2389 = mad(0.04736635088920593f, _1045, (mad(0.3395121395587921f, _1044, (_1043 * 0.613191545009613f)))); + float _2392 = mad(0.01345000695437193f, _1045, (mad(0.9163357615470886f, _1044, (_1043 * 0.07020691782236099f)))); + float _2395 = mad(0.8696067929267883f, _1045, (mad(0.1095672994852066f, _1044, (_1043 * 0.020618872717022896f)))); + float _2414 = exp2(((log2(((mad(_32, _2395, (mad(_31, _2392, (_2389 * _30))))) * 9.999999747378752e-05f))) * 0.1593017578125f)); + float _2415 = exp2(((log2(((mad(_35, _2395, (mad(_34, _2392, (_2389 * _33))))) * 9.999999747378752e-05f))) * 0.1593017578125f)); + float _2416 = exp2(((log2(((mad(_38, _2395, (mad(_37, _2392, (_2389 * _36))))) * 9.999999747378752e-05f))) * 0.1593017578125f)); + _2497 = (exp2(((log2(((1.0f / ((_2414 * 18.6875f) + 1.0f)) * ((_2414 * 18.8515625f) + 0.8359375f)))) * 78.84375f))); + _2498 = (exp2(((log2(((1.0f / ((_2415 * 18.6875f) + 1.0f)) * ((_2415 * 18.8515625f) + 0.8359375f)))) * 78.84375f))); + _2499 = (exp2(((log2(((1.0f / ((_2416 * 18.6875f) + 1.0f)) * ((_2416 * 18.8515625f) + 0.8359375f)))) * 78.84375f))); + } else { + _2497 = _1043; + _2498 = _1044; + _2499 = _1045; + if (!((((uint)(cb0_065z)) == 8))) { + if (((((uint)(cb0_065z)) == 9))) { + float _2451 = mad(0.04736635088920593f, _1033, (mad(0.3395121395587921f, _1032, (_1031 * 0.613191545009613f)))); + float _2454 = mad(0.01345000695437193f, _1033, (mad(0.9163357615470886f, _1032, (_1031 * 0.07020691782236099f)))); + float _2457 = mad(0.8696067929267883f, _1033, (mad(0.1095672994852066f, _1032, (_1031 * 0.020618872717022896f)))); + _2497 = (mad(_32, _2457, (mad(_31, _2454, (_2451 * _30))))); + _2498 = (mad(_35, _2457, (mad(_34, _2454, (_2451 * _33))))); + _2499 = (mad(_38, _2457, (mad(_37, _2454, (_2451 * _36))))); + } else { + float _2470 = mad(0.04736635088920593f, _1059, (mad(0.3395121395587921f, _1058, (_1057 * 0.613191545009613f)))); + float _2473 = mad(0.01345000695437193f, _1059, (mad(0.9163357615470886f, _1058, (_1057 * 0.07020691782236099f)))); + float _2476 = mad(0.8696067929267883f, _1059, (mad(0.1095672994852066f, _1058, (_1057 * 0.020618872717022896f)))); + _2497 = (exp2(((log2((mad(_32, _2476, (mad(_31, _2473, (_2470 * _30))))))) * (cb0_027z)))); + _2498 = (exp2(((log2((mad(_35, _2476, (mad(_34, _2473, (_2470 * _33))))))) * (cb0_027z)))); + _2499 = (exp2(((log2((mad(_38, _2476, (mad(_37, _2473, (_2470 * _36))))))) * (cb0_027z)))); + } + } + } + } + } + } + } + SV_Target.x = (_2497 * 0.9523810148239136f); + SV_Target.y = (_2498 * 0.9523810148239136f); + SV_Target.z = (_2499 * 0.9523810148239136f); + SV_Target.w = 0.0f; + return SV_Target; +} diff --git a/src/games/unrealengine/p3r/godray_0xCB9976C8.ps_6_0.hlsl b/src/games/unrealengine/p3r/godray_0xCB9976C8.ps_6_0.hlsl new file mode 100644 index 00000000..ce454d96 --- /dev/null +++ b/src/games/unrealengine/p3r/godray_0xCB9976C8.ps_6_0.hlsl @@ -0,0 +1,69 @@ +#include "../common.hlsl" + +Texture2D t0 : register(t0); + +cbuffer cb0 : register(b0) { + float cb0_004x : packoffset(c004.x); + float cb0_004y : packoffset(c004.y); + float cb0_005x : packoffset(c005.x); + float cb0_005y : packoffset(c005.y); + uint cb0_037x : packoffset(c037.x); + uint cb0_037y : packoffset(c037.y); + float cb0_038z : packoffset(c038.z); + float cb0_038w : packoffset(c038.w); +}; + +cbuffer cb1 : register(b1) { + float cb1_000x : packoffset(c000.x); +}; + +cbuffer cb2 : register(b2) { + float cb2_000x : packoffset(c000.x); + float cb2_000y : packoffset(c000.y); + float cb2_000z : packoffset(c000.z); + float cb2_000w : packoffset(c000.w); + float cb2_002x : packoffset(c002.x); + float cb2_002y : packoffset(c002.y); + float cb2_002z : packoffset(c002.z); + float cb2_003x : packoffset(c003.x); + float cb2_003y : packoffset(c003.y); + float cb2_003z : packoffset(c003.z); + float cb2_004x : packoffset(c004.x); + float cb2_004y : packoffset(c004.y); + float cb2_004z : packoffset(c004.z); +}; + +cbuffer cb3 : register(b3) { + float cb3_001x : packoffset(c001.x); + float cb3_001y : packoffset(c001.y); + float cb3_001z : packoffset(c001.z); + float cb3_002x : packoffset(c002.x); +}; + +SamplerState s0 : register(s0); + +float4 main( + noperspective float4 SV_Position: SV_Position, + linear float4 TEXCOORD: TEXCOORD) + : SV_Target { + float4 SV_Target; + float _19 = ((SV_Position.x) - (float((uint)(cb0_037x)))) * (cb0_038z); + float _20 = ((SV_Position.y) - (float((uint)(cb0_037y)))) * (cb0_038w); + float4 _31 = t0.Sample(s0, float2(((_19 * (cb0_005x)) + (cb0_004x)), ((_20 * (cb0_005y)) + (cb0_004y)))); + float3 tonemapped = _31.rgb; + _31.rgb = saturate(tonemapped); + float _42 = 1.0f - _20; + float _49 = (_42 * _19) * (cb2_000y); + float _59 = ((1.0f - _19) * _42) * (cb2_000x); + float _67 = (cb2_000z)*_20; + float _77 = (cb2_000w) * (1.0f - (cb1_000x)); + float _81 = (_77 * (((_59 * (cb2_002x)) + ((cb2_004x)*_67)) + (_49 * (cb2_003x)))) + (_31.x); + float _82 = (_77 * (((_59 * (cb2_002y)) + ((cb2_004y)*_67)) + (_49 * (cb2_003y)))) + (_31.y); + float _83 = (_77 * (((_59 * (cb2_002z)) + ((cb2_004z)*_67)) + (_49 * (cb2_003z)))) + (_31.z); + SV_Target.x = (max(((((cb3_001x)-_81) * (cb3_002x)) + _81), 0.0f)); + SV_Target.y = (max(((((cb3_001y)-_82) * (cb3_002x)) + _82), 0.0f)); + SV_Target.z = (max(((((cb3_001z)-_83) * (cb3_002x)) + _83), 0.0f)); + SV_Target.rgb = renodx::draw::UpgradeToneMapByLuminance(tonemapped, renodx::tonemap::renodrt::NeutralSDR(tonemapped), SV_Target.rgb, 1.f); + + return SV_Target; +} diff --git a/src/games/unrealengine/p3r/mainmenu_text_0xBFE48347.ps_6_0.hlsl b/src/games/unrealengine/p3r/mainmenu_text_0xBFE48347.ps_6_0.hlsl new file mode 100644 index 00000000..7f2b5c7a --- /dev/null +++ b/src/games/unrealengine/p3r/mainmenu_text_0xBFE48347.ps_6_0.hlsl @@ -0,0 +1,155 @@ +struct _t0 { + float data[4]; +}; +StructuredBuffer<_t0> t0 : register(t0); + +Texture3D t1 : register(t1); + +Texture2D t2 : register(t2); + +Texture2D t3 : register(t3); + +Texture2D t4 : register(t4); + +Texture2D t5 : register(t5); + +cbuffer cb0 : register(b0) { + float cb0_004x : packoffset(c004.x); + float cb0_004y : packoffset(c004.y); + float cb0_004w : packoffset(c004.w); + float cb0_005x : packoffset(c005.x); + float cb0_005y : packoffset(c005.y); + float cb0_005w : packoffset(c005.w); + float cb0_006x : packoffset(c006.x); + float cb0_006y : packoffset(c006.y); + float cb0_006w : packoffset(c006.w); + float cb0_007x : packoffset(c007.x); + float cb0_007y : packoffset(c007.y); + float cb0_007w : packoffset(c007.w); + float cb0_044x : packoffset(c044.x); + float cb0_044y : packoffset(c044.y); + float cb0_044z : packoffset(c044.z); + float cb0_044w : packoffset(c044.w); + float cb0_045x : packoffset(c045.x); + float cb0_045y : packoffset(c045.y); + float cb0_045z : packoffset(c045.z); + float cb0_045w : packoffset(c045.w); + float cb0_046x : packoffset(c046.x); + float cb0_046y : packoffset(c046.y); + float cb0_046z : packoffset(c046.z); + float cb0_046w : packoffset(c046.w); + float cb0_047x : packoffset(c047.x); + float cb0_047y : packoffset(c047.y); + float cb0_047z : packoffset(c047.z); + float cb0_047w : packoffset(c047.w); + float cb0_070x : packoffset(c070.x); + float cb0_070y : packoffset(c070.y); + float cb0_070z : packoffset(c070.z); + float cb0_135y : packoffset(c135.y); + float cb0_140x : packoffset(c140.x); + float cb0_208z : packoffset(c208.z); + float cb0_209x : packoffset(c209.x); + float cb0_209y : packoffset(c209.y); + float cb0_209z : packoffset(c209.z); +}; + +cbuffer cb1 : register(b1) { + float cb1_114w : packoffset(c114.w); +}; + +cbuffer cb2 : register(b2) { + float cb2_001x : packoffset(c001.x); + float cb2_001y : packoffset(c001.y); + float cb2_001z : packoffset(c001.z); + float cb2_003w : packoffset(c003.w); + float cb2_004x : packoffset(c004.x); + float cb2_004y : packoffset(c004.y); + float cb2_004z : packoffset(c004.z); +}; + +SamplerState s0 : register(s0); + +SamplerState s1 : register(s1); + +SamplerState s2 : register(s2); + +SamplerState s3 : register(s3); + +SamplerState s4 : register(s4); + +float4 main( + linear float4 TEXCOORD10_centroid : TEXCOORD10_centroid, + linear float4 TEXCOORD11_centroid : TEXCOORD11_centroid, + linear float4 TEXCOORD : TEXCOORD, + nointerpolation uint PRIMITIVE_ID : PRIMITIVE_ID, + linear float4 TEXCOORD_7 : TEXCOORD7, + noperspective float4 SV_Position : SV_Position, + nointerpolation uint SV_IsFrontFace : SV_IsFrontFace +) : SV_Target { + float4 SV_Target; + float _68 = (mad((SV_Position.z), (cb0_046w), (mad((SV_Position.y), (cb0_045w), ((cb0_044w) * (SV_Position.x)))))) + (cb0_047w); + float _72 = (((mad((SV_Position.z), (cb0_046x), (mad((SV_Position.y), (cb0_045x), ((cb0_044x) * (SV_Position.x)))))) + (cb0_047x)) / _68) - (cb0_070x); + float _73 = (((mad((SV_Position.z), (cb0_046y), (mad((SV_Position.y), (cb0_045y), ((cb0_044y) * (SV_Position.x)))))) + (cb0_047y)) / _68) - (cb0_070y); + float _74 = (((mad((SV_Position.z), (cb0_046z), (mad((SV_Position.y), (cb0_045z), ((cb0_044z) * (SV_Position.x)))))) + (cb0_047z)) / _68) - (cb0_070z); + float4 _75 = t2.Sample(s1, float2((TEXCOORD.x), (TEXCOORD.y))); + float _88 = (((cb2_003w) * (TEXCOORD.x)) + -0.5f) + (cb2_004x); + float _89 = (TEXCOORD.y) + -0.5f; + float4 _94 = t4.Sample(s3, float2(((dot(float2(_88, _89), float2(1.0f, -0.0f))) + 0.5f), ((dot(float2(_88, _89), float2(0.0f, 1.0f))) + 0.5f))); + float _98 = (_94.x) * (((float4)(t3.Sample(s2, float2((TEXCOORD.x), (TEXCOORD.y))))).w); + float _101 = _98 + (_75.x); + float _102 = ((_94.y) * (((float4)(t3.Sample(s2, float2((TEXCOORD.x), (TEXCOORD.y))))).w)) + (_75.y); + float _103 = ((_94.z) * (((float4)(t3.Sample(s2, float2((TEXCOORD.x), (TEXCOORD.y))))).w)) + (_75.z); + float _127 = saturate((((_98 + (_75.w)) + ((((float4)(t5.Sample(s4, float2((TEXCOORD.x), (TEXCOORD.y))))).w) * 0.10000000149011612f)) * (cb2_004z))); + float _186 = (TEXCOORD_7.x); + float _187 = (TEXCOORD_7.y); + float _188 = (TEXCOORD_7.z); + float _189 = (TEXCOORD_7.w); + float _230; + float _231; + float _232; + float _233; + if ((((cb1_114w) > 0.0f))) { + float _139 = (mad(_74, (cb0_006w), (mad(_73, (cb0_005w), (_72 * (cb0_004w)))))) + (cb0_007w); + float4 _173 = t1.SampleLevel(s0, float3((((((mad(_74, (cb0_006x), (mad(_73, (cb0_005x), (_72 * (cb0_004x)))))) + (cb0_007x)) / _139) * 0.5f) + 0.5f), (0.5f - ((((mad(_74, (cb0_006y), (mad(_73, (cb0_005y), (_72 * (cb0_004y)))))) + (cb0_007y)) / _139) * 0.5f)), (((cb0_209z) * (log2((((cb0_209x) * _139) + (cb0_209y))))) * (cb0_208z))), 0.0f); + _186 = (((_173.w) * (TEXCOORD_7.x)) + (_173.x)); + _187 = (((_173.w) * (TEXCOORD_7.y)) + (_173.y)); + _188 = (((_173.w) * (TEXCOORD_7.z)) + (_173.z)); + _189 = ((_173.w) * (TEXCOORD_7.w)); + } + float _190 = max(((((cb2_001x) - _101) * (cb2_004y)) + _101), 0.0f); + float _191 = max(((((cb2_001y) - _102) * (cb2_004y)) + _102), 0.0f); + float _192 = max(((((cb2_001z) - _103) * (cb2_004y)) + _103), 0.0f); + _230 = _127; + _231 = _190; + _232 = _191; + _233 = _192; + if ((((cb0_140x) > 0.0f))) { + uint _197 = 197 * ((uint)(PRIMITIVE_ID)); + /* _t0 _199 = t0.Load(((uint)(_197 + 5))); + _t0 _210 = t0.Load(((uint)(_197 + 19))); */ + + _t0 temp_199 = t0.Load(((uint)(_197 + 5))); + _t0 temp_210 = t0.Load(((uint)(_197 + 19))); + + float4 _199 = temp_199.data[0 / 4]; + float4 _210 = temp_210.data[0 / 4]; + + _230 = _127; + _231 = _190; + _232 = _191; + _233 = _192; + if ((((bool)(((abs((_74 - (_199.z)))) > ((_210.z) + 1.0f)))) || ((bool)(((bool)(((abs((_72 - (_199.x)))) > ((_210.x) + 1.0f)))) || ((bool)(((abs((_73 - (_199.y)))) > ((_210.y) + 1.0f)))))))) { + float _227 = float((uint)((bool)(((frac(((dot(float3(_72, _73, _74), float3(0.5770000219345093f, 0.5770000219345093f, 0.5770000219345093f))) * 0.0020000000949949026f))) > 0.5f)))); + _230 = 1.0f; + _231 = (1.0f - _227); + _232 = 1.0f; + _233 = _227; + } + } + SV_Target.x = ((cb0_135y) * ((_231 * _189) + _186)); + SV_Target.y = ((cb0_135y) * ((_232 * _189) + _187)); + SV_Target.z = (((_233 * _189) + _188) * (cb0_135y)); + SV_Target.rgb = saturate(SV_Target.rgb); + SV_Target.w = _230; + return SV_Target; +}