mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Software: Use new scissor logic
Unlike the hardware backends, the software renderer can use multiple scissor rectangles (though this will result in extra rasterization).
This commit is contained in:
@ -307,7 +307,7 @@ void ProcessTriangle(OutputVertexData* v0, OutputVertexData* v1, OutputVertexDat
|
||||
PerspectiveDivide(v0);
|
||||
PerspectiveDivide(v1);
|
||||
PerspectiveDivide(v2);
|
||||
Rasterizer::UpdateZSlope(v0, v1, v2);
|
||||
Rasterizer::UpdateZSlope(v0, v1, v2, bpmem.scissorOffset.x * 2, bpmem.scissorOffset.y * 2);
|
||||
INCSTAT(g_stats.this_frame.num_triangles_culled)
|
||||
return;
|
||||
}
|
||||
@ -320,7 +320,7 @@ void ProcessTriangle(OutputVertexData* v0, OutputVertexData* v1, OutputVertexDat
|
||||
PerspectiveDivide(v0);
|
||||
PerspectiveDivide(v2);
|
||||
PerspectiveDivide(v1);
|
||||
Rasterizer::UpdateZSlope(v0, v2, v1);
|
||||
Rasterizer::UpdateZSlope(v0, v2, v1, bpmem.scissorOffset.x * 2, bpmem.scissorOffset.y * 2);
|
||||
INCSTAT(g_stats.this_frame.num_triangles_culled)
|
||||
return;
|
||||
}
|
||||
@ -533,10 +533,8 @@ void PerspectiveDivide(OutputVertexData* vertex)
|
||||
Vec3& screen = vertex->screenPosition;
|
||||
|
||||
float wInverse = 1.0f / projected.w;
|
||||
screen.x =
|
||||
projected.x * wInverse * xfmem.viewport.wd + xfmem.viewport.xOrig - bpmem.scissorOffset.x * 2;
|
||||
screen.y =
|
||||
projected.y * wInverse * xfmem.viewport.ht + xfmem.viewport.yOrig - bpmem.scissorOffset.y * 2;
|
||||
screen.x = projected.x * wInverse * xfmem.viewport.wd + xfmem.viewport.xOrig;
|
||||
screen.y = projected.y * wInverse * xfmem.viewport.ht + xfmem.viewport.yOrig;
|
||||
screen.z = projected.z * wInverse * xfmem.viewport.zRange + xfmem.viewport.farZ;
|
||||
}
|
||||
} // namespace Clipper
|
||||
|
Reference in New Issue
Block a user