bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt

99 lines
3.1 KiB
Plaintext
Raw Normal View History

2015-04-03 09:30:48 +03:00
#include <metal_stdlib>
2016-03-05 21:48:54 +03:00
#pragma clang diagnostic ignored "-Wparentheses-equality"
2015-04-03 09:30:48 +03:00
using namespace metal;
struct xlatMtlShaderInput {
half2 xlv_TEXCOORD0;
};
struct xlatMtlShaderOutput {
half4 _fragData [[color(0)]];
};
struct xlatMtlShaderUniform {
half _NumPasses;
half4 _ContrastShift;
half4 _SaturationShift;
half4 _HueShift;
half4 _LuminosityShift;
};
fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
, texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
{
xlatMtlShaderOutput _mtl_o;
2016-09-22 07:01:52 +03:00
half4 t_1 = 0;
half4 tmpvar_2 = 0;
2015-04-03 09:30:48 +03:00
tmpvar_2 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
t_1 = tmpvar_2;
2016-09-22 07:01:52 +03:00
if ((_mtl_u._NumPasses > (half)(0.0))) {
half passes_3 = 0;
2015-04-03 09:30:48 +03:00
passes_3 = _mtl_u._NumPasses;
2016-09-22 07:01:52 +03:00
float i_4 = 0;
half3 res_5 = 0;
2015-04-03 09:30:48 +03:00
res_5 = tmpvar_2.xyz;
i_4 = 0.0;
while (true) {
if ((i_4 >= 4.0)) {
break;
};
2016-09-22 07:01:52 +03:00
if ((i_4 == (float)(passes_3))) {
2015-04-03 09:30:48 +03:00
break;
};
if ((i_4 == 0.0)) {
2016-09-22 07:01:52 +03:00
half3 tmpvar_6 = 0;
half val_7 = 0;
val_7 = ((_mtl_u._ContrastShift.x * (half)(3.0)) + (half)(12.0));
half tmpvar_8 = 0;
tmpvar_8 = pow ((cos(val_7) + (half)(1.0)), val_7);
tmpvar_6 = ((res_5 - (half)(0.5)) * tmpvar_8);
2015-04-03 09:30:48 +03:00
res_5 = tmpvar_6;
} else {
if ((i_4 == 1.0)) {
2016-09-22 07:01:52 +03:00
half3 tmpvar_9 = 0;
half val_10 = 0;
val_10 = ((_mtl_u._SaturationShift.y * (half)(3.0)) + (half)(12.0));
half tmpvar_11 = 0;
tmpvar_11 = pow ((cos(val_10) + (half)(1.0)), val_10);
tmpvar_9 = ((res_5 - (half)(0.5)) * tmpvar_11);
2015-04-03 09:30:48 +03:00
res_5 = tmpvar_9;
} else {
if ((i_4 == 2.0)) {
2016-09-22 07:01:52 +03:00
half3 tmpvar_12 = 0;
half val_13 = 0;
val_13 = ((_mtl_u._HueShift.z * (half)(3.0)) + (half)(12.0));
half tmpvar_14 = 0;
tmpvar_14 = pow ((cos(val_13) + (half)(1.0)), val_13);
tmpvar_12 = ((res_5 - (half)(0.5)) * tmpvar_14);
2015-04-03 09:30:48 +03:00
res_5 = tmpvar_12;
} else {
2016-09-22 07:01:52 +03:00
half3 tmpvar_15 = 0;
half val_16 = 0;
val_16 = ((_mtl_u._LuminosityShift.x * (half)(3.0)) + (half)(12.0));
half tmpvar_17 = 0;
tmpvar_17 = pow ((cos(val_16) + (half)(1.0)), val_16);
tmpvar_15 = ((res_5 - (half)(0.5)) * tmpvar_17);
2015-04-03 09:30:48 +03:00
res_5 = tmpvar_15;
};
};
};
i_4 += 1.0;
};
t_1.xyz = res_5;
};
2016-09-22 07:01:52 +03:00
half4 tmpvar_18 = 0;
2015-04-03 09:30:48 +03:00
tmpvar_18.w = half(1.0);
tmpvar_18.xyz = t_1.xyz;
_mtl_o._fragData = tmpvar_18;
return _mtl_o;
}
// stats: 37 alu 1 tex 7 flow
// inputs: 1
// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
// uniforms: 5 (total size: 40)
// #0: _NumPasses (medium float) 1x1 [-1] loc 0
// #1: _ContrastShift (medium float) 4x1 [-1] loc 8
// #2: _SaturationShift (medium float) 4x1 [-1] loc 16
// #3: _HueShift (low float) 4x1 [-1] loc 24
// #4: _LuminosityShift (low float) 4x1 [-1] loc 32
// textures: 1
// #0: _MainTex (low 2d) 0x0 [-1] loc 0