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:
authorJeroen Bakker <jbakker>2021-12-07 12:33:55 +0300
committerJeroen Bakker <jeroen@blender.org>2021-12-07 12:34:38 +0300
commitb069218a5563662b08b3057c96e5e0be877c16ca (patch)
treed4079211cbefefa07af58f89992a5ea840368776 /source/blender/draw/intern/draw_view_data.h
parente2f0b4a0cbe5934dbd591caa53f9259eee431cee (diff)
DrawManager: Engine Instance Data.
In the original design draw engines had to copy with a limitation that they were not allowed to reuse complex data structures between drawing calls. Data that could be reused were limited to: - GPUFramebuffers - GPUTextures - Memory that could be removed calling MEM_freeN (storage list) - DRWPass This is fine when the storage list contains arrays or structs but when more complex data types (vectors, maps) etc wasn't possible. This patch adds instance_data that can be reused between drawing calls. The instance_data is controlled by the draw engine and doesn't need to be limited as described above. When an engines stores instance_data it must implement the `DrawEngineType.instance_free` callback to free the data. The patch originates from eevee rewrite. But was added to master as the image engine rewrite also has a need for it. Reviewed By: fclem Differential Revision: https://developer.blender.org/D13425
Diffstat (limited to 'source/blender/draw/intern/draw_view_data.h')
-rw-r--r--source/blender/draw/intern/draw_view_data.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_view_data.h b/source/blender/draw/intern/draw_view_data.h
index c8176170a61..01b614fb021 100644
--- a/source/blender/draw/intern/draw_view_data.h
+++ b/source/blender/draw/intern/draw_view_data.h
@@ -63,6 +63,12 @@ typedef struct ViewportEngineData {
TextureList *txl;
PassList *psl;
StorageList *stl;
+ /**
+ * \brief Memory block that can be freely used by the draw engine.
+ * When used the draw engine must implement #DrawEngineType.instance_free callback.
+ */
+ void *instance_data;
+
char info[GPU_INFO_SIZE];
/* we may want to put this elsewhere */