You are on page 1of 4

#version 320 es

#define FORCE_EARLY_Z layout(early_fragment_tests) in

#define ATTRIBUTE_LOCATION(x)
#define FRAGMENT_OUTPUT_LOCATION(x)
#define FRAGMENT_OUTPUT_LOCATION_INDEXED(x, y)
#define UBO_BINDING(packing, x) layout(packing, binding = x)
#define SAMPLER_BINDING(x) layout(binding = x)
#define SSBO_BINDING(x) layout(binding = x)

#define VARYING_LOCATION(x)

#extension GL_OES_geometry_point_size : enable


#extension GL_ANDROID_extension_pack_es31a : enable

#extension GL_EXT_shader_framebuffer_fetch: enable


#define FB_FETCH_VALUE real_ocol0
#define FRAGMENT_INOUT inout
precision highp float;
precision highp int;
precision highp sampler2DArray;
precision highp usamplerBuffer;
precision highp sampler2DMS;
precision highp image2DArray;
#define float2 vec2
#define float3 vec3
#define float4 vec4
#define uint2 uvec2
#define uint3 uvec3
#define uint4 uvec4
#define int2 ivec2
#define int3 ivec3
#define int4 ivec4
#define frac fract
#define lerp mix
//Pixel Shader for TEV stages
//4 TEV stages, 2 texgens, 0 IND stages
int idot(int3 x, int3 y)
{
int3 tmp = x * y;
return tmp.x + tmp.y + tmp.z;
}
int idot(int4 x, int4 y)
{
int4 tmp = x * y;
return tmp.x + tmp.y + tmp.z + tmp.w;
}

int iround(float x) { return int (round(x)); }


int2 iround(float2 x) { return int2(round(x)); }
int3 iround(float3 x) { return int3(round(x)); }
int4 iround(float4 x) { return int4(round(x)); }

SAMPLER_BINDING(0) uniform sampler2DArray samp[8];

UBO_BINDING(std140, 1) uniform PSBlock {


int4 color[4];
int4 k[4];
int4 alphaRef;
float4 texdim[8];
int4 czbias[2];
int4 cindscale[2];
int4 cindmtx[6];
int4 cfogcolor;
int4 cfogi;
float4 cfogf;
float4 cfogrange[3];
float4 czslope;
float2 cefbscale;
};

