From 1f64aecb303a47ff1a441aa0149e46fa49217169 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 3 Sep 2012 13:17:21 +0000 Subject: 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 --- source/blender/gpu/intern/gpu_material.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/gpu') 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 */ -- cgit v1.2.3