Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-11-25 18:16:50 +0300
committerAntony Riakiotakis <kalast@gmail.com>2014-11-25 18:16:50 +0300
commit9f64a86436838729edea3c1ab905158032d64b4c (patch)
tree5b8fdec6c2288b70c6a861cb240e06d72e83689a /source/blender/gpu/intern/gpu_material.c
parent435eaa79b26c1b72287dd78df3ae7a1d79db3d32 (diff)
Fix framebuffer completeness being broken after last framebuffer cleanup
commits. Basically, we don't set a draw buffer until draw time comes. Also add explicit validation function to validate after all textures have been attached (could be done automatically at bind time too probably, but left out for now)
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r--source/blender/gpu/intern/gpu_material.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index d6244b4255b..e4228bedf9d 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1868,6 +1868,11 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
return lamp;
}
+ if (!GPU_framebuffer_check_valid(lamp->fb, NULL)) {
+ gpu_lamp_shadow_free(lamp);
+ return lamp;
+ }
+
/* FBO and texture for blurring */
lamp->blurfb = GPU_framebuffer_create();
if (!lamp->blurfb) {
@@ -1885,6 +1890,11 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
gpu_lamp_shadow_free(lamp);
return lamp;
}
+
+ if (!GPU_framebuffer_check_valid(lamp->blurfb, NULL)) {
+ gpu_lamp_shadow_free(lamp);
+ return lamp;
+ }
}
else {
lamp->tex = GPU_texture_create_depth(lamp->size, lamp->size, NULL);
@@ -1897,6 +1907,11 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
gpu_lamp_shadow_free(lamp);
return lamp;
}
+
+ if (!GPU_framebuffer_check_valid(lamp->fb, NULL)) {
+ gpu_lamp_shadow_free(lamp);
+ return lamp;
+ }
}
GPU_framebuffer_restore();