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-04-16 20:33:09 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-04-16 20:38:58 +0300
commitc2d4ba2ff54b47a8053c8dd19411186d2a050115 (patch)
treec9c407c50a2eba66c0fbe7151bba328996e71074 /source/blender/gpu/intern
parentdccda1fe434e3e3af47c44720cfedc9c1c4ccf52 (diff)
GPU/DRW: Add GPU_R16UI format.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_texture.c11
1 files changed, 9 insertions, 2 deletions
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 */