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
This commit is contained in:
@@ -265,6 +265,7 @@ DrawEngineType draw_engine_basic_type = {
|
||||
&basic_data_size,
|
||||
NULL,
|
||||
&basic_engine_free,
|
||||
NULL, /* instance_free */
|
||||
&basic_cache_init,
|
||||
&basic_cache_populate,
|
||||
&basic_cache_finish,
|
||||
|
||||
Reference in New Issue
Block a user