[Bf-blender-cvs] [0a73000dfc1] blender2.8: GPUTexture: Add support for GPU_RG16.

Clément Foucault noreply at git.blender.org
Mon Apr 30 16:39:35 CEST 2018


Commit: 0a73000dfc1d5a7ca286f21a3c3021943b45bc60
Author: Clément Foucault
Date:   Mon Apr 30 16:15:01 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB0a73000dfc1d5a7ca286f21a3c3021943b45bc60

GPUTexture: Add support for GPU_RG16.

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

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/draw_manager_texture.c b/source/blender/draw/intern/draw_manager_texture.c
index 5b4bc765807..71d1ec0e840 100644
--- a/source/blender/draw/intern/draw_manager_texture.c
+++ b/source/blender/draw/intern/draw_manager_texture.c
@@ -38,6 +38,7 @@ static bool drw_texture_format_supports_framebuffer(GPUTextureFormat format)
 		case GPU_R32F:
 		case GPU_R32UI:
 		case GPU_RG8:
+		case GPU_RG16:
 		case GPU_RG16F:
 		case GPU_RG16I:
 		case GPU_RG32F:
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index f6fe4fe28e5..a64b0a0a862 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -68,6 +68,7 @@ typedef enum GPUTextureFormat {
 	GPU_RG32F,
 	GPU_RG16F,
 	GPU_RG16I,
+	GPU_RG16,
 	GPU_R32F,
 	GPU_R32UI,
 	GPU_R16F,
@@ -85,7 +86,6 @@ typedef enum GPUTextureFormat {
 	GPU_RGBA8UI,
 	GPU_RG32I,
 	GPU_RG32UI,
-	GPU_RG16,
 	GPU_RG16UI,
 	GPU_RG8I,
 	GPU_RG8UI,
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 3f2fc52b4d6..d55bc02c836 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -192,6 +192,7 @@ static GLenum gpu_texture_get_format(
 			break;
 		case GPU_RG16F:
 		case GPU_RG16I:
+		case GPU_RG16:
 		case GPU_DEPTH24_STENCIL8:
 		case GPU_DEPTH_COMPONENT32F:
 		case GPU_RGBA8:
@@ -227,6 +228,7 @@ static GLenum gpu_texture_get_format(
 		case GPU_RGB16F: return GL_RGB16F;
 		case GPU_RG16F: return GL_RG16F;
 		case GPU_RG16I: return GL_RG16I;
+		case GPU_RG16: return GL_RG16;
 		case GPU_RGBA8: return GL_RGBA8;
 		case GPU_R32F: return GL_R32F;
 		case GPU_R32UI: return GL_R32UI;
@@ -263,6 +265,7 @@ static int gpu_texture_get_component_count(GPUTextureFormat format)
 		case GPU_R11F_G11F_B10F:
 			return 3;
 		case GPU_RG8:
+		case GPU_RG16:
 		case GPU_RG16F:
 		case GPU_RG16I:
 		case GPU_RG32F:



More information about the Bf-blender-cvs mailing list