mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Discover that various games that have black screen problem in nvidia is just caused by having negative zfar or znear values, in ati is not a problem, the drivers can handle it.
This is a test, clamp the values to see if this fix the problem, please test a lot don't know if this breaks something else git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4491 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1347,6 +1347,11 @@ void UpdateViewport()
|
||||
double GLNear = (xfregs.rawViewport[5] - xfregs.rawViewport[2]) / 16777216.0f;
|
||||
double GLFar = xfregs.rawViewport[5] / 16777216.0f;
|
||||
|
||||
if (GLNear < 0.0f) GLNear = 0.0f;
|
||||
if (GLNear > 1.0f) GLNear = 1.0f;
|
||||
if (GLFar > 1.0f) GLFar = 1.0f;
|
||||
if (GLFar < 0.0f) GLFar = 0.0f;
|
||||
|
||||
// Update the view port
|
||||
glViewport(GLx, GLy, GLWidth, GLHeight);
|
||||
glDepthRange(GLNear, GLFar);
|
||||
|
Reference in New Issue
Block a user