Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-10-11 16:08:57 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-10-12 17:38:55 +0300
commit9b692ecabd3ddf675b4c6e09999415138df598d4 (patch)
tree32450200054fbd5a7144e5661b4cddeedede4b26 /source/blender/gpu/intern/gpu_texture.c
parentf2e6f8bb8d5c6aae07e9845c15eba099a7edadfd (diff)
GPUTexture: Add support for GPU_RGBA8UI
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.c')
-rw-r--r--source/blender/gpu/intern/gpu_texture.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index abb632ce718..6a8e686afb3 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -138,6 +138,7 @@ static int gpu_get_component_count(GPUTextureFormat format)
{
switch (format) {
case GPU_RGBA8:
+ case GPU_RGBA8UI:
case GPU_RGBA16F:
case GPU_RGBA16:
case GPU_RGBA32F:
@@ -183,7 +184,7 @@ static void gpu_validate_data_format(GPUTextureFormat tex_format, GPUDataFormat
}
}
/* Byte formats */
- else if (ELEM(tex_format, GPU_R8, GPU_RG8, GPU_RGBA8)) {
+ else if (ELEM(tex_format, GPU_R8, GPU_RG8, GPU_RGBA8, GPU_RGBA8UI)) {
BLI_assert(ELEM(data_format, GPU_DATA_UNSIGNED_BYTE, GPU_DATA_FLOAT));
}
/* Special case */
@@ -298,6 +299,7 @@ static uint gpu_get_bytesize(GPUTextureFormat data_type)
case GPU_RG16:
case GPU_DEPTH24_STENCIL8:
case GPU_DEPTH_COMPONENT32F:
+ case GPU_RGBA8UI:
case GPU_RGBA8:
case GPU_R11F_G11F_B10F:
case GPU_R32F:
@@ -335,6 +337,7 @@ static GLenum gpu_get_gl_internalformat(GPUTextureFormat format)
case GPU_RG16I: return GL_RG16I;
case GPU_RG16: return GL_RG16;
case GPU_RGBA8: return GL_RGBA8;
+ case GPU_RGBA8UI: return GL_RGBA8UI;
case GPU_R32F: return GL_R32F;
case GPU_R32UI: return GL_R32UI;
case GPU_R32I: return GL_R32I;