[Bf-blender-cvs] [57f1475b182] blender2.8: GPU_framebuffer: Fix performance issue on intel.
Clément Foucault
noreply at git.blender.org
Sat Aug 12 16:02:01 CEST 2017
Commit: 57f1475b182b34a2c06bd3992859b79166f9b18d
Author: Clément Foucault
Date: Sat Aug 12 16:16:28 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB57f1475b182b34a2c06bd3992859b79166f9b18d
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.
===================================================================
M source/blender/gpu/intern/gpu_framebuffer.c
===================================================================
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);
}
More information about the Bf-blender-cvs
mailing list