struct VS_OUTPUT {
float4 pos;
float4 colors_0;
float4 colors_1;
float3 tex0;
float3 tex1;
float clipDist0;
float clipDist1;
};
FORCE_EARLY_Z;
FRAGMENT_OUTPUT_LOCATION_INDEXED(0, 0) FRAGMENT_INOUT vec4 real_ocol0;
VARYING_LOCATION(0) in VertexData {
centroid float4 pos;
centroid float4 colors_0;
centroid float4 colors_1;
centroid float3 tex0;
centroid float3 tex1;
centroid float clipDist0;
centroid float clipDist1;
};
void main()
{
float4 rawpos = gl_FragCoord;
float4 initial_ocol0 = FB_FETCH_VALUE;
float4 ocol0;
float4 ocol1;
int4 c0 = color[1], c1 = color[2], c2 = color[3], prev = color[0];
int4 rastemp, textemp, konsttemp;
int3 comp16 = int3(1, 256, 0), comp24 = int3(1, 256, 256*256);
int alphabump=0;
int3 tevcoord=int3(0, 0, 0);
int2 wrappedcoord, tempcoord;
int4 tevin_a,tevin_b,tevin_c,tevin_d,tevin_temp;

float4 col0 = colors_0;


float4 col1 = colors_1;
int2 fixpoint_uv0 = int2((tex0.z == 0.0 ? tex0.xy : tex0.xy / tex0.z) *
texdim[0].zw);
int2 fixpoint_uv1 = int2((tex1.z == 0.0 ? tex1.xy : tex1.xy / tex1.z) *
texdim[1].zw);

// TEV stage 0
rastemp = iround(col0 * 255.0).rgba;
tevcoord.xy = fixpoint_uv0;
textemp = iround(255.0 * texture(samp[0], float3(float2(tevcoord.xy).xy *
texdim[0].xy, 0.0))).rgba;
tevin_a = int4(int3(0,0,0), 0)&int4(255, 255, 255, 255);
tevin_b = int4(textemp.rgb, 0)&int4(255, 255, 255, 255);
tevin_c = int4(rastemp.rgb, 0)&int4(255, 255, 255, 255);
tevin_d = int4(int3(0,0,0), rastemp.a);
tevin_temp = (tevin_a<<8) + (tevin_b-tevin_a)*(tevin_c+(tevin_c>>7));
// color combine
prev.rgb = (((tevin_d.rgb)) + ((((tevin_temp.rgb)) + 128)>>8));
// alpha combine
prev.a = (((tevin_d.a)) + ((((tevin_temp.a)) + 128)>>8));
prev = clamp(prev, int4(0,0,0,0), int4(255,255,255,255));

// TEV stage 1
rastemp = iround(col0 * 255.0).rgba;
tevcoord.xy = fixpoint_uv1;
textemp = iround(255.0 * texture(samp[1], float3(float2(tevcoord.xy).xy *
texdim[1].xy, 0.0))).rgba;
tevin_a = int4(int3(0,0,0), 0)&int4(255, 255, 255, 255);
tevin_b = int4(textemp.rgb, 0)&int4(255, 255, 255, 255);
tevin_c = int4(rastemp.rgb, 0)&int4(255, 255, 255, 255);
tevin_d = int4(int3(0,0,0), prev.a);
tevin_temp = (tevin_a<<8) + (tevin_b-tevin_a)*(tevin_c+(tevin_c>>7));
// color combine
c0.rgb = (((tevin_d.rgb)) + ((((tevin_temp.rgb)) + 128)>>8));
// alpha combine
prev.a = (((tevin_d.a)) + ((((tevin_temp.a)) + 128)>>8));
c0.rgb = clamp(c0.rgb, int3(0,0,0), int3(255,255,255));
prev.a = clamp(prev.a, 0, 255);

// TEV stage 2
textemp = int4(255, 255, 255, 255);
konsttemp = int4(k[0].rgb, 255);
tevin_a = int4(int3(0,0,0), 0)&int4(255, 255, 255, 255);
tevin_b = int4(konsttemp.rgb, 0)&int4(255, 255, 255, 255);
tevin_c = int4(c0.rgb, 0)&int4(255, 255, 255, 255);
tevin_d = int4(prev.rgb, prev.a);
tevin_temp = (tevin_a<<8) + (tevin_b-tevin_a)*(tevin_c+(tevin_c>>7));
// color combine
prev.rgb = (((tevin_d.rgb)) + ((((tevin_temp.rgb)) + 128)>>8));
// alpha combine
prev.a = (((tevin_d.a)) + ((((tevin_temp.a)) + 128)>>8));
prev = clamp(prev, int4(0,0,0,0), int4(255,255,255,255));

// TEV stage 3
textemp = int4(255, 255, 255, 255);
tevin_a = int4(int3(0,0,0), 0)&int4(255, 255, 255, 255);
tevin_b = int4(int3(0,0,0), 0)&int4(255, 255, 255, 255);
tevin_c = int4(int3(0,0,0), 0)&int4(255, 255, 255, 255);
tevin_d = int4(prev.rgb, prev.a);
tevin_temp = (tevin_a<<8) + (tevin_b-tevin_a)*(tevin_c+(tevin_c>>7));
// color combine
prev.rgb = (((tevin_d.rgb) << 1) + ((((tevin_temp.rgb) << 1) + 128)>>8));
// alpha combine
prev.a = (((tevin_d.a)) + ((((tevin_temp.a)) + 128)>>8));
prev = clamp(prev, int4(0,0,0,0), int4(255,255,255,255));
prev = prev & 255;
int zCoord = int(rawpos.z * 16777216.0);
zCoord = clamp(zCoord, 0, 0xFFFFFF);
float ze = (cfogf.x * 16777216.0) / float(cfogi.y - (zCoord >> cfogi.w));
float fog = clamp(ze - cfogf.y, 0.0, 1.0);
fog = 1.0 - exp2(-8.0 * fog * fog);
int ifog = iround(fog * 256.0);
prev.rgb = (prev.rgb * (256 - ifog) + cfogcolor.rgb * ifog) >> 8;
ocol1 = float4(0.0, 0.0, 0.0, float(prev.a) / 255.0);
prev.a = alphaRef.a;
ocol0 = float4(prev) / 255.0;
float4 blend_src;
blend_src.rgb = ocol1.aaa;
blend_src.a = 1.0;
float4 blend_dst;
blend_dst.rgb = float3(1.0, 1.0, 1.0) - ocol1.aaa;
blend_dst.a = 0.0;
float4 blend_result;
blend_result.rgb = initial_ocol0.rgb * blend_dst.rgb + ocol0.rgb *
blend_src.rgb;
blend_result.a = initial_ocol0.a * blend_dst.a + ocol0.a * blend_src.a;
real_ocol0 = blend_result;
}
Compile failed.
ERROR: 0:92: invalid qualifier for in/out block.
ERROR: 0:92: invalid qualifier for in/out block.
ERROR: 0:92: invalid qualifier for in/out block.
ERROR: 0:92: invalid qualifier for in/out block.
ERROR: 0:92: invalid qualifier for in/out block.
ERROR: 0:92: invalid qualifier for in/out block.
ERROR: 0:92: invalid qualifier for in/out block.
7 compilation errors. No code generated.

You might also like