diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-02-11 17:18:55 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-02-11 17:19:04 +0300 |
commit | 804e90b42d728ecb1073af8d0bae15a91b13a469 (patch) | |
tree | 309de25d99c92286b10c9d27e547fd43a69299c1 /source/blender/gpu/intern/gpu_texture.c | |
parent | 58cdab8b9759dd59b55895f2f76b9624addbb324 (diff) |
DRW: Color Management improvement
Reviewed By: brecht sergey jbakker
Differential Revision: http://developer.blender.org/D6729
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index 84328b8dfd4..ccafc785526 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -51,7 +51,7 @@ static struct GPUTextureGlobal { } GG = {NULL, NULL, NULL}; /* Maximum number of FBOs a texture can be attached to. */ -#define GPU_TEX_MAX_FBO_ATTACHED 10 +#define GPU_TEX_MAX_FBO_ATTACHED 12 typedef enum eGPUTextureFormatFlag { GPU_FORMAT_DEPTH = (1 << 0), @@ -183,6 +183,7 @@ static int gpu_get_component_count(eGPUTextureFormat format) case GPU_RGBA16F: case GPU_RGBA16: case GPU_RGBA32F: + case GPU_SRGB8_A8: return 4; case GPU_RGB16F: case GPU_R11F_G11F_B10F: @@ -221,7 +222,7 @@ static void gpu_validate_data_format(eGPUTextureFormat tex_format, eGPUDataForma } } /* Byte formats */ - else if (ELEM(tex_format, GPU_R8, GPU_RG8, GPU_RGBA8, GPU_RGBA8UI)) { + else if (ELEM(tex_format, GPU_R8, GPU_RG8, GPU_RGBA8, GPU_RGBA8UI, GPU_SRGB8_A8)) { BLI_assert(ELEM(data_format, GPU_DATA_UNSIGNED_BYTE, GPU_DATA_FLOAT)); } /* Special case */ @@ -349,6 +350,7 @@ static uint gpu_get_bytesize(eGPUTextureFormat data_type) case GPU_DEPTH_COMPONENT32F: case GPU_RGBA8UI: case GPU_RGBA8: + case GPU_SRGB8_A8: case GPU_R11F_G11F_B10F: case GPU_R32F: case GPU_R32UI: @@ -398,6 +400,8 @@ static GLenum gpu_get_gl_internalformat(eGPUTextureFormat format) return GL_RGBA8; case GPU_RGBA8UI: return GL_RGBA8UI; + case GPU_SRGB8_A8: + return GL_SRGB8_ALPHA8; case GPU_R32F: return GL_R32F; case GPU_R32UI: |