Blender  V3.3
Macros | Typedefs | Enumerations | Functions | Variables
GPU_texture.h File Reference
#include "BLI_utildefines.h"
#include "GPU_state.h"

Go to the source code of this file.

Macros

#define GPU_TEXTURE_FREE_SAFE(texture)
 

Typedefs

typedef struct GPUTexture GPUTexture
 
typedef enum eGPUSamplerState eGPUSamplerState
 
typedef enum eGPUTextureFormat eGPUTextureFormat
 
typedef enum eGPUDataFormat eGPUDataFormat
 
typedef enum eGPUTextureUsage eGPUTextureUsage
 

Enumerations

enum  eGPUSamplerState {
  GPU_SAMPLER_DEFAULT = 0 , GPU_SAMPLER_FILTER = (1 << 0) , GPU_SAMPLER_MIPMAP = (1 << 1) , GPU_SAMPLER_REPEAT_S = (1 << 2) ,
  GPU_SAMPLER_REPEAT_T = (1 << 3) , GPU_SAMPLER_REPEAT_R = (1 << 4) , GPU_SAMPLER_CLAMP_BORDER = (1 << 5) , GPU_SAMPLER_COMPARE = (1 << 6) ,
  GPU_SAMPLER_ANISO = (1 << 7) , GPU_SAMPLER_ICON = (1 << 8) , GPU_SAMPLER_REPEAT = (GPU_SAMPLER_REPEAT_S | GPU_SAMPLER_REPEAT_T | GPU_SAMPLER_REPEAT_R)
}
 
enum  eGPUTextureFormat {
  GPU_RGBA8UI , GPU_RGBA8I , GPU_RGBA8 , GPU_RGBA32UI ,
  GPU_RGBA32I , GPU_RGBA32F , GPU_RGBA16UI , GPU_RGBA16I ,
  GPU_RGBA16F , GPU_RGBA16 , GPU_RG8UI , GPU_RG8I ,
  GPU_RG8 , GPU_RG32UI , GPU_RG32I , GPU_RG32F ,
  GPU_RG16UI , GPU_RG16I , GPU_RG16F , GPU_RG16 ,
  GPU_R8UI , GPU_R8I , GPU_R8 , GPU_R32UI ,
  GPU_R32I , GPU_R32F , GPU_R16UI , GPU_R16I ,
  GPU_R16F , GPU_R16 , GPU_RGB10_A2 , GPU_R11F_G11F_B10F ,
  GPU_DEPTH32F_STENCIL8 , GPU_DEPTH24_STENCIL8 , GPU_SRGB8_A8 , GPU_RGB16F ,
  GPU_SRGB8_A8_DXT1 , GPU_SRGB8_A8_DXT3 , GPU_SRGB8_A8_DXT5 , GPU_RGBA8_DXT1 ,
  GPU_RGBA8_DXT3 , GPU_RGBA8_DXT5 , GPU_DEPTH_COMPONENT32F , GPU_DEPTH_COMPONENT24 ,
  GPU_DEPTH_COMPONENT16
}
 
enum  eGPUDataFormat {
  GPU_DATA_FLOAT , GPU_DATA_INT , GPU_DATA_UINT , GPU_DATA_UBYTE ,
  GPU_DATA_UINT_24_8 , GPU_DATA_10_11_11_REV , GPU_DATA_2_10_10_10_REV , GPU_DATA_HALF_FLOAT
}
 
enum  eGPUTextureUsage { GPU_TEXTURE_USAGE_SHADER_READ = (1 << 0) , GPU_TEXTURE_USAGE_SHADER_WRITE = (1 << 1) , GPU_TEXTURE_USAGE_ATTACHMENT = (1 << 2) , GPU_TEXTURE_USAGE_GENERAL = 0xFF }
 

Functions

void GPU_samplers_update (void)
 
unsigned int GPU_texture_memory_usage_get (void)
 
