From dde4fc63ff7b3b359707c7da0dfb5a6156bd5ede Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 11 Dec 2015 02:53:21 +0100 Subject: Fix T46951: GLSL draw mode missing some textures. --- source/blender/gpu/intern/gpu_codegen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/gpu/intern/gpu_codegen.c') diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 800ed9399a9..1db44c5b3a9 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1000,18 +1000,21 @@ void GPU_pass_bind(GPUPass *pass, double time, int mipmap) GPU_shader_bind(shader); - /* now bind the textures */ + /* create the textures */ for (input = inputs->first; input; input = input->next) { if (input->ima) input->tex = GPU_texture_from_blender(input->ima, input->iuser, input->image_isdata, time, mipmap); else if (input->prv) input->tex = GPU_texture_from_preview(input->prv, mipmap); + } + /* bind the textures, in second loop so texture binding during + * create doesn't overwrite already bound textures */ + for (input = inputs->first; input; input = input->next) { if (input->tex && input->bindtex) { GPU_texture_bind(input->tex, input->texid); GPU_shader_uniform_texture(shader, input->shaderloc, input->tex); } - } } -- cgit v1.2.3