mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-31 02:59:33 +02:00
Merge pull request #4781 from raven02/cleanup
Cleanup ClearmodeDepthMask
This commit is contained in:
@@ -212,7 +212,7 @@ void TransformDrawEngineDX9::ApplyDrawState(int prim) {
|
||||
// Depth Test
|
||||
dxstate.depthTest.enable();
|
||||
dxstate.depthFunc.set(D3DCMP_ALWAYS);
|
||||
dxstate.depthWrite.set(gstate.isClearModeDepthWriteEnabled());
|
||||
dxstate.depthWrite.set(gstate.isClearModeDepthMask());
|
||||
|
||||
// Color Test
|
||||
bool colorMask = (gstate.clearmode >> 8) & 1;
|
||||
|
||||
@@ -335,7 +335,7 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
||||
// Depth Test
|
||||
glstate.depthTest.enable();
|
||||
glstate.depthFunc.set(GL_ALWAYS);
|
||||
glstate.depthWrite.set(gstate.isClearModeDepthWriteEnabled() || alwaysDepthWrite ? GL_TRUE : GL_FALSE);
|
||||
glstate.depthWrite.set(gstate.isClearModeDepthMask() || alwaysDepthWrite ? GL_TRUE : GL_FALSE);
|
||||
|
||||
// Color Test
|
||||
bool colorMask = gstate.isClearModeColorMask();
|
||||
|
||||
+4
-2
@@ -213,6 +213,7 @@ struct GPUgstate
|
||||
float tgenMatrix[12];
|
||||
float boneMatrix[12 * 8]; // Eight bone matrices.
|
||||
|
||||
// Framebuffer
|
||||
u32 getFrameBufRawAddress() const { return (fbptr & 0xFFFFFF) | ((fbwidth & 0xFF0000) << 8); }
|
||||
// 0x44000000 is uncached VRAM.
|
||||
u32 getFrameBufAddress() const { return 0x44000000 | getFrameBufRawAddress(); }
|
||||
@@ -229,7 +230,8 @@ struct GPUgstate
|
||||
// Cull
|
||||
bool isCullEnabled() const { return cullfaceEnable & 1; }
|
||||
int getCullMode() const { return cullmode & 1; }
|
||||
bool isClearModeDepthWriteEnabled() const { return (clearmode&0x400) != 0; }
|
||||
|
||||
// Color Mask
|
||||
bool isClearModeColorMask() const { return (clearmode&0x100) != 0; }
|
||||
bool isClearModeAlphaMask() const { return (clearmode&0x200) != 0; }
|
||||
bool isClearModeDepthMask() const { return (clearmode&0x400) != 0; }
|
||||
@@ -237,9 +239,9 @@ struct GPUgstate
|
||||
|
||||
// Blend
|
||||
GEBlendSrcFactor getBlendFuncA() const { return (GEBlendSrcFactor)(blend & 0xF); }
|
||||
GEBlendDstFactor getBlendFuncB() const { return (GEBlendDstFactor)((blend >> 4) & 0xF); }
|
||||
u32 getFixA() const { return blendfixa & 0xFFFFFF; }
|
||||
u32 getFixB() const { return blendfixb & 0xFFFFFF; }
|
||||
GEBlendDstFactor getBlendFuncB() const { return (GEBlendDstFactor)((blend >> 4) & 0xF); }
|
||||
GEBlendMode getBlendEq() const { return static_cast<GEBlendMode>((blend >> 8) & 0x7); }
|
||||
bool isAlphaBlendEnabled() const { return alphaBlendEnable & 1; }
|
||||
|
||||
|
||||
@@ -1022,7 +1022,7 @@ void DrawTriangleSlice(
|
||||
if (gstate.isDepthTestEnabled() && gstate.isDepthWriteEnabled()) {
|
||||
SetPixelDepth(p.x, p.y, z);
|
||||
}
|
||||
} else if (clearMode && gstate.isClearModeDepthWriteEnabled()) {
|
||||
} else if (clearMode && gstate.isClearModeDepthMask()) {
|
||||
SetPixelDepth(p.x, p.y, z);
|
||||
}
|
||||
|
||||
@@ -1150,7 +1150,7 @@ void DrawPixel(ScreenCoords pos, Vec3<int> prim_color_rgb, int prim_color_a, Vec
|
||||
if (gstate.isDepthTestEnabled() && gstate.isDepthWriteEnabled()) {
|
||||
SetPixelDepth(p.x, p.y, z);
|
||||
}
|
||||
} else if (clearMode && gstate.isClearModeDepthWriteEnabled()) {
|
||||
} else if (clearMode && gstate.isClearModeDepthMask()) {
|
||||
SetPixelDepth(p.x, p.y, z);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user