mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
BPFunctions: Move upscaling of scissor rect to VideoCommon
This commit is contained in:
@ -258,10 +258,10 @@ bool Renderer::CheckForResize()
|
||||
return false;
|
||||
}
|
||||
|
||||
void Renderer::SetScissorRect(const EFBRectangle& rc)
|
||||
void Renderer::SetScissorRect(const MathUtil::Rectangle<int>& rc)
|
||||
{
|
||||
TargetRectangle trc = ConvertEFBRectangle(rc);
|
||||
D3D::context->RSSetScissorRects(1, trc.AsRECT());
|
||||
const RECT rect = {rc.left, rc.top, rc.right, rc.bottom};
|
||||
D3D::context->RSSetScissorRects(1, &rect);
|
||||
}
|
||||
|
||||
// This function allows the CPU to directly access the EFB.
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
CreateStagingTexture(StagingTextureType type, const TextureConfig& config) override;
|
||||
|
||||
void SetBlendingState(const BlendingState& state) override;
|
||||
void SetScissorRect(const EFBRectangle& rc) override;
|
||||
void SetScissorRect(const MathUtil::Rectangle<int>& rc) override;
|
||||
void SetRasterizationState(const RasterizationState& state) override;
|
||||
void SetDepthState(const DepthState& state) override;
|
||||
void SetTexture(u32 index, const AbstractTexture* texture) override;
|
||||
|
@ -863,20 +863,9 @@ TargetRectangle Renderer::ConvertEFBRectangle(const EFBRectangle& rc)
|
||||
return result;
|
||||
}
|
||||
|
||||
// Function: This function handles the OpenGL glScissor() function
|
||||
// ----------------------------
|
||||
// Call browser: OpcodeDecoding.cpp ExecuteDisplayList > Decode() > LoadBPReg()
|
||||
// case 0x52 > SetScissorRect()
|
||||
// ----------------------------
|
||||
// bpmem.scissorTL.x, y = 342x342
|
||||
// bpmem.scissorBR.x, y = 981x821
|
||||
// Renderer::GetTargetHeight() = the fixed ini file setting
|
||||
// donkopunchstania - it appears scissorBR is the bottom right pixel inside the scissor box
|
||||
// therefore the width and height are (scissorBR + 1) - scissorTL
|
||||
void Renderer::SetScissorRect(const EFBRectangle& rc)
|
||||
void Renderer::SetScissorRect(const MathUtil::Rectangle<int>& rc)
|
||||
{
|
||||
TargetRectangle trc = ConvertEFBRectangle(rc);
|
||||
glScissor(trc.left, trc.bottom, trc.GetWidth(), trc.GetHeight());
|
||||
glScissor(rc.left, rc.bottom, rc.GetWidth(), rc.GetHeight());
|
||||
}
|
||||
|
||||
void ClearEFBCache()
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
CreateStagingTexture(StagingTextureType type, const TextureConfig& config) override;
|
||||
|
||||
void SetBlendingState(const BlendingState& state) override;
|
||||
void SetScissorRect(const EFBRectangle& rc) override;
|
||||
void SetScissorRect(const MathUtil::Rectangle<int>& rc) override;
|
||||
void SetRasterizationState(const RasterizationState& state) override;
|
||||
void SetDepthState(const DepthState& state) override;
|
||||
void SetTexture(u32 index, const AbstractTexture* texture) override;
|
||||
|
@ -899,14 +899,10 @@ void Renderer::SetInterlacingMode()
|
||||
{
|
||||
}
|
||||
|
||||
void Renderer::SetScissorRect(const EFBRectangle& rc)
|
||||
void Renderer::SetScissorRect(const MathUtil::Rectangle<int>& rc)
|
||||
{
|
||||
TargetRectangle target_rc = ConvertEFBRectangle(rc);
|
||||
|
||||
VkRect2D scissor = {
|
||||
{target_rc.left, target_rc.top},
|
||||
{static_cast<uint32_t>(target_rc.GetWidth()), static_cast<uint32_t>(target_rc.GetHeight())}};
|
||||
|
||||
VkRect2D scissor = {{rc.left, rc.top},
|
||||
{static_cast<u32>(rc.GetWidth()), static_cast<u32>(rc.GetHeight())}};
|
||||
StateTracker::GetInstance()->SetScissor(scissor);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
void RestoreAPIState() override;
|
||||
|
||||
void SetBlendingState(const BlendingState& state) override;
|
||||
void SetScissorRect(const EFBRectangle& rc) override;
|
||||
void SetScissorRect(const MathUtil::Rectangle<int>& rc) override;
|
||||
void SetRasterizationState(const RasterizationState& state) override;
|
||||
void SetDepthState(const DepthState& state) override;
|
||||
void SetTexture(u32 index, const AbstractTexture* texture) override;
|
||||
|
Reference in New Issue
Block a user