[Bf-blender-cvs] [f7f3b089774] blender2.8: GPUTexture: Unlock GL_R16I format.

Clément Foucault noreply at git.blender.org
Wed Mar 14 12:50:48 CET 2018


Commit: f7f3b08977490e5ed2da93e46a1fce90a0630cff
Author: Clément Foucault
Date:   Tue Mar 13 22:36:24 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBf7f3b08977490e5ed2da93e46a1fce90a0630cff

GPUTexture: Unlock GL_R16I format.

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

M	source/blender/draw/intern/DRW_render.h
M	source/blender/draw/intern/draw_manager_texture.c
M	source/blender/gpu/GPU_texture.h
M	source/blender/gpu/intern/gpu_texture.c

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

diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h
index 937e88051c2..33b89bb8024 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -182,6 +182,7 @@ typedef enum {
 	DRW_TEX_RG_32,
 	DRW_TEX_R_8,
 	DRW_TEX_R_16,
+	DRW_TEX_R_16I,
 	DRW_TEX_R_32,
 	DRW_TEX_DEPTH_16,
 	DRW_TEX_DEPTH_24,
diff --git a/source/blender/draw/intern/draw_manager_texture.c b/source/blender/draw/intern/draw_manager_texture.c
index bbef680e77a..e033a0c506e 100644
--- a/source/blender/draw/intern/draw_manager_texture.c
+++ b/source/blender/draw/intern/draw_manager_texture.c
@@ -35,6 +35,7 @@ void drw_texture_get_format(
 			/* Only add formats that are COMPATIBLE with FB.
 			 * Generally they are multiple of 16bit. */
 			case DRW_TEX_R_16:
+			case DRW_TEX_R_16I:
 			case DRW_TEX_R_32:
 			case DRW_TEX_RG_8:
 			case DRW_TEX_RG_16:
@@ -70,6 +71,7 @@ void drw_texture_get_format(
 		case DRW_TEX_RG_32: *r_data_type = GPU_RG32F; break;
 		case DRW_TEX_R_8: *r_data_type = GPU_R8; break;
 		case DRW_TEX_R_16: *r_data_type = GPU_R16F; break;
+		case DRW_TEX_R_16I: *r_data_type = GPU_R16I; break;
 		case DRW_TEX_R_32: *r_data_type = GPU_R32F; break;
 #if 0
 		case DRW_TEX_RGB_8: *r_data_type = GPU_RGB8; break;
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index 486af0a8a74..0fde0edcf2b 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -70,6 +70,7 @@ typedef enum GPUTextureFormat {
 	GPU_RG16I,
 	GPU_R32F,
 	GPU_R16F,
+	GPU_R16I,
 	GPU_RG8,
 	GPU_R8,
 #if 0
@@ -88,7 +89,6 @@ typedef enum GPUTextureFormat {
 	GPU_RG8UI,
 	GPU_R32I,
 	GPU_R32UI,
-	GPU_R16I,
 	GPU_R16UI,
 	GPU_R16,
 	GPU_R8I,
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 651cbda00e8..bd25dd03f13 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -136,7 +136,7 @@ static GLenum gpu_texture_get_format(
 		*is_stencil = false;
 
 		/* Integer formats */
-		if (ELEM(data_type, GPU_RG16I)) {
+		if (ELEM(data_type, GPU_RG16I, GPU_R16I)) {
 			*data_format = GL_INT;
 
 			switch (components) {
@@ -185,6 +185,7 @@ static GLenum gpu_texture_get_format(
 			break;
 		case GPU_DEPTH_COMPONENT16:
 		case GPU_R16F:
+		case GPU_R16I:
 		case GPU_RG8:
 			*bytesize = 2;
 			break;
@@ -209,6 +210,7 @@ static GLenum gpu_texture_get_format(
 		case GPU_RGBA8: return GL_RGBA8;
 		case GPU_R32F: return GL_R32F;
 		case GPU_R16F: return GL_R16F;
+		case GPU_R16I: return GL_R16I;
 		case GPU_RG8: return GL_RG8;
 		case GPU_R8: return GL_R8;
 		/* Special formats texture & renderbuffer */



More information about the Bf-blender-cvs mailing list