diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-10 17:59:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-10 17:59:17 +0300 |
commit | d240206c8853aa4a18f0e05087e3166e491cdf9c (patch) | |
tree | 0c4ed6e222fbe2b6543cde3cd3396b338a2c5547 /source | |
parent | 1817a045b47985e9edb3ccdbbfc5ea9f79c8d363 (diff) |
fix for crash with GLSL material when image couldn't be loaded.
also quiet pep8 warnings.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index d1424dcabcd..310e2ec722c 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1130,8 +1130,10 @@ static void do_material_tex(GPUShadeInput *shi) if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) { float ima_x= 512.0f, ima_y= 512.f; // prevent calling textureSize, glsl 1.3 only ImBuf *ibuf= BKE_image_get_ibuf(tex->ima, &tex->iuser); - if(ibuf) - ima_x= ibuf->x; ima_y= ibuf->y; + if(ibuf) { + ima_x= ibuf->x; + ima_y= ibuf->y; + } GPU_link( mat, "mtex_bump_apply_texspace", fDet, dBs, dBt, vR1, vR2, |