Blender V5.3
BKE_image_gpu.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
13
14#include <cstdint>
15
16namespace blender {
17
18namespace gpu {
19class Texture;
20} // namespace gpu
21
22struct ImBuf;
23struct Image;
24struct ImageTile;
25struct ImageUser;
26struct Main;
27
33
34/*
35 * Like #BKE_image_acquire_gpu_texture, but can also get render or compositing result.
36 *
37 * If #only_full_resolution is true, null will be returned if no single gpu::Texture
38 * can be created at full resolution.
39 */
41 ImageUser *iuser,
42 bool only_full_resolution = false);
43
44/*
45 * Like #BKE_image_acquire_gpu_texture, but can also return a GPU array texture and tile mapping
46 * texture for UDIM tiles as used in material shaders. The caller must release the textures.
47 */
51
52 /* True if the texture needs a tile mapping, set even if textures were not loaded
53 * yet and the pointers are null. */
54 bool need_tile_mapping = false;
55};
56
58 ImageUser *iuser,
59 const bool use_tile_mapping,
60 const bool try_only);
61
62/* Return whether the material GPU texture of an image is already loaded, without creating it. */
64 ImageUser *iuser,
65 const bool use_tile_mapping);
66
67/* Ensure the material GPU texture of an image is created, without returning it. */
69 ImageUser *iuser,
70 const bool use_tile_mapping);
71
76
83
88
93
106
112
113} // namespace blender
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
BMesh Iterators.
__int64 int64_t
Definition BKE_text.h:90
void BKE_image_ensure_gpu_material_texture(Image *image, ImageUser *iuser, const bool use_tile_mapping)
Definition image_gpu.cc:790
void BKE_image_free_gpu_texture_caches(Image *ima)
Definition image_gpu.cc:818
void BKE_image_free_gpu_fallback()
Definition image_gpu.cc:439
ImageGPUTextures BKE_image_acquire_gpu_material_texture(Image *image, ImageUser *iuser, const bool use_tile_mapping, const bool try_only)
Definition image_gpu.cc:762
void BKE_image_assign_gpu_texture(Image *image, gpu::Texture *texture)
Definition image_gpu.cc:737
void BKE_image_free_all_gpu_texture_caches(Main *bmain)
Definition image_gpu.cc:845
gpu::Texture * BKE_image_acquire_gpu_viewer_texture(Image *image, ImageUser *iuser, bool only_full_resolution=false)
Definition image_gpu.cc:749
bool BKE_image_has_gpu_texture(Image *ima)
Definition image_gpu.cc:95
bool BKE_image_has_gpu_texture_premultiplied_alpha(Image *image, ImBuf *ibuf)
Definition image_gpu.cc:116
void BKE_image_free_gpu_udim_textures(Image *ima)
Definition image_gpu.cc:812
int64_t BKE_image_partial_update_flush(Image *ima, const ImageUser *iuser)
Definition image_gpu.cc:867
bool BKE_image_has_gpu_material_texture(Image *image, ImageUser *iuser, const bool use_tile_mapping)
Definition image_gpu.cc:770
void BKE_image_free_anim_gpu_texture_caches(Main *bmain)
Definition image_gpu.cc:854
gpu::Texture * BKE_image_acquire_gpu_texture(Image *image, ImageUser *iuser)
Definition image_gpu.cc:732