[Bf-blender-cvs] [8ffb7613873] blender2.8: GPUFramebuffer: Fix recursive downsample exiting early.

Clément Foucault noreply at git.blender.org
Tue Oct 17 03:06:14 CEST 2017


Commit: 8ffb76138731d6241a6ac5bfc17bb764cfa59053
Author: Clément Foucault
Date:   Tue Oct 17 03:06:04 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB8ffb76138731d6241a6ac5bfc17bb764cfa59053

GPUFramebuffer: Fix recursive downsample exiting early.

I should really proof read my commits a bit more.

===================================================================

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 1d157ecb14c..de5dff1b69c 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -576,23 +576,24 @@ void GPU_framebuffer_recursive_downsample(
 
 	for (i = 1; i < num_iter + 1; i++) {
 
+		/* calculate next viewport size */
+		current_dim[0] /= 2;
+		current_dim[1] /= 2;
+
 		if (GPU_type_matches(GPU_DEVICE_AMD_VEGA, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE)) {
 			/* NOTE : here 16 is because of a bug on AMD Vega GPU + non-pro drivers, that prevents us
 			 * from sampling mipmaps that are smaller or equal to 16px. (9) */
-			if (current_dim[0] / 2 > 16 && current_dim[1] / 2 > 16) {
+			if (current_dim[0] <= 16 && current_dim[1] <= 16) {
 				break;
 			}
 		}
 		else {
-			if (current_dim[0] / 2 > 1 && current_dim[1] / 2 > 1) {
+			if (current_dim[0] <= 2 && current_dim[1] <= 2) {
+				/* Cannot reduce further. */
 				break;
 			}
 		}
 
-		/* calculate next viewport size */
-		current_dim[0] /= 2;
-		current_dim[1] /= 2;
-
 		/* ensure that the viewport size is always at least 1x1 */
 		CLAMP_MIN(current_dim[0], 1);
 		CLAMP_MIN(current_dim[1], 1);



More information about the Bf-blender-cvs mailing list