GPUTextureGPU_texture_create_1d (const char *name, int w, int mip_len, eGPUTextureFormat format, const float *data)
 
GPUTextureGPU_texture_create_1d_array (const char *name, int w, int h, int mip_len, eGPUTextureFormat format, const float *data)
 
GPUTextureGPU_texture_create_2d (const char *name, int w, int h, int mip_len, eGPUTextureFormat format, const float *data)
 
GPUTextureGPU_texture_create_2d_array (const char *name, int w, int h, int d, int mip_len, eGPUTextureFormat format, const float *data)
 
GPUTextureGPU_texture_create_3d (const char *name, int w, int h, int d, int mip_len, eGPUTextureFormat texture_format, eGPUDataFormat data_format, const void *data)
 
GPUTextureGPU_texture_create_cube (const char *name, int w, int mip_len, eGPUTextureFormat format, const float *data)
 
GPUTextureGPU_texture_create_cube_array (const char *name, int w, int d, int mip_len, eGPUTextureFormat format, const float *data)
 
GPUTextureGPU_texture_create_from_vertbuf (const char *name, struct GPUVertBuf *vert)
 
GPUTextureGPU_texture_create_compressed_2d (const char *name, int w, int h, int miplen, eGPUTextureFormat format, const void *data)
 
GPUTextureGPU_texture_create_error (int dimension, bool array)
 
GPUTextureGPU_texture_create_view (const char *name, const GPUTexture *src, eGPUTextureFormat format, int mip_start, int mip_len, int layer_start, int layer_len, bool cube_as_array)
 
void GPU_texture_update_mipmap (GPUTexture *tex, int miplvl, eGPUDataFormat gpu_data_format, const void *pixels)
 
void GPU_texture_update (GPUTexture *tex, eGPUDataFormat data_format, const void *data)
 
void GPU_texture_update_sub (GPUTexture *tex, eGPUDataFormat data_format, const void *pixels, int offset_x, int offset_y, int offset_z, int width, int height, int depth)
 
void GPU_unpack_row_length_set (uint len)
 
voidGPU_texture_read (GPUTexture *tex, eGPUDataFormat data_format, int miplvl)
 
void GPU_texture_clear (GPUTexture *tex, eGPUDataFormat data_format, const void *data)
 
void GPU_texture_free (GPUTexture *tex)
 
void GPU_texture_ref (GPUTexture *tex)
 
void GPU_texture_bind (GPUTexture *tex, int unit)
 
void GPU_texture_bind_ex (GPUTexture *tex, eGPUSamplerState state, int unit, bool set_number)
 
void GPU_texture_unbind (GPUTexture *tex)
 
void GPU_texture_unbind_all (void)
 
void GPU_texture_image_bind (GPUTexture *tex, int unit)
 
void GPU_texture_image_unbind (GPUTexture *tex)
 
void GPU_texture_image_unbind_all (void)
 
void GPU_texture_copy (GPUTexture *dst, GPUTexture *src)
 
void GPU_texture_generate_mipmap (GPUTexture *tex)
 
void GPU_texture_anisotropic_filter (GPUTexture *tex, bool use_aniso)
 
void GPU_texture_compare_mode (GPUTexture *tex, bool use_compare)
 
void GPU_texture_filter_mode (GPUTexture *tex, bool use_filter)
 
void GPU_texture_mipmap_mode (GPUTexture *tex, bool use_mipmap, bool use_filter)
 
void GPU_texture_wrap_mode (GPUTexture *tex, bool use_repeat, bool use_clamp)
 
void GPU_texture_swizzle_set (GPUTexture *tex, const char swizzle[4])
 
void GPU_texture_stencil_texture_mode_set (GPUTexture *tex, bool use_stencil)
 
int GPU_texture_dimensions (const GPUTexture *tex)
 
int GPU_texture_width (const GPUTexture *tex)
 
int GPU_texture_height (const GPUTexture *tex)
 
int GPU_texture_layer_count (const GPUTexture *tex)
 
int GPU_texture_mip_count (const GPUTexture *tex)
 
int GPU_texture_orig_width (const GPUTexture *tex)
 
int GPU_texture_orig_height (const GPUTexture *tex)
 
void GPU_texture_orig_size_set (GPUTexture *tex, int w, int h)
 
eGPUTextureFormat GPU_texture_format (const GPUTexture *tex)
 
bool GPU_texture_array (const GPUTexture *tex)
 
bool GPU_texture_cube (const GPUTexture *tex)
 
bool GPU_texture_depth (const GPUTexture *tex)
 
bool GPU_texture_stencil (const GPUTexture *tex)
 
bool GPU_texture_integer (const GPUTexture *tex)
 
void ** GPU_texture_py_reference_get (GPUTexture *tex)
 
void GPU_texture_py_reference_set (GPUTexture *tex, void **py_ref)
 
int GPU_texture_opengl_bindcode (const GPUTexture *tex)
 
void GPU_texture_get_mipmap_size (GPUTexture *tex, int lvl, int *size)
 
size_t GPU_texture_component_len (eGPUTextureFormat format)
 
size_t GPU_texture_dataformat_size (eGPUDataFormat data_format)
 

Variables

static const int GPU_SAMPLER_MAX = (GPU_SAMPLER_ICON + 1)
 

Macro Definition Documentation

◆ GPU_TEXTURE_FREE_SAFE

#define GPU_TEXTURE_FREE_SAFE (   texture)
Value:
do { \
if (texture != NULL) { \
GPU_texture_free(texture); \
texture = NULL; \
} \
} while (0)

Definition at line 40 of file GPU_texture.h.

Typedef Documentation

◆ eGPUDataFormat

◆ eGPUSamplerState

GPU Samplers state

  • Specify the sampler state to bind a texture with.
  • Internally used by textures.
  • All states are created at startup to avoid runtime costs.

◆ eGPUTextureFormat

Wrapper to supported OpenGL/Vulkan texture internal storage If you need a type just un-comment it. Be aware that some formats are not supported by render-buffers. All of the following formats are part of the OpenGL 3.3 core specification.

◆ eGPUTextureUsage

◆ GPUTexture

typedef struct GPUTexture GPUTexture

Opaque type hiding blender::gpu::Texture.

Definition at line 1 of file GPU_texture.h.

Enumeration Type Documentation

◆ eGPUDataFormat

Enumerator
GPU_DATA_FLOAT 
GPU_DATA_INT 
GPU_DATA_UINT 
GPU_DATA_UBYTE 
GPU_DATA_UINT_24_8 
GPU_DATA_10_11_11_REV 
GPU_DATA_2_10_10_10_REV 
GPU_DATA_HALF_FLOAT 

Definition at line 170 of file GPU_texture.h.

◆ eGPUSamplerState

GPU Samplers state

  • Specify the sampler state to bind a texture with.
  • Internally used by textures.
  • All states are created at startup to avoid runtime costs.
Enumerator
GPU_SAMPLER_DEFAULT 
GPU_SAMPLER_FILTER 
GPU_SAMPLER_MIPMAP 
GPU_SAMPLER_REPEAT_S 
GPU_SAMPLER_REPEAT_T 
GPU_SAMPLER_REPEAT_R 
GPU_SAMPLER_CLAMP_BORDER 
GPU_SAMPLER_COMPARE 
GPU_SAMPLER_ANISO 
GPU_SAMPLER_ICON 
GPU_SAMPLER_REPEAT 

Definition at line 25 of file GPU_texture.h.

◆ eGPUTextureFormat

Wrapper to supported OpenGL/Vulkan texture internal storage If you need a type just un-comment it. Be aware that some formats are not supported by render-buffers. All of the following formats are part of the OpenGL 3.3 core specification.

Enumerator
GPU_RGBA8UI 
GPU_RGBA8I 
GPU_RGBA8 
GPU_RGBA32UI 
GPU_RGBA32I 
GPU_RGBA32F 
GPU_RGBA16UI 
GPU_RGBA16I 
GPU_RGBA16F 
GPU_RGBA16 
GPU_RG8UI 
GPU_RG8I 
GPU_RG8 
GPU_RG32UI 
GPU_RG32I 
GPU_RG32F 
GPU_RG16UI 
GPU_RG16I 
GPU_RG16F 
GPU_RG16 
GPU_R8UI 
GPU_R8I 
GPU_R8 
GPU_R32UI 
GPU_R32I 
GPU_R32F 
GPU_R16UI 
GPU_R16I 
GPU_R16F 
GPU_R16 
GPU_RGB10_A2 
GPU_R11F_G11F_B10F 
GPU_DEPTH32F_STENCIL8 
GPU_DEPTH24_STENCIL8 
GPU_SRGB8_A8 
GPU_RGB16F 
GPU_SRGB8_A8_DXT1 
GPU_SRGB8_A8_DXT3 
GPU_SRGB8_A8_DXT5 
GPU_RGBA8_DXT1 
GPU_RGBA8_DXT3 
GPU_RGBA8_DXT5 
GPU_DEPTH_COMPONENT32F 
GPU_DEPTH_COMPONENT24 
GPU_DEPTH_COMPONENT16 

Definition at line 83 of file GPU_texture.h.

◆ eGPUTextureUsage

Enumerator
GPU_TEXTURE_USAGE_SHADER_READ 
GPU_TEXTURE_USAGE_SHADER_WRITE 
GPU_TEXTURE_USAGE_ATTACHMENT 
GPU_TEXTURE_USAGE_GENERAL 

Definition at line 181 of file GPU_texture.h.

Function Documentation

◆ GPU_samplers_update()

void GPU_samplers_update ( void  )

Update user defined sampler states.

Definition at line 702 of file gpu_texture.cc.

References blender::gpu::GPUBackend::get(), and blender::gpu::GPUBackend::samplers_update().

◆ GPU_texture_anisotropic_filter()

void GPU_texture_anisotropic_filter ( GPUTexture tex,
bool  use_aniso 
)

◆ GPU_texture_array()

bool GPU_texture_array ( const GPUTexture tex)

◆ GPU_texture_bind()

void GPU_texture_bind ( GPUTexture tex,
int  unit 
)

◆ GPU_texture_bind_ex()

void GPU_texture_bind_ex ( GPUTexture tex,
eGPUSamplerState  state,
int  unit,
bool  set_number 
)

◆ GPU_texture_clear()

void GPU_texture_clear ( GPUTexture tex,
eGPUDataFormat  data_format,
const void data 
)

Fills the whole texture with the same data for all pixels.

Warning
Only work for 2D texture for now.
Only clears the MIP 0 of the texture.
Parameters
data_formatdata format of the pixel data.
Note
The format is float for UNORM textures.
Parameters
data1 pixel worth of data to fill the texture with.

Definition at line 438 of file gpu_texture.cc.

References BLI_assert, clear(), data, and tex.

Referenced by blender::draw::Texture::clear(), gpu_viewport_textures_create(), and pygpu_texture_clear().

◆ GPU_texture_compare_mode()

void GPU_texture_compare_mode ( GPUTexture tex,
bool  use_compare 
)

◆ GPU_texture_component_len()

size_t GPU_texture_component_len ( eGPUTextureFormat  format)

Definition at line 717 of file gpu_texture.cc.

References blender::gpu::to_component_len().

Referenced by pygpu_texture__tp_new(), and pygpu_texture_read().

◆ GPU_texture_copy()

void GPU_texture_copy ( GPUTexture dst,
GPUTexture src 
)

Copy a texture content to a similar texture. Only MIP 0 is copied.

Definition at line 503 of file gpu_texture.cc.

References src.

Referenced by OVERLAY_xray_depth_copy(), OVERLAY_xray_depth_infront_copy(), and workbench_antialiasing_draw_pass().

◆ GPU_texture_create_1d()

GPUTexture* GPU_texture_create_1d ( const char *  name,
int  w,
int  mip_len,
eGPUTextureFormat  format,
const float data 
)
Note
data is expected to be float. If the format is not compatible with float data or if the data is not in float format, use GPU_texture_update to upload the data with the right data format. mip_len is the number of mip level to allocate. It must be >= 1.

Definition at line 278 of file gpu_texture.cc.

References data, GPU_DATA_FLOAT, blender::gpu::GPU_TEXTURE_1D, gpu_texture_create(), and w().

Referenced by addGPULut1D2D(), createGPUCurveMapping(), DRW_create_weight_colorramp_texture(), DRW_globals_update(), DRW_texture_create_1d(), GPU_material_sss_profile_get(), pygpu_texture__tp_new(), blender::gpu::tests::test_gpu_shader_compute_1d(), and workbench_volume_engine_init().

◆ GPU_texture_create_1d_array()

GPUTexture* GPU_texture_create_1d_array ( const char *  name,
int  w,
int  h,
int  mip_len,
eGPUTextureFormat  format,
const float data 
)

◆ GPU_texture_create_2d()

GPUTexture* GPU_texture_create_2d ( const char *  name,
int  w,
int  h,
int  mip_len,
eGPUTextureFormat  format,
const float data 
)

◆ GPU_texture_create_2d_array()

GPUTexture* GPU_texture_create_2d_array ( const char *  name,
int  w,
int  h,
int  d,
int  mip_len,
eGPUTextureFormat  format,
const float data 
)

◆ GPU_texture_create_3d()

GPUTexture* GPU_texture_create_3d ( const char *  name,
int  w,
int  h,
int  d,
int  mip_len,
eGPUTextureFormat  texture_format,
eGPUDataFormat  data_format,
const void data 
)

◆ GPU_texture_create_compressed_2d()

GPUTexture* GPU_texture_create_compressed_2d ( const char *  name,
int  w,
int  h,
int  miplen,
eGPUTextureFormat  format,
const void data 
)

data should hold all the data for all mipmaps. DDS texture loading. Return NULL if support is not available.

Definition at line 336 of file gpu_texture.cc.

References data, blender::gpu::GPUBackend::get(), offset, size(), tex, blender::gpu::GPUBackend::texture_alloc(), blender::gpu::to_block_size(), blender::gpu::to_data_format(), and w().

Referenced by IMB_create_gpu_texture().

◆ GPU_texture_create_cube()

GPUTexture* GPU_texture_create_cube ( const char *  name,
int  w,
int  mip_len,
eGPUTextureFormat  format,
const float data 
)

◆ GPU_texture_create_cube_array()

GPUTexture* GPU_texture_create_cube_array ( const char *  name,
int  w,
int  d,
int  mip_len,
eGPUTextureFormat  format,
const float data 
)

◆ GPU_texture_create_error()

GPUTexture* GPU_texture_create_error ( int  dimension,
bool  array 
)

◆ GPU_texture_create_from_vertbuf()

GPUTexture* GPU_texture_create_from_vertbuf ( const char *  name,
struct GPUVertBuf vert 
)

◆ GPU_texture_create_view()

GPUTexture* GPU_texture_create_view ( const char *  name,
const GPUTexture src,
eGPUTextureFormat  format,
int  mip_start,
int  mip_len,
int  layer_start,
int  layer_len,
bool  cube_as_array 
)

Create an alias of the source texture data. If src is freed, the texture view will continue to be valid. If mip_start or mip_len is bigger than available mips they will be clamped. If cube_as_array is true, then the texture cube (array) becomes a 2D array texture. TODO(@fclem): Target conversion is not implemented yet.

Definition at line 388 of file gpu_texture.cc.

References BLI_assert, blender::gpu::GPUBackend::get(), src, blender::gpu::GPUBackend::texture_alloc(), view, and blender::gpu::wrap().

Referenced by blender::draw::Texture::ensure_layer_views(), blender::draw::Texture::ensure_mip_views(), and blender::draw::Texture::stencil_view().

◆ GPU_texture_cube()

bool GPU_texture_cube ( const GPUTexture tex)

◆ GPU_texture_dataformat_size()

size_t GPU_texture_dataformat_size ( eGPUDataFormat  data_format)

◆ GPU_texture_depth()

bool GPU_texture_depth ( const GPUTexture tex)

◆ GPU_texture_dimensions()

int GPU_texture_dimensions ( const GPUTexture tex)

Return the number of dimensions of the texture ignoring dimension of layers (1, 2 or 3). Cube textures are considered 2D.

Definition at line 583 of file gpu_texture.cc.

References blender::gpu::GPU_TEXTURE_1D, blender::gpu::GPU_TEXTURE_2D, blender::gpu::GPU_TEXTURE_3D, blender::gpu::GPU_TEXTURE_CUBE, and type.

Referenced by createGPUShader().

◆ GPU_texture_filter_mode()

void GPU_texture_filter_mode ( GPUTexture tex,
bool  use_filter 
)

◆ GPU_texture_format()

eGPUTextureFormat GPU_texture_format ( const GPUTexture tex)

◆ GPU_texture_free()

void GPU_texture_free ( GPUTexture tex)

◆ GPU_texture_generate_mipmap()

void GPU_texture_generate_mipmap ( GPUTexture tex)

◆ GPU_texture_get_mipmap_size()

void GPU_texture_get_mipmap_size ( GPUTexture tex,
int  lvl,
int *  size 
)

◆ GPU_texture_height()

int GPU_texture_height ( const GPUTexture tex)

◆ GPU_texture_image_bind()

void GPU_texture_image_bind ( GPUTexture tex,
int  unit 
)

◆ GPU_texture_image_unbind()

void GPU_texture_image_unbind ( GPUTexture tex)

◆ GPU_texture_image_unbind_all()

void GPU_texture_image_unbind_all ( void  )

◆ GPU_texture_integer()

bool GPU_texture_integer ( const GPUTexture tex)

◆ GPU_texture_layer_count()

int GPU_texture_layer_count ( const GPUTexture tex)

Definition at line 612 of file gpu_texture.cc.

References tex.

Referenced by blender::draw::Texture::ensure_layer_views().

◆ GPU_texture_memory_usage_get()

unsigned int GPU_texture_memory_usage_get ( void  )

Definition at line 227 of file gpu_texture.cc.

Referenced by DRW_stats_draw().

◆ GPU_texture_mip_count()

int GPU_texture_mip_count ( const GPUTexture tex)

Definition at line 617 of file gpu_texture.cc.

References tex.

Referenced by blender::draw::Texture::ensure_mip_views().

◆ GPU_texture_mipmap_mode()

void GPU_texture_mipmap_mode ( GPUTexture tex,
bool  use_mipmap,
bool  use_filter 
)

◆ GPU_texture_opengl_bindcode()

int GPU_texture_opengl_bindcode ( const GPUTexture tex)

Definition at line 683 of file gpu_texture.cc.

References tex.

Referenced by pygpu_offscreen_color_texture_get().

◆ GPU_texture_orig_height()

int GPU_texture_orig_height ( const GPUTexture tex)

Definition at line 627 of file gpu_texture.cc.

References tex.

Referenced by OVERLAY_image_empty_cache_populate().

◆ GPU_texture_orig_size_set()

void GPU_texture_orig_size_set ( GPUTexture tex,
int  w,
int  h 
)

Definition at line 632 of file gpu_texture.cc.

References tex, and w().

Referenced by image_get_gpu_texture().

