diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-05 18:33:56 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-05 18:49:14 +0300 |
commit | ab95cdaba970a30127d804bd1e66ad25ab021ec1 (patch) | |
tree | d0da883e11f81253cb7b3e5a75288ca69598e437 /source/blender/blenkernel/intern/image_gpu.c | |
parent | bac4606937514405641659d91a30bf3e6832cdf7 (diff) |
GPUTexture: Change texture creation API
This is to modernize the API:
- Add meaningful name to all textures (except DRW textures).
- Remove unused err_out argument: only used for offscreen python.
- Add mipmap count to creation functions for future changes.
- Clarify the data usage in creation functions.
This is a cleanup commit, there is no functional change.
# Conflicts:
# source/blender/gpu/GPU_texture.h
Diffstat (limited to 'source/blender/blenkernel/intern/image_gpu.c')
-rw-r--r-- | source/blender/blenkernel/intern/image_gpu.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/image_gpu.c b/source/blender/blenkernel/intern/image_gpu.c index 0a6015a3933..183129bf9b6 100644 --- a/source/blender/blenkernel/intern/image_gpu.c +++ b/source/blender/blenkernel/intern/image_gpu.c @@ -95,7 +95,7 @@ static GPUTexture *gpu_texture_create_tile_mapping(Image *ima, const int multivi tile_info[3] = tile->runtime.tilearray_size[1] / array_h; } - GPUTexture *tex = GPU_texture_create_1d_array(width, 2, GPU_RGBA32F, data, NULL); + GPUTexture *tex = GPU_texture_create_1d_array(ima->id.name + 2, width, 2, 1, GPU_RGBA32F, data); GPU_texture_mipmap_mode(tex, false, false); MEM_freeN(data); @@ -180,7 +180,7 @@ static GPUTexture *gpu_texture_create_tile_array(Image *ima, ImBuf *main_ibuf) const bool use_high_bitdepth = (ima->flag & IMA_HIGH_BITDEPTH); /* Create Texture without content. */ GPUTexture *tex = IMB_touch_gpu_texture( - main_ibuf, arraywidth, arrayheight, arraylayers, use_high_bitdepth); + ima->id.name + 2, main_ibuf, arraywidth, arrayheight, arraylayers, use_high_bitdepth); /* Upload each tile one by one. */ LISTBASE_FOREACH (ImageTile *, tile, &ima->tiles) { @@ -316,7 +316,8 @@ static GPUTexture *image_get_gpu_texture(Image *ima, (ima ? (ima->alpha_mode != IMA_ALPHA_STRAIGHT) : false) : (ima ? (ima->alpha_mode == IMA_ALPHA_PREMUL) : true); - *tex = IMB_create_gpu_texture(ibuf_intern, use_high_bitdepth, store_premultiplied); + *tex = IMB_create_gpu_texture( + ima->id.name + 2, ibuf_intern, use_high_bitdepth, store_premultiplied); if (GPU_mipmap_enabled()) { GPU_texture_generate_mipmap(*tex); |