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>2020-07-29 19:13:19 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-07-30 00:06:37 +0300
commit5f6fb5bb41ed0057f0e2f0ccded717fbf04e55e2 (patch)
tree94ce813b25b5bf766136e694f893517e93432bf7 /source/blender/gpu/intern/gpu_texture.cc
parent7e8d4937307e0be3ab4587c58c49f16211466987 (diff)
Cleanup: Split gpu_texture_image.c into BKE and IMB modules
This is in order to disolve GPU_draw.h into more meaningful code blocks. All the Image related function are in `image_gpu.c`. All the MovieClip related function are in `movieclip.c`. The IMB module now has a connection with GPU. This is not strickly necessary and the code could be move to `image_gpu.c` if needed. The Image garbage collection is also ported to `image_gpu.c`.
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.cc')
-rw-r--r--source/blender/gpu/intern/gpu_texture.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc
index db9d961e2e3..7237cbd8999 100644
--- a/source/blender/gpu/intern/gpu_texture.cc
+++ b/source/blender/gpu/intern/gpu_texture.cc
@@ -1118,15 +1118,15 @@ GPUTexture *GPU_texture_create_buffer(eGPUTextureFormat tex_format, const GLuint
return tex;
}
-static GLenum convert_target_to_gl(eGPUTextureTarget target)
-{
- switch (target) {
- case TEXTARGET_2D:
- return GL_TEXTURE_2D;
- case TEXTARGET_2D_ARRAY:
- return GL_TEXTURE_2D_ARRAY;
- case TEXTARGET_TILE_MAPPING:
- return GL_TEXTURE_1D_ARRAY;
+static GLenum convert_target_to_gl(int dimension, bool is_array)
+{
+ switch (dimension) {
+ case 1:
+ return is_array ? GL_TEXTURE_1D : GL_TEXTURE_1D_ARRAY;
+ case 2:
+ return is_array ? GL_TEXTURE_2D : GL_TEXTURE_2D_ARRAY;
+ case 3:
+ return GL_TEXTURE_3D;
default:
BLI_assert(0);
return GL_TEXTURE_2D;
@@ -1134,9 +1134,9 @@ static GLenum convert_target_to_gl(eGPUTextureTarget target)
}
/* Create an error texture that will bind an invalid texture (pink) at draw time. */
-GPUTexture *GPU_texture_create_error(eGPUTextureTarget target)
+GPUTexture *GPU_texture_create_error(int dimension, bool is_array)
{
- GLenum textarget = convert_target_to_gl(target);
+ GLenum textarget = convert_target_to_gl(dimension, is_array);
GPUTexture *tex = (GPUTexture *)MEM_callocN(sizeof(GPUTexture), __func__);
tex->bindcode = 0;