diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-06-05 23:05:21 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-06-05 23:05:37 +0300 |
commit | 2ebde4c82bd478d19a9b3116ac600e715ffc0165 (patch) | |
tree | 46fbf5de4ed3694924aa4b2b4a36c4f9a3f79479 /source/blender/draw/engines/eevee/eevee_private.h | |
parent | 6d4f08467715030e7ef8833758b8da986280f236 (diff) |
Eevee: Optimize scene with a large number of objects.
Using a GHash to store the shgroup of every Material. This way we do not duplicates the DRWShadingGroups allocations on every object.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_private.h')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_private.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index 0d5ab592563..84c6de8593c 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -303,6 +303,7 @@ typedef struct EEVEE_PrivateData { struct DRWShadingGroup *shadow_shgrp; struct DRWShadingGroup *depth_shgrp; struct DRWShadingGroup *depth_shgrp_cull; + struct GHash *material_hash; } EEVEE_PrivateData; /* Transient data */ /* eevee_data.c */ @@ -315,6 +316,7 @@ EEVEE_LampEngineData *EEVEE_lamp_data_get(Object *ob); void EEVEE_materials_init(void); void EEVEE_materials_cache_init(EEVEE_Data *vedata); void EEVEE_materials_cache_populate(EEVEE_Data *vedata, EEVEE_SceneLayerData *sldata, Object *ob, struct Batch *geom); +void EEVEE_materials_cache_finish(EEVEE_Data *vedata); struct GPUMaterial *EEVEE_material_world_probe_get(struct Scene *scene, struct World *wo); struct GPUMaterial *EEVEE_material_world_background_get(struct Scene *scene, struct World *wo); struct GPUMaterial *EEVEE_material_mesh_probe_get(struct Scene *scene, Material *ma); |