diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-09-14 02:02:38 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-09-14 02:03:19 +0300 |
commit | 5ae63f03d926748028f52371383e6e239cd63ae7 (patch) | |
tree | ed6c0ec02bb2345a7c7de2866aa5585b3587d556 /source | |
parent | 3b080c3f66c05751f02af9a3f509c1a46b34ba20 (diff) |
DRW: Fix texture binding logic.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 1b372de8034..3072eb50429 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1835,21 +1835,19 @@ static void draw_geometry(DRWShadingGroup *shgroup, Gwn_Batch *geom, const float static void draw_bind_texture(GPUTexture *tex) { - int bind = GPU_texture_bound_number(tex); - if (bind == -1) { + if (RST.bound_texs[RST.bind_tex_inc] != tex) { if (RST.bind_tex_inc >= 0) { if (RST.bound_texs[RST.bind_tex_inc] != NULL) { GPU_texture_unbind(RST.bound_texs[RST.bind_tex_inc]); } RST.bound_texs[RST.bind_tex_inc] = tex; GPU_texture_bind(tex, RST.bind_tex_inc); - - RST.bind_tex_inc--; } else { printf("Not enough texture slots! Reduce number of textures used by your shader.\n"); } } + RST.bind_tex_inc--; } static void draw_bind_ubo(GPUUniformBuffer *ubo) |