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-26 21:20:03 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-07-26 22:07:25 +0300
commit54237994d8b4fd199dc8a616685638b39e7e278d (patch)
tree0fce384c32a42a489afdcdae803fee086fb60c10 /source/blender/gpu
parent487eaeed7e3da6bbadc7899062574ef9b62ab7e4 (diff)
Cleanup: Image: Rename redundant enum for clarity
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_texture.c8
-rw-r--r--source/blender/gpu/intern/gpu_texture_image.cc20
2 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 2eac3c6f64d..e3d0dcdf65b 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -1189,10 +1189,10 @@ GPUTexture *GPU_texture_create_buffer(eGPUTextureFormat tex_format, const GLuint
static GLenum convert_target_to_gl(int target)
{
static const GLenum table[] = {
- [TEXTARGET_TEXTURE_2D] = GL_TEXTURE_2D,
- [TEXTARGET_TEXTURE_CUBE_MAP] = GL_TEXTURE_CUBE_MAP,
- [TEXTARGET_TEXTURE_2D_ARRAY] = GL_TEXTURE_2D_ARRAY,
- [TEXTARGET_TEXTURE_TILE_MAPPING] = GL_TEXTURE_1D_ARRAY,
+ [TEXTARGET_2D] = GL_TEXTURE_2D,
+ [TEXTARGET_CUBE_MAP] = GL_TEXTURE_CUBE_MAP,
+ [TEXTARGET_2D_ARRAY] = GL_TEXTURE_2D_ARRAY,
+ [TEXTARGET_TILE_MAPPING] = GL_TEXTURE_1D_ARRAY,
};
return table[target];
}
diff --git a/source/blender/gpu/intern/gpu_texture_image.cc b/source/blender/gpu/intern/gpu_texture_image.cc
index 4b091ecc618..bbc54651b87 100644
--- a/source/blender/gpu/intern/gpu_texture_image.cc
+++ b/source/blender/gpu/intern/gpu_texture_image.cc
@@ -195,7 +195,7 @@ static GPUTexture **gpu_get_image_gputexture(Image *ima, int textarget, const in
static uint gpu_texture_create_tile_mapping(Image *ima, const int multiview_eye)
{
- GPUTexture *tilearray = ima->gputexture[TEXTARGET_TEXTURE_2D_ARRAY][multiview_eye];
+ GPUTexture *tilearray = ima->gputexture[TEXTARGET_2D_ARRAY][multiview_eye];
if (tilearray == NULL) {
return 0;
@@ -559,10 +559,10 @@ static GPUTexture **gpu_get_movieclip_gputexture(MovieClip *clip,
}
if (textarget == GL_TEXTURE_2D) {
- return &tex->gputexture[TEXTARGET_TEXTURE_2D];
+ return &tex->gputexture[TEXTARGET_2D];
}
else if (textarget == GL_TEXTURE_CUBE_MAP) {
- return &tex->gputexture[TEXTARGET_TEXTURE_CUBE_MAP];
+ return &tex->gputexture[TEXTARGET_CUBE_MAP];
}
}
}
@@ -886,10 +886,10 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, ImBuf *ibuf,
}
}
- if (textarget == TEXTARGET_TEXTURE_2D_ARRAY) {
+ if (textarget == TEXTARGET_2D_ARRAY) {
bindcode = gpu_texture_create_tile_array(ima, ibuf_intern);
}
- else if (textarget == TEXTARGET_TEXTURE_TILE_MAPPING) {
+ else if (textarget == TEXTARGET_TILE_MAPPING) {
bindcode = gpu_texture_create_tile_mapping(ima, iuser ? iuser->multiview_eye : 0);
}
else {
@@ -905,7 +905,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, ImBuf *ibuf,
GPU_texture_orig_size_set(*tex, ibuf_intern->x, ibuf_intern->y);
- if (textarget == TEXTARGET_TEXTURE_TILE_MAPPING) {
+ if (textarget == TEXTARGET_TILE_MAPPING) {
/* Special for tile mapping. */
GPU_texture_mipmap_mode(*tex, false, false);
}
@@ -1265,7 +1265,7 @@ void GPU_paint_set_mipmap(Main *bmain, bool mipmap)
if (ima->gpuflag & IMA_GPU_MIPMAP_COMPLETE) {
for (int eye = 0; eye < 2; eye++) {
for (int a = 0; a < TEXTARGET_COUNT; a++) {
- if (ELEM(a, TEXTARGET_TEXTURE_2D, TEXTARGET_TEXTURE_2D_ARRAY)) {
+ if (ELEM(a, TEXTARGET_2D, TEXTARGET_2D_ARRAY)) {
GPUTexture *tex = ima->gputexture[a][eye];
if (tex != NULL) {
GPU_texture_bind(tex, 0);
@@ -1291,7 +1291,7 @@ void GPU_paint_set_mipmap(Main *bmain, bool mipmap)
if (BKE_image_has_opengl_texture(ima)) {
for (int eye = 0; eye < 2; eye++) {
for (int a = 0; a < TEXTARGET_COUNT; a++) {
- if (ELEM(a, TEXTARGET_TEXTURE_2D, TEXTARGET_TEXTURE_2D_ARRAY)) {
+ if (ELEM(a, TEXTARGET_2D, TEXTARGET_2D_ARRAY)) {
GPUTexture *tex = ima->gputexture[a][eye];
if (tex != NULL) {
GPU_texture_bind(tex, 0);
@@ -1322,14 +1322,14 @@ void GPU_paint_update_image(Image *ima, ImageUser *iuser, int x, int y, int w, i
GPU_free_image(ima);
}
- GPUTexture *tex = ima->gputexture[TEXTARGET_TEXTURE_2D][0];
+ GPUTexture *tex = ima->gputexture[TEXTARGET_2D][0];
/* Check if we need to update the main gputexture. */
if (tex != NULL && tile == ima->tiles.first) {
gpu_texture_update_from_ibuf(tex, ima, ibuf, NULL, x, y, w, h);
}
/* Check if we need to update the array gputexture. */
- tex = ima->gputexture[TEXTARGET_TEXTURE_2D_ARRAY][0];
+ tex = ima->gputexture[TEXTARGET_2D_ARRAY][0];
if (tex != NULL) {
gpu_texture_update_from_ibuf(tex, ima, ibuf, tile, x, y, w, h);
}