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:
authorDalai Felinto <dfelinto@gmail.com>2017-08-22 15:33:57 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-08-22 15:37:28 +0300
commitd7b3e33af43fa5a42e87689b441e6aa08e544754 (patch)
treea2e9c948d4d49867303032fcf6af96e57b57c567 /source/blender/gpu/intern
parent5f4066c87d55b8e4dc3713a8d66a2ffac9c51586 (diff)
GL_TEXTURE_2D_ARRAY wasn't handled in GPU_texture_update
Although the problem was exposed in 9457715d9a6f, the problem was in the original code that was copied over. To have: ``` } else { /* EXPECTED_VALUE */ ``` Without an BLI_assert(value == EXPECTED_VALUE); is asking for troubles. Yet another reason to favour switch statements with: ``` default: BLI_assert(!"value not implemented or supported"); ``` Instead of chained if/else if/else /* expected_value */.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_texture.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 25e54633552..7d8a354074a 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -732,6 +732,7 @@ void GPU_texture_update(GPUTexture *tex, const float *pixels)
glTexSubImage1D(tex->target, 0, 0, tex->w, format, data_format, pixels);
break;
case GL_TEXTURE_3D:
+ case GL_TEXTURE_2D_ARRAY:
glTexSubImage3D(tex->target, 0, 0, 0, 0, tex->w, tex->h, tex->d, format, data_format, pixels);
break;
default: