[Bf-blender-cvs] [b1bc3dfb890] temp-eeveelightcache: GPUTexture: Support GL_R11FG11FB10F textures w/ GPU_DATA_FLOAT data

Clément Foucault noreply at git.blender.org
Thu Jul 5 00:17:46 CEST 2018


Commit: b1bc3dfb89056c5180a30d77492bbd6597d7f1ea
Author: Clément Foucault
Date:   Wed Jul 4 18:42:23 2018 +0200
Branches: temp-eeveelightcache
https://developer.blender.org/rBb1bc3dfb89056c5180a30d77492bbd6597d7f1ea

GPUTexture: Support GL_R11FG11FB10F textures w/ GPU_DATA_FLOAT data

This was needed for matcaps.

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

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

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

diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c
index 468a961627e..255afeb5af3 100644
--- a/source/blender/blenkernel/intern/studiolight.c
+++ b/source/blender/blenkernel/intern/studiolight.c
@@ -239,8 +239,8 @@ static void studiolight_create_equirectangular_radiance_gputexture(StudioLight *
 				offset3 += 3;
 				offset4 += 4;
 			}
-			sl->equirectangular_radiance_gputexture = GPU_texture_create_2D(
-			        ibuf->x, ibuf->y, GPU_R11F_G11F_B10F, sl->gpu_matcap_3components, error);
+			sl->equirectangular_radiance_gputexture = GPU_texture_create_nD(
+			        ibuf->x, ibuf->y, 0, 2, sl->gpu_matcap_3components, GPU_R11F_G11F_B10F, GPU_DATA_FLOAT, 0, false, error);
 		}
 		else {
 			sl->equirectangular_radiance_gputexture = GPU_texture_create_2D(
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 3740d382562..2df6ed7ca5b 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -185,7 +185,7 @@ static void gpu_validate_data_format(GPUTextureFormat tex_format, GPUDataFormat
 		}
 		/* Special case */
 		else if (ELEM(tex_format, GPU_R11F_G11F_B10F)) {
-			BLI_assert(ELEM(data_format, GPU_DATA_10_11_11_REV));
+			BLI_assert(ELEM(data_format, GPU_DATA_10_11_11_REV, GPU_DATA_FLOAT));
 		}
 		/* Float formats */
 		else {



More information about the Bf-blender-cvs mailing list