Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-03-19 00:32:12 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-03-20 00:05:34 +0300
commitd7ecd4a0f3ba87781edec45b03c99eb9e354608a (patch)
treead6bfa19da94cd3a83047699edc08b3d2d73c943 /source/blender/draw/intern/draw_texture_pool.h
parentdbf1e7c07f0ffcc475a468e161991e882a999268 (diff)
DRW: Add new texture from pool acquire/release mechanism
This adds a simple and more manageable temp texture behavior. The texture is garanteed to be available only between the acquire/release pair. This makes the same engine able to reuse the textures and even overlap the acquire & release calls.
Diffstat (limited to 'source/blender/draw/intern/draw_texture_pool.h')
-rw-r--r--source/blender/draw/intern/draw_texture_pool.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_texture_pool.h b/source/blender/draw/intern/draw_texture_pool.h
index 5a7915e15e7..1c30ea88552 100644
--- a/source/blender/draw/intern/draw_texture_pool.h
+++ b/source/blender/draw/intern/draw_texture_pool.h
@@ -30,6 +30,17 @@ void DRW_texture_pool_free(DRWTexturePool *pool);
GPUTexture *DRW_texture_pool_query(
DRWTexturePool *pool, int width, int height, eGPUTextureFormat format, void *user);
/**
+ * Returns a temporary texture that needs to be released after use. Texture content is undefined.
+ */
+GPUTexture *DRW_texture_pool_texture_acquire(DRWTexturePool *pool,
+ int width,
+ int height,
+ eGPUTextureFormat format);
+/**
+ * Releases a previously acquired texture.
+ */
+void DRW_texture_pool_texture_release(DRWTexturePool *pool, GPUTexture *tmp_tex);
+/**
* Resets the user bits for each texture in the pool and delete unused ones.
*/
void DRW_texture_pool_reset(DRWTexturePool *pool);