Blender V5.3
gpu_texture.cc File Reference

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::gpu

Functions

Utilities
unsigned int blender::GPU_texture_memory_usage_get ()
const char * blender::GPU_texture_format_name (gpu::TextureFormat format)
size_t blender::GPU_texture_component_len (gpu::TextureFormat format)
size_t blender::GPU_texture_dataformat_size (eGPUDataFormat data_format)
C-API
static gpu::Texture * blender::gpu_texture_create (const char *name, const int w, const int h, const int d, const GPUTextureType type, int mip_len, TextureFormat tex_format, eGPUTextureUsage usage, const void *pixels, eGPUDataFormat data_format=GPU_DATA_FLOAT)
void * blender::GPU_texture_read (Texture *texture, eGPUDataFormat data_format, int mip_level)
void blender::GPU_texture_read (Texture *texture, eGPUDataFormat data_format, int mip_level, void *dst)
size_t blender::GPU_texture_read_size_get (const Texture *texture, eGPUDataFormat data_format, int mip_level)
Creation
gpu::Texture * blender::GPU_texture_create_1d (const char *name, int width, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
gpu::Texture * blender::GPU_texture_create_1d_array (const char *name, int width, int layer_len, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
gpu::Texture * blender::GPU_texture_create_2d (const char *name, int width, int height, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
gpu::Texture * blender::GPU_texture_create_2d_array (const char *name, int width, int height, int layer_len, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
gpu::Texture * blender::GPU_texture_create_3d (const char *name, int width, int height, int depth, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const void *data)
gpu::Texture * blender::GPU_texture_create_cube (const char *name, int width, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
gpu::Texture * blender::GPU_texture_create_cube_array (const char *name, int width, int layer_len, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
gpu::Texture * blender::GPU_texture_create_compressed_2d (const char *name, int width, int height, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const void *data)
gpu::Texture * blender::GPU_texture_create_from_vertbuf (const char *name, gpu::VertBuf *vertex_buf)
gpu::Texture * blender::GPU_texture_create_error (int dimension, bool array)
Texture Views
gpu::Texture * blender::GPU_texture_create_view (const char *name, gpu::Texture *source_texture, gpu::TextureFormat view_format, int mip_start, int mip_len, int layer_start, int layer_len, bool cube_as_array, bool use_stencil)
Introspection API
eGPUTextureUsage blender::GPU_texture_usage (const gpu::Texture *texture)
int blender::GPU_texture_dimensions (const gpu::Texture *texture)
int blender::GPU_texture_width (const gpu::Texture *texture)
int blender::GPU_texture_height (const gpu::Texture *texture)
int blender::GPU_texture_depth (const gpu::Texture *texture)
int blender::GPU_texture_layer_count (const gpu::Texture *texture)
int blender::GPU_texture_mip_count (const gpu::Texture *texture)
gpu::TextureFormat blender::GPU_texture_format (const gpu::Texture *texture)
bool blender::GPU_texture_has_depth_format (const gpu::Texture *texture)
bool blender::GPU_texture_has_stencil_format (const gpu::Texture *texture)
bool blender::GPU_texture_has_integer_format (const gpu::Texture *texture)
bool blender::GPU_texture_has_float_format (const gpu::Texture *texture)
bool blender::GPU_texture_has_normalized_format (const gpu::Texture *texture)
bool blender::GPU_texture_has_signed_format (const gpu::Texture *texture)
bool blender::GPU_texture_has_compressed_format (const gpu::Texture *texture)
bool blender::GPU_texture_is_cube (const gpu::Texture *texture)
bool blender::GPU_texture_is_view (const gpu::Texture *texture)
bool blender::GPU_texture_is_array (const gpu::Texture *texture)
void blender::GPU_texture_get_mipmap_size (gpu::Texture *texture, int mip_level, int *r_size)
Modify & Update
void blender::GPU_texture_update_mipmap (gpu::Texture *texture, int mip_level, eGPUDataFormat data_format, const void *pixels, uint unpack_row_length=0)
void blender::GPU_texture_update_sub (gpu::Texture *texture, eGPUDataFormat data_format, const void *pixels, int offset_x, int offset_y, int offset_z, int width, int height, int depth, uint unpack_row_length=0)
void blender::GPU_texture_clear (gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
void blender::GPU_texture_update (gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
void blender::GPU_texture_copy (gpu::Texture *dst, gpu::Texture *src)
Pixel Buffer

Used for interfacing with other graphic APIs using graphic interoperability. It can also be used for more efficient partial update from CPU side.

void blender::GPU_texture_update_sub_from_pixel_buffer (gpu::Texture *texture, eGPUDataFormat data_format, GPUPixelBuffer *pixel_buf, int offset_x, int offset_y, int offset_z, int width, int height, int depth)
GPUPixelBuffer * blender::GPU_pixel_buffer_create (size_t byte_size)
void blender::GPU_pixel_buffer_free (GPUPixelBuffer *pixel_buf)
void * blender::GPU_pixel_buffer_map (GPUPixelBuffer *pixel_buf)
void blender::GPU_pixel_buffer_unmap (GPUPixelBuffer *pixel_buf)
size_t blender::GPU_pixel_buffer_size (GPUPixelBuffer *pixel_buf)
GPUPixelBufferNativeHandle blender::GPU_pixel_buffer_get_native_handle (GPUPixelBuffer *pixel_buf)
Binding
void blender::GPU_texture_bind_ex (gpu::Texture *texture, GPUSamplerState state, int unit)
void blender::GPU_texture_bind (gpu::Texture *texture, int unit)
void blender::GPU_texture_unbind (gpu::Texture *texture)
void blender::GPU_texture_unbind_all ()
void blender::GPU_texture_image_bind (gpu::Texture *texture, int unit)
void blender::GPU_texture_image_unbind (gpu::Texture *texture)
void blender::GPU_texture_image_unbind_all ()
State API
void blender::GPU_texture_compare_mode (gpu::Texture *texture, bool use_compare)
void blender::GPU_texture_filter_mode (gpu::Texture *texture, bool use_filter)
void blender::GPU_texture_mipmap_mode (gpu::Texture *texture, bool use_mipmap, bool use_filter)
void blender::GPU_texture_anisotropic_filter (gpu::Texture *texture, bool use_aniso)
void blender::GPU_texture_extend_mode_x (gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
void blender::GPU_texture_extend_mode_y (gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
void blender::GPU_texture_extend_mode (gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
void blender::GPU_texture_swizzle_set (gpu::Texture *texture, const char swizzle[4])
Freeing
void blender::GPU_texture_free (gpu::Texture *texture)
void blender::GPU_texture_ref (gpu::Texture *texture)
Python API & meta-data

These are not intrinsic properties of a texture but they are stored inside the gpu::Texture structure for tracking purpose.

int blender::GPU_texture_original_width (const gpu::Texture *texture)
int blender::GPU_texture_original_height (const gpu::Texture *texture)
void blender::GPU_texture_original_size_set (gpu::Texture *texture, int width, int height)
void ** blender::GPU_texture_py_reference_get (gpu::Texture *texture)
void blender::GPU_texture_py_reference_set (gpu::Texture *texture, void **py_ref)