[Video] Change GrCombineOther_t to gfxCombineOther_t
This commit is contained in:
parent
8c88b25a9e
commit
b319feb9be
File diff suppressed because it is too large
Load Diff
|
@ -48,10 +48,11 @@ typedef struct
|
||||||
gfxCombineFunction_t c_fnc;
|
gfxCombineFunction_t c_fnc;
|
||||||
gfxCombineFactor_t c_fac;
|
gfxCombineFactor_t c_fac;
|
||||||
gfxCombineLocal_t c_loc;
|
gfxCombineLocal_t c_loc;
|
||||||
uint32_t c_oth; // gfxColorCombine flags
|
gfxCombineOther_t c_oth; // grColorCombine flags
|
||||||
gfxCombineFunction_t a_fnc;
|
gfxCombineFunction_t a_fnc;
|
||||||
gfxCombineFactor_t a_fac;
|
gfxCombineFactor_t a_fac;
|
||||||
gfxCombineLocal_t a_loc;
|
gfxCombineLocal_t a_loc;
|
||||||
|
gfxCombineOther_t a_oth; // gfxAlphaCombine flags
|
||||||
gfxCombineFunction_t tmu0_func;
|
gfxCombineFunction_t tmu0_func;
|
||||||
gfxCombineFactor_t tmu0_fac;
|
gfxCombineFactor_t tmu0_fac;
|
||||||
gfxCombineFunction_t tmu1_func;
|
gfxCombineFunction_t tmu1_func;
|
||||||
|
@ -60,7 +61,6 @@ typedef struct
|
||||||
gfxCombineFactor_t tmu0_a_fac;
|
gfxCombineFactor_t tmu0_a_fac;
|
||||||
gfxCombineFunction_t tmu1_a_func;
|
gfxCombineFunction_t tmu1_a_func;
|
||||||
gfxCombineFactor_t tmu1_a_fac;
|
gfxCombineFactor_t tmu1_a_fac;
|
||||||
uint32_t a_oth; // gfxAlphaCombine flags
|
|
||||||
uint32_t tex, tmu0_invert, tmu1_invert;
|
uint32_t tex, tmu0_invert, tmu1_invert;
|
||||||
uint32_t tmu0_a_invert, tmu1_a_invert;
|
uint32_t tmu0_a_invert, tmu1_a_invert;
|
||||||
int dc0_lodbias, dc1_lodbias;
|
int dc0_lodbias, dc1_lodbias;
|
||||||
|
|
|
@ -55,13 +55,13 @@ static gfxChipID_t SetupFBtoScreenCombiner(uint32_t texture_size, uint32_t opaqu
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
// GR_COMBINE_OTHER_CONSTANT,
|
// GFX_COMBINE_OTHER_CONSTANT,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
if (opaque)
|
if (opaque)
|
||||||
{
|
{
|
||||||
|
@ -400,7 +400,7 @@ static void DrawDepthBufferToScreen256(FB_TO_SCREEN_INFO & fb_info)
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_CONSTANT,
|
GFX_COMBINE_OTHER_CONSTANT,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
uint16_t * src = (uint16_t*)image;
|
uint16_t * src = (uint16_t*)image;
|
||||||
src += fb_info.ul_x + fb_info.ul_y * fb_info.width;
|
src += fb_info.ul_x + fb_info.ul_y * fb_info.width;
|
||||||
|
@ -470,12 +470,12 @@ static void DrawHiresDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
||||||
GFX_COMBINE_FACTOR_NONE,
|
GFX_COMBINE_FACTOR_NONE,
|
||||||
GFX_COMBINE_LOCAL_CONSTANT,
|
GFX_COMBINE_LOCAL_CONSTANT,
|
||||||
GR_COMBINE_OTHER_NONE,
|
GFX_COMBINE_OTHER_NONE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaBlendFunction(GR_BLEND_SRC_ALPHA,
|
gfxAlphaBlendFunction(GR_BLEND_SRC_ALPHA,
|
||||||
GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
GR_BLEND_ONE_MINUS_SRC_ALPHA,
|
||||||
|
@ -582,7 +582,7 @@ void DrawDepthBufferToScreen(FB_TO_SCREEN_INFO & fb_info)
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_CONSTANT,
|
GFX_COMBINE_OTHER_CONSTANT,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxTexDownloadMipMap(tmu, voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu], GR_MIPMAPLEVELMASK_BOTH, &t_info);
|
gfxTexDownloadMipMap(tmu, voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu], GR_MIPMAPLEVELMASK_BOTH, &t_info);
|
||||||
gfxTexSource(tmu, voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu], GR_MIPMAPLEVELMASK_BOTH, &t_info);
|
gfxTexSource(tmu, voodoo.tex_min_addr[tmu] + voodoo.tmem_ptr[tmu], GR_MIPMAPLEVELMASK_BOTH, &t_info);
|
||||||
|
|
|
@ -364,13 +364,13 @@ void compile_chroma_shader()
|
||||||
|
|
||||||
switch (chroma_other_alpha)
|
switch (chroma_other_alpha)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
strcat(fragment_shader_chroma, "float alpha = vFrontColor.a; \n");
|
strcat(fragment_shader_chroma, "float alpha = vFrontColor.a; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
strcat(fragment_shader_chroma, "float alpha = ctexture1.a; \n");
|
strcat(fragment_shader_chroma, "float alpha = ctexture1.a; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
strcat(fragment_shader_chroma, "float alpha = constant_color.a; \n");
|
strcat(fragment_shader_chroma, "float alpha = constant_color.a; \n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -379,13 +379,13 @@ void compile_chroma_shader()
|
||||||
|
|
||||||
switch (chroma_other_color)
|
switch (chroma_other_color)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(vFrontColor),alpha); \n");
|
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(vFrontColor),alpha); \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(ctexture1),alpha); \n");
|
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(ctexture1),alpha); \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(constant_color),alpha); \n");
|
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(constant_color),alpha); \n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -707,13 +707,13 @@ void writeGLSLColorOther(int other)
|
||||||
{
|
{
|
||||||
switch (other)
|
switch (other)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
strcat(fragment_shader_color_combiner, "vec4 color_other = vFrontColor; \n");
|
strcat(fragment_shader_color_combiner, "vec4 color_other = vFrontColor; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
strcat(fragment_shader_color_combiner, "vec4 color_other = ctexture1; \n");
|
strcat(fragment_shader_color_combiner, "vec4 color_other = ctexture1; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
strcat(fragment_shader_color_combiner, "vec4 color_other = constant_color; \n");
|
strcat(fragment_shader_color_combiner, "vec4 color_other = constant_color; \n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -784,7 +784,7 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, GrCombineOther_t other, bool invert)
|
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
|
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
|
||||||
static int last_function = 0;
|
static int last_function = 0;
|
||||||
|
@ -879,13 +879,13 @@ int setOtherAlphaSource(int other)
|
||||||
{
|
{
|
||||||
switch(other)
|
switch(other)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
return GL_PRIMARY_COLOR_ARB;
|
return GL_PRIMARY_COLOR_ARB;
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
return GL_PREVIOUS_ARB;
|
return GL_PREVIOUS_ARB;
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
return GL_CONSTANT_ARB;
|
return GL_CONSTANT_ARB;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -915,13 +915,13 @@ void writeGLSLAlphaOther(int other)
|
||||||
{
|
{
|
||||||
switch (other)
|
switch (other)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
strcat(fragment_shader_alpha_combiner, "float alpha_other = vFrontColor.a; \n");
|
strcat(fragment_shader_alpha_combiner, "float alpha_other = vFrontColor.a; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
strcat(fragment_shader_alpha_combiner, "float alpha_other = ctexture1.a; \n");
|
strcat(fragment_shader_alpha_combiner, "float alpha_other = ctexture1.a; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
strcat(fragment_shader_alpha_combiner, "float alpha_other = constant_color.a; \n");
|
strcat(fragment_shader_alpha_combiner, "float alpha_other = constant_color.a; \n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -989,7 +989,7 @@ void writeGLSLAlphaFactor(int factor, int local, int need_local, int other, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, GrCombineOther_t other, bool invert)
|
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
|
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
|
||||||
static int last_function = 0;
|
static int last_function = 0;
|
||||||
|
|
|
@ -319,13 +319,13 @@ void compile_chroma_shader()
|
||||||
|
|
||||||
switch (chroma_other_alpha)
|
switch (chroma_other_alpha)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
strcat(fragment_shader_chroma, "float alpha = gl_Color.a; \n");
|
strcat(fragment_shader_chroma, "float alpha = gl_Color.a; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
strcat(fragment_shader_chroma, "float alpha = ctexture1.a; \n");
|
strcat(fragment_shader_chroma, "float alpha = ctexture1.a; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
strcat(fragment_shader_chroma, "float alpha = constant_color.a; \n");
|
strcat(fragment_shader_chroma, "float alpha = constant_color.a; \n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -334,13 +334,13 @@ void compile_chroma_shader()
|
||||||
|
|
||||||
switch (chroma_other_color)
|
switch (chroma_other_color)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(gl_Color),alpha); \n");
|
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(gl_Color),alpha); \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(ctexture1),alpha); \n");
|
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(ctexture1),alpha); \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(constant_color),alpha); \n");
|
strcat(fragment_shader_chroma, "vec4 color = vec4(vec3(constant_color),alpha); \n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -610,13 +610,13 @@ int setOtherColorSource(int other)
|
||||||
{
|
{
|
||||||
switch (other)
|
switch (other)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
return GL_PRIMARY_COLOR_ARB;
|
return GL_PRIMARY_COLOR_ARB;
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
return GL_PREVIOUS_ARB;
|
return GL_PREVIOUS_ARB;
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
return GL_CONSTANT_ARB;
|
return GL_CONSTANT_ARB;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -645,13 +645,13 @@ void writeGLSLColorOther(int other)
|
||||||
{
|
{
|
||||||
switch (other)
|
switch (other)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
strcat(fragment_shader_color_combiner, "vec4 color_other = gl_Color; \n");
|
strcat(fragment_shader_color_combiner, "vec4 color_other = gl_Color; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
strcat(fragment_shader_color_combiner, "vec4 color_other = ctexture1; \n");
|
strcat(fragment_shader_color_combiner, "vec4 color_other = ctexture1; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
strcat(fragment_shader_color_combiner, "vec4 color_other = constant_color; \n");
|
strcat(fragment_shader_color_combiner, "vec4 color_other = constant_color; \n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -722,7 +722,7 @@ void writeGLSLColorFactor(int factor, int local, int need_local, int other, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, GrCombineOther_t other, bool invert)
|
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
|
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
|
||||||
|
|
||||||
|
@ -817,13 +817,13 @@ int setOtherAlphaSource(int other)
|
||||||
{
|
{
|
||||||
switch (other)
|
switch (other)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
return GL_PRIMARY_COLOR_ARB;
|
return GL_PRIMARY_COLOR_ARB;
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
return GL_PREVIOUS_ARB;
|
return GL_PREVIOUS_ARB;
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
return GL_CONSTANT_ARB;
|
return GL_CONSTANT_ARB;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -852,13 +852,13 @@ void writeGLSLAlphaOther(int other)
|
||||||
{
|
{
|
||||||
switch (other)
|
switch (other)
|
||||||
{
|
{
|
||||||
case GR_COMBINE_OTHER_ITERATED:
|
case GFX_COMBINE_OTHER_ITERATED:
|
||||||
strcat(fragment_shader_alpha_combiner, "float alpha_other = gl_Color.a; \n");
|
strcat(fragment_shader_alpha_combiner, "float alpha_other = gl_Color.a; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_TEXTURE:
|
case GFX_COMBINE_OTHER_TEXTURE:
|
||||||
strcat(fragment_shader_alpha_combiner, "float alpha_other = ctexture1.a; \n");
|
strcat(fragment_shader_alpha_combiner, "float alpha_other = ctexture1.a; \n");
|
||||||
break;
|
break;
|
||||||
case GR_COMBINE_OTHER_CONSTANT:
|
case GFX_COMBINE_OTHER_CONSTANT:
|
||||||
strcat(fragment_shader_alpha_combiner, "float alpha_other = constant_color.a; \n");
|
strcat(fragment_shader_alpha_combiner, "float alpha_other = constant_color.a; \n");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -926,7 +926,7 @@ void writeGLSLAlphaFactor(int factor, int local, int need_local, int other, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, GrCombineOther_t other, bool invert)
|
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert)
|
||||||
{
|
{
|
||||||
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
|
WriteTrace(TraceGlitch, TraceDebug, "function: %d factor: %d local: %d other: %d invert: %d", function, factor, local, other, invert);
|
||||||
static int last_function = 0;
|
static int last_function = 0;
|
||||||
|
|
|
@ -23,8 +23,8 @@ void gfxTextureBufferExt(gfxChipID_t tmu, uint32_t startAddress, gfxLOD_t lodmin
|
||||||
uint32_t gfxTexMaxAddress(gfxChipID_t tmu);
|
uint32_t gfxTexMaxAddress(gfxChipID_t tmu);
|
||||||
uint32_t gfxTexTextureMemRequired(uint32_t evenOdd, gfxTexInfo *info);
|
uint32_t gfxTexTextureMemRequired(uint32_t evenOdd, gfxTexInfo *info);
|
||||||
void gfxConstantColorValue(gfxColor_t value);
|
void gfxConstantColorValue(gfxColor_t value);
|
||||||
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, GrCombineOther_t other, bool invert);
|
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert);
|
||||||
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, GrCombineOther_t other, bool invert);
|
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert);
|
||||||
void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, gfxCombineFactor_t rgb_factor, gfxCombineFunction_t alpha_function, gfxCombineFactor_t alpha_factor, bool rgb_invert, bool alpha_invert);
|
void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, gfxCombineFactor_t rgb_factor, gfxCombineFunction_t alpha_function, gfxCombineFactor_t alpha_factor, bool rgb_invert, bool alpha_invert);
|
||||||
void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df);
|
void gfxAlphaBlendFunction(GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df);
|
||||||
void gfxAlphaTestReferenceValue(gfxAlpha_t value);
|
void gfxAlphaTestReferenceValue(gfxAlpha_t value);
|
||||||
|
|
|
@ -154,6 +154,14 @@ enum gfxCombineLocal_t
|
||||||
GFX_COMBINE_LOCAL_DEPTH = 0x2,
|
GFX_COMBINE_LOCAL_DEPTH = 0x2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum gfxCombineOther_t
|
||||||
|
{
|
||||||
|
GFX_COMBINE_OTHER_ITERATED = 0x0,
|
||||||
|
GFX_COMBINE_OTHER_TEXTURE = 0x1,
|
||||||
|
GFX_COMBINE_OTHER_CONSTANT = 0x2,
|
||||||
|
GFX_COMBINE_OTHER_NONE = GFX_COMBINE_OTHER_CONSTANT,
|
||||||
|
};
|
||||||
|
|
||||||
enum GFX_CMBX
|
enum GFX_CMBX
|
||||||
{
|
{
|
||||||
GFX_CMBX_ZERO = 0x00,
|
GFX_CMBX_ZERO = 0x00,
|
||||||
|
|
|
@ -326,13 +326,13 @@ static gfxTextureFormat_t TexBufSetupCombiner(int force_rgb = FALSE)
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
// GR_COMBINE_OTHER_CONSTANT,
|
// GFX_COMBINE_OTHER_CONSTANT,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
// gfxConstantColorValue (0xFFFFFFFF);
|
// gfxConstantColorValue (0xFFFFFFFF);
|
||||||
gfxAlphaBlendFunction(GR_BLEND_ONE, // use alpha compare, but not T0 alpha
|
gfxAlphaBlendFunction(GR_BLEND_ONE, // use alpha compare, but not T0 alpha
|
||||||
|
|
|
@ -1955,12 +1955,12 @@ void set_message_combiner()
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
||||||
GR_BLEND_ZERO,
|
GR_BLEND_ZERO,
|
||||||
|
|
|
@ -2505,13 +2505,13 @@ void rdp_fillrect()
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
||||||
GFX_COMBINE_FACTOR_NONE,
|
GFX_COMBINE_FACTOR_NONE,
|
||||||
GFX_COMBINE_LOCAL_CONSTANT,
|
GFX_COMBINE_LOCAL_CONSTANT,
|
||||||
GR_COMBINE_OTHER_NONE,
|
GFX_COMBINE_OTHER_NONE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
|
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
||||||
GFX_COMBINE_FACTOR_NONE,
|
GFX_COMBINE_FACTOR_NONE,
|
||||||
GFX_COMBINE_LOCAL_CONSTANT,
|
GFX_COMBINE_LOCAL_CONSTANT,
|
||||||
GR_COMBINE_OTHER_NONE,
|
GFX_COMBINE_OTHER_NONE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
|
|
||||||
gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO);
|
gfxAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, GR_BLEND_ONE, GR_BLEND_ZERO);
|
||||||
|
@ -2543,7 +2543,7 @@ void rdp_fillrect()
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
||||||
GFX_COMBINE_FACTOR_NONE,
|
GFX_COMBINE_FACTOR_NONE,
|
||||||
GFX_COMBINE_LOCAL_CONSTANT,
|
GFX_COMBINE_LOCAL_CONSTANT,
|
||||||
GR_COMBINE_OTHER_NONE,
|
GFX_COMBINE_OTHER_NONE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxConstantColorValue((cmb.ccolor & 0xFFFFFF00) | (rdp.fog_color & 0xFF));
|
gfxConstantColorValue((cmb.ccolor & 0xFFFFFF00) | (rdp.fog_color & 0xFF));
|
||||||
rdp.update |= UPDATE_COMBINE;
|
rdp.update |= UPDATE_COMBINE;
|
||||||
|
@ -3121,12 +3121,12 @@ void SetWireframeCol()
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
||||||
GFX_COMBINE_FACTOR_NONE,
|
GFX_COMBINE_FACTOR_NONE,
|
||||||
GFX_COMBINE_LOCAL_ITERATED,
|
GFX_COMBINE_LOCAL_ITERATED,
|
||||||
GR_COMBINE_OTHER_NONE,
|
GFX_COMBINE_OTHER_NONE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
||||||
GFX_COMBINE_FACTOR_NONE,
|
GFX_COMBINE_FACTOR_NONE,
|
||||||
GFX_COMBINE_LOCAL_ITERATED,
|
GFX_COMBINE_LOCAL_ITERATED,
|
||||||
GR_COMBINE_OTHER_NONE,
|
GFX_COMBINE_OTHER_NONE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
||||||
GR_BLEND_ZERO,
|
GR_BLEND_ZERO,
|
||||||
|
@ -3149,12 +3149,12 @@ void SetWireframeCol()
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
||||||
GFX_COMBINE_FACTOR_NONE,
|
GFX_COMBINE_FACTOR_NONE,
|
||||||
GFX_COMBINE_LOCAL_CONSTANT,
|
GFX_COMBINE_LOCAL_CONSTANT,
|
||||||
GR_COMBINE_OTHER_NONE,
|
GFX_COMBINE_OTHER_NONE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_LOCAL,
|
||||||
GFX_COMBINE_FACTOR_NONE,
|
GFX_COMBINE_FACTOR_NONE,
|
||||||
GFX_COMBINE_LOCAL_CONSTANT,
|
GFX_COMBINE_LOCAL_CONSTANT,
|
||||||
GR_COMBINE_OTHER_NONE,
|
GFX_COMBINE_OTHER_NONE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxConstantColorValue(0xFF0000FF);
|
gfxConstantColorValue(0xFF0000FF);
|
||||||
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
||||||
|
|
|
@ -75,12 +75,12 @@ float set_sprite_combine_mode()
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
||||||
GR_BLEND_ZERO,
|
GR_BLEND_ZERO,
|
||||||
|
@ -161,12 +161,12 @@ void DrawHiresDepthImage(const DRAWIMAGE & d)
|
||||||
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxColorCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
gfxAlphaCombine(GFX_COMBINE_FUNCTION_SCALE_OTHER,
|
||||||
GFX_COMBINE_FACTOR_ONE,
|
GFX_COMBINE_FACTOR_ONE,
|
||||||
GFX_COMBINE_LOCAL_NONE,
|
GFX_COMBINE_LOCAL_NONE,
|
||||||
GR_COMBINE_OTHER_TEXTURE,
|
GFX_COMBINE_OTHER_TEXTURE,
|
||||||
FXFALSE);
|
FXFALSE);
|
||||||
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
gfxAlphaBlendFunction(GR_BLEND_ONE,
|
||||||
GR_BLEND_ZERO,
|
GR_BLEND_ZERO,
|
||||||
|
|
Loading…
Reference in New Issue