57 {
59
60 RenderBehaveBuilder builder{ this ,frameInfo.m_FrameIndex, frameInfo.m_ImageIndex };
61
62 builder.BeginRenderPass();
63
65
67
68 static std::function<void(Entity)> drawSelected = [&](Entity
e) {
69
70 if (
e.HasComponent<MeshComponent>())
71 {
72 MeshComponent& meshComp =
e.GetComponent<MeshComponent>();
73
75 builder.BindPipeline("WorldPickRenderer.WorldPick.Default");
76
77 builder.UpdatePushConstant<uint64_t>([&](auto& push) {
78 push = meshPack->GetMeshDesc().GetBufferAddress();
79 });
80 });
81 }
82
83 if (
e.HasComponent<SpriteComponent>())
84 {
85 SpriteComponent& meshComp =
e.GetComponent<SpriteComponent>();
86
88 builder.BindPipeline("WorldPickRenderer.WorldPick.Default");
89
90 builder.UpdatePushConstant<uint64_t>([&](auto& push) {
91 push = meshPack->GetMeshDesc().GetBufferAddress();
92 });
93 });
94 }
95 };
96
97 frameInfo.m_PickEntityID.for_each([&](const auto& k, const auto& v) {
98
99 Entity
e = frameInfo.m_World->QueryEntitybyID(k);
100
101 drawSelected(e);
102
103 if (
e.HasComponent<EntityComponent>())
104 {
105 EntityComponent& entityComp =
e.GetComponent<EntityComponent>();
106
107 for (auto& entity : entityComp.GetEntities())
108 {
109 Entity child = frameInfo.m_World->QueryEntitybyID(entity);
110 drawSelected(child);
111 }
112 }
113
114 return false;
115 });
116
117 builder.EndRenderPass();
118 }
#define SPICES_PROFILE_ZONE
static DescriptorSetInfo & GetByName(const String2 &name)
Get a DescriptorSetInfo by owner's name.
std::shared_ptr< RendererPass > m_Pass
RendererPass.
VulkanState & m_VulkanState
This variable is passed while renderer instanced.
std::array< VkCommandBuffer, MaxFrameInFlight > m_GraphicCommandBuffer