Blender V5.3
eevee_sync.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11
12#pragma once
13
14#include "BKE_duplilist.hh"
15#include "BLI_function_ref.hh"
16#include "BLI_map.hh"
17#include "DNA_modifier_types.h"
18#include "DNA_object_types.h"
19#include "DRW_render.hh"
20
21#include "draw_handle.hh"
22
23namespace blender::eevee {
24
25using namespace draw;
26
27class Instance;
28
29/* -------------------------------------------------------------------- */
33
34struct BaseHandle {
35 const uint recalc = 0;
36};
37
40
41 ObjectHandle(const ObjectRef &ob_ref,
44 uint sub_key = 0)
45 : ObjectRef(ob_ref, sub_key), BaseHandle{recalc}, res_handle(res_handle) {};
46};
47
48struct WorldHandle : public BaseHandle {};
49
50struct Material;
51struct MaterialPass;
52
54 private:
55 Instance &inst_;
56
57 public:
58 SyncModule(Instance &inst) : inst_(inst) {};
60
62 const ResourceHandleRange &res_handle,
63 uint sub_key = 0);
64
65 void sync_mesh(const ObjectRef &ob_ref);
66 bool sync_sculpt(const ObjectRef &ob_ref);
67 void sync_pointcloud(const ObjectRef &ob_ref);
68 void sync_volume(const ObjectRef &ob_ref);
69 void sync_curves(const ObjectRef &ob_ref,
70 struct HairParticleInfo const *hair_particle = nullptr);
71
72 private:
73 void sync_common_passes(const Material &material,
74 FunctionRef<void(const MaterialPass &)> sync_cb);
75 void sync_volume_passes(const ObjectHandle &ob_handle,
76 const Material &material,
77 FunctionRef<void(const MaterialPass &, int)> sync_cb);
78 void sync_alpha_blended_passes(const ObjectHandle &ob_handle,
79 const Material &material,
80 FunctionRef<void(const MaterialPass &, int)> sync_cb);
81
82 void sync_common(const ObjectHandle &ob_handle,
83 Span<Material *> materials,
84 Span<GPUMaterial *> gpu_materials);
85};
86
93
95void foreach_hair_particle(Instance &inst, ObjectRef &ob_ref, HairHandleCallback callback);
96
98
99} // namespace blender::eevee
Object is a sort of wrapper for general info.
ObjectRef(Object *ob, Object *dupli_parent=nullptr, DupliObject *dupli_object=nullptr)
A running instance of the engine.
ObjectHandle sync_object(const ObjectRef &ob_ref, const ResourceHandleRange &res_handle, uint sub_key=0)
Definition eevee_sync.cc:32
void sync_curves(const ObjectRef &ob_ref, struct HairParticleInfo const *hair_particle=nullptr)
void sync_mesh(const ObjectRef &ob_ref)
void sync_pointcloud(const ObjectRef &ob_ref)
SyncModule(Instance &inst)
Definition eevee_sync.hh:58
void sync_volume(const ObjectRef &ob_ref)
bool sync_sculpt(const ObjectRef &ob_ref)
FunctionRef< void(const HairParticleInfo &)> HairHandleCallback
Definition eevee_sync.hh:94
void foreach_hair_particle(Instance &inst, ObjectRef &ob_ref, HairHandleCallback callback)
unsigned int uint
Definition BKE_text.h:55
ObjectHandle(const ObjectRef &ob_ref, const ResourceHandleRange &res_handle, uint recalc, uint sub_key=0)
Definition eevee_sync.hh:41
const ResourceHandleRange res_handle
Definition eevee_sync.hh:39