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-05-31 19:34:17 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-05-31 20:09:20 +0300
commit494470ba232dafaaff771ac90f773c6771375b50 (patch)
tree709828108070cb596238d045080a081b4c1aa985
parent8789490f961d9ddda1a2f2f6cb090c64a0ec5728 (diff)
GPUTexture: Expose GPU_texture_create_buffer and add GL_R32I support.
-rw-r--r--source/blender/gpu/GPU_texture.h5
-rw-r--r--source/blender/gpu/intern/gpu_texture.c4
2 files changed, 7 insertions, 2 deletions
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;