From c2d4ba2ff54b47a8053c8dd19411186d2a050115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 16 Apr 2018 19:33:09 +0200 Subject: GPU/DRW: Add GPU_R16UI format. --- source/blender/gpu/intern/gpu_texture.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/blender/gpu/intern') 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 */ -- cgit v1.2.3