[Bf-blender-cvs] [5ada6e75401] blender2.8: GPUTexture: Fix HDRI being clamped on OSX

Clément Foucault noreply at git.blender.org
Wed Sep 19 23:59:29 CEST 2018


Commit: 5ada6e754011beee80bf299510d169113fd8101f
Author: Clément Foucault
Date:   Wed Sep 19 23:59:00 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5ada6e754011beee80bf299510d169113fd8101f

GPUTexture: Fix HDRI being clamped on OSX

Seems like GLEW_ARB_texture_float is not defined in core profile on OSX
even if float textures are part of the 3.3 core spec.

So removing uneeded backup cases.

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

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 7b64161ddd2..3680a45d83f 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -473,13 +473,11 @@ void GPU_create_gl_tex(
 
 	if (textarget == GL_TEXTURE_2D) {
 		if (use_high_bit_depth) {
-			if (GLEW_ARB_texture_float)
-				glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect);
-			else
-				glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect);
+			glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect);
 		}
-		else
+		else {
 			glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, rectw, recth, 0, GL_RGBA, GL_UNSIGNED_BYTE, rect);
+		}
 
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
 
@@ -502,10 +500,7 @@ void GPU_create_gl_tex(
 				for (i = 1; i < ibuf->miptot; i++) {
 					ImBuf *mip = ibuf->mipmap[i - 1];
 					if (use_high_bit_depth) {
-						if (GLEW_ARB_texture_float)
-							glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA16F, mip->x, mip->y, 0, GL_RGBA, GL_FLOAT, mip->rect_float);
-						else
-							glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA16, mip->x, mip->y, 0, GL_RGBA, GL_FLOAT, mip->rect_float);
+						glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA16F, mip->x, mip->y, 0, GL_RGBA, GL_FLOAT, mip->rect_float);
 					}
 					else {
 						glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA8, mip->x, mip->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, mip->rect);
@@ -525,7 +520,7 @@ void GPU_create_gl_tex(
 
 		if (h == w && is_power_of_2_i(h) && !is_over_resolution_limit(textarget, h, w)) {
 			void **cube_map = gpu_gen_cube_map(rect, frect, rectw, recth, use_high_bit_depth);
-			GLenum informat = use_high_bit_depth ? (GLEW_ARB_texture_float ? GL_RGBA16F : GL_RGBA16) : GL_RGBA8;
+			GLenum informat = use_high_bit_depth ? GL_RGBA16F : GL_RGBA8;
 			GLenum type = use_high_bit_depth ? GL_FLOAT : GL_UNSIGNED_BYTE;
 
 			if (cube_map)



More information about the Bf-blender-cvs mailing list