[Bf-blender-cvs] [cc3c15fbddc] blender-v3.2-release: GPU: Fix crash deferred shader compilation.

Jeroen Bakker noreply at git.blender.org
Mon May 9 09:58:36 CEST 2022


Commit: cc3c15fbddc78bb5377571125cccf57ba7ec3b9a
Author: Jeroen Bakker
Date:   Mon May 9 09:54:26 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rBcc3c15fbddc78bb5377571125cccf57ba7ec3b9a

GPU: Fix crash deferred shader compilation.

On certain systems when eevee is used in a 3d viewport could crash. It
happened more often on slower systems or systems with slower glsl compilers.

For example an Intel Mac Mini. The cause was that even if a GPUMaterial
was in used it could be freed.

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

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

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

diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index e8fb5fb2c45..7ec6ee5183a 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -168,6 +168,7 @@ static void gpu_material_free_single(GPUMaterial *material)
   if (material->sss_tex_profile != NULL) {
     GPU_texture_free(material->sss_tex_profile);
   }
+  MEM_freeN(material);
 }
 
 void GPU_material_free(ListBase *gpumaterial)
@@ -176,7 +177,6 @@ void GPU_material_free(ListBase *gpumaterial)
     GPUMaterial *material = link->data;
     DRW_deferred_shader_remove(material);
     gpu_material_free_single(material);
-    MEM_freeN(material);
   }
   BLI_freelistN(gpumaterial);
 }



More information about the Bf-blender-cvs mailing list