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_material.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_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 31b499d54ab..fcf3425e9c6 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1953,10 +1953,15 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par) return lamp; } + /* we need to properly bind to test for completeness */ + GPU_texture_bind_as_framebuffer(lamp->blurtex); + if (!GPU_framebuffer_check_valid(lamp->blurfb, NULL)) { gpu_lamp_shadow_free(lamp); - return lamp; - } + return lamp; + } + + GPU_framebuffer_texture_unbind(lamp->blurfb, lamp->blurtex); } else { lamp->tex = GPU_texture_create_depth(lamp->size, lamp->size, NULL); |