[Bf-blender-cvs] [47b7f06d0e1] master: Fix error in high bit-depth image tile drawing

Campbell Barton noreply at git.blender.org
Wed Sep 6 08:04:13 CEST 2017


Commit: 47b7f06d0e13efba04290d4cfa8c28d2342eebf7
Author: Campbell Barton
Date:   Wed Sep 6 16:08:01 2017 +1000
Branches: master
https://developer.blender.org/rB47b7f06d0e13efba04290d4cfa8c28d2342eebf7

Fix error in high bit-depth image tile drawing

>From @1xundoredo in D2824

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

M	source/blender/gpu/intern/gpu_draw.c

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

diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 1583d16ca27..2d7fa760e49 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -682,10 +682,10 @@ int GPU_verify_image(
 				if (do_color_management) {
 					srgb_frect = MEM_mallocN(ibuf->x * ibuf->y * sizeof(float) * 4, "floar_buf_col_cor");
 					gpu_verify_high_bit_srgb_buffer(srgb_frect, ibuf);
-					frect = srgb_frect + texwinsy * ibuf->x + texwinsx;
+					frect = srgb_frect + (4 * (texwinsy * ibuf->x + texwinsx));
 				}
 				else {
-					frect = ibuf->rect_float + texwinsy * ibuf->x + texwinsx;
+					frect = ibuf->rect_float + (ibuf->channels * (texwinsy * ibuf->x + texwinsx));
 				}
 			}
 			else {



More information about the Bf-blender-cvs mailing list