[Bf-blender-cvs] [40e69ad6df5] blender2.8: GPUTexture: Fix Cubemap upload

Clément Foucault noreply at git.blender.org
Tue Apr 18 13:28:02 CEST 2017


Commit: 40e69ad6df585dba8ee4b979919b0898de83b642
Author: Clément Foucault
Date:   Tue Apr 18 11:21:58 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB40e69ad6df585dba8ee4b979919b0898de83b642

GPUTexture: Fix Cubemap upload

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

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

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

diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 525a2b3d5dc..dae3c406259 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -587,12 +587,12 @@ GPUTexture *GPU_texture_create_cube_custom(int w, int channels, GPUTextureFormat
 	const float *fpixels_px, *fpixels_py, *fpixels_pz, *fpixels_nx, *fpixels_ny, *fpixels_nz;
 
 	if (fpixels) {
-		fpixels_px = fpixels + 0 * w * w;
-		fpixels_py = fpixels + 1 * w * w;
-		fpixels_pz = fpixels + 2 * w * w;
-		fpixels_nx = fpixels + 3 * w * w;
-		fpixels_ny = fpixels + 4 * w * w;
-		fpixels_nz = fpixels + 5 * w * w;
+		fpixels_px = fpixels + 0 * w * w * channels;
+		fpixels_nx = fpixels + 1 * w * w * channels;
+		fpixels_py = fpixels + 2 * w * w * channels;
+		fpixels_ny = fpixels + 3 * w * w * channels;
+		fpixels_pz = fpixels + 4 * w * w * channels;
+		fpixels_nz = fpixels + 5 * w * w * channels;
 	}
 	else {
 		fpixels_px = fpixels_py = fpixels_pz = fpixels_nx = fpixels_ny = fpixels_nz = NULL;




More information about the Bf-blender-cvs mailing list