mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 16:59:18 +01:00
rename UpdateViewport to SetViewport like all others setters in RenderBase.h
This commit is contained in:
parent
3cd6918dec
commit
5a660c27bc
@ -476,8 +476,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Called from VertexShaderManager
|
void Renderer::SetViewport()
|
||||||
void Renderer::UpdateViewport()
|
|
||||||
{
|
{
|
||||||
// reversed gxsetviewport(xorig, yorig, width, height, nearz, farz)
|
// reversed gxsetviewport(xorig, yorig, width, height, nearz, farz)
|
||||||
// [0] = width/2
|
// [0] = width/2
|
||||||
@ -1018,7 +1017,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
|
|||||||
RestoreAPIState();
|
RestoreAPIState();
|
||||||
D3D::BeginFrame();
|
D3D::BeginFrame();
|
||||||
D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), FramebufferManager::GetEFBDepthTexture()->GetDSV());
|
D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), FramebufferManager::GetEFBDepthTexture()->GetDSV());
|
||||||
UpdateViewport();
|
SetViewport();
|
||||||
|
|
||||||
Core::Callback_VideoCopiedToXFB(XFBWrited || (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB));
|
Core::Callback_VideoCopiedToXFB(XFBWrited || (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB));
|
||||||
XFBWrited = false;
|
XFBWrited = false;
|
||||||
@ -1038,7 +1037,7 @@ void Renderer::RestoreAPIState()
|
|||||||
D3D::stateman->PopBlendState();
|
D3D::stateman->PopBlendState();
|
||||||
D3D::stateman->PopDepthState();
|
D3D::stateman->PopDepthState();
|
||||||
D3D::stateman->PopRasterizerState();
|
D3D::stateman->PopRasterizerState();
|
||||||
UpdateViewport();
|
SetViewport();
|
||||||
BPFunctions::SetScissor();
|
BPFunctions::SetScissor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
void SetLineWidth();
|
void SetLineWidth();
|
||||||
void SetSamplerState(int stage,int texindex);
|
void SetSamplerState(int stage,int texindex);
|
||||||
void SetInterlacingMode();
|
void SetInterlacingMode();
|
||||||
|
void SetViewport();
|
||||||
|
|
||||||
// TODO: Fix confusing names (see ResetAPIState and RestoreAPIState)
|
// TODO: Fix confusing names (see ResetAPIState and RestoreAPIState)
|
||||||
void ApplyState(bool bUseDstAlpha);
|
void ApplyState(bool bUseDstAlpha);
|
||||||
@ -44,8 +45,6 @@ public:
|
|||||||
|
|
||||||
void ReinterpretPixelData(unsigned int convtype);
|
void ReinterpretPixelData(unsigned int convtype);
|
||||||
|
|
||||||
void UpdateViewport();
|
|
||||||
|
|
||||||
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
|
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
|
||||||
|
|
||||||
static bool CheckForResize();
|
static bool CheckForResize();
|
||||||
|
@ -1078,8 +1078,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called from VertexShaderManager
|
void Renderer::SetViewport()
|
||||||
void Renderer::UpdateViewport()
|
|
||||||
{
|
{
|
||||||
// reversed gxsetviewport(xorig, yorig, width, height, nearz, farz)
|
// reversed gxsetviewport(xorig, yorig, width, height, nearz, farz)
|
||||||
// [0] = width/2
|
// [0] = width/2
|
||||||
@ -1651,7 +1650,7 @@ void Renderer::RestoreAPIState()
|
|||||||
SetDepthMode();
|
SetDepthMode();
|
||||||
SetBlendMode(true);
|
SetBlendMode(true);
|
||||||
SetLogicOpMode();
|
SetLogicOpMode();
|
||||||
UpdateViewport();
|
SetViewport();
|
||||||
|
|
||||||
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
|
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, g_ActiveConfig.bWireFrame ? GL_LINE : GL_FILL);
|
glPolygonMode(GL_FRONT_AND_BACK, g_ActiveConfig.bWireFrame ? GL_LINE : GL_FILL);
|
||||||
|
@ -54,6 +54,7 @@ public:
|
|||||||
void SetLineWidth() override;
|
void SetLineWidth() override;
|
||||||
void SetSamplerState(int stage,int texindex) override;
|
void SetSamplerState(int stage,int texindex) override;
|
||||||
void SetInterlacingMode() override;
|
void SetInterlacingMode() override;
|
||||||
|
void SetViewport() override;
|
||||||
|
|
||||||
// TODO: Implement and use these
|
// TODO: Implement and use these
|
||||||
void ApplyState(bool bUseDstAlpha) override {}
|
void ApplyState(bool bUseDstAlpha) override {}
|
||||||
@ -76,8 +77,6 @@ public:
|
|||||||
|
|
||||||
void ReinterpretPixelData(unsigned int convtype) override;
|
void ReinterpretPixelData(unsigned int convtype) override;
|
||||||
|
|
||||||
void UpdateViewport() override;
|
|
||||||
|
|
||||||
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
|
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -509,8 +509,8 @@ void Renderer::RecordVideoMemory()
|
|||||||
FifoRecorder::GetInstance().SetVideoMemory(bpMem, cpMem, xfMem, xfRegs, sizeof(XFRegisters) / 4);
|
FifoRecorder::GetInstance().SetVideoMemory(bpMem, cpMem, xfMem, xfRegs, sizeof(XFRegisters) / 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateViewport()
|
void SetViewport()
|
||||||
{
|
{
|
||||||
if (xfregs.viewport.wd != 0 && xfregs.viewport.ht != 0)
|
if (xfregs.viewport.wd != 0 && xfregs.viewport.ht != 0)
|
||||||
g_renderer->UpdateViewport();
|
g_renderer->SetViewport();
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ public:
|
|||||||
virtual void SetLineWidth() = 0;
|
virtual void SetLineWidth() = 0;
|
||||||
virtual void SetSamplerState(int stage,int texindex) = 0;
|
virtual void SetSamplerState(int stage,int texindex) = 0;
|
||||||
virtual void SetInterlacingMode() = 0;
|
virtual void SetInterlacingMode() = 0;
|
||||||
|
virtual void SetViewport() = 0;
|
||||||
|
|
||||||
virtual void ApplyState(bool bUseDstAlpha) = 0;
|
virtual void ApplyState(bool bUseDstAlpha) = 0;
|
||||||
virtual void RestoreState() = 0;
|
virtual void RestoreState() = 0;
|
||||||
@ -107,8 +108,6 @@ public:
|
|||||||
// Finish up the current frame, print some stats
|
// Finish up the current frame, print some stats
|
||||||
virtual void Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& rc,float Gamma = 1.0f) = 0;
|
virtual void Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& rc,float Gamma = 1.0f) = 0;
|
||||||
|
|
||||||
virtual void UpdateViewport() = 0;
|
|
||||||
|
|
||||||
virtual bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc) = 0;
|
virtual bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc) = 0;
|
||||||
|
|
||||||
static unsigned int GetPrevPixelFormat() { return prev_efb_format; }
|
static unsigned int GetPrevPixelFormat() { return prev_efb_format; }
|
||||||
@ -160,4 +159,5 @@ private:
|
|||||||
|
|
||||||
extern Renderer *g_renderer;
|
extern Renderer *g_renderer;
|
||||||
|
|
||||||
void UpdateViewport();
|
extern void SetViewport();
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "XFMemory.h"
|
#include "XFMemory.h"
|
||||||
#include "VideoCommon.h"
|
#include "VideoCommon.h"
|
||||||
#include "VertexManagerBase.h"
|
#include "VertexManagerBase.h"
|
||||||
|
#include "RenderBase.h"
|
||||||
|
|
||||||
#include "RenderBase.h"
|
#include "RenderBase.h"
|
||||||
float GC_ALIGNED16(g_fProjectionMatrix[16]);
|
float GC_ALIGNED16(g_fProjectionMatrix[16]);
|
||||||
@ -173,8 +174,6 @@ static void ViewportCorrectionMatrix(Matrix44& result)
|
|||||||
result.data[4*1+3] = (-intendedHt + 2.f * (Y - intendedY)) / Ht + 1.f;
|
result.data[4*1+3] = (-intendedHt + 2.f * (Y - intendedY)) / Ht + 1.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateViewport();
|
|
||||||
|
|
||||||
void VertexShaderManager::Init()
|
void VertexShaderManager::Init()
|
||||||
{
|
{
|
||||||
Dirty();
|
Dirty();
|
||||||
@ -373,7 +372,7 @@ void VertexShaderManager::SetConstants()
|
|||||||
constants.depthparams[1] = xfregs.viewport.zRange / 16777216.0f;
|
constants.depthparams[1] = xfregs.viewport.zRange / 16777216.0f;
|
||||||
dirty = true;
|
dirty = true;
|
||||||
// This is so implementation-dependent that we can't have it here.
|
// This is so implementation-dependent that we can't have it here.
|
||||||
UpdateViewport();
|
SetViewport();
|
||||||
|
|
||||||
// Update projection if the viewport isn't 1:1 useable
|
// Update projection if the viewport isn't 1:1 useable
|
||||||
if(!g_ActiveConfig.backend_info.bSupportsOversizedViewports)
|
if(!g_ActiveConfig.backend_info.bSupportsOversizedViewports)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user