diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-08-18 15:22:40 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-08-18 16:07:17 +0300 |
commit | 91ab64f38f354664f714fe2dab0a3a3bff2b7e9e (patch) | |
tree | 122e02c42c5f330325345beafa77ee84f85f3c18 /source | |
parent | 95b1b7756d6e09b0bcf98c120de2b6552c1848be (diff) |
GPU_texture : Add RG8 format.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 9 | ||||
-rw-r--r-- | source/blender/gpu/GPU_texture.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.c | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index b6a12cf84ff..889fb3ce810 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -397,16 +397,16 @@ static void drw_texture_get_format( case DRW_TEX_RGBA_16: *r_data_type = GPU_RGBA16F; break; case DRW_TEX_RGB_16: *r_data_type = GPU_RGB16F; break; case DRW_TEX_RGB_11_11_10: *r_data_type = GPU_R11F_G11F_B10F; break; + case DRW_TEX_RG_8: *r_data_type = GPU_RG8; break; case DRW_TEX_RG_16: *r_data_type = GPU_RG16F; break; 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_32: *r_data_type = GPU_R32F; break; #if 0 - case DRW_TEX_RGBA_32: *data_type = GPU_RGBA32F; break; - case DRW_TEX_RGB_8: *data_type = GPU_RGB8; break; - case DRW_TEX_RGB_32: *data_type = GPU_RGB32F; break; - case DRW_TEX_RG_8: *data_type = GPU_RG8; break; + case DRW_TEX_RGBA_32: *r_data_type = GPU_RGBA32F; break; + case DRW_TEX_RGB_8: *r_data_type = GPU_RGB8; break; + case DRW_TEX_RGB_32: *r_data_type = GPU_RGB32F; break; #endif case DRW_TEX_DEPTH_16: *r_data_type = GPU_DEPTH_COMPONENT16; break; case DRW_TEX_DEPTH_24: *r_data_type = GPU_DEPTH_COMPONENT24; break; @@ -2210,6 +2210,7 @@ static GPUTextureFormat convert_tex_format( switch (fbo_format) { case DRW_TEX_R_16: *r_channels = 1; return GPU_R16F; case DRW_TEX_R_32: *r_channels = 1; return GPU_R32F; + case DRW_TEX_RG_8: *r_channels = 2; return GPU_RG8; case DRW_TEX_RG_16: *r_channels = 2; return GPU_RG16F; case DRW_TEX_RG_32: *r_channels = 2; return GPU_RG32F; case DRW_TEX_RGBA_8: *r_channels = 4; return GPU_RGBA8; diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index 6d6c195c175..83872ccdf80 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -69,6 +69,7 @@ typedef enum GPUTextureFormat { GPU_RG16F, GPU_R32F, GPU_R16F, + GPU_RG8, GPU_R8, #if 0 GPU_RGBA32I, @@ -83,7 +84,6 @@ typedef enum GPUTextureFormat { GPU_RG16, GPU_RG16I, GPU_RG16UI, - GPU_RG8, GPU_RG8I, GPU_RG8UI, GPU_R32I, diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index d7d90a28a8c..959fc7e8794 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -167,6 +167,7 @@ static GLenum gpu_texture_get_format( break; case GPU_DEPTH_COMPONENT16: case GPU_R16F: + case GPU_RG8: *bytesize = 2; break; case GPU_R8: @@ -189,6 +190,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_RG8: return GL_RG8; case GPU_R8: return GL_R8; /* Special formats texture & renderbuffer */ case GPU_R11F_G11F_B10F: return GL_R11F_G11F_B10F; |