diff options
author | Jeroen Bakker <jbakker> | 2021-12-07 12:33:55 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-12-07 12:34:38 +0300 |
commit | b069218a5563662b08b3057c96e5e0be877c16ca (patch) | |
tree | d4079211cbefefa07af58f89992a5ea840368776 /source/blender/draw/engines/image | |
parent | e2f0b4a0cbe5934dbd591caa53f9259eee431cee (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/engines/image')
-rw-r--r-- | source/blender/draw/engines/image/image_engine.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/draw/engines/image/image_engine.cc b/source/blender/draw/engines/image/image_engine.cc index 37db7246e67..be5946f34eb 100644 --- a/source/blender/draw/engines/image/image_engine.cc +++ b/source/blender/draw/engines/image/image_engine.cc @@ -191,6 +191,7 @@ DrawEngineType draw_engine_image_type = { &IMAGE_data_size, /* vedata_size */ &IMAGE_engine_init, /* engine_init */ &IMAGE_engine_free, /* engine_free */ + nullptr, /* instance_free */ &IMAGE_cache_init, /* cache_init */ &IMAGE_cache_populate, /* cache_populate */ nullptr, /* cache_finish */ |