aboutsummaryrefslogtreecommitdiff
path: root/src/GPU3D_Soft.cpp
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-06-01 15:16:44 +0200
committerStapleButter <thetotalworm@gmail.com>2017-06-01 15:16:44 +0200
commit77d0a0d76e28df3d2393d62ff98ce3cec4431f33 (patch)
tree39a6f2ca9492456ad9610999467c4f357de8e0b9 /src/GPU3D_Soft.cpp
parentd1781c8bf2a0bd65c72e7349834a20932467252d (diff)
only do lower-pixel rendering when rendering under an edge
Diffstat (limited to 'src/GPU3D_Soft.cpp')
-rw-r--r--src/GPU3D_Soft.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp
index 07222f2..e78524d 100644
--- a/src/GPU3D_Soft.cpp
+++ b/src/GPU3D_Soft.cpp
@@ -1027,10 +1027,14 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
continue;
}
+ u32 dstattr = AttrBuffer[pixeladdr];
+
// if depth test against the topmost pixel fails, test
// against the pixel underneath
if (!fnDepthTest(DepthBuffer[pixeladdr], z))
{
+ if (!(dstattr & 0x3)) continue;
+
pixeladdr += 258;
if (!fnDepthTest(DepthBuffer[pixeladdr], z))
continue;
@@ -1096,7 +1100,6 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
}
else
{
- u32 dstattr = AttrBuffer[pixeladdr];
attr |= (1<<30);
if (polygon->IsShadow) dstattr |= (1<<30);
@@ -1148,10 +1151,14 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
continue;
}
+ u32 dstattr = AttrBuffer[pixeladdr];
+
// if depth test against the topmost pixel fails, test
// against the pixel underneath
if (!fnDepthTest(DepthBuffer[pixeladdr], z))
{
+ if (!(dstattr & 0x3)) continue;
+
pixeladdr += 258;
if (!fnDepthTest(DepthBuffer[pixeladdr], z))
continue;
@@ -1244,10 +1251,14 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
continue;
}
+ u32 dstattr = AttrBuffer[pixeladdr];
+
// if depth test against the topmost pixel fails, test
// against the pixel underneath
if (!fnDepthTest(DepthBuffer[pixeladdr], z))
{
+ if (!(dstattr & 0x3)) continue;
+
pixeladdr += 258;
if (!fnDepthTest(DepthBuffer[pixeladdr], z))
continue;
@@ -1313,7 +1324,6 @@ void RenderPolygonScanline(RendererPolygon* rp, s32 y)
}
else
{
- u32 dstattr = AttrBuffer[pixeladdr];
attr |= (1<<30);
if (polygon->IsShadow) dstattr |= (1<<30);