25 int last_user_id = -1;
48 int user_id =
pool->last_user_id;
51 if (
pool->users[user_id] != user) {
57 user_id =
pool->users.first_index_of_try(user);
61 user_id =
pool->users.size();
62 pool->users.append(user);
66 pool->last_user_id = user_id;
83 char name[16] =
"DRW_tex_pool";
85 int texture_id =
pool->handles.size();
86 SNPRINTF(name,
"DRW_tex_pool_%d", texture_id);
92 pool->handles.append(handle);
116 for (
auto i :
pool->tmp_tex_released.index_range()) {
117 if (texture_match(
pool->tmp_tex_released[i])) {
118 tmp_tex =
pool->tmp_tex_released[i];
125 pool->tmp_tex_released.remove_and_reorder(found_index);
129 for (
auto i :
pool->tmp_tex_pruned.index_range()) {
130 if (texture_match(
pool->tmp_tex_pruned[i])) {
131 tmp_tex =
pool->tmp_tex_pruned[i];
138 pool->tmp_tex_pruned.remove_and_reorder(found_index);
144 char name[16] =
"DRW_tex_pool";
146 int texture_id =
pool->handles.size();
147 SNPRINTF(name,
"DRW_tex_pool_%d", texture_id);
152 pool->tmp_tex_acquired.append(tmp_tex);
159 pool->tmp_tex_acquired.remove_first_occurrence_and_reorder(tmp_tex);
160 pool->tmp_tex_released.append(tmp_tex);
165 pool->last_user_id = -1;
167 for (
auto it =
pool->handles.rbegin(); it !=
pool->handles.rend(); ++it) {
181 for (
int i =
pool->handles.size() - 1; i >= 0; i--) {
182 if (!
pool->handles[i].texture) {
183 pool->handles.remove_and_reorder(i);
191 pool->tmp_tex_pruned =
pool->tmp_tex_released;
192 pool->tmp_tex_released.clear();
#define SNPRINTF(dst, format,...)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
int GPU_texture_height(const GPUTexture *tex)
struct GPUTexture GPUTexture
int GPU_texture_width(const GPUTexture *tex)
bool GPU_texture_integer(const GPUTexture *tex)
void GPU_texture_free(GPUTexture *tex)
void GPU_texture_filter_mode(GPUTexture *tex, bool use_filter)
GPUTexture * GPU_texture_create_2d(const char *name, int w, int h, int mip_len, eGPUTextureFormat format, const float *data)
eGPUTextureFormat GPU_texture_format(const GPUTexture *tex)
bool GPU_texture_depth(const GPUTexture *tex)
void DRW_texture_pool_free(DRWTexturePool *pool)
GPUTexture * DRW_texture_pool_texture_acquire(DRWTexturePool *pool, int width, int height, eGPUTextureFormat format)
void DRW_texture_pool_reset(DRWTexturePool *pool)
GPUTexture * DRW_texture_pool_query(DRWTexturePool *pool, int width, int height, eGPUTextureFormat format, void *user)
void DRW_texture_pool_texture_release(DRWTexturePool *pool, GPUTexture *tmp_tex)
DRWTexturePool * DRW_texture_pool_create()
struct DRWTexturePool DRWTexturePool
unsigned __int64 uint64_t
Vector< void *, 16 > users
Vector< DRWTexturePoolHandle > handles
Vector< GPUTexture * > tmp_tex_acquired
Vector< GPUTexture * > tmp_tex_released
Vector< GPUTexture * > tmp_tex_pruned