mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
GFX: Possible fix for depth range
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4044 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -181,6 +181,8 @@ void HandleCgError(CGcontext ctx, CGerror err, void* appdata)
|
||||
// Init functions
|
||||
bool Renderer::Init()
|
||||
{
|
||||
xfregs.depthRangeConst[0] = 16777216.0f;
|
||||
xfregs.depthRangeConst[1] = 16777216.0f;
|
||||
bool bSuccess = true;
|
||||
s_blendMode = 0;
|
||||
s_MSAACoverageSamples = 0;
|
||||
@ -1446,14 +1448,11 @@ void UpdateViewport()
|
||||
int GLy = (int)ceil(Renderer::GetTargetHeight() - ((int)(xfregs.rawViewport[4] - xfregs.rawViewport[1] - 342 - scissorYOff)) * MValueY);
|
||||
int GLWidth = (int)ceil(abs((int)(2 * xfregs.rawViewport[0])) * MValueX);
|
||||
int GLHeight = (int)ceil(abs((int)(2 * xfregs.rawViewport[1])) * MValueY);
|
||||
double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2]) / xfregs.depthRangeConst[0];
|
||||
double GLFar = xfregs.rawViewport[5] / xfregs.depthRangeConst[1];
|
||||
|
||||
// Update the view port
|
||||
glViewport(GLx, GLy, GLWidth, GLHeight);
|
||||
|
||||
// GLDepthRange - this could be a source of trouble - see the viewport hacks.
|
||||
// TODO : Should this use 16777216.0f or 16777215.0f ?
|
||||
double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2]) / 16777215.0f;
|
||||
double GLFar = xfregs.rawViewport[5] / 16777215.0f;
|
||||
glDepthRange(GLNear, GLFar);
|
||||
|
||||
// -------------------------------------
|
||||
|
Reference in New Issue
Block a user