mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
use EFBRectangle for scissor rect
This one is backend independed. The backend should recalc such things on their own.
This commit is contained in:
@ -303,9 +303,10 @@ bool Renderer::CheckForResize()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::SetScissorRect(const TargetRectangle& rc)
|
void Renderer::SetScissorRect(const EFBRectangle& rc)
|
||||||
{
|
{
|
||||||
D3D::context->RSSetScissorRects(1, rc.AsRECT());
|
TargetRectangle trc = ConvertEFBRectangle(rc);
|
||||||
|
D3D::context->RSSetScissorRects(1, trc.AsRECT());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::SetColorMask()
|
void Renderer::SetColorMask()
|
||||||
|
@ -13,7 +13,7 @@ public:
|
|||||||
|
|
||||||
void SetColorMask();
|
void SetColorMask();
|
||||||
void SetBlendMode(bool forceUpdate);
|
void SetBlendMode(bool forceUpdate);
|
||||||
void SetScissorRect(const TargetRectangle& rc);
|
void SetScissorRect(const EFBRectangle& rc);
|
||||||
void SetGenerationMode();
|
void SetGenerationMode();
|
||||||
void SetDepthMode();
|
void SetDepthMode();
|
||||||
void SetLogicOpMode();
|
void SetLogicOpMode();
|
||||||
|
@ -862,9 +862,10 @@ TargetRectangle Renderer::ConvertEFBRectangle(const EFBRectangle& rc)
|
|||||||
// Renderer::GetTargetHeight() = the fixed ini file setting
|
// Renderer::GetTargetHeight() = the fixed ini file setting
|
||||||
// donkopunchstania - it appears scissorBR is the bottom right pixel inside the scissor box
|
// donkopunchstania - it appears scissorBR is the bottom right pixel inside the scissor box
|
||||||
// therefore the width and height are (scissorBR + 1) - scissorTL
|
// therefore the width and height are (scissorBR + 1) - scissorTL
|
||||||
void Renderer::SetScissorRect(const TargetRectangle& rc)
|
void Renderer::SetScissorRect(const EFBRectangle& rc)
|
||||||
{
|
{
|
||||||
glScissor(rc.left, rc.bottom, rc.GetWidth(), rc.GetHeight());
|
TargetRectangle trc = g_renderer->ConvertEFBRectangle(rc);
|
||||||
|
glScissor(trc.left, trc.bottom, trc.GetWidth(), trc.GetHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::SetColorMask()
|
void Renderer::SetColorMask()
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
void SetColorMask() override;
|
void SetColorMask() override;
|
||||||
void SetBlendMode(bool forceUpdate) override;
|
void SetBlendMode(bool forceUpdate) override;
|
||||||
void SetScissorRect(const TargetRectangle& rc) override;
|
void SetScissorRect(const EFBRectangle& rc) override;
|
||||||
void SetGenerationMode() override;
|
void SetGenerationMode() override;
|
||||||
void SetDepthMode() override;
|
void SetDepthMode() override;
|
||||||
void SetLogicOpMode() override;
|
void SetLogicOpMode() override;
|
||||||
|
@ -47,8 +47,7 @@ void SetScissor()
|
|||||||
if (rc.left > rc.right) rc.right = rc.left;
|
if (rc.left > rc.right) rc.right = rc.left;
|
||||||
if (rc.top > rc.bottom) rc.bottom = rc.top;
|
if (rc.top > rc.bottom) rc.bottom = rc.top;
|
||||||
|
|
||||||
TargetRectangle trc = g_renderer->ConvertEFBRectangle(rc);
|
g_renderer->SetScissorRect(rc);
|
||||||
g_renderer->SetScissorRect(trc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetLineWidth()
|
void SetLineWidth()
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
virtual void SetColorMask() = 0;
|
virtual void SetColorMask() = 0;
|
||||||
virtual void SetBlendMode(bool forceUpdate) = 0;
|
virtual void SetBlendMode(bool forceUpdate) = 0;
|
||||||
virtual void SetScissorRect(const TargetRectangle& rc) = 0;
|
virtual void SetScissorRect(const EFBRectangle& rc) = 0;
|
||||||
virtual void SetGenerationMode() = 0;
|
virtual void SetGenerationMode() = 0;
|
||||||
virtual void SetDepthMode() = 0;
|
virtual void SetDepthMode() = 0;
|
||||||
virtual void SetLogicOpMode() = 0;
|
virtual void SetLogicOpMode() = 0;
|
||||||
|
Reference in New Issue
Block a user