Blender V5.3
image_gpu.cc File Reference
#include <mutex>
#include "MEM_guardedalloc.h"
#include "BLI_boxpack_2d.hh"
#include "BLI_fileops.hh"
#include "BLI_listbase.hh"
#include "BLI_math_base.hh"
#include "BLI_math_base_c.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_path_utils.hh"
#include "BLI_string.hh"
#include "BLI_time.hh"
#include "DNA_image_types.h"
#include "IMB_cache.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "BKE_image.hh"
#include "BKE_image_gpu.hh"
#include "BKE_main.hh"
#include "IMB_partial_update.hh"
#include "GPU_capabilities.hh"
#include "GPU_texture.hh"
#include "CLG_log.h"
#include "image_intern.hh"

Go to the source code of this file.

Classes

struct  blender::PackTile
struct  blender::Changes

Namespaces

namespace  blender
 BMesh Iterators.

Functions

int64_t blender::BKE_image_partial_update_flush (Image *ima, const ImageUser *iuser)
UDIM image buffers for atlas and tile mapping
static ImBuf * blender::image_udim_gpu_cache_get (Image *image, ImageCacheKey key)
static ImBuf * blender::image_udim_gpu_ibuf_get (Image *ima, const int udim_index)
static ImBuf * blender::image_udim_gpu_ibuf_ensure (Image *ima, const int udim_index)
static void blender::image_udim_gpu_ibuf_remove (Image *ima, const int udim_index)
Query State
bool blender::BKE_image_has_gpu_texture (Image *ima)
bool blender::BKE_image_has_gpu_texture_premultiplied_alpha (Image *image, ImBuf *ibuf)
UDIM GPU Texture
static bool blender::is_over_resolution_limit (int w, int h)
static int blender::smaller_power_of_2_limit (int num)
static gpu::Texture * blender::gpu_texture_create_tile_mapping (Image *ima, gpu::Texture *tilearray)
static int blender::compare_packtile (const void *a, const void *b)
static gpu::Texture * blender::gpu_texture_create_tile_array (Image *ima, ImBuf *main_ibuf)
Image Sequences
static void blender::image_cache_free_inactive_frame_gpu_textures (Image *ima, const ImBuf *current_ibuf)
Get GPU texture from Image
static void blender::image_gpu_atlas_try_partial_update (Image *image, ImageUser *iuser)
static ImageGPUTextures blender::image_get_gpu_texture_tiled (Image *ima, ImageUser *iuser, const bool try_only)
static bool blender::image_gpu_texture_fits_full_resolution (const ImBuf *ibuf)
static ImageGPUTextures blender::image_get_gpu_texture_single (Image *ima, ImageUser *iuser, const bool use_viewers, const bool only_full_resolution, const bool try_only)
static ImageGPUTextures blender::image_get_gpu_texture (Image *ima, ImageUser *iuser, const bool use_viewers, const bool only_full_resolution, const bool use_tile_mapping, const bool try_only)
gpu::Texture * blender::BKE_image_acquire_gpu_texture (Image *image, ImageUser *iuser)
void blender::BKE_image_assign_gpu_texture (Image *image, gpu::Texture *texture)
gpu::Texture * blender::BKE_image_acquire_gpu_viewer_texture (Image *image, ImageUser *iuser, bool only_full_resolution=false)
Material textures
ImageGPUTextures blender::BKE_image_acquire_gpu_material_texture (Image *image, ImageUser *iuser, const bool use_tile_mapping, const bool try_only)
bool blender::BKE_image_has_gpu_material_texture (Image *image, ImageUser *iuser, const bool use_tile_mapping)
void blender::BKE_image_ensure_gpu_material_texture (Image *image, ImageUser *iuser, const bool use_tile_mapping)
Deletion
void blender::BKE_image_free_gpu_udim_textures (Image *ima)
void blender::BKE_image_free_gpu_texture_caches (Image *ima)
void blender::BKE_image_free_all_gpu_texture_caches (Main *bmain)
void blender::BKE_image_free_anim_gpu_texture_caches (Main *bmain)

Variables

static CLG_LogRef blender::LOG = {"image.gpu"}

Error handling

enum class  blender::ImageLoadError { blender::LoadFailed , blender::FileMissing , blender::GPUTextureFailed }
static ImBuf * blender::g_error_imbuf = nullptr
static ImBuf * blender::image_gpu_error_imbuf_ensure ()
static void blender::image_gpu_log_load_error_once (Image *ima, ImageUser *iuser, ImageLoadError error)
static void blender::image_gpu_clear_load_error (Image *ima)
void blender::BKE_image_free_gpu_fallback ()