From bfde41895f52402874359e70c495ca79c8c501c6 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 27 May 2012 08:03:26 +0200 Subject: [PATCH] Update the viewport when the scissor offset is changed Fixes a bug with Another Code: R that was noticed when gx-optimization was merged. --- Source/Core/VideoCommon/Src/BPFunctions.cpp | 2 ++ Source/Core/VideoCommon/Src/VertexShaderManager.cpp | 5 +++++ Source/Core/VideoCommon/Src/VertexShaderManager.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/Source/Core/VideoCommon/Src/BPFunctions.cpp b/Source/Core/VideoCommon/Src/BPFunctions.cpp index dc0d0723a6..cddeae3000 100644 --- a/Source/Core/VideoCommon/Src/BPFunctions.cpp +++ b/Source/Core/VideoCommon/Src/BPFunctions.cpp @@ -62,6 +62,8 @@ void SetScissor() TargetRectangle trc = g_renderer->ConvertEFBRectangle(rc); g_renderer->SetScissorRect(trc); + + UpdateViewportWithCorrection(); } void SetLineWidth() diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 6c5f59fc48..6ad877318f 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -51,6 +51,11 @@ static float s_fViewRotation[2]; void UpdateViewport(Matrix44& vpCorrection); +void UpdateViewportWithCorrection() +{ + UpdateViewport(s_viewportCorrection); +} + inline void SetVSConstant4f(unsigned int const_number, float f1, float f2, float f3, float f4) { g_renderer->SetVSConstant4f(const_number, f1, f2, f3, f4); diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.h b/Source/Core/VideoCommon/Src/VertexShaderManager.h index 1252304389..86f77ee3da 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.h +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.h @@ -33,6 +33,8 @@ struct ProjectionHack void UpdateProjectionHack(int iParams[], std::string sParams[]); +void UpdateViewportWithCorrection(); + // The non-API dependent parts. class VertexShaderManager {