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-09-04 23:56:30 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-05 18:49:14 +0300
commitbac4606937514405641659d91a30bf3e6832cdf7 (patch)
tree740db8bff5e694c2e9f943f928e08030925d0fcf /source/blender/imbuf/intern/util_gpu.c
parent7d4adbdfaba4f23b2adbf96f97ce18806aca31c8 (diff)
Cleanup: GPUTexture: Remove use of GPU_texture_create_nD
Use creation + update function instead.
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);