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:
Diffstat (limited to 'source/blender/imbuf/intern/util_gpu.c')
-rw-r--r--source/blender/imbuf/intern/util_gpu.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/util_gpu.c b/source/blender/imbuf/intern/util_gpu.c
index 58ff8473a85..e538e8e1659 100644
--- a/source/blender/imbuf/intern/util_gpu.c
+++ b/source/blender/imbuf/intern/util_gpu.c
@@ -165,8 +165,13 @@ GPUTexture *IMB_touch_gpu_texture(ImBuf *ibuf, int w, int h, int layers, bool us
eGPUTextureFormat tex_format;
imb_gpu_get_format(ibuf, use_high_bitdepth, &data_format, &tex_format);
- GPUTexture *tex = GPU_texture_create_nD(
- w, h, layers, 2, NULL, tex_format, data_format, 0, false, NULL);
+ GPUTexture *tex;
+ if (layers > 0) {
+ tex = GPU_texture_create_2d_array(w, h, layers, tex_format, NULL, NULL);
+ }
+ else {
+ tex = GPU_texture_create_2d(w, h, tex_format, NULL, NULL);
+ }
GPU_texture_anisotropic_filter(tex, true);
return tex;
@@ -248,7 +253,8 @@ GPUTexture *IMB_create_gpu_texture(ImBuf *ibuf, bool use_high_bitdepth, bool use
void *data = imb_gpu_get_data(ibuf, do_rescale, size, compress_as_srgb, use_premult, &freebuf);
/* Create Texture. */
- tex = GPU_texture_create_nD(UNPACK2(size), 0, 2, data, tex_format, data_format, 0, false, NULL);
+ tex = GPU_texture_create_2d(UNPACK2(size), tex_format, NULL, NULL);
+ GPU_texture_update(tex, data_format, data);
GPU_texture_anisotropic_filter(tex, true);