[Bf-blender-cvs] [9ff81955352] blender2.8: OpenGL: Remove remaining instances of GL_RGBA16F_ARB.

Clément Foucault noreply at git.blender.org
Tue Apr 24 12:48:49 CEST 2018


Commit: 9ff819553520198468bf67b4920b50dc5b047bb6
Author: Clément Foucault
Date:   Tue Apr 24 11:10:30 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9ff819553520198468bf67b4920b50dc5b047bb6

OpenGL: Remove remaining instances of GL_RGBA16F_ARB.

There is no need for it now that we use opengl 3.3. Use GL_RGBA16F instead.

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

M	intern/cycles/device/device.cpp
M	intern/cycles/device/device_cuda.cpp
M	intern/opencolorio/ocio_impl_glsl.cc
M	source/blender/editors/screen/glutil.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/gpu/intern/gpu_draw.c

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

diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp
index aa2a10a3dd9..906c01c619d 100644
--- a/intern/cycles/device/device.cpp
+++ b/intern/cycles/device/device.cpp
@@ -248,7 +248,7 @@ void Device::draw_pixels(
 	if(rgba.data_type == TYPE_HALF) {
 		GLhalf *data_pointer = (GLhalf*)rgba.host_pointer;
 		data_pointer += 4 * y * w;
-		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, w, h, 0, GL_RGBA, GL_HALF_FLOAT, data_pointer);
+		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, w, h, 0, GL_RGBA, GL_HALF_FLOAT, data_pointer);
 	}
 	else {
 		uint8_t *data_pointer = (uint8_t*)rgba.host_pointer;
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 54d4c731ed4..66c3f526ae7 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -1893,7 +1893,7 @@ public:
 		glGenTextures(1, &pmem.cuTexId);
 		glBindTexture(GL_TEXTURE_2D, pmem.cuTexId);
 		if(mem.data_type == TYPE_HALF)
-			glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, pmem.w, pmem.h, 0, GL_RGBA, GL_HALF_FLOAT, NULL);
+			glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, pmem.w, pmem.h, 0, GL_RGBA, GL_HALF_FLOAT, NULL);
 		else
 			glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, pmem.w, pmem.h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 08f3c15eb95..e20d507b470 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -218,7 +218,7 @@ static bool ensureCurveMappingAllocated(OCIO_GLSLDrawState *state, OCIO_CurveMap
 	/* clean glError buffer */
 	while (glGetError() != GL_NO_ERROR) {}
 
-	glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16F_ARB, curve_mapping_settings->lut_size,
+	glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16F, curve_mapping_settings->lut_size,
 	             0, GL_RGBA, GL_FLOAT, curve_mapping_settings->lut);
 
 	state->curve_mapping_texture_allocated = true;
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index cd875c73eda..39178af9e4e 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -228,15 +228,7 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state,
 
 	if (type == GL_FLOAT) {
 		/* need to set internal format to higher range float */
-
-		/* NOTE: this could fail on some drivers, like mesa,
-		 *       but currently this code is only used by color
-		 *       management stuff which already checks on whether
-		 *       it's possible to use GL_RGBA16F_ARB
-		 */
-
-		/* TODO viewport : remove extension */
-		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, tex_w, tex_h, 0, format, GL_FLOAT, NULL);
+		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, tex_w, tex_h, 0, format, GL_FLOAT, NULL);
 	}
 	else {
 		/* switch to 8bit RGBA for byte buffer */
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 6f88a3481b5..804d7d97eb0 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1316,7 +1316,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
 	if (type == GL_FLOAT)
-		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, ibuf->x, ibuf->y, 0, format, type, display_buffer);
+		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, ibuf->x, ibuf->y, 0, format, type, display_buffer);
 	else
 		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ibuf->x, ibuf->y, 0, format, type, display_buffer);
 
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 6b768d4bdd6..8b23cf6f936 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -480,7 +480,7 @@ 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_ARB, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect);
+				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);
 		}
@@ -509,7 +509,7 @@ void GPU_create_gl_tex(
 					ImBuf *mip = ibuf->mipmap[i - 1];
 					if (use_high_bit_depth) {
 						if (GLEW_ARB_texture_float)
-							glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA16F_ARB, 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_RGBA16, mip->x, mip->y, 0, GL_RGBA, GL_FLOAT, mip->rect_float);
 					}
@@ -531,7 +531,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_ARB : GL_RGBA16) : GL_RGBA8;
+			GLenum informat = use_high_bit_depth ? (GLEW_ARB_texture_float ? GL_RGBA16F : GL_RGBA16) : 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