diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-03 17:17:21 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-09-03 17:17:21 +0400 |
commit | 1f64aecb303a47ff1a441aa0149e46fa49217169 (patch) | |
tree | 10b908a8f46db4b079e8e8fe2dc8e98ad6c3d825 /source | |
parent | d6ec4b874b99f096ce2aa1c2864609bb2e4b58ad (diff) |
Fix for usage of un-initialized memory.
Checked by Brecht when were in Blender Institute.
Discovered when was looking into #32296: Node Texture - Node Material - GLSL Viewport rendering issue
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 81b80b83166..c831b92936f 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1396,10 +1396,10 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr) GPU_material_enable_alpha(mat); if ((mat->scene->gm.flag & GAME_GLSL_NO_LIGHTS) || (ma->mode & MA_SHLESS)) { - shr->combined = shi->rgb; - shr->alpha = shi->alpha; GPU_link(mat, "set_rgb", shi->rgb, &shr->diff); GPU_link(mat, "set_rgb_zero", &shr->spec); + GPU_link(mat, "set_value", shi->alpha, &shr->alpha); + shr->combined = shr->diff; } else { if (GPU_link_changed(shi->emit) || ma->emit != 0.0f) { @@ -1418,7 +1418,8 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr) material_lights(shi, shr); shr->combined = shr->diff; - shr->alpha = shi->alpha; + + GPU_link(mat, "set_value", shi->alpha, &shr->alpha); if (world) { /* exposure correction */ |