gl4: unbind the depth tex from the fbo before reading from it

fixes diagonal pixel line issue with AMD gpu
should help issue #16
This commit is contained in:
Raph 2019-09-15 18:30:44 +02:00
parent 24d663b40d
commit 732e685ea7
1 changed files with 6 additions and 0 deletions

View File

@ -611,6 +611,9 @@ void gl4DrawStrips(GLuint output_fbo, int width, int height)
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glcache.Disable(GL_DEPTH_TEST);
// Although the depth test is disabled and thus writes to the depth buffer are also disabled,
// AMD cards have serious issues when the depth/stencil texture is still bound to the framebuffer
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, depthTexId);
glActiveTexture(GL_TEXTURE0);
@ -626,6 +629,9 @@ void gl4DrawStrips(GLuint output_fbo, int width, int height)
if (settings.rend.ModifierVolumes)
DrawTranslucentModVols(previous_pass.mvo_tr_count, current_pass.mvo_tr_count - previous_pass.mvo_tr_count);
// Rebind the depth/stencil texture to the framebuffer
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, stencilTexId, 0);
if (render_pass < render_pass_count - 1)
{
//