VideoSW: Drop SetScissor().

Just access the global state directly.
This commit is contained in:
degasus 2016-03-06 10:24:28 +01:00
parent 8b0fd623e5
commit 7a154181b4
3 changed files with 19 additions and 30 deletions

View File

@ -29,11 +29,6 @@ static s32 vertex0Y;
static float vertexOffsetX; static float vertexOffsetX;
static float vertexOffsetY; static float vertexOffsetY;
static s32 scissorLeft = 0;
static s32 scissorTop = 0;
static s32 scissorRight = 0;
static s32 scissorBottom = 0;
static Tev tev; static Tev tev;
static RasterBlock rasterBlock; static RasterBlock rasterBlock;
@ -69,28 +64,6 @@ static inline int iround(float x)
return t; 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) void SetTevReg(int reg, int comp, bool konst, s16 color)
{ {
tev.SetRegColor(reg, comp, konst, 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; s32 maxy = (std::max(std::max(Y1, Y2), Y3) + 0xF) >> 4;
// scissor // 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); minx = std::max(minx, scissorLeft);
maxx = std::min(maxx, scissorRight); maxx = std::min(maxx, scissorRight);
miny = std::max(miny, scissorTop); miny = std::max(miny, scissorTop);

View File

@ -14,8 +14,6 @@ namespace Rasterizer
void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2); void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2);
void SetScissor();
void SetTevReg(int reg, int comp, bool konst, s16 color); void SetTevReg(int reg, int comp, bool konst, s16 color);
struct Slope struct Slope

View File

@ -79,7 +79,6 @@ void SWVertexLoader::vFlush(bool useDstAlpha)
m_SetupUnit->Init(primitiveType); m_SetupUnit->Init(primitiveType);
// set all states with are stored within video sw // set all states with are stored within video sw
Rasterizer::SetScissor();
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
Rasterizer::SetTevReg(i, Tev::RED_C, false, PixelShaderManager::constants.colors[i][0]); Rasterizer::SetTevReg(i, Tev::RED_C, false, PixelShaderManager::constants.colors[i][0]);