mirror of
https://github.com/libretro/RetroArch
synced 2025-02-10 12:40:03 +00:00
266 lines
8.2 KiB
GLSL
266 lines
8.2 KiB
GLSL
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- XML/GLSL shader autogenerated by cg2xml.py -->
|
|
<shader language="GLSL" style="GLES2">
|
|
<vertex><![CDATA[
|
|
varying vec4 _t1;
|
|
varying vec2 _texCoord1;
|
|
varying vec4 _color1;
|
|
varying vec4 _position1;
|
|
varying float _frame_rotation;
|
|
varying float _frame_direction;
|
|
varying float _frame_count;
|
|
varying vec2 _output_dummy_size;
|
|
struct input_dummy {
|
|
vec2 _video_size;
|
|
vec2 _texture_size;
|
|
vec2 _output_dummy_size;
|
|
float _frame_count;
|
|
float _frame_direction;
|
|
float _frame_rotation;
|
|
};
|
|
struct out_vertex {
|
|
vec4 _position1;
|
|
vec4 _color1;
|
|
vec2 _texCoord1;
|
|
vec4 _t1;
|
|
};
|
|
out_vertex _ret_0;
|
|
uniform mat4 rubyMVPMatrix;
|
|
uniform input_dummy _IN1;
|
|
vec4 _r0003;
|
|
attribute vec4 rubyVertexCoord;
|
|
attribute vec4 COLOR;
|
|
attribute vec4 rubyTexCoord;
|
|
varying vec4 COL0;
|
|
varying vec4 TEX0;
|
|
varying vec4 TEX1;
|
|
|
|
|
|
mat4 transpose_(mat4 matrix)
|
|
{
|
|
mat4 ret;
|
|
for (int i = 0; i < 4; i++)
|
|
for (int j = 0; j < 4; j++)
|
|
ret[i][j] = matrix[j][i];
|
|
|
|
return ret;
|
|
}
|
|
|
|
uniform mediump vec2 rubyOutputSize;
|
|
uniform mediump vec2 rubyTextureSize;
|
|
uniform mediump vec2 rubyInputSize;
|
|
void main()
|
|
{
|
|
mat4 rubyMVPMatrix_ = transpose_(rubyMVPMatrix);
|
|
out_vertex _OUT;
|
|
vec2 _ps;
|
|
_r0003.x = dot(rubyMVPMatrix_[0], rubyVertexCoord);
|
|
_r0003.y = dot(rubyMVPMatrix_[1], rubyVertexCoord);
|
|
_r0003.z = dot(rubyMVPMatrix_[2], rubyVertexCoord);
|
|
_r0003.w = dot(rubyMVPMatrix_[3], rubyVertexCoord);
|
|
_ps = vec2(1.00000000E+00/rubyTextureSize.x, 1.00000000E+00/rubyTextureSize.y);
|
|
_OUT._t1.xy = vec2(0.00000000E+00, -_ps.y);
|
|
_OUT._t1.zw = vec2(-_ps.x, 0.00000000E+00);
|
|
_position1 = _r0003;
|
|
_color1 = COLOR;
|
|
_texCoord1 = rubyTexCoord.xy;
|
|
_t1 = _OUT._t1;
|
|
gl_Position = _r0003;
|
|
COL0 = COLOR;
|
|
TEX0.xy = rubyTexCoord.xy;
|
|
TEX1 = _OUT._t1;
|
|
return;
|
|
COL0 = _color1;
|
|
TEX0.xy = _texCoord1;
|
|
TEX1 = _t1;
|
|
}
|
|
]]></vertex>
|
|
<fragment><![CDATA[
|
|
#ifdef GL_ES
|
|
precision mediump float;
|
|
#endif
|
|
varying vec4 _t1;
|
|
varying vec2 _texCoord;
|
|
varying vec4 _color1;
|
|
varying float _frame_rotation;
|
|
varying float _frame_direction;
|
|
varying float _frame_count;
|
|
varying vec2 _output_dummy_size;
|
|
struct input_dummy {
|
|
vec2 _video_size;
|
|
vec2 _texture_size;
|
|
vec2 _output_dummy_size;
|
|
float _frame_count;
|
|
float _frame_direction;
|
|
float _frame_rotation;
|
|
};
|
|
struct out_vertex {
|
|
vec4 _color1;
|
|
vec2 _texCoord;
|
|
vec4 _t1;
|
|
};
|
|
vec4 _ret_0;
|
|
vec3 _TMP10;
|
|
vec3 _TMP11;
|
|
vec3 _TMP12;
|
|
float _TMP13;
|
|
float _TMP14;
|
|
vec4 _TMP9;
|
|
vec4 _TMP8;
|
|
vec4 _TMP7;
|
|
vec4 _TMP6;
|
|
vec4 _TMP5;
|
|
vec4 _TMP4;
|
|
vec4 _TMP3;
|
|
vec4 _TMP2;
|
|
vec4 _TMP1;
|
|
vec4 _TMP0;
|
|
uniform sampler2D rubyTexture;
|
|
uniform input_dummy _IN1;
|
|
vec2 _x0020;
|
|
vec2 _c0024;
|
|
vec2 _c0026;
|
|
vec2 _c0028;
|
|
vec2 _c0032;
|
|
vec2 _c0034;
|
|
vec2 _c0036;
|
|
vec2 _c0038;
|
|
vec2 _c0040;
|
|
vec2 _c0042;
|
|
varying vec4 TEX0;
|
|
varying vec4 TEX1;
|
|
|
|
uniform mediump vec2 rubyOutputSize;
|
|
uniform mediump vec2 rubyTextureSize;
|
|
uniform mediump vec2 rubyInputSize;
|
|
void main()
|
|
{
|
|
vec2 _fp;
|
|
vec2 _st;
|
|
vec2 _g1;
|
|
vec2 _g2;
|
|
float _AO;
|
|
float _BO;
|
|
float _CO;
|
|
vec3 _B;
|
|
vec3 _C;
|
|
vec3 _D;
|
|
vec3 _E;
|
|
vec3 _F;
|
|
vec3 _G;
|
|
vec3 _H;
|
|
vec3 _I;
|
|
vec3 _C4;
|
|
vec3 _G5;
|
|
float _b;
|
|
float _c;
|
|
float _d;
|
|
float _e;
|
|
float _f;
|
|
float _g;
|
|
float _h;
|
|
float _i;
|
|
float _c4;
|
|
float _g5;
|
|
vec3 _res;
|
|
bool _fx_1;
|
|
bool _condition_11;
|
|
bool _condition_21;
|
|
bool _condition_31;
|
|
_x0020 = TEX0.xy*rubyTextureSize;
|
|
_fp = fract(_x0020);
|
|
_st = vec2(float((_fp.x >= 5.00000000E-01)), float((_fp.y >= 5.00000000E-01)));
|
|
_g1 = TEX1.xy*((_st.x + _st.y) - 1.00000000E+00) + TEX1.zw*(_st.x - _st.y);
|
|
_g2 = TEX1.xy*(_st.y - _st.x) + TEX1.zw*((_st.x + _st.y) - 1.00000000E+00);
|
|
_AO = 2.00000000E+00*_st.y - 1.00000000E+00;
|
|
_BO = 2.00000000E+00*_st.x - 1.00000000E+00;
|
|
_CO = (_st.x + _st.y) - 5.00000000E-01;
|
|
_c0024 = TEX0.xy + _g1;
|
|
_TMP0 = texture2D(rubyTexture, _c0024);
|
|
_B = vec3(float(_TMP0.x), float(_TMP0.y), float(_TMP0.z));
|
|
_c0026 = (TEX0.xy + _g1) - _g2;
|
|
_TMP1 = texture2D(rubyTexture, _c0026);
|
|
_C = vec3(float(_TMP1.x), float(_TMP1.y), float(_TMP1.z));
|
|
_c0028 = TEX0.xy + _g2;
|
|
_TMP2 = texture2D(rubyTexture, _c0028);
|
|
_D = vec3(float(_TMP2.x), float(_TMP2.y), float(_TMP2.z));
|
|
_TMP3 = texture2D(rubyTexture, TEX0.xy);
|
|
_E = vec3(float(_TMP3.x), float(_TMP3.y), float(_TMP3.z));
|
|
_c0032 = TEX0.xy - _g2;
|
|
_TMP4 = texture2D(rubyTexture, _c0032);
|
|
_F = vec3(float(_TMP4.x), float(_TMP4.y), float(_TMP4.z));
|
|
_c0034 = (TEX0.xy - _g1) + _g2;
|
|
_TMP5 = texture2D(rubyTexture, _c0034);
|
|
_G = vec3(float(_TMP5.x), float(_TMP5.y), float(_TMP5.z));
|
|
_c0036 = TEX0.xy - _g1;
|
|
_TMP6 = texture2D(rubyTexture, _c0036);
|
|
_H = vec3(float(_TMP6.x), float(_TMP6.y), float(_TMP6.z));
|
|
_c0038 = (TEX0.xy - _g1) - _g2;
|
|
_TMP7 = texture2D(rubyTexture, _c0038);
|
|
_I = vec3(float(_TMP7.x), float(_TMP7.y), float(_TMP7.z));
|
|
_c0040 = (TEX0.xy + _g1) - 2.00000000E+00*_g2;
|
|
_TMP8 = texture2D(rubyTexture, _c0040);
|
|
_C4 = vec3(float(_TMP8.x), float(_TMP8.y), float(_TMP8.z));
|
|
_c0042 = (TEX0.xy - 2.00000000E+00*_g1) + _g2;
|
|
_TMP9 = texture2D(rubyTexture, _c0042);
|
|
_G5 = vec3(float(_TMP9.x), float(_TMP9.y), float(_TMP9.z));
|
|
_TMP14 = dot(vec3(float(_B.x), float(_B.y), float(_B.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_b = float(_TMP13);
|
|
_TMP14 = dot(vec3(float(_C.x), float(_C.y), float(_C.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_c = float(_TMP13);
|
|
_TMP14 = dot(vec3(float(_D.x), float(_D.y), float(_D.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_d = float(_TMP13);
|
|
_TMP14 = dot(vec3(float(_E.x), float(_E.y), float(_E.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_e = float(_TMP13);
|
|
_TMP14 = dot(vec3(float(_F.x), float(_F.y), float(_F.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_f = float(_TMP13);
|
|
_TMP14 = dot(vec3(float(_G.x), float(_G.y), float(_G.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_g = float(_TMP13);
|
|
_TMP14 = dot(vec3(float(_H.x), float(_H.y), float(_H.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_h = float(_TMP13);
|
|
_TMP14 = dot(vec3(float(_I.x), float(_I.y), float(_I.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_i = float(_TMP13);
|
|
_TMP14 = dot(vec3(float(_C4.x), float(_C4.y), float(_C4.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_c4 = float(_TMP13);
|
|
_TMP14 = dot(vec3(float(_G5.x), float(_G5.y), float(_G5.z)), vec3( 6.55360000E+04, 2.55000000E+02, 1.00000000E+00));
|
|
_TMP13 = float(_TMP14);
|
|
_g5 = float(_TMP13);
|
|
_res = vec3(float(_E.x), float(_E.y), float(_E.z));
|
|
_fx_1 = _AO*_fp.y + _BO*_fp.x > _CO;
|
|
if (_fx_1) {
|
|
_condition_11 = _e != _h && (_h == _f && (_e != _i && (_e != _b || _e != _d || _f != _b && _f != _c || _h != _d && _h != _g) || _e == _g && (_i == _h || _e == _d || _h != _d) || _e == _c && (_i == _h || _e == _b || _f != _b)) || _e != _f && _h != _i && _e == _g && (_f == _i && _h != _d || _e != _i && _h == _g5));
|
|
_condition_21 = _e != _h && _e != _f && _f != _i && _e == _c && (_h == _i && _f != _b || _e != _i && _f == _c4);
|
|
_condition_31 = _e != _h && _g == _e && _e == _c && _e != _i && _e != _f;
|
|
if (_condition_11) {
|
|
_TMP10 = _H;
|
|
} else {
|
|
if (_condition_21) {
|
|
_TMP11 = _F;
|
|
} else {
|
|
if (_condition_31) {
|
|
_TMP12 = (_F + _H)*5.00000000E-01;
|
|
} else {
|
|
_TMP12 = _E;
|
|
}
|
|
_TMP11 = _TMP12;
|
|
}
|
|
_TMP10 = _TMP11;
|
|
}
|
|
_res = vec3(float(_TMP10.x), float(_TMP10.y), float(_TMP10.z));
|
|
}
|
|
_ret_0 = vec4(_res.x, _res.y, _res.z, 1.00000000E+00);
|
|
gl_FragColor = _ret_0;
|
|
return;
|
|
}
|
|
]]></fragment>
|
|
</shader>
|