diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index a67ef0f4..5e9e2126 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -96,7 +96,6 @@ target_compile_definitions(wivrn PRIVATE IMGUI_USE_WCHAR32) target_compile_definitions(wivrn PRIVATE IMGUI_ENABLE_FREETYPE) # target_compile_definitions(wivrn PRIVATE IMGUI_DISABLE_OBSOLETE_FUNCTIONS) # incompatible with implot # target_compile_definitions(wivrn PRIVATE IMGUI_ENABLE_FREETYPE_LUNASVG) -target_compile_definitions(wivrn PRIVATE IMGUI_DEFINE_MATH_OPERATORS) target_compile_features(wivrn PRIVATE cxx_std_20) target_compile_definitions(wivrn PRIVATE "XR_USE_TIMESPEC=1") diff --git a/client/render/image_loader.cpp b/client/render/image_loader.cpp index b88515d3..ceb0069e 100644 --- a/client/render/image_loader.cpp +++ b/client/render/image_loader.cpp @@ -340,7 +340,8 @@ void image_loader::do_load_raw(const void * pixels, vk::Extent3D extent, vk::For info.setCommandBuffers(*cb); auto fence = device.createFence(vk::FenceCreateInfo{}); queue.submit(info, *fence); - device.waitForFences(*fence, true, 1'000'000'000); + if (auto result = device.waitForFences(*fence, true, 1'000'000'000); result != vk::Result::eSuccess) + throw std::runtime_error("vkWaitForfences: " + vk::to_string(result)); r->image_view = vk::raii::ImageView{device, vk::ImageViewCreateInfo{ .image = r->image, diff --git a/client/render/imgui_impl.cpp b/client/render/imgui_impl.cpp index c1cdad7c..b4c499a1 100644 --- a/client/render/imgui_impl.cpp +++ b/client/render/imgui_impl.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ - #include "imgui_impl.h" #include "implot.h" @@ -38,7 +37,7 @@ #include #include "image_loader.h" -#include "../external/IconsFontAwesome6.h" +#include "IconsFontAwesome6.h" /* Do not use: * @@ -472,7 +471,8 @@ XrCompositionLayerQuad imgui_context::end_frame() auto& cb = get_command_buffer().command_buffer; auto& fence = get_command_buffer().fence; - device.waitForFences(*fence, true, 1'000'000'000); // TODO check timeout + if (auto result = device.waitForFences(*fence, true, 1'000'000'000); result != vk::Result::eSuccess) + throw std::runtime_error("vkWaitForfences: " + vk::to_string(result)); device.resetFences(*fence); cb.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit}); @@ -531,7 +531,8 @@ imgui_context::~imgui_context() } // Wait for fences before ImGui_ImplVulkan_Shutdown is called - device.waitForFences(fences, true, 1'000'000'000); + if (auto result = device.waitForFences(fences, true, 1'000'000'000); result != vk::Result::eSuccess) + spdlog::error("vkWaitForfences: {}", vk::to_string(result)); ImGui_ImplVulkan_Shutdown(); ImPlot::DestroyContext(); diff --git a/client/render/scene_renderer.cpp b/client/render/scene_renderer.cpp index 905b4d71..ca897ff8 100644 --- a/client/render/scene_renderer.cpp +++ b/client/render/scene_renderer.cpp @@ -220,7 +220,8 @@ void scene_renderer::wait_idle() for(auto&& [i, f]: utils::enumerate(frame_resources)) fences[i] = *f.fence; - device.waitForFences(fences, true, 1'000'000'000); // TODO check for timeout + if (auto result = device.waitForFences(fences, true, 1'000'000'000); result != vk::Result::eSuccess) + throw std::runtime_error("vkWaitForfences: " + vk::to_string(result)); } // #define MSAA_4x @@ -537,7 +538,8 @@ void scene_renderer::start_frame() current_frame_index = (current_frame_index + 1) % frame_resources.size(); auto& f = current_frame(); - device.waitForFences(*f.fence, true, 1'000'000'000); + if (auto result = device.waitForFences(*f.fence, true, 1'000'000'000); result != vk::Result::eSuccess) + throw std::runtime_error("vkWaitForfences: " + vk::to_string(result)); device.resetFences(*f.fence); f.resources.clear(); diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index 501e6d01..f985464e 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -17,6 +17,8 @@ * along with this program. If not, see . */ +#define IMGUI_DEFINE_MATH_OPERATORS + #include "application.h" #include "imgui.h" #include "implot.h" @@ -233,11 +235,9 @@ void scenes::lobby::gui_server_list() if (!data.manual) { ImGui::SetCursorPos(ImVec2(pos.x, pos.y + 50)); - ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0,1,0,1)); if (ImGui::Checkbox(("Autoconnect##" + cookie).c_str(), &data.autoconnect)) save_config(); vibrate_on_hover(); - ImGui::PopStyleColor(); } // TODO diff --git a/client/scenes/lobby_keyboard.cpp b/client/scenes/lobby_keyboard.cpp index fbfaa07e..c90141d0 100644 --- a/client/scenes/lobby_keyboard.cpp +++ b/client/scenes/lobby_keyboard.cpp @@ -17,6 +17,8 @@ * along with this program. If not, see . */ +#define IMGUI_DEFINE_MATH_OPERATORS + #include "imgui.h" #include "imgui_internal.h" #include "lobby.h" @@ -311,7 +313,7 @@ static void draw_single_key(const key& k, int key_id, ImVec2 size_arg) return /*false*/; bool hovered, held; - bool pressed = button_behavior(bb, id, &hovered, &held, flags); + [[maybe_unused]] bool pressed = button_behavior(bb, id, &hovered, &held, flags); // Render const ImU32 col = ImGui::GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button); diff --git a/client/scenes/stream_stats.cpp b/client/scenes/stream_stats.cpp index 1718958e..e10d2e1d 100644 --- a/client/scenes/stream_stats.cpp +++ b/client/scenes/stream_stats.cpp @@ -17,6 +17,8 @@ * along with this program. If not, see . */ +#define IMGUI_DEFINE_MATH_OPERATORS + #include "stream.h" #include "application.h" @@ -202,7 +204,7 @@ XrCompositionLayerQuad scenes::stream::plot_performance_metrics(XrTime predicted for(auto&& [index, metrics]: utils::enumerate(decoder_metrics)) { std::string title = "Decoder " + std::to_string(index); - if (ImPlot::BeginPlot(title.c_str(), plot_size, ImPlotFlags_CanvasOnly | ImPlotFlags_NoChild)) + if (ImPlot::BeginPlot(title.c_str(), plot_size, ImPlotFlags_NoTitle | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMouseText | ImPlotFlags_NoChild)) { float min_v = 0; float max_v = compute_plot_max_value(&(metrics.data()->displayed), metrics.size(), sizeof(decoder_metric));