From 6798a4763e9c879a3e2ace6da26527e533c66aa4 Mon Sep 17 00:00:00 2001 From: degasus Date: Sun, 13 Oct 2013 15:41:11 +0200 Subject: [PATCH] VideoCommon: revert the ViewPort changes xfregs isn't written when calling this function, so we have to use such an invalid flag :-( --- Source/Core/VideoCommon/Src/PixelShaderManager.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp index c773e734d6..5f793b5a44 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp @@ -12,6 +12,7 @@ #include "RenderBase.h" static bool s_bFogRangeAdjustChanged; +static bool s_bViewPortChanged; static int nLightsChanged[2]; // min,max PixelShaderConstants PixelShaderManager::constants; @@ -26,6 +27,7 @@ void PixelShaderManager::Init() void PixelShaderManager::Dirty() { s_bFogRangeAdjustChanged = true; + s_bViewPortChanged = true; nLightsChanged[0] = 0; nLightsChanged[1] = 0x80; SetColorChanged(0, 0); @@ -133,6 +135,13 @@ void PixelShaderManager::SetConstants(u32 components) nLightsChanged[0] = nLightsChanged[1] = -1; } } + + if(s_bViewPortChanged) + { + constants.zbias[1][0] = xfregs.viewport.farZ / 16777216.0f; + constants.zbias[1][1] = xfregs.viewport.zRange / 16777216.0f; + dirty = true; + } } // This one is high in profiles (0.5%). @@ -183,10 +192,7 @@ void PixelShaderManager::SetZTextureBias() void PixelShaderManager::SetViewportChanged() { - constants.zbias[1][0] = xfregs.viewport.farZ / 16777216.0f; - constants.zbias[1][1] = xfregs.viewport.zRange / 16777216.0f; - dirty = true; - + s_bViewPortChanged = true; s_bFogRangeAdjustChanged = true; // TODO: Shouldn't be necessary with an accurate fog range adjust implementation }