#version 150 #extension GL_ARB_shader_image_load_store : enable #extension GL_ARB_shading_language_420pack : enable #extension GL_ARB_sample_shading : enable #define SAMPLER_BINDING(x) layout(binding = x) #extension GL_ARB_shader_storage_buffer_object : enable #extension GL_ARB_gpu_shader5 : enable #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 float1x1 mat1 #define float2x2 mat2 #define float3x3 mat3 #define float4x4 mat4 #define float4x3 mat4x3 #define float3x4 mat3x4 #define frac fract #define lerp mix #define saturate(x) clamp(x, 0.0, 1.0) #define mul(x, y) (y * x) //Pixel Shader for TEV stages #define wu int #define wu2 ivec2 #define wu3 ivec3 #define wu4 ivec4 int4 CHK_O_U8(int4 x) { return x & 255; } #define BOR(x, n) ((x) | (n)) #define BSHR(x, n) ((x) >> (n)) int2 BSH(int2 x, int n) { if(n >= 0) { return x >> n; } else { return x << (-n); } } int remainder(int x, int y) { return x % y; } // dot product for integer vectors 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; } // rounding + casting to integer at once in a single function wu wuround(float x) { return wu(round(x)); } wu2 wuround(float2 x) { return wu2(round(x)); } wu3 wuround(float3 x) { return wu3(round(x)); } wu4 wuround(float4 x) { return wu4(round(x)); } SAMPLER_BINDING(0) uniform sampler2DArray samp0; SAMPLER_BINDING(1) uniform sampler2DArray samp1; SAMPLER_BINDING(2) uniform sampler2DArray samp2; SAMPLER_BINDING(3) uniform sampler2DArray samp3; SAMPLER_BINDING(4) uniform sampler2DArray samp4; SAMPLER_BINDING(5) uniform sampler2DArray samp5; SAMPLER_BINDING(6) uniform sampler2DArray samp6; SAMPLER_BINDING(7) uniform sampler2DArray samp7; layout(std140, binding = 1) uniform PSBlock { wu4 color[4] ; wu4 k[4] ; wu4 alphaRef ; float4 texdim[8] ; wu4 czbias[2] ; wu4 cindscale[2] ; wu4 cindmtx[6] ; wu4 cfogcolor ; wu4 cfogi ; float4 cfogf[2] ; float4 czslope ; float4 cefbscale ; }; out vec4 ocol0; in VertexData { centroid float4 pos; centroid float4 colors_0; centroid float4 colors_1; centroid float3 tex0; centroid float3 tex1; centroid float3 tex2; centroid float4 clipPos_2; }; void main() { float4 rawpos = gl_FragCoord; wu4 c0 = color[1], c1 = color[2], c2 = color[3], prev = color[0]; wu4 tex_t = wu4(0,0,0,0), ras_t = wu4(0,0,0,0), konst_t = wu4(0,0,0,0); wu3 c16 = wu3(1,256,0), c24 = wu3(1,256,256*256); wu a_bump=0; wu3 tevcoord=wu3(0,0,0); wu2 wrappedcoord=wu2(0,0), t_coord=wu2(0,0),ittmpexp=wu2(0,0); wu4 tin_a = wu4(0,0,0,0), tin_b = wu4(0,0,0,0), tin_c = wu4(0,0,0,0), tin_d = wu4(0,0,0,0); float3 uv0 = tex0; float3 uv1 = tex1; float3 uv2 = tex2; float4 clipPos = clipPos_2; float4 col0 = colors_0; float4 col1 = colors_1; clipPos = float4(rawpos.x, rawpos.y, clipPos.z, clipPos.w); uv0.xy = trunc(128.0 * uv0.xy * texdim[0].zw); uv1.xy = trunc(128.0 * uv1.xy * texdim[1].zw); uv2.xy = trunc(128.0 * uv2.xy * texdim[2].zw); //5 TEV stages, 3 texgens, 20483 IND stages // TEV stage 0 tevcoord.xy = wu2(uv0.xy); tex_t = wuround(texture(samp0,float3((float2(tevcoord.xy) * (1.0/128.0)).xy * texdim[0].xy, 0.0)).rgba * 255.0); tin_a = (wu4(0,0,0,0)); tin_b = (wu4(0,0,0,0)); tin_c = (wu4(0,0,0,0)); tin_d = wu4(tex_t.rgb,tex_t.a); // color combine prev.rgb = clamp(((((tin_d.rgb)) + ((((tin_a.rgb << 8)) + 128) >> 8))),wu(0),wu(255)); // alpha combine prev.a = clamp(((((tin_d.a)) + ((((tin_a.a << 8)) + 128) >> 8))),wu(0),wu(255)); // TEV done // TEV stage 1 tevcoord.xy = wu2(uv1.xy); tex_t = wuround(texture(samp0,float3((float2(tevcoord.xy) * (1.0/128.0)).xy * texdim[0].xy, 0.0)).rgba * 255.0); konst_t = wu4(k[0].rgb,k[0].a); tin_a = (wu4(tex_t.rgb,tex_t.a)); tin_b = (wu4(prev.rgb,prev.a)); tin_c = CHK_O_U8(wu4(konst_t.rgb,konst_t.a)); tin_d = wu4(0,0,0,0); // color combine c1.rgb = clamp(tin_d.rgb+(max(sign(tin_a.rgb - tin_b.rgb - 0.5), int3(0,0,0)) * tin_c.rgb),wu(0),wu(255)); // alpha combine c1.a = clamp(tin_d.a+((tin_a.a > tin_b.a) ? tin_c.a : 0),wu(0),wu(255)); // TEV done // TEV stage 2 tevcoord.xy = wu2(uv1.xy); tex_t = wuround(texture(samp0,float3((float2(tevcoord.xy) * (1.0/128.0)).xy * texdim[0].xy, 0.0)).rgba * 255.0); tin_a = (wu4(prev.rgb,prev.a)); tin_b = (wu4(tex_t.rgb,tex_t.a)); tin_c = (wu4(c1.rgb,c1.a)); tin_c = BOR(tin_c, BSHR(tin_c, 7)); tin_d = wu4(0,0,0,0); // color combine prev.rgb = clamp(((((tin_d.rgb)) + ((((tin_a.rgb*256 + (tin_b.rgb - tin_a.rgb) * tin_c.rgb)) + 128) >> 8))),wu(0),wu(255)); // alpha combine prev.a = clamp(((((tin_d.a)) + ((((tin_a.a*256 + (tin_b.a - tin_a.a) * tin_c.a)) + 128) >> 8))),wu(0),wu(255)); // TEV done // TEV stage 3 tevcoord.xy = wu2(uv2.xy); tex_t = wuround(texture(samp0,float3((float2(tevcoord.xy) * (1.0/128.0)).xy * texdim[0].xy, 0.0)).rgba * 255.0); konst_t = wu4(k[0].rgb,k[0].a); tin_a = (wu4(tex_t.rgb,tex_t.a)); tin_b = (wu4(prev.rgb,prev.a)); tin_c = CHK_O_U8(wu4(konst_t.rgb,konst_t.a)); tin_d = wu4(0,0,0,0); // color combine c1.rgb = clamp(tin_d.rgb+(max(sign(tin_a.rgb - tin_b.rgb - 0.5), int3(0,0,0)) * tin_c.rgb),wu(0),wu(255)); // alpha combine c1.a = clamp(tin_d.a+((tin_a.a > tin_b.a) ? tin_c.a : 0),wu(0),wu(255)); // TEV done // TEV stage 4 tevcoord.xy = wu2(uv2.xy); tex_t = wuround(texture(samp0,float3((float2(tevcoord.xy) * (1.0/128.0)).xy * texdim[0].xy, 0.0)).rgba * 255.0); tin_a = (wu4(prev.rgb,prev.a)); tin_b = (wu4(tex_t.rgb,tex_t.a)); tin_c = (wu4(c1.rgb,c1.a)); tin_c = BOR(tin_c, BSHR(tin_c, 7)); tin_d = wu4(0,0,0,0); // color combine prev.rgb = clamp(((((tin_d.rgb)) + ((((tin_a.rgb*256 + (tin_b.rgb - tin_a.rgb) * tin_c.rgb)) + 128) >> 8))),wu(0),wu(255)); // alpha combine prev.a = clamp(((((tin_d.a)) + ((((tin_a.a*256 + (tin_b.a - tin_a.a) * tin_c.a)) + 128) >> 8))),wu(0),wu(255)); // TEV done wu zCoord = czbias[1].x + wuround((clipPos.z / clipPos.w) * float(czbias[1].y)); ocol0 = float4(prev) * (1.0/255.0); } 0(156) : error C7011: implicit cast from "vec3" to "ivec3" 0(184) : error C7011: implicit cast from "vec3" to "ivec3"