Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
VideoCommon: revert the ViewPort changes
xfregs isn't written when calling this function, so we have to use such an invalid flag :-(
  • Loading branch information
degasus committed Oct 13, 2013
1 parent 4dc1881 commit 6798a47
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Source/Core/VideoCommon/Src/PixelShaderManager.cpp
Expand Up @@ -12,6 +12,7 @@

#include "RenderBase.h"
static bool s_bFogRangeAdjustChanged;
static bool s_bViewPortChanged;
static int nLightsChanged[2]; // min,max

PixelShaderConstants PixelShaderManager::constants;
Expand All @@ -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);
Expand Down Expand Up @@ -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%).
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 6798a47

Please sign in to comment.