Eevee: Stop depsgraph update callback form allocating unneeded memory
[blender.git] / source / blender / draw / engines / eevee / eevee_data.c
index ef1ff02685521adcf774aaa7bf78cfe4f22caf59..d1cd1b1440cb15eead36125e5b6c72c60833a03f 100644 (file)
@@ -78,6 +78,12 @@ static void eevee_lightprobe_data_free(void *storage)
        BLI_freelistN(&ped->captured_object_list);
 }
 
+EEVEE_ViewLayerData *EEVEE_view_layer_data_get(void)
+{
+       return (EEVEE_ViewLayerData *)DRW_view_layer_engine_data_get(
+               &draw_engine_eevee_type);
+}
+
 EEVEE_ViewLayerData *EEVEE_view_layer_data_ensure(void)
 {
        EEVEE_ViewLayerData **sldata = (EEVEE_ViewLayerData **)DRW_view_layer_engine_data_ensure(
@@ -90,6 +96,12 @@ EEVEE_ViewLayerData *EEVEE_view_layer_data_ensure(void)
        return *sldata;
 }
 
+EEVEE_ObjectEngineData *EEVEE_object_data_get(Object *ob)
+{
+       return (EEVEE_ObjectEngineData *)DRW_object_engine_data_get(
+               ob, &draw_engine_eevee_type);
+}
+
 EEVEE_ObjectEngineData *EEVEE_object_data_ensure(Object *ob)
 {
        EEVEE_ObjectEngineData **oedata = (EEVEE_ObjectEngineData **)DRW_object_engine_data_ensure(
@@ -102,6 +114,12 @@ EEVEE_ObjectEngineData *EEVEE_object_data_ensure(Object *ob)
        return *oedata;
 }
 
+EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_get(Object *ob)
+{
+       return (EEVEE_LightProbeEngineData *)DRW_object_engine_data_get(
+               ob, &draw_engine_eevee_type);
+}
+
 EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_ensure(Object *ob)
 {
        EEVEE_LightProbeEngineData **pedata = (EEVEE_LightProbeEngineData **)DRW_object_engine_data_ensure(
@@ -116,6 +134,12 @@ EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_ensure(Object *ob)
        return *pedata;
 }
 
+EEVEE_LampEngineData *EEVEE_lamp_data_get(Object *ob)
+{
+       return (EEVEE_LampEngineData *)DRW_object_engine_data_get(
+               ob, &draw_engine_eevee_type);
+}
+
 EEVEE_LampEngineData *EEVEE_lamp_data_ensure(Object *ob)
 {
        EEVEE_LampEngineData **ledata = (EEVEE_LampEngineData **)DRW_object_engine_data_ensure(