diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-08-12 17:16:28 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-08-12 17:16:43 +0300 |
commit | 57f1475b182b34a2c06bd3992859b79166f9b18d (patch) | |
tree | fb3d9f52465da64a9ffea204c71ff2330f7b1ac5 /source/blender/gpu/intern | |
parent | b858b44f2e151a8ccf417a0207d039a07f449d29 (diff) |
GPU_framebuffer: Fix performance issue on intel.
This should fixes the error message that a stall occured because of busy mipmap.
This happened on the minmax buffer generation and introduced a random 0.2ms latency.
I'm not sure of what was happening though.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index 5a64b0ec781..5ab5a0bcaad 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -543,6 +543,7 @@ void GPU_framebuffer_blit(GPUFrameBuffer *fb_read, int read_slot, GPUFrameBuffer void GPU_framebuffer_recursive_downsample( GPUFrameBuffer *fb, GPUTexture *tex, int num_iter, void (*callback)(void *userData, int level), void *userData) { + int i; int current_dim[2] = {GPU_texture_width(tex), GPU_texture_height(tex)}; GLenum attachment; @@ -567,7 +568,7 @@ void GPU_framebuffer_recursive_downsample( glReadBuffer(GL_COLOR_ATTACHMENT0); } - for (int i=1; i < num_iter+1 && (current_dim[0] > 1 && current_dim[1] > 1); i++) { + for (i=1; i < num_iter+1 && (current_dim[0] > 4 && current_dim[1] > 4); i++) { /* calculate next viewport size */ current_dim[0] /= 2; @@ -595,7 +596,7 @@ void GPU_framebuffer_recursive_downsample( /* reset mipmap level range for the depth image */ GPU_texture_bind(tex, 0); glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_BASE_LEVEL, 0); - glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, num_iter); + glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, i); GPU_texture_unbind(tex); } |