[Bf-blender-cvs] [ff1cdddf704] experimental-build: Test fix for eevee textures
Dalai Felinto
noreply at git.blender.org
Thu Sep 21 19:37:23 CEST 2017
Commit: ff1cdddf704ae97b96e3e166203a8d6d1321b229
Author: Dalai Felinto
Date: Thu Sep 21 19:28:09 2017 +0200
Branches: experimental-build
https://developer.blender.org/rBff1cdddf704ae97b96e3e166203a8d6d1321b229
Test fix for eevee textures
===================================================================
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 bc8adf7556a..b4375c7031b 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;
}
}
@@ -1868,6 +1871,7 @@ static void bind_ubo(GPUUniformBuffer *ubo)
static void release_texture_slots(void)
{
+ RST.bind_tex_inc = 0;
memset(RST.bound_tex_slots, 0x0, sizeof(bool) * GPU_max_textures());
}
More information about the Bf-blender-cvs
mailing list