[Bf-blender-cvs] [9b692ecabd3] blender2.8: GPUTexture: Add support for GPU_RGBA8UI

Clément Foucault noreply at git.blender.org
Fri Oct 12 16:51:29 CEST 2018


Commit: 9b692ecabd3ddf675b4c6e09999415138df598d4
Author: Clément Foucault
Date:   Thu Oct 11 15:08:57 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9b692ecabd3ddf675b4c6e09999415138df598d4

GPUTexture: Add support for GPU_RGBA8UI

===================================================================

M	source/blender/gpu/intern/gpu_texture.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list