Bit of cleanup. Clean up my massive hack in the ShaderManagerFiles. Almost feature parity with Nvidia CG now I think. Just need to do Alpha test with Dual source blending now.

This commit is contained in:
Ryan Houdek 2011-12-08 03:20:31 -06:00
parent 1201988fe4
commit cecc3c3873
6 changed files with 52 additions and 40 deletions

View file

@ -149,12 +149,12 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " sampleUv = sampleUv * "I_COLORS"[0].xy;\n");
if(ApiType == API_OPENGL)
if(ApiType == API_OPENGL || ApiType == API_GLSL)
WRITE(p," sampleUv.y = "I_COLORS"[1].y - sampleUv.y;\n");
WRITE(p, " sampleUv = sampleUv + "I_COLORS"[1].zw;\n");
if(ApiType != API_OPENGL)
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");
@ -237,12 +237,12 @@ void Write32BitSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, " sampleUv.y = yb + xoff;\n");
WRITE(p, " sampleUv = sampleUv * "I_COLORS"[0].xy;\n");
if(ApiType == API_OPENGL)
if(ApiType == API_OPENGL || ApiType == API_GLSL)
WRITE(p," sampleUv.y = "I_COLORS"[1].y - sampleUv.y;\n");
WRITE(p, " sampleUv = sampleUv + "I_COLORS"[1].zw;\n");
if(ApiType != API_OPENGL)
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");
@ -263,7 +263,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)
if(ApiType != API_OPENGL || ApiType != API_GLSL)
texSampleIncrementUnit = I_COLORS"[0].x / "I_COLORS"[0].z";
else
texSampleIncrementUnit = I_COLORS"[0].x";