[Bf-blender-cvs] [73e1435ab1e] blender2.8: DRW: Fix regression

Clément Foucault noreply at git.blender.org
Thu Sep 21 19:54:56 CEST 2017


Commit: 73e1435ab1efc95262cd494fd535d4cfb723c5c8
Author: Clément Foucault
Date:   Thu Sep 21 19:54:43 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB73e1435ab1efc95262cd494fd535d4cfb723c5c8

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

===================================================================

M	source/blender/draw/intern/draw_manager.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list