[Bf-blender-cvs] [494470ba232] blender2.8: GPUTexture: Expose GPU_texture_create_buffer and add GL_R32I support.

Clément Foucault noreply at git.blender.org
Thu May 31 19:12:13 CEST 2018


Commit: 494470ba232dafaaff771ac90f773c6771375b50
Author: Clément Foucault
Date:   Thu May 31 18:34:17 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB494470ba232dafaaff771ac90f773c6771375b50

GPUTexture: Expose GPU_texture_create_buffer and add GL_R32I support.

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

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

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

diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index cc66b5dbf9b..737b4a542c8 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -156,7 +156,10 @@ GPUTexture *GPU_texture_create_3D(
         int w, int h, int d, GPUTextureFormat data_type, const float *pixels, char err_out[256]);
 GPUTexture *GPU_texture_create_cube(
         int w, GPUTextureFormat data_type, const float *pixels, char err_out[256]);
-GPUTexture *GPU_texture_create_from_vertbuf(struct Gwn_VertBuf *vert);
+GPUTexture *GPU_texture_create_from_vertbuf(
+        struct Gwn_VertBuf *vert);
+GPUTexture *GPU_texture_create_buffer(
+        GPUTextureFormat data_type, const uint buffer);
 
 GPUTexture *GPU_texture_from_blender(
         struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time, int mipmap);
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 38b38736660..14d0b27bc28 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -203,6 +203,7 @@ static GLenum gpu_texture_get_format(
 		case GPU_R11F_G11F_B10F:
 		case GPU_R32F:
 		case GPU_R32UI:
+		case GPU_R32I:
 			*bytesize = 4;
 			break;
 		case GPU_DEPTH_COMPONENT24:
@@ -237,6 +238,7 @@ static GLenum gpu_texture_get_format(
 		case GPU_RGBA8: return GL_RGBA8;
 		case GPU_R32F: return GL_R32F;
 		case GPU_R32UI: return GL_R32UI;
+		case GPU_R32I: return GL_R32I;
 		case GPU_R16F: return GL_R16F;
 		case GPU_R16I: return GL_R16I;
 		case GPU_R16UI: return GL_R16UI;
@@ -616,7 +618,7 @@ static GPUTexture *GPU_texture_cube_create(
 }
 
 /* Special buffer textures. data_type must be compatible with the buffer content. */
-static GPUTexture *GPU_texture_create_buffer(GPUTextureFormat data_type, const GLuint buffer)
+GPUTexture *GPU_texture_create_buffer(GPUTextureFormat data_type, const GLuint buffer)
 {
 	GPUTexture *tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture");
 	tex->number = -1;



More information about the Bf-blender-cvs mailing list