summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/BPStructs.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2022-04-24 15:00:42 -0400
committerGitHub <noreply@github.com>2022-04-24 15:00:42 -0400
commitc0488de4829cb3a7d1d76522cee821ec8ad03f95 (patch)
treef780b8a71377afc24ccf79504f53d0c230510198 /Source/Core/VideoCommon/BPStructs.cpp
parent8e7c84842595f64b63184933cf4f6d7c78bb82e8 (diff)
parentf3eff70e2fda8ad0894f34336584f331ab989b68 (diff)
Merge pull request #10251 from Pokechu22/negative-scissor
Rework scissor handling
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
-rw-r--r--Source/Core/VideoCommon/BPStructs.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp
index 503ef6154f..c6746d444a 100644
--- a/Source/Core/VideoCommon/BPStructs.cpp
+++ b/Source/Core/VideoCommon/BPStructs.cpp
@@ -131,8 +131,6 @@ static void BPWritten(const BPCmd& bp, int cycles_into_future)
case BPMEM_SCISSORTL: // Scissor Rectable Top, Left
case BPMEM_SCISSORBR: // Scissor Rectable Bottom, Right
case BPMEM_SCISSOROFFSET: // Scissor Offset
- SetScissor();
- SetViewport();
VertexShaderManager::SetViewportChanged();
GeometryShaderManager::SetViewportChanged();
return;
@@ -815,19 +813,10 @@ std::pair<std::string, std::string> GetBPRegInfo(u8 cmd, u32 cmddata)
fmt::to_string(TevStageIndirect{.fullhex = cmddata}));
case BPMEM_SCISSORTL: // 0x20
- {
- const X12Y12 top_left{.hex = cmddata};
- return std::make_pair(RegName(BPMEM_SCISSORTL),
- fmt::format("Scissor Top: {}\nScissor Left: {}", top_left.y, top_left.x));
- }
+ return std::make_pair(RegName(BPMEM_SCISSORTL), fmt::to_string(ScissorPos{.hex = cmddata}));
case BPMEM_SCISSORBR: // 0x21
- {
- const X12Y12 bottom_right{.hex = cmddata};
- return std::make_pair(
- RegName(BPMEM_SCISSORBR),
- fmt::format("Scissor Bottom: {}\nScissor Right: {}", bottom_right.y, bottom_right.x));
- }
+ return std::make_pair(RegName(BPMEM_SCISSORBR), fmt::to_string(ScissorPos{.hex = cmddata}));
case BPMEM_LINEPTWIDTH: // 0x22
return std::make_pair(RegName(BPMEM_LINEPTWIDTH), fmt::to_string(LPSize{.hex = cmddata}));
@@ -1002,11 +991,8 @@ std::pair<std::string, std::string> GetBPRegInfo(u8 cmd, u32 cmddata)
// TODO: Description
case BPMEM_SCISSOROFFSET: // 0x59
- {
- const S32X10Y10 xy{.hex = cmddata};
return std::make_pair(RegName(BPMEM_SCISSOROFFSET),
- fmt::format("Scissor X offset: {}\nScissor Y offset: {}", xy.x, xy.y));
- }
+ fmt::to_string(ScissorOffset{.hex = cmddata}));
case BPMEM_PRELOAD_ADDR: // 0x60
return DescriptionlessReg(BPMEM_PRELOAD_ADDR);
@@ -1284,8 +1270,7 @@ void BPReload()
// let's not risk actually replaying any writes.
// note that PixelShaderManager is already covered since it has its own DoState.
SetGenerationMode();
- SetScissor();
- SetViewport();
+ SetScissorAndViewport();
SetDepthMode();
SetBlendMode();
OnPixelFormatChange();