diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index e2f97ad347..4020d4b646 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -29,11 +29,6 @@ static s32 vertex0Y; static float vertexOffsetX; static float vertexOffsetY; -static s32 scissorLeft = 0; -static s32 scissorTop = 0; -static s32 scissorRight = 0; -static s32 scissorBottom = 0; - static Tev tev; static RasterBlock rasterBlock; @@ -69,28 +64,6 @@ static inline int iround(float x) return t; } -void SetScissor() -{ - int xoff = bpmem.scissorOffset.x * 2 - 342; - int yoff = bpmem.scissorOffset.y * 2 - 342; - - scissorLeft = bpmem.scissorTL.x - xoff - 342; - if (scissorLeft < 0) - scissorLeft = 0; - - scissorTop = bpmem.scissorTL.y - yoff - 342; - if (scissorTop < 0) - scissorTop = 0; - - scissorRight = bpmem.scissorBR.x - xoff - 341; - if (scissorRight > EFB_WIDTH) - scissorRight = EFB_WIDTH; - - scissorBottom = bpmem.scissorBR.y - yoff - 341; - if (scissorBottom > EFB_HEIGHT) - scissorBottom = EFB_HEIGHT; -} - void SetTevReg(int reg, int comp, bool konst, s16 color) { tev.SetRegColor(reg, comp, konst, color); @@ -330,6 +303,25 @@ void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVer s32 maxy = (std::max(std::max(Y1, Y2), Y3) + 0xF) >> 4; // scissor + int xoff = bpmem.scissorOffset.x * 2 - 342; + int yoff = bpmem.scissorOffset.y * 2 - 342; + + s32 scissorLeft = bpmem.scissorTL.x - xoff - 342; + if (scissorLeft < 0) + scissorLeft = 0; + + s32 scissorTop = bpmem.scissorTL.y - yoff - 342; + if (scissorTop < 0) + scissorTop = 0; + + s32 scissorRight = bpmem.scissorBR.x - xoff - 341; + if (scissorRight > EFB_WIDTH) + scissorRight = EFB_WIDTH; + + s32 scissorBottom = bpmem.scissorBR.y - yoff - 341; + if (scissorBottom > EFB_HEIGHT) + scissorBottom = EFB_HEIGHT; + minx = std::max(minx, scissorLeft); maxx = std::min(maxx, scissorRight); miny = std::max(miny, scissorTop); diff --git a/Source/Core/VideoBackends/Software/Rasterizer.h b/Source/Core/VideoBackends/Software/Rasterizer.h index a80565647e..ab6da546ed 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.h +++ b/Source/Core/VideoBackends/Software/Rasterizer.h @@ -14,8 +14,6 @@ namespace Rasterizer void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2); - void SetScissor(); - void SetTevReg(int reg, int comp, bool konst, s16 color); struct Slope diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index 33f9ae3030..2509bdcbd4 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -79,7 +79,6 @@ void SWVertexLoader::vFlush(bool useDstAlpha) m_SetupUnit->Init(primitiveType); // set all states with are stored within video sw - Rasterizer::SetScissor(); for (int i = 0; i < 4; i++) { Rasterizer::SetTevReg(i, Tev::RED_C, false, PixelShaderManager::constants.colors[i][0]);