fix gcc compilation

This commit is contained in:
degasus 2012-12-19 23:42:22 +01:00
parent 57426ee726
commit 85ac76e8e2
4 changed files with 62 additions and 62 deletions

View File

@ -647,18 +647,18 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
if (ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "layout(std140) uniform PSBlock {\n");
WRITE(p, "%sfloat4 "I_COLORS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_COLORS));
WRITE(p, "%sfloat4 "I_KCOLORS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_KCOLORS));
WRITE(p, "%sfloat4 "I_ALPHA"[1] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_ALPHA));
WRITE(p, "%sfloat4 "I_TEXDIMS"[8] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_TEXDIMS));
WRITE(p, "%sfloat4 "I_ZBIAS"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_ZBIAS));
WRITE(p, "%sfloat4 "I_INDTEXSCALE"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_INDTEXSCALE));
WRITE(p, "%sfloat4 "I_INDTEXMTX"[6] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_INDTEXMTX));
WRITE(p, "%sfloat4 "I_FOG"[3] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_FOG));
WRITE(p, "%sfloat4 " I_COLORS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_COLORS));
WRITE(p, "%sfloat4 " I_KCOLORS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_KCOLORS));
WRITE(p, "%sfloat4 " I_ALPHA"[1] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_ALPHA));
WRITE(p, "%sfloat4 " I_TEXDIMS"[8] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_TEXDIMS));
WRITE(p, "%sfloat4 " I_ZBIAS"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_ZBIAS));
WRITE(p, "%sfloat4 " I_INDTEXSCALE"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_INDTEXSCALE));
WRITE(p, "%sfloat4 " I_INDTEXMTX"[6] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_INDTEXMTX));
WRITE(p, "%sfloat4 " I_FOG"[3] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_FOG));
// Compiler will optimize these out by itself.
WRITE(p, "%sfloat4 "I_PLIGHTS"[40] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PLIGHTS));
WRITE(p, "%sfloat4 "I_PMATERIALS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PMATERIALS));
WRITE(p, "%sfloat4 " I_PLIGHTS"[40] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PLIGHTS));
WRITE(p, "%sfloat4 " I_PMATERIALS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PMATERIALS));
if (ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "};\n");
@ -1355,7 +1355,7 @@ void SampleTexture(char *&p, const char *destination, const char *texcoords, con
if (ApiType == API_D3D11)
WRITE(p, "%s=Tex%d.Sample(samp%d,%s.xy * " I_TEXDIMS"[%d].xy).%s;\n", destination, texmap,texmap, texcoords, texmap, texswap);
else
WRITE(p, "%s=%s(samp%d,%s.xy * "I_TEXDIMS"[%d].xy).%s;\n", destination, ApiType == API_GLSL ? "texture2D" : "tex2D", texmap, texcoords, texmap, texswap);
WRITE(p, "%s=%s(samp%d,%s.xy * " I_TEXDIMS"[%d].xy).%s;\n", destination, ApiType == API_GLSL ? "texture2D" : "tex2D", texmap, texcoords, texmap, texswap);
}
static const char *tevAlphaFuncsTable[] =

View File

@ -95,7 +95,7 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
if (ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "layout(std140%s) uniform PSBlock {\n", g_ActiveConfig.backend_info.bSupportsGLSLBinding ? ", binding = 1" : "");
WRITE(p, "%sfloat4 "I_COLORS"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_COLORS));
WRITE(p, "%sfloat4 " I_COLORS"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_COLORS));
if (ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "};\n");
@ -155,7 +155,7 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " float yl = floor(uv1.y / %f);\n", blkH);
WRITE(p, " float yb = yl * %f;\n", blkH);
WRITE(p, " float yoff = uv1.y - yb;\n");
WRITE(p, " float xp = uv1.x + (yoff * "I_COLORS"[1].x);\n");
WRITE(p, " float xp = uv1.x + (yoff * " I_COLORS"[1].x);\n");
WRITE(p, " float xel = floor(xp / %f);\n", blkW);
WRITE(p, " float xb = floor(xel / %f);\n", blkH);
WRITE(p, " float xoff = xel - (xb * %f);\n", blkH);
@ -163,17 +163,17 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " sampleUv.x = xib + (xb * %f);\n", blkW);
WRITE(p, " sampleUv.y = yb + xoff;\n");
WRITE(p, " sampleUv = sampleUv * "I_COLORS"[0].xy;\n");
WRITE(p, " sampleUv = sampleUv * " I_COLORS"[0].xy;\n");
if (ApiType == API_OPENGL || ApiType == API_GLSL)
WRITE(p," sampleUv.y = "I_COLORS"[1].y - sampleUv.y;\n");
WRITE(p," sampleUv.y = " I_COLORS"[1].y - sampleUv.y;\n");
WRITE(p, " sampleUv = sampleUv + "I_COLORS"[1].zw;\n");
WRITE(p, " sampleUv = sampleUv + " I_COLORS"[1].zw;\n");
if (ApiType != API_OPENGL && ApiType != API_GLSL)
{
WRITE(p, " sampleUv = sampleUv + float2(0.0f,1.0f);\n");// still to determine the reason for this
WRITE(p, " sampleUv = sampleUv / "I_COLORS"[0].zw;\n");
WRITE(p, " sampleUv = sampleUv / " I_COLORS"[0].zw;\n");
}
}
@ -186,7 +186,7 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType)
// Two were merged for GLSL
if (ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "layout(std140%s) uniform PSBlock {\n", g_ActiveConfig.backend_info.bSupportsGLSLBinding ? ", binding = 1" : "");
WRITE(p, "%sfloat4 "I_COLORS"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_COLORS));
WRITE(p, "%sfloat4 " I_COLORS"[2] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_COLORS));
if (ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "};\n");
@ -242,7 +242,7 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " float yl = floor(uv1.y / %f);\n", blkH);
WRITE(p, " float yb = yl * %f;\n", blkH);
WRITE(p, " float yoff = uv1.y - yb;\n");
WRITE(p, " float xp = uv1.x + (yoff * "I_COLORS"[1].x);\n");
WRITE(p, " float xp = uv1.x + (yoff * " I_COLORS"[1].x);\n");
WRITE(p, " float xel = floor(xp / 2);\n");
WRITE(p, " float xb = floor(xel / %f);\n", blkH);
WRITE(p, " float xoff = xel - (xb * %f);\n", blkH);
@ -254,17 +254,17 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " sampleUv.x = xib + (halfxb * %f);\n", blkW);
WRITE(p, " sampleUv.y = yb + xoff;\n");
WRITE(p, " sampleUv = sampleUv * "I_COLORS"[0].xy;\n");
WRITE(p, " sampleUv = sampleUv * " I_COLORS"[0].xy;\n");
if (ApiType == API_OPENGL || ApiType == API_GLSL)
WRITE(p," sampleUv.y = "I_COLORS"[1].y - sampleUv.y;\n");
WRITE(p," sampleUv.y = " I_COLORS"[1].y - sampleUv.y;\n");
WRITE(p, " sampleUv = sampleUv + "I_COLORS"[1].zw;\n");
WRITE(p, " sampleUv = sampleUv + " I_COLORS"[1].zw;\n");
if (ApiType != API_OPENGL && ApiType != API_GLSL)
{
WRITE(p, " sampleUv = sampleUv + float2(0.0f,1.0f);\n");// still to determine the reason for this
WRITE(p, " sampleUv = sampleUv / "I_COLORS"[0].zw;\n");
WRITE(p, " sampleUv = sampleUv / " I_COLORS"[0].zw;\n");
}
}
@ -283,7 +283,7 @@ void WriteSampleColor(char*& p, const char* colorComp, const char* dest, API_TYP
// the increment of sampleUv.x is delayed, so we perform it here. see WriteIncrementSampleX.
const char* texSampleIncrementUnit;
if (ApiType != API_OPENGL || ApiType != API_GLSL)
texSampleIncrementUnit = I_COLORS"[0].x / "I_COLORS"[0].z";
texSampleIncrementUnit = I_COLORS"[0].x / " I_COLORS"[0].z";
else
texSampleIncrementUnit = I_COLORS"[0].x";

View File

@ -225,15 +225,15 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
if (ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "layout(std140) uniform VSBlock {\n");
WRITE(p, "%sfloat4 "I_POSNORMALMATRIX"[6] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_POSNORMALMATRIX));
WRITE(p, "%sfloat4 "I_PROJECTION"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PROJECTION));
WRITE(p, "%sfloat4 "I_MATERIALS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_MATERIALS));
WRITE(p, "%sfloat4 "I_LIGHTS"[40] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_LIGHTS));
WRITE(p, "%sfloat4 "I_TEXMATRICES"[24] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_TEXMATRICES)); // also using tex matrices
WRITE(p, "%sfloat4 "I_TRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType),WriteRegister(ApiType, "c", C_TRANSFORMMATRICES));
WRITE(p, "%sfloat4 "I_NORMALMATRICES"[32] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_NORMALMATRICES));
WRITE(p, "%sfloat4 "I_POSTTRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_POSTTRANSFORMMATRICES));
WRITE(p, "%sfloat4 "I_DEPTHPARAMS" %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_DEPTHPARAMS));
WRITE(p, "%sfloat4 " I_POSNORMALMATRIX"[6] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_POSNORMALMATRIX));
WRITE(p, "%sfloat4 " I_PROJECTION"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_PROJECTION));
WRITE(p, "%sfloat4 " I_MATERIALS"[4] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_MATERIALS));
WRITE(p, "%sfloat4 " I_LIGHTS"[40] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_LIGHTS));
WRITE(p, "%sfloat4 " I_TEXMATRICES"[24] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_TEXMATRICES)); // also using tex matrices
WRITE(p, "%sfloat4 " I_TRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType),WriteRegister(ApiType, "c", C_TRANSFORMMATRICES));
WRITE(p, "%sfloat4 " I_NORMALMATRICES"[32] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_NORMALMATRICES));
WRITE(p, "%sfloat4 " I_POSTTRANSFORMMATRICES"[64] %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_POSTTRANSFORMMATRICES));
WRITE(p, "%sfloat4 " I_DEPTHPARAMS" %s;\n", WriteLocation(ApiType), WriteRegister(ApiType, "c", C_DEPTHPARAMS));
if (ApiType == API_GLSL && g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "};\n");
@ -359,11 +359,11 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
WRITE(p, "int posmtx = int(fposmtx);\n");
}
WRITE(p, "float4 pos = float4(dot("I_TRANSFORMMATRICES"[posmtx], rawpos), dot("I_TRANSFORMMATRICES"[posmtx+1], rawpos), dot("I_TRANSFORMMATRICES"[posmtx+2], rawpos), 1);\n");
WRITE(p, "float4 pos = float4(dot(" I_TRANSFORMMATRICES"[posmtx], rawpos), dot(" I_TRANSFORMMATRICES"[posmtx+1], rawpos), dot(" I_TRANSFORMMATRICES"[posmtx+2], rawpos), 1);\n");
if (components & VB_HAS_NRMALL) {
WRITE(p, "int normidx = posmtx >= 32 ? (posmtx-32) : posmtx;\n");
WRITE(p, "float3 N0 = "I_NORMALMATRICES"[normidx].xyz, N1 = "I_NORMALMATRICES"[normidx+1].xyz, N2 = "I_NORMALMATRICES"[normidx+2].xyz;\n");
WRITE(p, "float3 N0 = " I_NORMALMATRICES"[normidx].xyz, N1 = " I_NORMALMATRICES"[normidx+1].xyz, N2 = " I_NORMALMATRICES"[normidx+2].xyz;\n");
}
if (components & VB_HAS_NRM0)
@ -375,13 +375,13 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
}
else
{
WRITE(p, "float4 pos = float4(dot("I_POSNORMALMATRIX"[0], rawpos), dot("I_POSNORMALMATRIX"[1], rawpos), dot("I_POSNORMALMATRIX"[2], rawpos), 1.0f);\n");
WRITE(p, "float4 pos = float4(dot(" I_POSNORMALMATRIX"[0], rawpos), dot(" I_POSNORMALMATRIX"[1], rawpos), dot(" I_POSNORMALMATRIX"[2], rawpos), 1.0f);\n");
if (components & VB_HAS_NRM0)
WRITE(p, "float3 _norm0 = normalize(float3(dot("I_POSNORMALMATRIX"[3].xyz, rawnorm0), dot("I_POSNORMALMATRIX"[4].xyz, rawnorm0), dot("I_POSNORMALMATRIX"[5].xyz, rawnorm0)));\n");
WRITE(p, "float3 _norm0 = normalize(float3(dot(" I_POSNORMALMATRIX"[3].xyz, rawnorm0), dot(" I_POSNORMALMATRIX"[4].xyz, rawnorm0), dot(" I_POSNORMALMATRIX"[5].xyz, rawnorm0)));\n");
if (components & VB_HAS_NRM1)
WRITE(p, "float3 _norm1 = float3(dot("I_POSNORMALMATRIX"[3].xyz, rawnorm1), dot("I_POSNORMALMATRIX"[4].xyz, rawnorm1), dot("I_POSNORMALMATRIX"[5].xyz, rawnorm1));\n");
WRITE(p, "float3 _norm1 = float3(dot(" I_POSNORMALMATRIX"[3].xyz, rawnorm1), dot(" I_POSNORMALMATRIX"[4].xyz, rawnorm1), dot(" I_POSNORMALMATRIX"[5].xyz, rawnorm1));\n");
if (components & VB_HAS_NRM2)
WRITE(p, "float3 _norm2 = float3(dot("I_POSNORMALMATRIX"[3].xyz, rawnorm2), dot("I_POSNORMALMATRIX"[4].xyz, rawnorm2), dot("I_POSNORMALMATRIX"[5].xyz, rawnorm2));\n");
WRITE(p, "float3 _norm2 = float3(dot(" I_POSNORMALMATRIX"[3].xyz, rawnorm2), dot(" I_POSNORMALMATRIX"[4].xyz, rawnorm2), dot(" I_POSNORMALMATRIX"[5].xyz, rawnorm2));\n");
}
if (!(components & VB_HAS_NRM0))
@ -389,7 +389,7 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
WRITE(p, "o.pos = float4(dot("I_PROJECTION"[0], pos), dot("I_PROJECTION"[1], pos), dot("I_PROJECTION"[2], pos), dot("I_PROJECTION"[3], pos));\n");
WRITE(p, "o.pos = float4(dot(" I_PROJECTION"[0], pos), dot(" I_PROJECTION"[1], pos), dot(" I_PROJECTION"[2], pos), dot(" I_PROJECTION"[3], pos));\n");
WRITE(p, "float4 mat, lacc;\n"
"float3 ldir, h;\n"
@ -468,7 +468,7 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
if (components & (VB_HAS_NRM1|VB_HAS_NRM2)) {
// transform the light dir into tangent space
WRITE(p, "ldir = normalize("I_LIGHTS"[%d + 3].xyz - pos.xyz);\n", texinfo.embosslightshift);
WRITE(p, "ldir = normalize(" I_LIGHTS"[%d + 3].xyz - pos.xyz);\n", texinfo.embosslightshift);
WRITE(p, "o.tex%d.xyz = o.tex%d.xyz + float3(dot(ldir, _norm1), dot(ldir, _norm2), 0.0f);\n", i, texinfo.embosssourceshift);
}
else
@ -492,16 +492,16 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
{
WRITE(p, "int tmp = int(tex%d.z);\n", i);
if (texinfo.projection == XF_TEXPROJ_STQ)
WRITE(p, "o.tex%d.xyz = float3(dot(coord, "I_TRANSFORMMATRICES"[tmp]), dot(coord, "I_TRANSFORMMATRICES"[tmp+1]), dot(coord, "I_TRANSFORMMATRICES"[tmp+2]));\n", i);
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TRANSFORMMATRICES"[tmp]), dot(coord, " I_TRANSFORMMATRICES"[tmp+1]), dot(coord, " I_TRANSFORMMATRICES"[tmp+2]));\n", i);
else {
WRITE(p, "o.tex%d.xyz = float3(dot(coord, "I_TRANSFORMMATRICES"[tmp]), dot(coord, "I_TRANSFORMMATRICES"[tmp+1]), 1);\n", i);
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TRANSFORMMATRICES"[tmp]), dot(coord, " I_TRANSFORMMATRICES"[tmp+1]), 1);\n", i);
}
}
else {
if (texinfo.projection == XF_TEXPROJ_STQ)
WRITE(p, "o.tex%d.xyz = float3(dot(coord, "I_TEXMATRICES"[%d]), dot(coord, "I_TEXMATRICES"[%d]), dot(coord, "I_TEXMATRICES"[%d]));\n", i, 3*i, 3*i+1, 3*i+2);
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TEXMATRICES"[%d]), dot(coord, " I_TEXMATRICES"[%d]), dot(coord, " I_TEXMATRICES"[%d]));\n", i, 3*i, 3*i+1, 3*i+2);
else
WRITE(p, "o.tex%d.xyz = float3(dot(coord, "I_TEXMATRICES"[%d]), dot(coord, "I_TEXMATRICES"[%d]), 1);\n", i, 3*i, 3*i+1);
WRITE(p, "o.tex%d.xyz = float3(dot(coord, " I_TEXMATRICES"[%d]), dot(coord, " I_TEXMATRICES"[%d]), 1);\n", i, 3*i, 3*i+1);
}
break;
}
@ -510,9 +510,9 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
const PostMtxInfo& postInfo = xfregs.postMtxInfo[i];
int postidx = postInfo.index;
WRITE(p, "float4 P0 = "I_POSTTRANSFORMMATRICES"[%d];\n"
"float4 P1 = "I_POSTTRANSFORMMATRICES"[%d];\n"
"float4 P2 = "I_POSTTRANSFORMMATRICES"[%d];\n",
WRITE(p, "float4 P0 = " I_POSTTRANSFORMMATRICES"[%d];\n"
"float4 P1 = " I_POSTTRANSFORMMATRICES"[%d];\n"
"float4 P2 = " I_POSTTRANSFORMMATRICES"[%d];\n",
postidx&0x3f, (postidx+1)&0x3f, (postidx+2)&0x3f);
if (texGenSpecialCase) {

View File

@ -114,21 +114,21 @@ void PixelShaderCache::Init()
"%s\n"
"%suniform sampler2DRect samp0;\n"
"%s\n"
"%svec4 "I_COLORS"[7];\n"
"%svec4 " I_COLORS"[7];\n"
"%s\n"
"void main(){\n"
"vec4 Temp0, Temp1;\n"
"vec4 K0 = vec4(0.5, 0.5, 0.5, 0.5);\n"
"Temp0 = texture2DRect(samp0, gl_TexCoord[0].xy);\n"
"Temp0 = Temp0 * "I_COLORS"[%d];\n"
"Temp0 = Temp0 * " I_COLORS"[%d];\n"
"Temp0 = Temp0 + K0;\n"
"Temp0 = floor(Temp0);\n"
"Temp0 = Temp0 * "I_COLORS"[%d];\n"
"Temp1.x = dot(Temp0, "I_COLORS"[%d]);\n"
"Temp1.y = dot(Temp0, "I_COLORS"[%d]);\n"
"Temp1.z = dot(Temp0, "I_COLORS"[%d]);\n"
"Temp1.w = dot(Temp0, "I_COLORS"[%d]);\n"
"gl_FragData[0] = Temp1 + "I_COLORS"[%d];\n"
"Temp0 = Temp0 * " I_COLORS"[%d];\n"
"Temp1.x = dot(Temp0, " I_COLORS"[%d]);\n"
"Temp1.y = dot(Temp0, " I_COLORS"[%d]);\n"
"Temp1.z = dot(Temp0, " I_COLORS"[%d]);\n"
"Temp1.w = dot(Temp0, " I_COLORS"[%d]);\n"
"gl_FragData[0] = Temp1 + " I_COLORS"[%d];\n"
"}\n",
(g_ActiveConfig.backend_info.bSupportsGLSLUBO || g_ActiveConfig.backend_info.bSupportsGLSLBinding) ? "330 compatibility" : "120",
g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "#extension GL_ARB_shading_language_420pack : enable" : "",
@ -150,7 +150,7 @@ void PixelShaderCache::Init()
"%s\n"
"%suniform sampler2DRect samp0;\n"
"%s\n"
"%svec4 "I_COLORS"[5];\n"
"%svec4 " I_COLORS"[5];\n"
"%s\n"
"void main(){\n"
"vec4 R0, R1, R2;\n"
@ -170,11 +170,11 @@ void PixelShaderCache::Init()
"R0.w = (R0 * K1.x).w;\n"
"R0.w = floor(R0).w;\n"
"R0.w = (R0 * K1.y).w;\n"
"R1.x = dot(R0, "I_COLORS"[%d]);\n"
"R1.y = dot(R0, "I_COLORS"[%d]);\n"
"R1.z = dot(R0, "I_COLORS"[%d]);\n"
"R1.w = dot(R0, "I_COLORS"[%d]);\n"
"gl_FragData[0] = R1 * "I_COLORS"[%d];\n"
"R1.x = dot(R0, " I_COLORS"[%d]);\n"
"R1.y = dot(R0, " I_COLORS"[%d]);\n"
"R1.z = dot(R0, " I_COLORS"[%d]);\n"
"R1.w = dot(R0, " I_COLORS"[%d]);\n"
"gl_FragData[0] = R1 * " I_COLORS"[%d];\n"
"}\n",
(g_ActiveConfig.backend_info.bSupportsGLSLUBO || g_ActiveConfig.backend_info.bSupportsGLSLBinding) ? "330 compatibility" : "120",
g_ActiveConfig.backend_info.bSupportsGLSLBinding ? "#extension GL_ARB_shading_language_420pack : enable" : "",