clamp OGL depth clear value, this might fix a problem some people reported with r6678
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6704 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
71209d99c8
commit
72738bf2e7
|
@ -864,6 +864,10 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE
|
||||||
(float)(color & 0xFF) / 255.0f,
|
(float)(color & 0xFF) / 255.0f,
|
||||||
(float)((color >> 24) & 0xFF) / 255.0f);
|
(float)((color >> 24) & 0xFF) / 255.0f);
|
||||||
float zval = -1.f + 2.f * (float)(z & 0xFFFFFF) / float(0xFFFFFF); // convert range [0;1] to [-1;1]
|
float zval = -1.f + 2.f * (float)(z & 0xFFFFFF) / float(0xFFFFFF); // convert range [0;1] to [-1;1]
|
||||||
|
if(zval > 1.0f)
|
||||||
|
zval = 1.0f;
|
||||||
|
if(zval < -1.0f)
|
||||||
|
zval = -1.0f;
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
glVertex3f(-1.f, -1.f, zval);
|
glVertex3f(-1.f, -1.f, zval);
|
||||||
glVertex3f(-1.f, 1.f, zval);
|
glVertex3f(-1.f, 1.f, zval);
|
||||||
|
|
Loading…
Reference in New Issue