Commit: 3cb42e59174e9b898ba5c9f9a70335f95cdda23d
Author: Clément Foucault
Date:   Mon Apr 9 12:09:51 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB3cb42e59174e9b898ba5c9f9a70335f95cdda23d

GPU Codegen: Fix assert caused by GC of failled shaders.

===================================================================

M       source/blender/gpu/intern/gpu_codegen.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_codegen.c 
b/source/blender/gpu/intern/gpu_codegen.c
index 7cd403d2721..b245c9a161f 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -2270,7 +2270,9 @@ void GPU_pass_release(GPUPass *pass)
 static void gpu_pass_free(GPUPass *pass)
 {
        BLI_assert(pass->refcount == 0);
-       GPU_shader_free(pass->shader);
+       if (pass->shader) {
+               GPU_shader_free(pass->shader);
+       }
        MEM_SAFE_FREE(pass->fragmentcode);
        MEM_SAFE_FREE(pass->geometrycode);
        MEM_SAFE_FREE(pass->vertexcode);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to