|
Blender V4.3
|
#include "BLI_utildefines.h"#include "MEM_guardedalloc.h"#include "GPU_capabilities.hh"#include "GPU_texture.hh"#include "IMB_colormanagement.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"Go to the source code of this file.
Functions | |
| static bool | imb_is_grayscale_texture_format_compatible (const ImBuf *ibuf) |
| static void | imb_gpu_get_format (const ImBuf *ibuf, bool high_bitdepth, bool use_grayscale, eGPUTextureFormat *r_texture_format) |
| static const char * | imb_gpu_get_swizzle (const ImBuf *ibuf) |
| static bool | IMB_gpu_get_compressed_format (const ImBuf *ibuf, eGPUTextureFormat *r_texture_format) |
| static void * | imb_gpu_get_data (const ImBuf *ibuf, const bool do_rescale, const int rescale_size[2], const bool store_premultiplied, const bool allow_grayscale, bool *r_freedata, eGPUDataFormat *r_data_format) |
| GPUTexture * | IMB_touch_gpu_texture (const char *name, ImBuf *ibuf, int w, int h, int layers, bool use_high_bitdepth, bool use_grayscale) |
| 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_grayscale, bool use_premult) |
| GPUTexture * | IMB_create_gpu_texture (const char *name, ImBuf *ibuf, bool use_high_bitdepth, bool use_premult) |
| eGPUTextureFormat | IMB_gpu_get_texture_format (const ImBuf *ibuf, bool high_bitdepth, bool use_grayscale) |
| void | IMB_gpu_clamp_half_float (ImBuf *image_buffer) |
| GPUTexture * IMB_create_gpu_texture | ( | const char * | name, |
| ImBuf * | ibuf, | ||
| bool | use_high_bitdepth, | ||
| bool | use_premult ) |
Definition at line 312 of file util_gpu.cc.
References BLI_assert, DDSData::data, ImBuf::dds_data, ImBuf::ftype, GPU_texture_anisotropic_filter(), GPU_texture_create_2d(), GPU_texture_create_compressed_2d(), GPU_texture_size_with_limit(), GPU_texture_swizzle_set(), GPU_texture_update(), GPU_TEXTURE_USAGE_GENERAL, GPU_TEXTURE_USAGE_HOST_READ, GPU_TEXTURE_USAGE_SHADER_READ, IMB_FTYPE_DDS, IMB_gpu_get_compressed_format(), imb_gpu_get_data(), imb_gpu_get_format(), imb_gpu_get_swizzle(), int, is_power_of_2_i(), max_ii(), MEM_freeN(), DDSData::nummipmaps, tex, UNPACK2, ImBuf::x, and ImBuf::y.
Referenced by BKE_movieclip_get_gpu_texture(), blender::realtime_compositor::CachedImage::CachedImage(), and image_get_gpu_texture().
| void IMB_gpu_clamp_half_float | ( | 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 404 of file util_gpu.cc.
References ImBuf::channels, clamp_f(), ImBufFloatBuffer::data, ImBuf::float_buffer, ImBuf::x, and ImBuf::y.
|
static |
Definition at line 92 of file util_gpu.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::colorspace, ImBuf::dds_data, DDSData::fourcc, FOURCC_DXT1, FOURCC_DXT3, FOURCC_DXT5, GPU_RGBA8_DXT1, GPU_RGBA8_DXT3, GPU_RGBA8_DXT5, GPU_SRGB8_A8_DXT1, GPU_SRGB8_A8_DXT3, GPU_SRGB8_A8_DXT5, IMB_colormanagement_space_is_data(), and IMB_colormanagement_space_is_scene_linear().
Referenced by IMB_create_gpu_texture().
|
static |
Apply colormanagement and scale buffer if needed. *r_freedata is set to true if the returned buffer need to be manually freed.
Definition at line 118 of file util_gpu.cc.
References Box, ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::colorspace, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, GPU_DATA_FLOAT, GPU_DATA_UBYTE, IMB_allocFromBuffer(), IMB_colormanagement_imbuf_to_byte_texture(), IMB_colormanagement_imbuf_to_float_texture(), IMB_colormanagement_space_is_data(), IMB_colormanagement_space_is_scene_linear(), IMB_colormanagement_space_is_srgb(), IMB_freeImBuf(), imb_is_grayscale_texture_format_compatible(), IMB_scale(), IMB_steal_byte_buffer(), IMB_steal_float_buffer(), MEM_freeN(), MEM_mallocN, UNPACK2, ImBuf::x, and ImBuf::y.
Referenced by IMB_create_gpu_texture(), and IMB_update_gpu_texture_sub().
|
static |
Definition at line 54 of file util_gpu.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::colorspace, ImBufFloatBuffer::data, ImBuf::flags, ImBuf::float_buffer, GPU_R16F, GPU_R32F, GPU_R8, GPU_RGBA16F, GPU_RGBA32F, GPU_RGBA8, GPU_SRGB8_A8, IB_halffloat, IMB_colormanagement_space_is_data(), IMB_colormanagement_space_is_scene_linear(), IMB_colormanagement_space_is_srgb(), and imb_is_grayscale_texture_format_compatible().
Referenced by IMB_create_gpu_texture(), IMB_gpu_get_texture_format(), IMB_touch_gpu_texture(), and IMB_update_gpu_texture_sub().
|
static |
Definition at line 86 of file util_gpu.cc.
References imb_is_grayscale_texture_format_compatible().
Referenced by IMB_create_gpu_texture(), and IMB_touch_gpu_texture().
| eGPUTextureFormat IMB_gpu_get_texture_format | ( | const ImBuf * | ibuf, |
| bool | high_bitdepth, | ||
| bool | use_grayscale ) |
Definition at line 395 of file util_gpu.cc.
References imb_gpu_get_format().
Referenced by uiTemplateImageInfo().
|
static |
Definition at line 21 of file util_gpu.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::colorspace, ImBufFloatBuffer::colorspace, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, IMB_colormanagement_space_is_data(), IMB_colormanagement_space_is_scene_linear(), IMB_colormanagement_space_is_srgb(), and ImBuf::planes.
Referenced by imb_gpu_get_data(), imb_gpu_get_format(), and imb_gpu_get_swizzle().
| GPUTexture * IMB_touch_gpu_texture | ( | const char * | name, |
| ImBuf * | ibuf, | ||
| int | w, | ||
| int | h, | ||
| int | layers, | ||
| bool | use_high_bitdepth, | ||
| bool | use_grayscale ) |
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 255 of file util_gpu.cc.
References GPU_texture_anisotropic_filter(), GPU_texture_create_2d(), GPU_texture_create_2d_array(), GPU_texture_swizzle_set(), GPU_TEXTURE_USAGE_SHADER_READ, imb_gpu_get_format(), imb_gpu_get_swizzle(), tex, and w().
Referenced by gpu_texture_create_tile_array().
| 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_grayscale, | ||
| 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 281 of file util_gpu.cc.
References GPU_texture_update_sub(), imb_gpu_get_data(), imb_gpu_get_format(), MEM_freeN(), tex, w(), ImBuf::x, ImBuf::y, and z().
Referenced by gpu_texture_create_tile_array().