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:
Diffstat (limited to 'source/blender/gpu/GPU_texture.h')
-rw-r--r--source/blender/gpu/GPU_texture.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index 9a1885160b6..deff9e47871 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -52,6 +52,14 @@ typedef enum eGPUSamplerState {
GPU_SAMPLER_REPEAT = (GPU_SAMPLER_REPEAT_S | GPU_SAMPLER_REPEAT_T | GPU_SAMPLER_REPEAT_R),
} eGPUSamplerState;
+#define GPU_TEXTURE_FREE_SAFE(texture) \
+ do { \
+ if (texture != NULL) { \
+ GPU_texture_free(texture); \
+ texture = NULL; \
+ } \
+ } while (0)
+
/* `GPU_SAMPLER_MAX` is not a valid enum value, but only a limit.
* It also creates a bad mask for the `NOT` operator in `ENUM_OPERATORS`.
*/