mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge remote-tracking branch 'remotes/origin/master' into new-shadercache-uids
This commit is contained in:
@ -42,6 +42,7 @@
|
||||
#include "Movie.h"
|
||||
#include "Television.h"
|
||||
#include "Host.h"
|
||||
#include "BPFunctions.h"
|
||||
|
||||
namespace DX11
|
||||
{
|
||||
@ -444,51 +445,9 @@ bool Renderer::CheckForResize()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Renderer::SetScissorRect()
|
||||
void Renderer::SetScissorRect(const TargetRectangle& rc)
|
||||
{
|
||||
TargetRectangle rc;
|
||||
GetScissorRect(rc);
|
||||
|
||||
if (rc.left < 0) rc.left = 0;
|
||||
if (rc.right < 0) rc.right = 0;
|
||||
if (rc.top < 0) rc.top = 0;
|
||||
if (rc.bottom < 0) rc.bottom = 0;
|
||||
|
||||
if (rc.left > EFB_WIDTH) rc.left = EFB_WIDTH;
|
||||
if (rc.right > EFB_WIDTH) rc.right = EFB_WIDTH;
|
||||
if (rc.top > EFB_HEIGHT) rc.top = EFB_HEIGHT;
|
||||
if (rc.bottom > EFB_HEIGHT) rc.bottom = EFB_HEIGHT;
|
||||
|
||||
rc.left = EFBToScaledX(rc.left);
|
||||
rc.right = EFBToScaledX(rc.right);
|
||||
rc.top = EFBToScaledY(rc.top);
|
||||
rc.bottom = EFBToScaledY(rc.bottom);
|
||||
|
||||
if (rc.left > rc.right)
|
||||
{
|
||||
int temp = rc.right;
|
||||
rc.right = rc.left;
|
||||
rc.left = temp;
|
||||
}
|
||||
if (rc.top > rc.bottom)
|
||||
{
|
||||
int temp = rc.bottom;
|
||||
rc.bottom = rc.top;
|
||||
rc.top = temp;
|
||||
}
|
||||
|
||||
if (rc.right >= rc.left && rc.bottom >= rc.top)
|
||||
{
|
||||
D3D::context->RSSetScissorRects(1, rc.AsRECT());
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//WARN_LOG(VIDEO, "Bad scissor rectangle: %i %i %i %i", rc.left, rc.top, rc.right, rc.bottom);
|
||||
*rc.AsRECT() = CD3D11_RECT(0.f, 0.f, s_target_width, s_target_height);
|
||||
D3D::context->RSSetScissorRects(1, rc.AsRECT());
|
||||
return false;
|
||||
}
|
||||
D3D::context->RSSetScissorRects(1, rc.AsRECT());
|
||||
}
|
||||
|
||||
void Renderer::SetColorMask()
|
||||
@ -1163,7 +1122,7 @@ void Renderer::RestoreAPIState()
|
||||
D3D::stateman->PopDepthState();
|
||||
D3D::stateman->PopRasterizerState();
|
||||
VertexShaderManager::SetViewportChanged();
|
||||
SetScissorRect();
|
||||
BPFunctions::SetScissor();
|
||||
}
|
||||
|
||||
void Renderer::ApplyState(bool bUseDstAlpha)
|
||||
|
@ -15,7 +15,7 @@ public:
|
||||
|
||||
void SetColorMask();
|
||||
void SetBlendMode(bool forceUpdate);
|
||||
bool SetScissorRect();
|
||||
void SetScissorRect(const TargetRectangle& rc);
|
||||
void SetGenerationMode();
|
||||
void SetDepthMode();
|
||||
void SetLogicOpMode();
|
||||
|
Reference in New Issue
Block a user