Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-09-21 20:54:43 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-09-21 20:54:43 +0300
commit73e1435ab1efc95262cd494fd535d4cfb723c5c8 (patch)
treea7dc21da99ace7ac989d41c26d1318dc13ce2bcb /source/blender/draw/intern
parentd97f52f0154923c3b2ba5f6095c35b1dad6aba0f (diff)
DRW: Fix regression
Textures were bound once. But since it was not unbound it's bind_num would not change and considered still bound next time a shader needed it. Fix T52866 Fix T52855
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/draw_manager.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 94f42f1ec18..1f3be9b1f4d 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1841,6 +1841,9 @@ static void bind_texture(GPUTexture *tex)
for (int i = 0; i < GPU_max_textures(); ++i) {
RST.bind_tex_inc = (RST.bind_tex_inc + 1) % GPU_max_textures();
if (RST.bound_tex_slots[RST.bind_tex_inc] == false) {
+ if (RST.bound_texs[RST.bind_tex_inc] != NULL) {
+ GPU_texture_unbind(RST.bound_texs[RST.bind_tex_inc]);
+ }
GPU_texture_bind(tex, RST.bind_tex_inc);
RST.bound_texs[RST.bind_tex_inc] = tex;
RST.bound_tex_slots[RST.bind_tex_inc] = true;