diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-12-16 23:52:55 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-12-16 23:52:55 +0300 |
commit | 3e61478b1be7b11b11fbccc37d6d64c99f354717 (patch) | |
tree | e51253443b9c84a127e99bd31f42758325245e42 /source/blender/gpu/intern/gpu_extensions.c | |
parent | 1b2fc747925ff369719fdcf97c56a01d1f28b76a (diff) |
Fix T42917 shadow maps not working on ATIs.
This is yet another issue with framebuffers. There are two issues: We
need the framebuffer fully bound to check for completeness and when we
bind a depth texture as frame buffer we need to disable read/write.
Diffstat (limited to 'source/blender/gpu/intern/gpu_extensions.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index e38686938fb..05c40d65df5 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -969,10 +969,16 @@ void GPU_texture_bind_as_framebuffer(GPUTexture *tex) /* bind framebuffer */ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, tex->fb->object); - /* last bound prevails here, better allow explicit control here too */ - glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + tex->fb_attachment); - glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + tex->fb_attachment); - + if (tex->depth) { + glDrawBuffer(GL_NONE); + glReadBuffer(GL_NONE); + } + else { + /* last bound prevails here, better allow explicit control here too */ + glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + tex->fb_attachment); + glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + tex->fb_attachment); + } + /* push matrices and set default viewport and matrix */ glViewport(0, 0, tex->w, tex->h); GG.currentfb = tex->fb->object; |