MCPcopy Create free account
hub / github.com/Ipotrick/Daxa / update

Method update

src/utils/impl_task_graph_ui.cpp:2486–2624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2484 }
2485
2486 auto TaskGraphDebugUi::update(TaskGraph & task_graph) -> bool
2487 {
2488 auto & ui_context = *r_cast<ImplTaskGraphDebugUi *>(this->object);
2489 auto * impl_tg = r_cast<ImplTaskGraph *>(task_graph.get());
2490
2491 ui_context.recreated = ui_context.last_exec_tg_unique_index != impl_tg->unique_index;
2492 ui_context.last_exec_tg_unique_index = impl_tg->unique_index;
2493
2494 /// ==============================================
2495 /// ======= PRE UPDATE RESOURCE VIEW STATE =======
2496 /// ==============================================
2497
2498 for (auto av_iter = ui_context.resource_viewer_states.begin(); av_iter != ui_context.resource_viewer_states.end();)
2499 {
2500 ResourceViewerState & state = av_iter->second;
2501 state.image.imgui_image_id = {};
2502 state.free_window = av_iter->second.free_window_next_frame;
2503
2504 state.open_frame_count += 1;
2505 u32 const readback_index = (state.open_frame_count) % READBACK_CIRCULAR_BUFFER_SIZE;
2506
2507 if (!state.image.readback_buffer.is_empty())
2508 {
2509 auto * readback_struct = ui_context.device.buffer_host_address_as<TaskGraphDebugUiImageReadbackStruct>(state.image.readback_buffer).value();
2510 state.image.latest_readback = readback_struct[readback_index];
2511 readback_struct[readback_index] = {
2512 .pos_min_value = ~0u,
2513 .neg_min_value = ~0u,
2514 };
2515 }
2516
2517 if (!state.image.destroy_display_image.is_empty())
2518 {
2519 ui_context.device.destroy_image(state.image.destroy_display_image);
2520 state.image.destroy_display_image = {};
2521 }
2522 if (!state.image.destroy_clone_image.is_empty())
2523 {
2524 ui_context.device.destroy_image(state.image.destroy_clone_image);
2525 state.image.destroy_clone_image = {};
2526 }
2527 ++av_iter;
2528 }
2529
2530 /// =======================================
2531 /// ======= TASK GRAPH MAIN UI TABS =======
2532 /// =======================================
2533
2534 bool open = true;
2535 if (ImGui::Begin("Task Graph Debug UI", &open, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollWithMouse))
2536 {
2537 ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None;
2538 if (ImGui::BeginTabBar("TgDebugUiTabBar", tab_bar_flags))
2539 {
2540 if (ImGui::BeginTabItem("Timeline"))
2541 {
2542 task_timeline_ui(ui_context, impl_tg);
2543 ImGui::EndTabItem();

Callers

nothing calls this directly

Calls 14

task_timeline_uiFunction · 0.85
memory_uiFunction · 0.85
resource_viewer_uiFunction · 0.85
destroy_resource_viewerFunction · 0.85
resource_detail_uiFunction · 0.85
task_details_uiFunction · 0.85
is_emptyMethod · 0.80
has_valueMethod · 0.80
containsMethod · 0.80
eraseMethod · 0.80
getMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected