Blender  V3.3
Classes | Functions
draw_texture_pool.cc File Reference
#include "BKE_global.h"
#include "BLI_vector.hh"
#include "draw_texture_pool.h"

Go to the source code of this file.

Classes

struct  DRWTexturePoolHandle
 
struct  DRWTexturePool
 

Functions

DRWTexturePoolDRW_texture_pool_create ()
 
void DRW_texture_pool_free (DRWTexturePool *pool)
 
GPUTextureDRW_texture_pool_query (DRWTexturePool *pool, int width, int height, eGPUTextureFormat format, void *user)
 
GPUTextureDRW_texture_pool_texture_acquire (DRWTexturePool *pool, int width, int height, eGPUTextureFormat format)
 
void DRW_texture_pool_texture_release (DRWTexturePool *pool, GPUTexture *tmp_tex)
 
void DRW_texture_pool_reset (DRWTexturePool *pool)
 

Function Documentation

◆ DRW_texture_pool_create()

DRWTexturePool* DRW_texture_pool_create ( void  )

Definition at line 32 of file draw_texture_pool.cc.

Referenced by DRW_viewport_data_create().

◆ DRW_texture_pool_free()

void DRW_texture_pool_free ( DRWTexturePool pool)

Definition at line 37 of file draw_texture_pool.cc.

References DRW_texture_pool_reset(), and blender::compositor::pool.

Referenced by DRW_viewport_data_free().

◆ DRW_texture_pool_query()

GPUTexture* DRW_texture_pool_query ( DRWTexturePool pool,
int  width,
int  height,
eGPUTextureFormat  format,
void user 
)

Try to find a texture corresponding to params into the texture pool. If no texture was found, create one and add it to the pool.

Definition at line 45 of file draw_texture_pool.cc.

References BLI_assert, G, G_DEBUG_GPU, GPU_texture_create_2d(), GPU_texture_depth(), GPU_texture_filter_mode(), GPU_texture_format(), GPU_texture_height(), GPU_texture_integer(), GPU_texture_width(), height, blender::compositor::pool, SNPRINTF, DRWTexturePoolHandle::texture, DRWTexturePoolHandle::users_bits, and width.

Referenced by DRW_texture_pool_query_2d().

◆ DRW_texture_pool_reset()

void DRW_texture_pool_reset ( DRWTexturePool pool)

Resets the user bits for each texture in the pool and delete unused ones.

Definition at line 163 of file draw_texture_pool.cc.

References BLI_assert, GPU_texture_free(), blender::compositor::pool, DRWTexturePoolHandle::texture, and DRWTexturePoolHandle::users_bits.

Referenced by DRW_texture_pool_free(), and drw_viewport_data_reset().

◆ DRW_texture_pool_texture_acquire()

GPUTexture* DRW_texture_pool_texture_acquire ( DRWTexturePool pool,
int  width,
int  height,
eGPUTextureFormat  format 
)

Returns a temporary texture that needs to be released after use. Texture content is undefined.

Definition at line 101 of file draw_texture_pool.cc.

References G, G_DEBUG_GPU, GPU_texture_create_2d(), GPU_texture_format(), GPU_texture_height(), GPU_texture_width(), height, blender::compositor::pool, SNPRINTF, tex, and width.

◆ DRW_texture_pool_texture_release()

void DRW_texture_pool_texture_release ( DRWTexturePool pool,
GPUTexture tmp_tex 
)

Releases a previously acquired texture.

Definition at line 157 of file draw_texture_pool.cc.

References blender::compositor::pool.