diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-16 20:33:09 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-04-16 20:38:58 +0300 |
commit | c2d4ba2ff54b47a8053c8dd19411186d2a050115 (patch) | |
tree | c9c407c50a2eba66c0fbe7151bba328996e71074 /source/blender/gpu | |
parent | dccda1fe434e3e3af47c44720cfedc9c1c4ccf52 (diff) |
GPU/DRW: Add GPU_R16UI format.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_texture.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.c | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index 57185d2f39e..92dc512e27d 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -71,6 +71,7 @@ typedef enum GPUTextureFormat { GPU_R32F, GPU_R16F, GPU_R16I, + GPU_R16UI, GPU_RG8, GPU_R8, #if 0 @@ -89,7 +90,6 @@ typedef enum GPUTextureFormat { GPU_RG8UI, GPU_R32I, GPU_R32UI, - GPU_R16UI, GPU_R16, GPU_R8I, GPU_R8UI, diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index 75830f60f03..cfc229166ed 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -147,8 +147,14 @@ static GLenum gpu_texture_get_format( } else { /* Integer formats */ - if (ELEM(data_type, GPU_RG16I, GPU_R16I)) { - *data_format = GL_INT; + if (ELEM(data_type, GPU_RG16I, GPU_R16I, GPU_R16UI)) { + if (ELEM(data_type, GPU_R16UI)) { + *data_format = GL_UNSIGNED_INT; + } + else { + *data_format = GL_INT; + } + *format_flag |= GPU_FORMAT_INTEGER; switch (components) { @@ -224,6 +230,7 @@ static GLenum gpu_texture_get_format( case GPU_R32F: return GL_R32F; case GPU_R16F: return GL_R16F; case GPU_R16I: return GL_R16I; + case GPU_R16UI: return GL_R16UI; case GPU_RG8: return GL_RG8; case GPU_R8: return GL_R8; /* Special formats texture & renderbuffer */ |