[Bf-blender-cvs] [edc8a4c] master: Fix memory leak when using two bump maps on the same material

Antony Riakiotakis noreply at git.blender.org
Tue Mar 10 15:27:40 CET 2015


Commit: edc8a4c4847e3ea3a58683926c22b519d2af830c
Author: Antony Riakiotakis
Date:   Tue Mar 10 15:26:55 2015 +0100
Branches: master
https://developer.blender.org/rBedc8a4c4847e3ea3a58683926c22b519d2af830c

Fix memory leak when using two bump maps on the same material

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

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 f8499ca..c754f63 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -1234,7 +1234,6 @@ static void do_material_tex(GPUShadeInput *shi)
 						float imag_tspace_dimension_x = 1024.0f;		// only used for texture space variant
 						float aspect = 1.0f;
 						
-						GPUNodeLink *surf_pos = GPU_builtin(GPU_VIEW_POSITION);
 						GPUNodeLink *vR1, *vR2;
 						GPUNodeLink *dBs, *dBt, *fDet;
 
@@ -1291,7 +1290,8 @@ static void do_material_tex(GPUShadeInput *shi)
 						
 						// re-initialize if bump space changed
 						if ( iBumpSpacePrev != iBumpSpace ) {
-							
+							GPUNodeLink *surf_pos = GPU_builtin(GPU_VIEW_POSITION);
+
 							if ( mtex->texflag & MTEX_BUMP_OBJECTSPACE )
 								GPU_link(mat, "mtex_bump_init_objspace",
 								         surf_pos, vNorg,




More information about the Bf-blender-cvs mailing list