Blender  V3.3
Functions
util_gpu.c File Reference
#include "imbuf.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "MEM_guardedalloc.h"
#include "BKE_global.h"
#include "GPU_capabilities.h"
#include "GPU_texture.h"
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"

Go to the source code of this file.

Functions

static void imb_gpu_get_format (const ImBuf *ibuf, bool high_bitdepth, eGPUDataFormat *r_data_format, eGPUTextureFormat *r_texture_format)
 
static voidimb_gpu_get_data (const ImBuf *ibuf, const bool do_rescale, const int rescale_size[2], const bool store_premultiplied, bool *r_freedata)
 
GPUTextureIMB_touch_gpu_texture (const char *name, ImBuf *ibuf, int w, int h, int layers, bool use_high_bitdepth)
 
void IMB_update_gpu_texture_sub (GPUTexture *tex, ImBuf *ibuf, int x, int y, int z, int w, int h, bool use_high_bitdepth, bool use_premult)
 
GPUTextureIMB_create_gpu_texture (const char *name, ImBuf *ibuf, bool use_high_bitdepth, bool use_premult)
 
void IMB_gpu_clamp_half_float (ImBuf *image_buffer)
 

Function Documentation

◆ IMB_create_gpu_texture()

GPUTexture* IMB_create_gpu_texture ( const char *  name,
struct ImBuf ibuf,
bool  use_high_bitdepth,
bool  use_premult 
)

◆ IMB_gpu_clamp_half_float()

void IMB_gpu_clamp_half_float ( struct ImBuf image_buffer)

Ensures that values stored in the float rect can safely loaded into half float gpu textures.

Does nothing when given image_buffer doesn't contain a float rect.

Definition at line 294 of file util_gpu.c.

References ImBuf::channels, clamp_f(), ImBuf::rect_float, ImBuf::x, and ImBuf::y.

◆ imb_gpu_get_data()

static void* imb_gpu_get_data ( const ImBuf ibuf,
const bool  do_rescale,
const int  rescale_size[2],
const bool  store_premultiplied,
bool r_freedata 
)
static

◆ imb_gpu_get_format()

static void imb_gpu_get_format ( const ImBuf ibuf,
bool  high_bitdepth,
eGPUDataFormat r_data_format,
eGPUTextureFormat r_texture_format 
)
static

◆ IMB_touch_gpu_texture()

GPUTexture* IMB_touch_gpu_texture ( const char *  name,
struct ImBuf ibuf,
int  w,
int  h,
int  layers,
bool  use_high_bitdepth 
)

The ibuf is only here to detect the storage type. The produced texture will have undefined content. It will need to be populated by using IMB_update_gpu_texture_sub().

Definition at line 179 of file util_gpu.c.

References GPU_texture_anisotropic_filter(), GPU_texture_create_2d(), GPU_texture_create_2d_array(), imb_gpu_get_format(), NULL, tex, and w().

Referenced by gpu_texture_create_tile_array().

◆ IMB_update_gpu_texture_sub()

void IMB_update_gpu_texture_sub ( struct GPUTexture tex,
struct ImBuf ibuf,
int  x,
int  y,
int  z,
int  w,
int  h,
bool  use_high_bitdepth,
bool  use_premult 
)

Will update a GPUTexture using the content of the ImBuf. Only one layer will be updated. Will resize the ibuf if needed. Z is the layer to update. Unused if the texture is 2D.

Definition at line 198 of file util_gpu.c.

References data, GPU_texture_update_sub(), imb_gpu_get_data(), imb_gpu_get_format(), MEM_freeN, size(), tex, w(), x, ImBuf::x, y, ImBuf::y, and z.

Referenced by gpu_texture_create_tile_array().