mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix clear mode, turn Alpha Test back on
This commit is contained in:
parent
a97f66766d
commit
b964516669
4 changed files with 19 additions and 14 deletions
|
@ -131,7 +131,7 @@ void GLES_GPU::CopyDisplayToOutput()
|
|||
DEBUG_LOG(HLE, "Found no FBO! displayFBPtr = %08x", displayFramebufPtr_);
|
||||
// No framebuffer to display! Clear to black.
|
||||
glClearColor(0,0,0,1);
|
||||
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Let's not add STENCIL_BUFFER_BIT until we have a stencil buffer (GL ES)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -85,12 +85,12 @@ char *GenerateFragmentShader()
|
|||
WRITE(p, "varying vec4 v_color1;\n");
|
||||
WRITE(p, "varying vec2 v_texcoord;\n");
|
||||
|
||||
WRITE(p, "void main() {");
|
||||
WRITE(p, "void main() {\n");
|
||||
WRITE(p, " vec4 v;\n");
|
||||
|
||||
if (gstate.clearmode & 1)
|
||||
{
|
||||
WRITE(p, "v = v_color0;\n");
|
||||
WRITE(p, " v = v_color0;\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -126,6 +126,8 @@ char *GenerateFragmentShader()
|
|||
WRITE(p, " v = t%s;\n", secondary); break;
|
||||
case GE_TEXFUNC_ADD:
|
||||
WRITE(p, " v = vec4(t.rgb + p.rgb, p.a * t.a)%s;\n", secondary); break;
|
||||
default:
|
||||
WRITE(p, " v = p;\n"); break;
|
||||
}
|
||||
} else { // texfmt == RGB
|
||||
switch (gstate.texfunc & 0x7) {
|
||||
|
@ -139,25 +141,28 @@ char *GenerateFragmentShader()
|
|||
WRITE(p, " v = vec4(t.rgb, p.a)%s;\n", secondary); break;
|
||||
case GE_TEXFUNC_ADD:
|
||||
WRITE(p, " v = vec4(t.rgb + p.rgb, p.a)%s;\n", secondary); break;
|
||||
default:
|
||||
WRITE(p, " v = p;\n"); break;
|
||||
}
|
||||
}
|
||||
|
||||
// Color doubling
|
||||
if (gstate.texfunc & 0x10000) {
|
||||
WRITE(p, " gl_FragColor = v * vec4(2.0, 2.0, 2.0, 1.0);");
|
||||
} else {
|
||||
WRITE(p, " gl_FragColor = v;\n");
|
||||
WRITE(p, " v = v * vec4(2.0, 2.0, 2.0, 1.0);");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
|
||||
if (gstate.alphaTestEnable & 1) {
|
||||
int alphaTestFunc = gstate.alphatest & 7;
|
||||
const char *alphaTestFuncs[] = { "#", "#", " == ", " != ", " < ", " <= ", " > ", " >= " }; // never/always don't make sense
|
||||
WRITE(p, "if (!(gl_FragColor.a %s u_alpharef.x)) discard;", alphaTestFuncs[alphaTestFunc]);
|
||||
}*/
|
||||
if (alphaTestFuncs[alphaTestFunc][0] != '#')
|
||||
WRITE(p, "if (!(v.a %s u_alpharef.x)) discard;", alphaTestFuncs[alphaTestFunc]);
|
||||
}
|
||||
// Fogging should be added here - and disabled during clear mode
|
||||
|
||||
}
|
||||
|
||||
WRITE(p, " gl_FragColor = v;\n");
|
||||
|
||||
//WRITE(p, " gl_FragColor = vec4(1,0,1,1);");
|
||||
WRITE(p, "}\n");
|
||||
|
||||
|
|
|
@ -196,8 +196,8 @@ void DisplayDrawer_DrawFramebuffer(u8 *framebuf, int pixelFormat, int linesize)
|
|||
void DrawActiveTexture(float w, float h, bool flip)
|
||||
{
|
||||
float u2 = 1.0f;
|
||||
float v1 = flip ? 1.0 : 0.0f;
|
||||
float v2 = flip ? 0.0 : 1.0f;
|
||||
float v1 = flip ? 1.0f : 0.0f;
|
||||
float v2 = flip ? 0.0f : 1.0f;
|
||||
|
||||
const float pos[12] = {0,0,0, w,0,0, w,h,0, 0,h,0};
|
||||
const float texCoords[8] = {0, v1, u2, v1, u2, v2, 0, v2};
|
||||
|
|
|
@ -43,7 +43,7 @@ struct TexCacheEntry
|
|||
{
|
||||
u32 addr;
|
||||
u32 hash;
|
||||
u32 frameCounter;
|
||||
int frameCounter;
|
||||
u32 numMips;
|
||||
u32 format;
|
||||
u32 clutaddr;
|
||||
|
|
Loading…
Add table
Reference in a new issue