MSL: Use powr instead of pow.

powr's additional UB rules match SPIR-V.
This commit is contained in:
Hans-Kristian Arntzen 2023-10-11 12:55:12 +02:00
parent 79401259fd
commit 09ba765844
12 changed files with 128 additions and 123 deletions

View File

@ -256,7 +256,7 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
float4 _260 = SSProfilesTexture.read(uint2(int3(1, int(uint(fma(select(float4(0.0), SceneTexturesStruct_GBufferDTexture.sample(SceneTexturesStruct_GBufferDTextureSampler, _114, level(0.0)), bool4(!(((_240 & 4294967280u) & 16u) != 0u))).x, 255.0, 0.5))), 0).xy), 0);
float _263 = _260.y * 0.5;
float3 _266 = fma(-_236, float3(_263), _148);
float _274 = pow(fast::clamp(dot(-(_152 * float3(rsqrt(dot(_152, _152)))), _236), 0.0, 1.0), 1.0);
float _274 = powr(fast::clamp(dot(-(_152 * float3(rsqrt(dot(_152, _152)))), _236), 0.0, 1.0), 1.0);
float _445;
if (_160)
{

View File

@ -161,8 +161,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float3 _599;
if (_Globals.OutputDevice >= 3u)
{
float3 _591 = pow(_577, float3(0.0126833133399486541748046875));
_599 = pow(fast::max(float3(0.0), _591 - float3(0.8359375)) / fma(float3(-18.6875), _591, float3(18.8515625)), float3(6.277394771575927734375)) * float3(10000.0);
float3 _591 = powr(_577, float3(0.0126833133399486541748046875));
_599 = powr(fast::max(float3(0.0), _591 - float3(0.8359375)) / fma(float3(-18.6875), _591, float3(18.8515625)), float3(6.277394771575927734375)) * float3(10000.0);
}
else
{
@ -212,7 +212,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float4 _861 = _Globals.ColorGammaMidtones * _Globals.ColorGamma;
float4 _864 = _Globals.ColorGainMidtones * _Globals.ColorGain;
float4 _867 = _Globals.ColorOffsetMidtones + _Globals.ColorOffset;
float3 _905 = fma(fma(pow(pow(fast::max(float3(0.0), mix(_772, _745, _808.xyz * float3(_808.w))) * float3(5.5555553436279296875), _811.xyz * float3(_811.w)) * float3(0.180000007152557373046875), float3(1.0) / (_814.xyz * float3(_814.w))), _817.xyz * float3(_817.w), _820.xyz + float3(_820.w)), float3(_852), fma(fma(pow(pow(fast::max(float3(0.0), mix(_772, _745, _751.xyz * float3(_751.w))) * float3(5.5555553436279296875), _756.xyz * float3(_756.w)) * float3(0.180000007152557373046875), float3(1.0) / (_761.xyz * float3(_761.w))), _766.xyz * float3(_766.w), _771.xyz + float3(_771.w)), float3(1.0 - _804), fma(pow(pow(fast::max(float3(0.0), mix(_772, _745, _855.xyz * float3(_855.w))) * float3(5.5555553436279296875), _858.xyz * float3(_858.w)) * float3(0.180000007152557373046875), float3(1.0) / (_861.xyz * float3(_861.w))), _864.xyz * float3(_864.w), _867.xyz + float3(_867.w)) * float3(_804 - _852)));
float3 _905 = fma(fma(powr(powr(fast::max(float3(0.0), mix(_772, _745, _808.xyz * float3(_808.w))) * float3(5.5555553436279296875), _811.xyz * float3(_811.w)) * float3(0.180000007152557373046875), float3(1.0) / (_814.xyz * float3(_814.w))), _817.xyz * float3(_817.w), _820.xyz + float3(_820.w)), float3(_852), fma(fma(powr(powr(fast::max(float3(0.0), mix(_772, _745, _751.xyz * float3(_751.w))) * float3(5.5555553436279296875), _756.xyz * float3(_756.w)) * float3(0.180000007152557373046875), float3(1.0) / (_761.xyz * float3(_761.w))), _766.xyz * float3(_766.w), _771.xyz + float3(_771.w)), float3(1.0 - _804), fma(powr(powr(fast::max(float3(0.0), mix(_772, _745, _855.xyz * float3(_855.w))) * float3(5.5555553436279296875), _858.xyz * float3(_858.w)) * float3(0.180000007152557373046875), float3(1.0) / (_861.xyz * float3(_861.w))), _864.xyz * float3(_864.w), _867.xyz + float3(_867.w)) * float3(_804 - _852)));
float3 _906 = _905 * _549;
float3 _914 = float3(_Globals.BlueCorrection);
float3 _916 = mix(_905, _905 * ((_551 * float3x3(float3(0.940437257289886474609375, -0.01830687932670116424560546875, 0.07786960899829864501953125), float3(0.008378696627914905548095703125, 0.82866001129150390625, 0.162961304187774658203125), float3(0.0005471261101774871349334716796875, -0.00088337459601461887359619140625, 1.00033628940582275390625))) * _550), _914) * _551;
@ -316,7 +316,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_1189 = fast::max(float3(0.0), mix(_1119, _1119 * ((_551 * float3x3(float3(1.06317996978759765625, 0.02339559979736804962158203125, -0.08657260239124298095703125), float3(-0.010633699595928192138671875, 1.2063200473785400390625, -0.1956900060176849365234375), float3(-0.0005908869788981974124908447265625, 0.00105247995816171169281005859375, 0.999538004398345947265625))) * _550), _914) * _549);
}
float3 _1218 = pow(fast::max(float3(0.0), mix((fma(float3(_Globals.MappingPolynomial.x), _1189 * _1189, float3(_Globals.MappingPolynomial.y) * _1189) + float3(_Globals.MappingPolynomial.z)) * float3(_Globals.ColorScale), _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
float3 _1218 = powr(fast::max(float3(0.0), mix((fma(float3(_Globals.MappingPolynomial.x), _1189 * _1189, float3(_Globals.MappingPolynomial.y) * _1189) + float3(_Globals.MappingPolynomial.z)) * float3(_Globals.ColorScale), _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
float3 _3001;
if (_Globals.OutputDevice == 0u)
{
@ -329,7 +329,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2973 = _2961 * 12.9200000762939453125;
break;
}
_2973 = fma(pow(_2961, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
_2973 = fma(powr(_2961, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
break;
}
float _2974 = _1218.y;
@ -341,7 +341,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2986 = _2974 * 12.9200000762939453125;
break;
}
_2986 = fma(pow(_2974, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
_2986 = fma(powr(_2974, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
break;
}
float _2987 = _1218.z;
@ -353,7 +353,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2999 = _2987 * 12.9200000762939453125;
break;
}
_2999 = fma(pow(_2987, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
_2999 = fma(powr(_2987, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
break;
}
_3001 = float3(_2973, _2986, _2999);
@ -364,7 +364,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
if (_Globals.OutputDevice == 1u)
{
float3 _2953 = fast::max(float3(6.1035199905745685100555419921875e-05), (_1218 * _547) * _576);
_2960 = fast::min(_2953 * float3(4.5), fma(pow(fast::max(_2953, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)), float3(1.09899997711181640625), float3(-0.098999999463558197021484375)));
_2960 = fast::min(_2953 * float3(4.5), fma(powr(fast::max(_2953, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)), float3(1.09899997711181640625), float3(-0.098999999463558197021484375)));
}
else
{
@ -593,7 +593,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2475 = _2472;
}
float3 _2479 = (float3(pow(10.0, _2327), pow(10.0, _2401), pow(10.0, _2475)) * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float3 _2479 = (float3(powr(10.0, _2327), powr(10.0, _2401), powr(10.0, _2475)) * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _2685 = _2479.x;
float _2688 = log((_2685 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2685);
float _2689 = _2688 * 0.4342944622039794921875;
@ -702,8 +702,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2936 = _2928;
}
float3 _2942 = pow(((float3(pow(10.0, _2768), pow(10.0, _2852), pow(10.0, _2936)) - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2950 = pow(fma(float3(18.8515625), _2942, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _2942, float3(1.0))), float3(78.84375));
float3 _2942 = powr(((float3(powr(10.0, _2768), powr(10.0, _2852), powr(10.0, _2936)) - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2950 = powr(fma(float3(18.8515625), _2942, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _2942, float3(1.0))), float3(78.84375));
}
else
{
@ -932,7 +932,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1638 = _1635;
}
float3 _1642 = (float3(pow(10.0, _1490), pow(10.0, _1564), pow(10.0, _1638)) * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float3 _1642 = (float3(powr(10.0, _1490), powr(10.0, _1564), powr(10.0, _1638)) * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _1848 = _1642.x;
float _1851 = log((_1848 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1848);
float _1852 = _1851 * 0.4342944622039794921875;
@ -1041,20 +1041,20 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2084 = _2081;
}
float3 _2089 = pow((float3(pow(10.0, _1926), pow(10.0, _2005), pow(10.0, _2084)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2097 = pow(fma(float3(18.8515625), _2089, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _2089, float3(1.0))), float3(78.84375));
float3 _2089 = powr((float3(powr(10.0, _1926), powr(10.0, _2005), powr(10.0, _2084)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2097 = powr(fma(float3(18.8515625), _2089, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _2089, float3(1.0))), float3(78.84375));
}
else
{
float3 _1260;
if (_Globals.OutputDevice == 7u)
{
float3 _1252 = pow(((_906 * _547) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_1260 = pow(fma(float3(18.8515625), _1252, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _1252, float3(1.0))), float3(78.84375));
float3 _1252 = powr(((_906 * _547) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_1260 = powr(fma(float3(18.8515625), _1252, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _1252, float3(1.0))), float3(78.84375));
}
else
{
_1260 = pow((_1218 * _547) * _576, float3(_Globals.InverseGamma.z));
_1260 = powr((_1218 * _547) * _576, float3(_Globals.InverseGamma.z));
}
_2097 = _1260;
}

View File

@ -162,8 +162,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float3 _625;
if (_Globals.OutputDevice >= 3u)
{
float3 _617 = pow(_603, float3(0.0126833133399486541748046875));
_625 = pow(fast::max(float3(0.0), _617 - float3(0.8359375)) / fma(float3(-18.6875), _617, float3(18.8515625)), float3(6.277394771575927734375)) * float3(10000.0);
float3 _617 = powr(_603, float3(0.0126833133399486541748046875));
_625 = powr(fast::max(float3(0.0), _617 - float3(0.8359375)) / fma(float3(-18.6875), _617, float3(18.8515625)), float3(6.277394771575927734375)) * float3(10000.0);
}
else
{
@ -213,7 +213,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float4 _887 = _Globals.ColorGammaMidtones * _Globals.ColorGamma;
float4 _890 = _Globals.ColorGainMidtones * _Globals.ColorGain;
float4 _893 = _Globals.ColorOffsetMidtones + _Globals.ColorOffset;
float3 _931 = fma(fma(pow(pow(fast::max(float3(0.0), mix(_798, _771, _834.xyz * float3(_834.w))) * float3(5.5555553436279296875), _837.xyz * float3(_837.w)) * float3(0.180000007152557373046875), float3(1.0) / (_840.xyz * float3(_840.w))), _843.xyz * float3(_843.w), _846.xyz + float3(_846.w)), float3(_878), fma(fma(pow(pow(fast::max(float3(0.0), mix(_798, _771, _777.xyz * float3(_777.w))) * float3(5.5555553436279296875), _782.xyz * float3(_782.w)) * float3(0.180000007152557373046875), float3(1.0) / (_787.xyz * float3(_787.w))), _792.xyz * float3(_792.w), _797.xyz + float3(_797.w)), float3(1.0 - _830), fma(pow(pow(fast::max(float3(0.0), mix(_798, _771, _881.xyz * float3(_881.w))) * float3(5.5555553436279296875), _884.xyz * float3(_884.w)) * float3(0.180000007152557373046875), float3(1.0) / (_887.xyz * float3(_887.w))), _890.xyz * float3(_890.w), _893.xyz + float3(_893.w)) * float3(_830 - _878)));
float3 _931 = fma(fma(powr(powr(fast::max(float3(0.0), mix(_798, _771, _834.xyz * float3(_834.w))) * float3(5.5555553436279296875), _837.xyz * float3(_837.w)) * float3(0.180000007152557373046875), float3(1.0) / (_840.xyz * float3(_840.w))), _843.xyz * float3(_843.w), _846.xyz + float3(_846.w)), float3(_878), fma(fma(powr(powr(fast::max(float3(0.0), mix(_798, _771, _777.xyz * float3(_777.w))) * float3(5.5555553436279296875), _782.xyz * float3(_782.w)) * float3(0.180000007152557373046875), float3(1.0) / (_787.xyz * float3(_787.w))), _792.xyz * float3(_792.w), _797.xyz + float3(_797.w)), float3(1.0 - _830), fma(powr(powr(fast::max(float3(0.0), mix(_798, _771, _881.xyz * float3(_881.w))) * float3(5.5555553436279296875), _884.xyz * float3(_884.w)) * float3(0.180000007152557373046875), float3(1.0) / (_887.xyz * float3(_887.w))), _890.xyz * float3(_890.w), _893.xyz + float3(_893.w)) * float3(_830 - _878)));
float3 _932 = _931 * _575;
float3 _940 = float3(_Globals.BlueCorrection);
float3 _942 = mix(_931, _931 * ((_577 * float3x3(float3(0.940437257289886474609375, -0.01830687932670116424560546875, 0.07786960899829864501953125), float3(0.008378696627914905548095703125, 0.82866001129150390625, 0.162961304187774658203125), float3(0.0005471261101774871349334716796875, -0.00088337459601461887359619140625, 1.00033628940582275390625))) * _576), _940) * _577;
@ -327,7 +327,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1229 = _1217 * 12.9200000762939453125;
break;
}
_1229 = fma(pow(_1217, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
_1229 = fma(powr(_1217, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
break;
}
float _1230 = _1216.y;
@ -339,7 +339,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1242 = _1230 * 12.9200000762939453125;
break;
}
_1242 = fma(pow(_1230, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
_1242 = fma(powr(_1230, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
break;
}
float _1243 = _1216.z;
@ -351,7 +351,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1255 = _1243 * 12.9200000762939453125;
break;
}
_1255 = fma(pow(_1243, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
_1255 = fma(powr(_1243, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
break;
}
float3 _1256 = float3(_1229, _1242, _1255);
@ -363,8 +363,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float4 _1279 = Texture1.sample(Texture1Sampler, float2(_1274 * 0.0625, _1276));
float4 _1283 = Texture1.sample(Texture1Sampler, float2(fma(_1274, 0.0625, 0.0625), _1276));
float3 _1289 = fast::max(float3(6.1035199905745685100555419921875e-05), fma(float3(_Globals.LUTWeights[0].x), _1256, float3(_Globals.LUTWeights[1].x) * mix(_1279, _1283, float4(_1270 - _1271)).xyz));
float3 _1295 = select(_1289 * float3(0.077399380505084991455078125), pow(fma(_1289, float3(0.94786727428436279296875), float3(0.0521326996386051177978515625)), float3(2.400000095367431640625)), _1289 > float3(0.040449999272823333740234375));
float3 _1324 = pow(fast::max(float3(0.0), mix((fma(float3(_Globals.MappingPolynomial.x), _1295 * _1295, float3(_Globals.MappingPolynomial.y) * _1295) + float3(_Globals.MappingPolynomial.z)) * _Globals.ColorScale, _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
float3 _1295 = select(_1289 * float3(0.077399380505084991455078125), powr(fma(_1289, float3(0.94786727428436279296875), float3(0.0521326996386051177978515625)), float3(2.400000095367431640625)), _1289 > float3(0.040449999272823333740234375));
float3 _1324 = powr(fast::max(float3(0.0), mix((fma(float3(_Globals.MappingPolynomial.x), _1295 * _1295, float3(_Globals.MappingPolynomial.y) * _1295) + float3(_Globals.MappingPolynomial.z)) * _Globals.ColorScale, _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
float3 _3103;
if (_Globals.OutputDevice == 0u)
{
@ -377,7 +377,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3075 = _3063 * 12.9200000762939453125;
break;
}
_3075 = fma(pow(_3063, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
_3075 = fma(powr(_3063, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
break;
}
float _3076 = _1324.y;
@ -389,7 +389,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3088 = _3076 * 12.9200000762939453125;
break;
}
_3088 = fma(pow(_3076, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
_3088 = fma(powr(_3076, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
break;
}
float _3089 = _1324.z;
@ -401,7 +401,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3101 = _3089 * 12.9200000762939453125;
break;
}
_3101 = fma(pow(_3089, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
_3101 = fma(powr(_3089, 0.4166666567325592041015625), 1.05499994754791259765625, -0.054999999701976776123046875);
break;
}
_3103 = float3(_3075, _3088, _3101);
@ -412,7 +412,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
if (_Globals.OutputDevice == 1u)
{
float3 _3055 = fast::max(float3(6.1035199905745685100555419921875e-05), (_1324 * _573) * _602);
_3062 = fast::min(_3055 * float3(4.5), fma(pow(fast::max(_3055, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)), float3(1.09899997711181640625), float3(-0.098999999463558197021484375)));
_3062 = fast::min(_3055 * float3(4.5), fma(powr(fast::max(_3055, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)), float3(1.09899997711181640625), float3(-0.098999999463558197021484375)));
}
else
{
@ -641,7 +641,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2579 = _2576;
}
float3 _2583 = (float3(pow(10.0, _2431), pow(10.0, _2505), pow(10.0, _2579)) * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float3 _2583 = (float3(powr(10.0, _2431), powr(10.0, _2505), powr(10.0, _2579)) * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _2787 = _2583.x;
float _2790 = log((_2787 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2787);
float _2791 = _2790 * 0.4342944622039794921875;
@ -750,8 +750,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_3038 = _3030;
}
float3 _3044 = pow(((float3(pow(10.0, _2870), pow(10.0, _2954), pow(10.0, _3038)) - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_3052 = pow(fma(float3(18.8515625), _3044, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _3044, float3(1.0))), float3(78.84375));
float3 _3044 = powr(((float3(powr(10.0, _2870), powr(10.0, _2954), powr(10.0, _3038)) - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_3052 = powr(fma(float3(18.8515625), _3044, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _3044, float3(1.0))), float3(78.84375));
}
else
{
@ -980,7 +980,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1744 = _1741;
}
float3 _1748 = (float3(pow(10.0, _1596), pow(10.0, _1670), pow(10.0, _1744)) * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float3 _1748 = (float3(powr(10.0, _1596), powr(10.0, _1670), powr(10.0, _1744)) * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _1952 = _1748.x;
float _1955 = log((_1952 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1952);
float _1956 = _1955 * 0.4342944622039794921875;
@ -1089,20 +1089,20 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2188 = _2185;
}
float3 _2193 = pow((float3(pow(10.0, _2030), pow(10.0, _2109), pow(10.0, _2188)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2201 = pow(fma(float3(18.8515625), _2193, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _2193, float3(1.0))), float3(78.84375));
float3 _2193 = powr((float3(powr(10.0, _2030), powr(10.0, _2109), powr(10.0, _2188)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2201 = powr(fma(float3(18.8515625), _2193, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _2193, float3(1.0))), float3(78.84375));
}
else
{
float3 _1366;
if (_Globals.OutputDevice == 7u)
{
float3 _1358 = pow(((_932 * _573) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_1366 = pow(fma(float3(18.8515625), _1358, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _1358, float3(1.0))), float3(78.84375));
float3 _1358 = powr(((_932 * _573) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_1366 = powr(fma(float3(18.8515625), _1358, float3(0.8359375)) * (float3(1.0) / fma(float3(18.6875), _1358, float3(1.0))), float3(78.84375));
}
else
{
_1366 = pow((_1324 * _573) * _602, float3(_Globals.InverseGamma.z));
_1366 = powr((_1324 * _573) * _602, float3(_Globals.InverseGamma.z));
}
_2201 = _1366;
}

View File

@ -435,7 +435,7 @@ vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buff
float3 _459;
if (MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w >= 0.0)
{
_459 = (MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.xyz * float3(pow(fast::clamp(dot(_341 * float3(_346), MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.xyz), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.w))) * float3(1.0 - fast::clamp(exp2(-(_428 * fast::max(_393 - MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w, 0.0))), 0.0, 1.0));
_459 = (MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.xyz * float3(powr(fast::clamp(dot(_341 * float3(_346), MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.xyz), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.w))) * float3(1.0 - fast::clamp(exp2(-(_428 * fast::max(_393 - MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w, 0.0))), 0.0, 1.0));
}
else
{

View File

@ -224,7 +224,7 @@ kernel void main0(device SSBO& _19 [[buffer(0)]])
_19.res = acosh(((device float*)&_19.f32)[0u]);
_19.res = atanh(((device float*)&_19.f32)[0u]);
_19.res = precise::atan2(((device float*)&_19.f32)[0u], ((device float*)&_19.f32)[1u]);
_19.res = pow(((device float*)&_19.f32)[0u], ((device float*)&_19.f32)[1u]);
_19.res = powr(((device float*)&_19.f32)[0u], ((device float*)&_19.f32)[1u]);
_19.res = exp(((device float*)&_19.f32)[0u]);
_19.res = log(((device float*)&_19.f32)[0u]);
_19.res = exp2(((device float*)&_19.f32)[0u]);

View File

@ -102,7 +102,7 @@ void test_builtins(thread half4& v4, thread half3& v3, thread half& v1)
res = asinh(v4);
res = acosh(v4);
res = atanh(v4);
res = pow(v4, v4);
res = powr(v4, v4);
res = exp(v4);
res = log(v4);
res = exp2(v4);

View File

@ -338,7 +338,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_View& View [[bu
else
{
float3 _521 = _501 * float3(_Globals.LightPositionAndInvRadius[_491].w);
_537 = pow(1.0 - fast::clamp(dot(_521, _521), 0.0, 1.0), _Globals.LightColorAndFalloffExponent[_491].w);
_537 = powr(1.0 - fast::clamp(dot(_521, _521), 0.0, 1.0), _Globals.LightColorAndFalloffExponent[_491].w);
}
float3 _544 = cross(_206, _507);
float _546 = _511 * _442;

View File

@ -256,7 +256,7 @@ fragment main0_out main0(constant type_View& View [[buffer(0)]], constant type_G
float4 _260 = SSProfilesTexture.read(uint2(int3(1, int(uint((select(float4(0.0), SceneTexturesStruct_GBufferDTexture.sample(SceneTexturesStruct_GBufferDTextureSampler, _114, level(0.0)), bool4(!(((_240 & 4294967280u) & 16u) != 0u))).x * 255.0) + 0.5)), 0).xy), 0);
float _263 = _260.y * 0.5;
float3 _266 = _148 - (_236 * float3(_263));
float _274 = pow(fast::clamp(dot(-(_152 * float3(rsqrt(dot(_152, _152)))), _236), 0.0, 1.0), 1.0);
float _274 = powr(fast::clamp(dot(-(_152 * float3(rsqrt(dot(_152, _152)))), _236), 0.0, 1.0), 1.0);
float _445;
if (_160)
{

View File

@ -163,8 +163,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float3 _599;
if (_Globals.OutputDevice >= 3u)
{
float3 _591 = pow(_577, float3(0.0126833133399486541748046875));
_599 = pow(fast::max(float3(0.0), _591 - float3(0.8359375)) / (float3(18.8515625) - (float3(18.6875) * _591)), float3(6.277394771575927734375)) * float3(10000.0);
float3 _591 = powr(_577, float3(0.0126833133399486541748046875));
_599 = powr(fast::max(float3(0.0), _591 - float3(0.8359375)) / (float3(18.8515625) - (float3(18.6875) * _591)), float3(6.277394771575927734375)) * float3(10000.0);
}
else
{
@ -224,7 +224,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float4 _861 = _Globals.ColorGammaMidtones * _Globals.ColorGamma;
float4 _864 = _Globals.ColorGainMidtones * _Globals.ColorGain;
float4 _867 = _Globals.ColorOffsetMidtones + _Globals.ColorOffset;
float3 _905 = ((((pow(pow(fast::max(float3(0.0), mix(_772, _745, _751.xyz * float3(_751.w))) * float3(5.5555553436279296875), _756.xyz * float3(_756.w)) * float3(0.180000007152557373046875), float3(1.0) / (_761.xyz * float3(_761.w))) * (_766.xyz * float3(_766.w))) + (_771.xyz + float3(_771.w))) * float3(1.0 - _804)) + (((pow(pow(fast::max(float3(0.0), mix(_772, _745, _855.xyz * float3(_855.w))) * float3(5.5555553436279296875), _858.xyz * float3(_858.w)) * float3(0.180000007152557373046875), float3(1.0) / (_861.xyz * float3(_861.w))) * (_864.xyz * float3(_864.w))) + (_867.xyz + float3(_867.w))) * float3(_804 - _852))) + (((pow(pow(fast::max(float3(0.0), mix(_772, _745, _808.xyz * float3(_808.w))) * float3(5.5555553436279296875), _811.xyz * float3(_811.w)) * float3(0.180000007152557373046875), float3(1.0) / (_814.xyz * float3(_814.w))) * (_817.xyz * float3(_817.w))) + (_820.xyz + float3(_820.w))) * float3(_852));
float3 _905 = ((((powr(powr(fast::max(float3(0.0), mix(_772, _745, _751.xyz * float3(_751.w))) * float3(5.5555553436279296875), _756.xyz * float3(_756.w)) * float3(0.180000007152557373046875), float3(1.0) / (_761.xyz * float3(_761.w))) * (_766.xyz * float3(_766.w))) + (_771.xyz + float3(_771.w))) * float3(1.0 - _804)) + (((powr(powr(fast::max(float3(0.0), mix(_772, _745, _855.xyz * float3(_855.w))) * float3(5.5555553436279296875), _858.xyz * float3(_858.w)) * float3(0.180000007152557373046875), float3(1.0) / (_861.xyz * float3(_861.w))) * (_864.xyz * float3(_864.w))) + (_867.xyz + float3(_867.w))) * float3(_804 - _852))) + (((powr(powr(fast::max(float3(0.0), mix(_772, _745, _808.xyz * float3(_808.w))) * float3(5.5555553436279296875), _811.xyz * float3(_811.w)) * float3(0.180000007152557373046875), float3(1.0) / (_814.xyz * float3(_814.w))) * (_817.xyz * float3(_817.w))) + (_820.xyz + float3(_820.w))) * float3(_852));
float3 _906 = _905 * _549;
float3 _914 = float3(_Globals.BlueCorrection);
float3 _916 = mix(_905, _905 * ((_551 * float3x3(float3(0.940437257289886474609375, -0.01830687932670116424560546875, 0.07786960899829864501953125), float3(0.008378696627914905548095703125, 0.82866001129150390625, 0.162961304187774658203125), float3(0.0005471261101774871349334716796875, -0.00088337459601461887359619140625, 1.00033628940582275390625))) * _550), _914) * _551;
@ -332,7 +332,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
{
_1189 = fast::max(float3(0.0), mix(_1119, _1119 * ((_551 * float3x3(float3(1.06317996978759765625, 0.02339559979736804962158203125, -0.08657260239124298095703125), float3(-0.010633699595928192138671875, 1.2063200473785400390625, -0.1956900060176849365234375), float3(-0.0005908869788981974124908447265625, 0.00105247995816171169281005859375, 0.999538004398345947265625))) * _550), _914) * _549);
}
float3 _1218 = pow(fast::max(float3(0.0), mix((((float3(_Globals.MappingPolynomial.x) * (_1189 * _1189)) + (float3(_Globals.MappingPolynomial.y) * _1189)) + float3(_Globals.MappingPolynomial.z)) * float3(_Globals.ColorScale), _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
float3 _1218 = powr(fast::max(float3(0.0), mix((((float3(_Globals.MappingPolynomial.x) * (_1189 * _1189)) + (float3(_Globals.MappingPolynomial.y) * _1189)) + float3(_Globals.MappingPolynomial.z)) * float3(_Globals.ColorScale), _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
float3 _3001;
if (_Globals.OutputDevice == 0u)
{
@ -345,7 +345,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2973 = _2961 * 12.9200000762939453125;
break;
}
_2973 = (pow(_2961, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
_2973 = (powr(_2961, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
float _2974 = _1218.y;
@ -357,7 +357,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2986 = _2974 * 12.9200000762939453125;
break;
}
_2986 = (pow(_2974, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
_2986 = (powr(_2974, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
float _2987 = _1218.z;
@ -369,7 +369,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2999 = _2987 * 12.9200000762939453125;
break;
}
_2999 = (pow(_2987, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
_2999 = (powr(_2987, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
_3001 = float3(_2973, _2986, _2999);
@ -380,7 +380,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
if (_Globals.OutputDevice == 1u)
{
float3 _2953 = fast::max(float3(6.1035199905745685100555419921875e-05), (_1218 * _547) * _576);
_2960 = fast::min(_2953 * float3(4.5), (pow(fast::max(_2953, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)) * float3(1.09899997711181640625)) - float3(0.098999999463558197021484375));
_2960 = fast::min(_2953 * float3(4.5), (powr(fast::max(_2953, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)) * float3(1.09899997711181640625)) - float3(0.098999999463558197021484375));
}
else
{
@ -542,7 +542,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2327 = _2324;
}
float3 _2329;
_2329.x = pow(10.0, _2327);
_2329.x = powr(10.0, _2327);
float _2330 = _2248.y;
float _2334 = log((_2330 <= 0.0) ? _2255 : _2330) / _1065;
float _2401;
@ -580,7 +580,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2401 = _2398;
}
_2329.y = pow(10.0, _2401);
_2329.y = powr(10.0, _2401);
float _2404 = _2248.z;
float _2408 = log((_2404 <= 0.0) ? _2255 : _2404) / _1065;
float _2475;
@ -618,9 +618,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2475 = _2472;
}
_2329.z = pow(10.0, _2475);
_2329.z = powr(10.0, _2475);
float3 _2479 = (_2329 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _2481 = 0.17999999225139617919921875 * pow(2.0, -12.0);
float _2481 = 0.17999999225139617919921875 * powr(2.0, -12.0);
float _2485 = log((_2481 <= 0.0) ? _2255 : _2481) / _1065;
float _2552;
if (_2485 <= _2260)
@ -689,8 +689,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2611 = _2608;
}
float _2612 = pow(10.0, _2611);
float _2614 = 0.17999999225139617919921875 * pow(2.0, 10.0);
float _2612 = powr(10.0, _2611);
float _2614 = 0.17999999225139617919921875 * powr(2.0, 10.0);
float _2618 = log((_2614 <= 0.0) ? _2255 : _2614) / _1065;
float _2683;
if (_2618 <= _2260)
@ -726,10 +726,10 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2683 = _2680;
}
float _2684 = pow(10.0, _2683);
float _2684 = powr(10.0, _2683);
float _2685 = _2479.x;
float _2689 = log((_2685 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2685) / _1065;
float _2690 = log(pow(10.0, _2552));
float _2690 = log(powr(10.0, _2552));
float _2691 = _2690 / _1065;
float _2768;
if (_2689 <= _2691)
@ -768,7 +768,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2768 = _2760;
}
float3 _2770;
_2770.x = pow(10.0, _2768);
_2770.x = powr(10.0, _2768);
float _2771 = _2479.y;
float _2775 = log((_2771 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2771) / _1065;
float _2852;
@ -807,7 +807,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2852 = _2844;
}
_2770.y = pow(10.0, _2852);
_2770.y = powr(10.0, _2852);
float _2855 = _2479.z;
float _2859 = log((_2855 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2855) / _1065;
float _2936;
@ -846,9 +846,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2936 = _2928;
}
_2770.z = pow(10.0, _2936);
float3 _2942 = pow(((_2770 - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2950 = pow((float3(0.8359375) + (float3(18.8515625) * _2942)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2942))), float3(78.84375));
_2770.z = powr(10.0, _2936);
float3 _2942 = powr(((_2770 - float3(3.5073844628641381859779357910156e-05)) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2950 = powr((float3(0.8359375) + (float3(18.8515625) * _2942)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2942))), float3(78.84375));
}
else
{
@ -1010,7 +1010,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1490 = _1487;
}
float3 _1492;
_1492.x = pow(10.0, _1490);
_1492.x = powr(10.0, _1490);
float _1493 = _1411.y;
float _1497 = log((_1493 <= 0.0) ? _1418 : _1493) / _1065;
float _1564;
@ -1048,7 +1048,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1564 = _1561;
}
_1492.y = pow(10.0, _1564);
_1492.y = powr(10.0, _1564);
float _1567 = _1411.z;
float _1571 = log((_1567 <= 0.0) ? _1418 : _1567) / _1065;
float _1638;
@ -1086,9 +1086,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1638 = _1635;
}
_1492.z = pow(10.0, _1638);
_1492.z = powr(10.0, _1638);
float3 _1642 = (_1492 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _1644 = 0.17999999225139617919921875 * pow(2.0, -12.0);
float _1644 = 0.17999999225139617919921875 * powr(2.0, -12.0);
float _1648 = log((_1644 <= 0.0) ? _1418 : _1644) / _1065;
float _1715;
if (_1648 <= _1423)
@ -1157,8 +1157,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1774 = _1771;
}
float _1775 = pow(10.0, _1774);
float _1777 = 0.17999999225139617919921875 * pow(2.0, 11.0);
float _1775 = powr(10.0, _1774);
float _1777 = 0.17999999225139617919921875 * powr(2.0, 11.0);
float _1781 = log((_1777 <= 0.0) ? _1418 : _1777) / _1065;
float _1846;
if (_1781 <= _1423)
@ -1194,10 +1194,10 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1846 = _1843;
}
float _1847 = pow(10.0, _1846);
float _1847 = powr(10.0, _1846);
float _1848 = _1642.x;
float _1852 = log((_1848 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1848) / _1065;
float _1854 = log(pow(10.0, _1715)) / _1065;
float _1854 = log(powr(10.0, _1715)) / _1065;
float _1926;
if (_1852 <= _1854)
{
@ -1235,7 +1235,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1926 = _1923;
}
float3 _1928;
_1928.x = pow(10.0, _1926);
_1928.x = powr(10.0, _1926);
float _1929 = _1642.y;
float _1933 = log((_1929 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1929) / _1065;
float _2005;
@ -1274,7 +1274,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2005 = _2002;
}
_1928.y = pow(10.0, _2005);
_1928.y = powr(10.0, _2005);
float _2008 = _1642.z;
float _2012 = log((_2008 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2008) / _1065;
float _2084;
@ -1313,21 +1313,21 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2084 = _2081;
}
_1928.z = pow(10.0, _2084);
float3 _2089 = pow((_1928 * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2097 = pow((float3(0.8359375) + (float3(18.8515625) * _2089)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2089))), float3(78.84375));
_1928.z = powr(10.0, _2084);
float3 _2089 = powr((_1928 * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2097 = powr((float3(0.8359375) + (float3(18.8515625) * _2089)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2089))), float3(78.84375));
}
else
{
float3 _1260;
if (_Globals.OutputDevice == 7u)
{
float3 _1252 = pow(((_906 * _547) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_1260 = pow((float3(0.8359375) + (float3(18.8515625) * _1252)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _1252))), float3(78.84375));
float3 _1252 = powr(((_906 * _547) * _576) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_1260 = powr((float3(0.8359375) + (float3(18.8515625) * _1252)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _1252))), float3(78.84375));
}
else
{
_1260 = pow((_1218 * _547) * _576, float3(_Globals.InverseGamma.z));
_1260 = powr((_1218 * _547) * _576, float3(_Globals.InverseGamma.z));
}
_2097 = _1260;
}

View File

@ -165,8 +165,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float3 _625;
if (_Globals.OutputDevice >= 3u)
{
float3 _617 = pow(_603, float3(0.0126833133399486541748046875));
_625 = pow(fast::max(float3(0.0), _617 - float3(0.8359375)) / (float3(18.8515625) - (float3(18.6875) * _617)), float3(6.277394771575927734375)) * float3(10000.0);
float3 _617 = powr(_603, float3(0.0126833133399486541748046875));
_625 = powr(fast::max(float3(0.0), _617 - float3(0.8359375)) / (float3(18.8515625) - (float3(18.6875) * _617)), float3(6.277394771575927734375)) * float3(10000.0);
}
else
{
@ -226,7 +226,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float4 _887 = _Globals.ColorGammaMidtones * _Globals.ColorGamma;
float4 _890 = _Globals.ColorGainMidtones * _Globals.ColorGain;
float4 _893 = _Globals.ColorOffsetMidtones + _Globals.ColorOffset;
float3 _931 = ((((pow(pow(fast::max(float3(0.0), mix(_798, _771, _777.xyz * float3(_777.w))) * float3(5.5555553436279296875), _782.xyz * float3(_782.w)) * float3(0.180000007152557373046875), float3(1.0) / (_787.xyz * float3(_787.w))) * (_792.xyz * float3(_792.w))) + (_797.xyz + float3(_797.w))) * float3(1.0 - _830)) + (((pow(pow(fast::max(float3(0.0), mix(_798, _771, _881.xyz * float3(_881.w))) * float3(5.5555553436279296875), _884.xyz * float3(_884.w)) * float3(0.180000007152557373046875), float3(1.0) / (_887.xyz * float3(_887.w))) * (_890.xyz * float3(_890.w))) + (_893.xyz + float3(_893.w))) * float3(_830 - _878))) + (((pow(pow(fast::max(float3(0.0), mix(_798, _771, _834.xyz * float3(_834.w))) * float3(5.5555553436279296875), _837.xyz * float3(_837.w)) * float3(0.180000007152557373046875), float3(1.0) / (_840.xyz * float3(_840.w))) * (_843.xyz * float3(_843.w))) + (_846.xyz + float3(_846.w))) * float3(_878));
float3 _931 = ((((powr(powr(fast::max(float3(0.0), mix(_798, _771, _777.xyz * float3(_777.w))) * float3(5.5555553436279296875), _782.xyz * float3(_782.w)) * float3(0.180000007152557373046875), float3(1.0) / (_787.xyz * float3(_787.w))) * (_792.xyz * float3(_792.w))) + (_797.xyz + float3(_797.w))) * float3(1.0 - _830)) + (((powr(powr(fast::max(float3(0.0), mix(_798, _771, _881.xyz * float3(_881.w))) * float3(5.5555553436279296875), _884.xyz * float3(_884.w)) * float3(0.180000007152557373046875), float3(1.0) / (_887.xyz * float3(_887.w))) * (_890.xyz * float3(_890.w))) + (_893.xyz + float3(_893.w))) * float3(_830 - _878))) + (((powr(powr(fast::max(float3(0.0), mix(_798, _771, _834.xyz * float3(_834.w))) * float3(5.5555553436279296875), _837.xyz * float3(_837.w)) * float3(0.180000007152557373046875), float3(1.0) / (_840.xyz * float3(_840.w))) * (_843.xyz * float3(_843.w))) + (_846.xyz + float3(_846.w))) * float3(_878));
float3 _932 = _931 * _575;
float3 _940 = float3(_Globals.BlueCorrection);
float3 _942 = mix(_931, _931 * ((_577 * float3x3(float3(0.940437257289886474609375, -0.01830687932670116424560546875, 0.07786960899829864501953125), float3(0.008378696627914905548095703125, 0.82866001129150390625, 0.162961304187774658203125), float3(0.0005471261101774871349334716796875, -0.00088337459601461887359619140625, 1.00033628940582275390625))) * _576), _940) * _577;
@ -344,7 +344,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1229 = _1217 * 12.9200000762939453125;
break;
}
_1229 = (pow(_1217, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
_1229 = (powr(_1217, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
float _1230 = _1216.y;
@ -356,7 +356,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1242 = _1230 * 12.9200000762939453125;
break;
}
_1242 = (pow(_1230, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
_1242 = (powr(_1230, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
float _1243 = _1216.z;
@ -368,7 +368,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1255 = _1243 * 12.9200000762939453125;
break;
}
_1255 = (pow(_1243, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
_1255 = (powr(_1243, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
float3 _1256 = float3(_1229, _1242, _1255);
@ -380,8 +380,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
float4 _1279 = Texture1.sample(Texture1Sampler, float2(_1275, _1276));
float4 _1283 = Texture1.sample(Texture1Sampler, float2(_1275 + 0.0625, _1276));
float3 _1289 = fast::max(float3(6.1035199905745685100555419921875e-05), (float3(_Globals.LUTWeights[0].x) * _1256) + (float3(_Globals.LUTWeights[1].x) * mix(_1279, _1283, float4(_1270 - _1271)).xyz));
float3 _1295 = select(_1289 * float3(0.077399380505084991455078125), pow((_1289 * float3(0.94786727428436279296875)) + float3(0.0521326996386051177978515625), float3(2.400000095367431640625)), _1289 > float3(0.040449999272823333740234375));
float3 _1324 = pow(fast::max(float3(0.0), mix((((float3(_Globals.MappingPolynomial.x) * (_1295 * _1295)) + (float3(_Globals.MappingPolynomial.y) * _1295)) + float3(_Globals.MappingPolynomial.z)) * _Globals.ColorScale, _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
float3 _1295 = select(_1289 * float3(0.077399380505084991455078125), powr((_1289 * float3(0.94786727428436279296875)) + float3(0.0521326996386051177978515625), float3(2.400000095367431640625)), _1289 > float3(0.040449999272823333740234375));
float3 _1324 = powr(fast::max(float3(0.0), mix((((float3(_Globals.MappingPolynomial.x) * (_1295 * _1295)) + (float3(_Globals.MappingPolynomial.y) * _1295)) + float3(_Globals.MappingPolynomial.z)) * _Globals.ColorScale, _Globals.OverlayColor.xyz, float3(_Globals.OverlayColor.w))), float3(_Globals.InverseGamma.y));
float3 _3103;
if (_Globals.OutputDevice == 0u)
{
@ -393,7 +393,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3075 = _1324.x * 12.9200000762939453125;
break;
}
_3075 = (pow(_1324.x, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
_3075 = (powr(_1324.x, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
float _3088;
@ -404,7 +404,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3088 = _1324.y * 12.9200000762939453125;
break;
}
_3088 = (pow(_1324.y, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
_3088 = (powr(_1324.y, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
float _3101;
@ -415,7 +415,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_3101 = _1324.z * 12.9200000762939453125;
break;
}
_3101 = (pow(_1324.z, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
_3101 = (powr(_1324.z, 0.4166666567325592041015625) * 1.05499994754791259765625) - 0.054999999701976776123046875;
break;
}
_3103 = float3(_3075, _3088, _3101);
@ -426,7 +426,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
if (_Globals.OutputDevice == 1u)
{
float3 _3055 = fast::max(float3(6.1035199905745685100555419921875e-05), (_1324 * _573) * _602);
_3062 = fast::min(_3055 * float3(4.5), (pow(fast::max(_3055, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)) * float3(1.09899997711181640625)) - float3(0.098999999463558197021484375));
_3062 = fast::min(_3055 * float3(4.5), (powr(fast::max(_3055, float3(0.017999999225139617919921875)), float3(0.449999988079071044921875)) * float3(1.09899997711181640625)) - float3(0.098999999463558197021484375));
}
else
{
@ -588,7 +588,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2431 = _2428;
}
float3 _2433;
_2433.x = pow(10.0, _2431);
_2433.x = powr(10.0, _2431);
float _2434 = _2352.y;
float _2438 = log((_2434 <= 0.0) ? _2359 : _2434) / _1091;
float _2505;
@ -626,7 +626,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2505 = _2502;
}
_2433.y = pow(10.0, _2505);
_2433.y = powr(10.0, _2505);
float _2508 = _2352.z;
float _2512 = log((_2508 <= 0.0) ? _2359 : _2508) / _1091;
float _2579;
@ -664,9 +664,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2579 = _2576;
}
_2433.z = pow(10.0, _2579);
_2433.z = powr(10.0, _2579);
float3 _2583 = (_2433 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _2585 = 0.17999999225139617919921875 * pow(2.0, -12.0);
float _2585 = 0.17999999225139617919921875 * powr(2.0, -12.0);
float _2589 = log((_2585 <= 0.0) ? _2359 : _2585) / _1091;
float _2656;
if (_2589 <= _2364)
@ -735,8 +735,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2713 = _2710;
}
float _2714 = pow(10.0, _2713);
float _2716 = 0.17999999225139617919921875 * pow(2.0, 10.0);
float _2714 = powr(10.0, _2713);
float _2716 = 0.17999999225139617919921875 * powr(2.0, 10.0);
float _2720 = log((_2716 <= 0.0) ? _2359 : _2716) / _1091;
float _2785;
if (_2720 <= _2364)
@ -772,10 +772,10 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2785 = _2782;
}
float _2786 = pow(10.0, _2785);
float _2786 = powr(10.0, _2785);
float _2787 = _2583.x;
float _2791 = log((_2787 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2787) / _1091;
float _2792 = log(pow(10.0, _2656));
float _2792 = log(powr(10.0, _2656));
float _2793 = _2792 / _1091;
float _2870;
if (_2791 <= _2793)
@ -814,7 +814,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2870 = _2862;
}
float3 _2872;
_2872.x = pow(10.0, _2870);
_2872.x = powr(10.0, _2870);
float _2873 = _2583.y;
float _2877 = log((_2873 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2873) / _1091;
float _2954;
@ -853,7 +853,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2954 = _2946;
}
_2872.y = pow(10.0, _2954);
_2872.y = powr(10.0, _2954);
float _2957 = _2583.z;
float _2961 = log((_2957 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2957) / _1091;
float _3038;
@ -892,9 +892,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_3038 = _3030;
}
_2872.z = pow(10.0, _3038);
float3 _3044 = pow(((_2872 - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_3052 = pow((float3(0.8359375) + (float3(18.8515625) * _3044)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _3044))), float3(78.84375));
_2872.z = powr(10.0, _3038);
float3 _3044 = powr(((_2872 - float3(3.5073844628641381859779357910156e-05)) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_3052 = powr((float3(0.8359375) + (float3(18.8515625) * _3044)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _3044))), float3(78.84375));
}
else
{
@ -1056,7 +1056,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_1596 = _1593;
}
float3 _1598;
_1598.x = pow(10.0, _1596);
_1598.x = powr(10.0, _1596);
float _1599 = _1517.y;
float _1603 = log((_1599 <= 0.0) ? _1524 : _1599) / _1091;
float _1670;
@ -1094,7 +1094,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1670 = _1667;
}
_1598.y = pow(10.0, _1670);
_1598.y = powr(10.0, _1670);
float _1673 = _1517.z;
float _1677 = log((_1673 <= 0.0) ? _1524 : _1673) / _1091;
float _1744;
@ -1132,9 +1132,9 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1744 = _1741;
}
_1598.z = pow(10.0, _1744);
_1598.z = powr(10.0, _1744);
float3 _1748 = (_1598 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375));
float _1750 = 0.17999999225139617919921875 * pow(2.0, -12.0);
float _1750 = 0.17999999225139617919921875 * powr(2.0, -12.0);
float _1754 = log((_1750 <= 0.0) ? _1524 : _1750) / _1091;
float _1821;
if (_1754 <= _1529)
@ -1203,8 +1203,8 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1878 = _1875;
}
float _1879 = pow(10.0, _1878);
float _1881 = 0.17999999225139617919921875 * pow(2.0, 11.0);
float _1879 = powr(10.0, _1878);
float _1881 = 0.17999999225139617919921875 * powr(2.0, 11.0);
float _1885 = log((_1881 <= 0.0) ? _1524 : _1881) / _1091;
float _1950;
if (_1885 <= _1529)
@ -1240,10 +1240,10 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_1950 = _1947;
}
float _1951 = pow(10.0, _1950);
float _1951 = powr(10.0, _1950);
float _1952 = _1748.x;
float _1956 = log((_1952 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1952) / _1091;
float _1958 = log(pow(10.0, _1821)) / _1091;
float _1958 = log(powr(10.0, _1821)) / _1091;
float _2030;
if (_1956 <= _1958)
{
@ -1281,7 +1281,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
_2030 = _2027;
}
float3 _2032;
_2032.x = pow(10.0, _2030);
_2032.x = powr(10.0, _2030);
float _2033 = _1748.y;
float _2037 = log((_2033 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2033) / _1091;
float _2109;
@ -1320,7 +1320,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2109 = _2106;
}
_2032.y = pow(10.0, _2109);
_2032.y = powr(10.0, _2109);
float _2112 = _1748.z;
float _2116 = log((_2112 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2112) / _1091;
float _2188;
@ -1359,21 +1359,21 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa
}
_2188 = _2185;
}
_2032.z = pow(10.0, _2188);
float3 _2193 = pow((_2032 * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2201 = pow((float3(0.8359375) + (float3(18.8515625) * _2193)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2193))), float3(78.84375));
_2032.z = powr(10.0, _2188);
float3 _2193 = powr((_2032 * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_2201 = powr((float3(0.8359375) + (float3(18.8515625) * _2193)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _2193))), float3(78.84375));
}
else
{
float3 _1366;
if (_Globals.OutputDevice == 7u)
{
float3 _1358 = pow(((_932 * _573) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_1366 = pow((float3(0.8359375) + (float3(18.8515625) * _1358)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _1358))), float3(78.84375));
float3 _1358 = powr(((_932 * _573) * _602) * float3(9.9999997473787516355514526367188e-05), float3(0.1593017578125));
_1366 = powr((float3(0.8359375) + (float3(18.8515625) * _1358)) * (float3(1.0) / (float3(1.0) + (float3(18.6875) * _1358))), float3(78.84375));
}
else
{
_1366 = pow((_1324 * _573) * _602, float3(_Globals.InverseGamma.z));
_1366 = powr((_1324 * _573) * _602, float3(_Globals.InverseGamma.z));
}
_2201 = _1366;
}

View File

@ -444,7 +444,7 @@ vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buff
float3 _459;
if (MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w >= 0.0)
{
_459 = (MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.xyz * float3(pow(fast::clamp(dot(_341 * float3(_346), MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.xyz), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.w))) * float3(1.0 - fast::clamp(exp2(-(_428 * fast::max(_393 - MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w, 0.0))), 0.0, 1.0));
_459 = (MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.xyz * float3(powr(fast::clamp(dot(_341 * float3(_346), MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.xyz), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_DirectionalInscatteringColor.w))) * float3(1.0 - fast::clamp(exp2(-(_428 * fast::max(_393 - MobileBasePass.MobileBasePass_Fog_InscatteringLightDirection.w, 0.0))), 0.0, 1.0));
}
else
{

View File

@ -10336,6 +10336,11 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop,
break;
}
case GLSLstd450Pow:
// powr makes x < 0.0 undefined, just like SPIR-V.
emit_binary_func_op(result_type, id, args[0], args[1], "powr");
break;
default:
CompilerGLSL::emit_glsl_op(result_type, id, eop, args, count);
break;