Fix T46951: GLSL draw mode missing some textures.

This commit is contained in:
Brecht Van Lommel 2015-12-11 02:53:21 +01:00
parent c593855b29
commit dde4fc63ff
Notes: blender-bot 2023-02-14 08:22:57 +01:00
Referenced by issue #46951, GLSL mode error
Referenced by issue #46960, Blender crashes in editor preview mode, but not in rendering
1 changed files with 5 additions and 2 deletions

View File

@ -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);
}
}
}