[Bf-blender-cvs] [306603ae76e] blender2.8: GPUTexture: Add support for 32bit textures.
Clément Foucault
noreply at git.blender.org
Wed May 10 01:12:04 CEST 2017
Commit: 306603ae76eddf51a6b534101636993a01e21591
Author: Clément Foucault
Date: Tue May 9 21:49:30 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB306603ae76eddf51a6b534101636993a01e21591
GPUTexture: Add support for 32bit textures.
===================================================================
M source/blender/draw/intern/draw_manager.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.c b/source/blender/draw/intern/draw_manager.c
index 826331d9371..1caf1abfd01 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1671,6 +1671,7 @@ static GPUTextureFormat convert_tex_format(int fbo_format, int *channels, bool *
case DRW_BUF_RG_16: *channels = 2; return GPU_RG16F;
case DRW_BUF_RGBA_8: *channels = 4; return GPU_RGBA8;
case DRW_BUF_RGBA_16: *channels = 4; return GPU_RGBA16F;
+ case DRW_BUF_RGBA_32: *channels = 4; return GPU_RGBA32F;
case DRW_BUF_DEPTH_24: *channels = 1; return GPU_DEPTH_COMPONENT24;
default:
BLI_assert(false);
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index 3cd64eb5255..8cf9806ae36 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -62,6 +62,7 @@ typedef struct GPUTexture GPUTexture;
* specification. */
typedef enum GPUTextureFormat {
/* Formats texture & renderbuffer */
+ GPU_RGBA32F,
GPU_RGBA16F,
GPU_RGBA8,
GPU_RG32F,
@@ -69,7 +70,6 @@ typedef enum GPUTextureFormat {
GPU_R16F,
GPU_R8,
#if 0
- GPU_RGBA32F,
GPU_RGBA32I,
GPU_RGBA32UI,
GPU_RGBA16,
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 6e7fec1942b..3bda41eaff6 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -143,6 +143,9 @@ static GLenum gpu_texture_get_format(
}
switch (data_type) {
+ case GPU_RGBA32F:
+ *bytesize = 32;
+ break;
case GPU_RG32F:
case GPU_RGBA16F:
*bytesize = 16;
@@ -175,6 +178,7 @@ static GLenum gpu_texture_get_format(
* For available types see GPU_texture.h */
switch (data_type) {
/* Formats texture & renderbuffer */
+ case GPU_RGBA32F: return GL_RGBA32F;
case GPU_RGBA16F: return GL_RGBA16F;
case GPU_RG32F: return GL_RG32F;
case GPU_RGB16F: return GL_RGB16F;
More information about the Bf-blender-cvs
mailing list