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>2021-10-05 10:36:11 +0300
committerJeroen Bakker <jeroen@blender.org>2021-10-05 10:39:54 +0300
commit1d49293b80446b89b5b12fa0eeefaf14e5051e48 (patch)
tree72e007ea9d498576ad9b48050f81f38994aa0d98 /source/blender/gpu/GPU_texture.h
parent08511b1c3de0338314940397083adaba4e9cf492 (diff)
DRW: Move buffer & temp textures & framebuffer management to DrawManager
This is a necessary step for EEVEE's new arch. This moves more data to the draw manager. This makes it easier to have the render or draw engines manage their own data. This makes more sense and cleans-up what the GPUViewport holds Also rewrites the Texture pool manager to be in C++. This also move the DefaultFramebuffer/TextureList and the engine related data to a new `DRWViewData` struct. This struct manages the per view (as in stereo view) engine data. There is a bit of cleanup in the way the draw manager is setup. We now use a temporary DRWData instead of creating a dummy viewport. Development: fclem, jbakker Differential Revision: https://developer.blender.org/D11966
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`.
*/