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:43:53 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-09-21 20:43:53 +0300
commitd97f52f0154923c3b2ba5f6095c35b1dad6aba0f (patch)
tree6eaf2d067ef64c694186c3830e57db85524438db /source/blender/draw/intern
parent803c757c2b64258890aa30d20187fd8daf83b5e4 (diff)
Revert "Fix T52855: Eevee: viewport artifacts"
This reverts commit 803c757c2b64258890aa30d20187fd8daf83b5e4.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/draw_manager.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index bc8adf7556a..94f42f1ec18 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -364,6 +364,8 @@ static struct DRWResourceState {
GPUTexture **bound_texs;
bool *bound_tex_slots;
+
+ int bind_tex_inc;
int bind_ubo_inc;
} RST = {NULL};
@@ -1837,10 +1839,11 @@ 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) {
- if (RST.bound_tex_slots[i] == false) {
- GPU_texture_bind(tex, i);
- RST.bound_texs[i] = tex;
- RST.bound_tex_slots[i] = true;
+ 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;
return;
}
}