MCPcopy Create free account
hub / github.com/MethanePowered/MethaneKit / Compute

Method Compute

Apps/08-ConsoleCompute/ConsoleComputeApp.cpp:208–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208void ConsoleComputeApp::Compute()
209{
210 META_FUNCTION_TASK();
211 const data::FrameSize& field_size = GetFieldSize();
212 const rhi::CommandQueue& compute_cmd_queue = m_compute_context.GetComputeCommandKit().GetQueue();
213 const rhi::ThreadGroupSize& thread_group_size = m_compute_state.GetSettings().thread_group_size;
214 const rhi::ThreadGroupsCount thread_groups_count(data::DivCeil(field_size.GetWidth(), thread_group_size.GetWidth()),
215 data::DivCeil(field_size.GetHeight(), thread_group_size.GetHeight()),
216 1U);
217
218 META_DEBUG_GROUP_VAR(s_debum_group, "Compute Frame");
219 m_compute_cmd_list.ResetWithState(m_compute_state, &s_debum_group);
220 m_compute_cmd_list.SetProgramBindings(m_compute_bindings);
221 m_compute_cmd_list.Dispatch(thread_groups_count);
222 m_compute_cmd_list.Commit();
223
224 compute_cmd_queue.Execute(m_compute_cmd_list_set);
225 m_compute_context.WaitForGpu(rhi::ContextWaitFor::ComputeComplete);
226 m_frame_data = m_frame_texture.GetData(compute_cmd_queue);
227 m_fps_counter.OnCpuFrameReadyToPresent();
228}
229
230void ConsoleComputeApp::Present(ftxui::Canvas& canvas)
231{

Callers

nothing calls this directly

Calls 13

DivCeilFunction · 0.85
GetQueueMethod · 0.80
GetComputeCommandKitMethod · 0.45
GetWidthMethod · 0.45
GetHeightMethod · 0.45
ResetWithStateMethod · 0.45
SetProgramBindingsMethod · 0.45
DispatchMethod · 0.45
CommitMethod · 0.45
ExecuteMethod · 0.45
WaitForGpuMethod · 0.45

Tested by

no test coverage detected