diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-09-21 18:40:08 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-09-21 18:41:39 +0300 |
commit | 803c757c2b64258890aa30d20187fd8daf83b5e4 (patch) | |
tree | 903fafb4e7914fa7bcc414f2355b8dd99f95d6ba /source/blender/draw/intern | |
parent | a99c64b12fbea69ba950be83fa9dd710e390719c (diff) |
Fix T52855: Eevee: viewport artifacts
Partial revert of 9068c0743e08.
This commit tried to do two things:
(1) Fix UBO binding logic [good]
(2) "Improve" texture binding logic [bad]
Don't ever mix different fixes and refactors in the same commit.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 94f42f1ec18..bc8adf7556a 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -364,8 +364,6 @@ static struct DRWResourceState { GPUTexture **bound_texs; bool *bound_tex_slots; - - int bind_tex_inc; int bind_ubo_inc; } RST = {NULL}; @@ -1839,11 +1837,10 @@ static void bind_texture(GPUTexture *tex) int bind_num = GPU_texture_bound_number(tex); if (bind_num == -1) { 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) { - 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; + if (RST.bound_tex_slots[i] == false) { + GPU_texture_bind(tex, i); + RST.bound_texs[i] = tex; + RST.bound_tex_slots[i] = true; return; } } |