A simple z-buffer fix for the GL plugin, we were setting the nearz as negative nearz, which messed up the fzero stage in Melee at a certain point. Also redundent code moved about

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@685 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2008-09-25 10:38:37 +00:00
parent 3b346a7d47
commit 015e43340a
2 changed files with 13 additions and 16 deletions

View File

@ -305,20 +305,15 @@ void VertexLoader::ProcessFormat()
//_assert_( VertexManager::s_pCurBufferPointer == s_pBaseBufferPointer ); //_assert_( VertexManager::s_pCurBufferPointer == s_pBaseBufferPointer );
if (!m_AttrDirty) { if (!m_AttrDirty)
{
if (m_VtxDesc.Hex0 == VertexManager::GetVtxDesc().Hex0 && (m_VtxDesc.Hex1&1)==(VertexManager::GetVtxDesc().Hex1&1)) if (m_VtxDesc.Hex0 == VertexManager::GetVtxDesc().Hex0 && (m_VtxDesc.Hex1&1)==(VertexManager::GetVtxDesc().Hex1&1))
// same return; // same
return;
m_VtxDesc.Hex = VertexManager::GetVtxDesc().Hex;
} }
else { else
// set anyway
m_VtxDesc.Hex = VertexManager::GetVtxDesc().Hex;
m_AttrDirty = 0; m_AttrDirty = 0;
}
m_VtxDesc.Hex = VertexManager::GetVtxDesc().Hex;
DVSTARTPROFILE(); DVSTARTPROFILE();
// Reset pipeline // Reset pipeline
@ -1054,12 +1049,14 @@ void VertexManager::Flush()
nonpow2tex |= 1<<i; nonpow2tex |= 1<<i;
if( tentry->mode.wrap_s > 0 ) nonpow2tex |= 1<<(8+i); if( tentry->mode.wrap_s > 0 ) nonpow2tex |= 1<<(8+i);
if( tentry->mode.wrap_t > 0 ) nonpow2tex |= 1<<(16+i); if( tentry->mode.wrap_t > 0 ) nonpow2tex |= 1<<(16+i);
TextureMngr::EnableTexRECT(i);
} }
// if texture is power of two, set to ones (since don't need scaling) // if texture is power of two, set to ones (since don't need scaling)
else PixelShaderMngr::SetTexDims(i, tentry->w, tentry->h, 0, 0); else
{
if( tentry->isNonPow2 ) TextureMngr::EnableTexRECT(i); PixelShaderMngr::SetTexDims(i, tentry->w, tentry->h, 0, 0);
else TextureMngr::EnableTex2D(i); TextureMngr::EnableTex2D(i);
}
if( g_Config.iLog & CONF_PRIMLOG ) { if( g_Config.iLog & CONF_PRIMLOG ) {
// save the textures // save the textures

View File

@ -324,7 +324,7 @@ void VertexShaderMngr::SetConstants(VERTEXSHADER& vs)
INFO_LOG("view: topleft=(%f,%f), wh=(%f,%f), z=(%f,%f)\n",rawViewport[3]-rawViewport[0]-342,rawViewport[4]+rawViewport[1]-342, INFO_LOG("view: topleft=(%f,%f), wh=(%f,%f), z=(%f,%f)\n",rawViewport[3]-rawViewport[0]-342,rawViewport[4]+rawViewport[1]-342,
2 * rawViewport[0], 2 * rawViewport[1], (rawViewport[5]-rawViewport[2])/16777215.0f, rawViewport[5]/16777215.0f); 2 * rawViewport[0], 2 * rawViewport[1], (rawViewport[5]-rawViewport[2])/16777215.0f, rawViewport[5]/16777215.0f);
glViewport((int)(rawViewport[3]-rawViewport[0]-342) * MValueX,Renderer::GetTargetHeight()-((int)(rawViewport[4]-rawViewport[1]-342)) * MValueY, abs((int)(2 * rawViewport[0])) * MValueX, abs((int)(2 * rawViewport[1])) * MValueY); glViewport((int)(rawViewport[3]-rawViewport[0]-342) * MValueX,Renderer::GetTargetHeight()-((int)(rawViewport[4]-rawViewport[1]-342)) * MValueY, abs((int)(2 * rawViewport[0])) * MValueX, abs((int)(2 * rawViewport[1])) * MValueY);
glDepthRange((rawViewport[5]-rawViewport[2])/16777215.0f, rawViewport[5]/16777215.0f); glDepthRange((rawViewport[5]-rawViewport[2])/-16777215.0f, rawViewport[5]/16777215.0f);
} }
if (bProjectionChanged) { if (bProjectionChanged) {