◆ GPU_texture_orig_width()

int GPU_texture_orig_width ( const GPUTexture tex)

Definition at line 622 of file gpu_texture.cc.

References tex.

Referenced by OVERLAY_image_empty_cache_populate().

◆ GPU_texture_py_reference_get()

void** GPU_texture_py_reference_get ( GPUTexture tex)

Definition at line 670 of file gpu_texture.cc.

References tex, and blender::gpu::unwrap().

Referenced by BPyGPUTexture_CreatePyObject().

◆ GPU_texture_py_reference_set()

void GPU_texture_py_reference_set ( GPUTexture tex,
void **  py_ref 
)

Definition at line 675 of file gpu_texture.cc.

References BLI_assert, tex, and blender::gpu::unwrap().

Referenced by BPyGPUTexture__tp_dealloc(), and BPyGPUTexture_CreatePyObject().

◆ GPU_texture_read()

void* GPU_texture_read ( GPUTexture tex,
eGPUDataFormat  data_format,
int  miplvl 
)

◆ GPU_texture_ref()

void GPU_texture_ref ( GPUTexture tex)

Definition at line 578 of file gpu_texture.cc.

References tex.

Referenced by BPyGPUTexture_CreatePyObject(), and drw_shgroup_material_texture().

◆ GPU_texture_stencil()

bool GPU_texture_stencil ( const GPUTexture tex)

◆ GPU_texture_stencil_texture_mode_set()

void GPU_texture_stencil_texture_mode_set ( GPUTexture tex,
bool  use_stencil 
)

Set depth stencil texture sampling behavior. Can work on texture views. If stencil sampling is enabled, an unsigned integer sampler is required.

Definition at line 558 of file gpu_texture.cc.

References BLI_assert, GPU_texture_stencil(), and tex.

Referenced by blender::draw::Texture::stencil_view().

◆ GPU_texture_swizzle_set()

void GPU_texture_swizzle_set ( GPUTexture tex,
const char  swizzle[4] 
)

Definition at line 553 of file gpu_texture.cc.

References tex.

Referenced by load_tex(), load_tex_cursor(), radial_control_set_tex(), and volume_grid_cache_get().

◆ GPU_texture_unbind()

void GPU_texture_unbind ( GPUTexture tex)

◆ GPU_texture_unbind_all()

void GPU_texture_unbind_all ( void  )

◆ GPU_texture_update()

void GPU_texture_update ( GPUTexture tex,
eGPUDataFormat  data_format,
const void data 
)

◆ GPU_texture_update_mipmap()

void GPU_texture_update_mipmap ( GPUTexture tex,
int  miplvl,
eGPUDataFormat  gpu_data_format,
const void pixels 
)

◆ GPU_texture_update_sub()

void GPU_texture_update_sub ( GPUTexture tex,
eGPUDataFormat  data_format,
const void pixels,
int  offset_x,
int  offset_y,
int  offset_z,
int  width,
int  height,
int  depth 
)

◆ GPU_texture_width()

int GPU_texture_width ( const GPUTexture tex)

◆ GPU_texture_wrap_mode()

void GPU_texture_wrap_mode ( GPUTexture tex,
bool  use_repeat,
bool  use_clamp 
)

◆ GPU_unpack_row_length_set()

void GPU_unpack_row_length_set ( uint  len)

Makes data interpretation aware of the source layout. Skipping pixels correctly when changing rows when doing partial update.

Definition at line 449 of file gpu_texture.cc.

References blender::gpu::Context::get(), len, blender::gpu::Context::state_manager, and blender::gpu::StateManager::texture_unpack_row_length_set().

Referenced by gpu_texture_update_unscaled(), and immDrawPixelsTexTiled_scaling_clipping().

Variable Documentation

◆ GPU_SAMPLER_MAX

const int GPU_SAMPLER_MAX = (GPU_SAMPLER_ICON + 1)
static