diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a68fb2e..93b78732 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -346,7 +346,6 @@ foreach(TARGET_NAME wivrn wivrn-server wivrn-dashboard wivrn-common wivrn-dissec -Wno-missing-field-initializers -Wno-unused-parameter -Wno-comment - -Wno-unused-variable -Wno-sign-compare $<$:-Wno-volatile -Wno-array-bounds> $<$:-Wno-deprecated-volatile -Wno-unneeded-internal-declaration -Wno-c99-extensions -Wno-unused-private-field> diff --git a/client/audio/linux/audio.cpp b/client/audio/linux/audio.cpp index f811d205..3d54d557 100644 --- a/client/audio/linux/audio.cpp +++ b/client/audio/linux/audio.cpp @@ -63,7 +63,7 @@ constexpr uint32_t target_latency_ms = 5; void init_pipewire() { - static bool done = [] { + [[maybe_unused]] static bool done = [] { int argc = 0; pw_init(&argc, nullptr); return true; diff --git a/client/render/animation.cpp b/client/render/animation.cpp index fd00b95e..afccef90 100644 --- a/client/render/animation.cpp +++ b/client/render/animation.cpp @@ -77,7 +77,6 @@ glm::quat cubic_spline(const glm::quat & a, const glm::quat & vb, const glm::qua template void apply_track(entt::registry & scene, const components::animation_track_impl & track, float current_time) { - entt::entity target = track.target; auto interpolation = track.interpolation; auto field = track.field; auto & value = scene.get(track.target).*field; diff --git a/client/render/imgui_impl.cpp b/client/render/imgui_impl.cpp index e511c494..784ac78a 100644 --- a/client/render/imgui_impl.cpp +++ b/client/render/imgui_impl.cpp @@ -560,7 +560,6 @@ void imgui_context::initialize_fonts() std::vector imgui_context::read_controllers_state(XrTime display_time) { float scroll_scale = io.DeltaTime * constants::gui::scroll_ratio; - size_t new_focused_controller = focused_controller; std::vector new_states; new_states.resize(controllers.size()); diff --git a/client/render/scene_loader.cpp b/client/render/scene_loader.cpp index e5663f6d..527efab2 100644 --- a/client/render/scene_loader.cpp +++ b/client/render/scene_loader.cpp @@ -198,7 +198,6 @@ std::vector read_vertex_attribute_aux2(const fastgltf::Asset & asset std::vector output; output.resize(accessor.count); - size_t index = 0; switch (fastgltf::getNumComponents(accessor.type)) { case 1: @@ -549,7 +548,6 @@ class loader_context fastgltf::Asset & gltf; vk::raii::PhysicalDevice physical_device; vk::raii::Device & device; - thread_safe & queue; image_loader loader; const std::map, std::string> & extras; @@ -581,7 +579,6 @@ public: gltf(gltf), physical_device(physical_device), device(device), - queue(queue), loader(device, physical_device, queue, queue_family_index), extras(extras) { @@ -1080,7 +1077,6 @@ public: break; } - size_t count = time.count; switch (channel.path) { // TODO: templatize the switch @@ -1264,7 +1260,6 @@ static void write_cache_entry(const std::filesystem::path & path, const cache_en { auto mtime = std::chrono::file_clock::to_sys(std::filesystem::last_write_time(entry.filename)); auto timestamp = std::chrono::duration_cast(mtime.time_since_epoch()).count(); - auto size = entry.size; json << ",\"timestamp\":" << timestamp; } diff --git a/client/scenes/gui_settings.cpp b/client/scenes/gui_settings.cpp index d9607f9a..ca1ec440 100644 --- a/client/scenes/gui_settings.cpp +++ b/client/scenes/gui_settings.cpp @@ -31,7 +31,6 @@ #include "render/imgui_impl.h" #include "render/ui_theme.h" #include "render/ui_widgets.h" -#include "stream.h" #include "utils/i18n.h" #include "xr/instance.h" #include "xr/session.h" @@ -488,7 +487,7 @@ void settings_post_processing(const settings_context & ctx) o.push_back(flag_name(f)); return o; }, .title = std::move(title), - .default_int = index(flags, config.openxr_post_processing.*member).value_or(0), + .default_int = index(flags, default_config.openxr_post_processing.*member).value_or(0), }); }; diff --git a/client/scenes/gui_settings.h b/client/scenes/gui_settings.h index 68341f1f..8668cc29 100644 --- a/client/scenes/gui_settings.h +++ b/client/scenes/gui_settings.h @@ -21,6 +21,7 @@ #include #include +#include class configuration; class imgui_context; @@ -39,7 +40,7 @@ namespace wivrn::gui struct settings_context { configuration & config; - configuration & default_config; + const configuration & default_config; xr::instance & instance; xr::session & session; xr::system & system; diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index 90f63f3b..785b0105 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -1115,7 +1115,6 @@ std::vector> scenes::lobby::draw_gui(XrTi ImGui::SetNextWindowSize({1400, 900}); ImGui::Begin("WiVRn", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove); - auto & config = application::get_config(); const float TopBarH = wivrn::ui::metrics::top_bar_height; // Top bar: logo left, feature toggles / battery / connection status right diff --git a/client/scenes/lobby_gui_customize.cpp b/client/scenes/lobby_gui_customize.cpp index d1bf343e..59bbb567 100644 --- a/client/scenes/lobby_gui_customize.cpp +++ b/client/scenes/lobby_gui_customize.cpp @@ -642,8 +642,6 @@ libcurl::curl_handle * scenes::lobby::parse_environment_list() void scenes::lobby::gui_customize(XrTime predicted_display_time) { - auto & config = application::get_config(); - namespace ui = wivrn::ui; ui::page_header(_cS("page header title", "Environment"), _cS("page header subtitle", "Choose the environment your panels float in.")); diff --git a/client/scenes/lobby_keyboard.cpp b/client/scenes/lobby_keyboard.cpp index 51cfea20..eb3f16c0 100644 --- a/client/scenes/lobby_keyboard.cpp +++ b/client/scenes/lobby_keyboard.cpp @@ -316,17 +316,7 @@ virtual_keyboard::key_status virtual_keyboard::button_behavior(const ImRect & bb if (mouse_down) { held = true; - - float prev_held_duration = held_duration; held_duration += g.IO.DeltaTime; - // if ((flags & ImGuiButtonFlags_Repeat) and held_duration > g.IO.KeyRepeatDelay) - // { - // int n1 = (prev_held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate; - // int n2 = (held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate; - // - // if (n2 != n1) - // pressed = true; - // } } else { diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index f36dc535..ffdd8b9c 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -894,8 +894,6 @@ void scenes::stream::render(const XrFrameState & frame_state) session.begin_frame(); - std::array image_indices; - #if WIVRN_FEATURE_RENDERDOC renderdoc_begin(*vk_instance); #endif diff --git a/client/scenes/stream_defoveator.cpp b/client/scenes/stream_defoveator.cpp index 0f0888a7..754a7842 100644 --- a/client/scenes/stream_defoveator.cpp +++ b/client/scenes/stream_defoveator.cpp @@ -119,8 +119,6 @@ stream_defoveator::pipeline_t & stream_defoveator::ensure_pipeline(size_t view, target.layout = vk::raii::PipelineLayout(device, pipeline_layout_info); - const auto & vk_device_extensions = application::get_vk_device_extensions(); - // Vertex shader auto vertex_shader = load_shader(device, "reprojection.vert"); diff --git a/client/scenes/stream_gui.cpp b/client/scenes/stream_gui.cpp index a841153b..a5a60e8d 100644 --- a/client/scenes/stream_gui.cpp +++ b/client/scenes/stream_gui.cpp @@ -363,8 +363,6 @@ void scenes::stream::gui_performance_metrics() void scenes::stream::gui_compact_view() { - const auto & metrics = global_metrics[(metrics_offset + global_metrics.size() - 1) % global_metrics.size()]; - if (ImGui::BeginTable("metrics", 2)) { auto f = [&](const char * label, float value, const char * unit) { diff --git a/client/scenes/stream_tracking.cpp b/client/scenes/stream_tracking.cpp index 2cc4c2e1..43d5c1bb 100644 --- a/client/scenes/stream_tracking.cpp +++ b/client/scenes/stream_tracking.cpp @@ -280,7 +280,6 @@ void scenes::stream::tracking() float applied_height_offset = config.get_height_offset(); xr::space height_offset_space = make_height_offset_space(applied_height_offset); - XrTime t0 = instance.now(); from_headset::tracking tracking; std::vector hands; std::vector> body; diff --git a/client/vk/shader.cpp b/client/vk/shader.cpp index e610c938..941dc01a 100644 --- a/client/vk/shader.cpp +++ b/client/vk/shader.cpp @@ -72,14 +72,6 @@ std::shared_ptr shader_loader::operator()(std::span spir for (SpvReflectSpecializationConstant * variable: enumerate(spvReflectEnumerateSpecializationConstants, reflect)) specialization_constants.emplace_back(variable->constant_id, variable->name); - for (SpvReflectDescriptorSet * variable: enumerate(spvReflectEnumerateDescriptorSets, reflect)) - { - } - - for (SpvReflectDescriptorBinding * variable: enumerate(spvReflectEnumerateDescriptorBindings, reflect)) - { - } - spvReflectDestroyShaderModule(&reflect); } else diff --git a/server/audio/audio_pipewire.cpp b/server/audio/audio_pipewire.cpp index a89aed81..ab9117a4 100644 --- a/server/audio/audio_pipewire.cpp +++ b/server/audio/audio_pipewire.cpp @@ -105,7 +105,6 @@ struct pipewire_device : public audio_device // Calculate quantum size: 5ms buffer for low latency while maintaining stability // Smaller buffers (<5ms) risk underruns, larger ones (>10ms) add perceptible latency uint32_t quantum_size = (desc.speaker->sample_rate * 5) / 1000; - uint32_t frame_size = desc.speaker->num_channels * sizeof(int16_t); std::string rate_str = std::format("1/{}", desc.speaker->sample_rate); std::string latency_str = std::format("{}/{}", quantum_size, desc.speaker->sample_rate); @@ -185,7 +184,6 @@ struct pipewire_device : public audio_device // Calculate quantum size: 5ms buffer for low latency while maintaining stability // Smaller buffers (<5ms) risk underruns, larger ones (>10ms) add perceptible latency uint32_t quantum_size = (desc.microphone->sample_rate * 5) / 1000; - uint32_t frame_size = desc.microphone->num_channels * sizeof(int16_t); std::string rate_str = std::format("1/{}", desc.microphone->sample_rate); std::string latency_str = std::format("{}/{}", quantum_size, desc.microphone->sample_rate); diff --git a/server/compositor/compositor.cpp b/server/compositor/compositor.cpp index 43373995..a3f88445 100644 --- a/server/compositor/compositor.cpp +++ b/server/compositor/compositor.cpp @@ -494,7 +494,7 @@ xrt_result_t compositor::layer_commit(xrt_graphics_sync_handle_t sync_handle) info.frame_id); } - auto j = encode_request.exchange(i); + [[maybe_unused]] auto j = encode_request.exchange(i); encode_request.notify_all(); assert(j == -1); diff --git a/server/compositor/foveation.cpp b/server/compositor/foveation.cpp index b973da65..93f5757d 100644 --- a/server/compositor/foveation.cpp +++ b/server/compositor/foveation.cpp @@ -594,7 +594,6 @@ std::array foveation::foveate( bool alpha) { update_ubo(cmd, flip_y, src_rect, src_fov); - auto ubo = gpu_buffer.data(); std::array src_image_info{ vk::DescriptorImageInfo{ diff --git a/server/compositor/pacer.cpp b/server/compositor/pacer.cpp index e4fb501b..a3b4fc4c 100644 --- a/server/compositor/pacer.cpp +++ b/server/compositor/pacer.cpp @@ -157,7 +157,6 @@ void pacer::on_feedback(const wivrn::from_headset::feedback & feedback, const cl if (d < 0) d += frame_duration_ns; d -= frame_duration_ns / 2; - auto l = last_ns; last_ns += d / 10; } diff --git a/server/driver/pose_list.cpp b/server/driver/pose_list.cpp index 0a2f6573..f6bbc1c8 100644 --- a/server/driver/pose_list.cpp +++ b/server/driver/pose_list.cpp @@ -77,7 +77,6 @@ xrt_space_relation pose_list::extrapolate(const xrt_space_relation & a, const xr float dt = (t - tb) / 1.e9; - float dt2_over_2 = dt * dt / 2; res.pose.position = res.pose.position + lin_vel * dt; if (res.relation_flags & XRT_SPACE_RELATION_ANGULAR_VELOCITY_VALID_BIT) diff --git a/server/driver/wivrn_body_tracker.cpp b/server/driver/wivrn_body_tracker.cpp index d474d963..f930c503 100644 --- a/server/driver/wivrn_body_tracker.cpp +++ b/server/driver/wivrn_body_tracker.cpp @@ -197,7 +197,6 @@ void body_joints_list::update_tracking(const wivrn::from_headset::meta_body & tr if (auto it = parent.virtual_trackers.find(joint); it != parent.virtual_trackers.cend()) { - const auto body_part = parent.joint_body_parts.at(joint); auto & tracker = it->second; // Quest reports VALID bit not TRACKED bit, make sure TRACKED is set when VALID @@ -240,7 +239,6 @@ void body_joints_list::update_tracking(const wivrn::from_headset::bd_body & trac if (auto it = parent.virtual_trackers.find(joint); it != parent.virtual_trackers.cend()) { - const auto body_part = parent.joint_body_parts.at(joint); auto & tracker = it->second; tracker.update_tracking(tracking.production_timestamp, tracking.timestamp, pose, offset); } diff --git a/server/driver/wivrn_session.cpp b/server/driver/wivrn_session.cpp index 7311b638..ce4e67a4 100644 --- a/server/driver/wivrn_session.cpp +++ b/server/driver/wivrn_session.cpp @@ -831,6 +831,10 @@ void wivrn_session::operator()(from_headset::visibility_mask_changed && mask) }, }; auto result = xrt_session_event_sink_push(&xrt_system.broadcast, &event); + if (result != XRT_SUCCESS) + { + U_LOG_W("failed to push visibility mask changed event"); + } } void wivrn_session::operator()(from_headset::session_state_changed && event) diff --git a/server/target_instance_wivrn.cpp b/server/target_instance_wivrn.cpp index 59807d63..d6ded070 100644 --- a/server/target_instance_wivrn.cpp +++ b/server/target_instance_wivrn.cpp @@ -53,7 +53,6 @@ xrt_result_t instance::create_system( auto u_sys = b_system_create(); *out_xsys = &u_sys->base; - struct xrt_system_compositor * xsysc = NULL; auto res = wivrn::wivrn_session::create_session( std::move(connection), *u_sys, diff --git a/server/utils/wivrn_vk_bundle.cpp b/server/utils/wivrn_vk_bundle.cpp index 705493a0..74656def 100644 --- a/server/utils/wivrn_vk_bundle.cpp +++ b/server/utils/wivrn_vk_bundle.cpp @@ -289,8 +289,6 @@ wivrn::vk_bundle::vk_bundle() : device_extensions.push_back(*it); } - float prio = 1.0; - std::vector queues_info; int queue_index = get_queue_index(queues, queues_info, queue.family_index); U_LOG_D("queue index: %d", queue_index); diff --git a/tools/wireshark/dissector.cpp b/tools/wireshark/dissector.cpp index ef495530..4dfc5e8f 100644 --- a/tools/wireshark/dissector.cpp +++ b/tools/wireshark/dissector.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -171,7 +170,7 @@ ftenum field_type = FT_UINT32; template <> ftenum field_type = FT_UINT64; template <> -ftenum field_type = FT_INT8; +[[maybe_unused]] ftenum field_type = FT_INT8; template <> ftenum field_type = FT_INT16; template <> @@ -181,7 +180,7 @@ ftenum field_type = FT_INT64; template <> ftenum field_type = FT_FLOAT; template <> -ftenum field_type = FT_DOUBLE; +[[maybe_unused]] ftenum field_type = FT_DOUBLE; } // namespace details @@ -491,9 +490,6 @@ struct tree_traits> static void dissect(proto_tree * tree, tvbuff_t * tvb, int & start) { - int start2 = start; - size_t size2 = size(tvb, start2); - bool has_value = get_uint8(tvb, start); if (has_value) diff --git a/tools/wivrnctl/main.cpp b/tools/wivrnctl/main.cpp index ca089845..9f2433f4 100644 --- a/tools/wivrnctl/main.cpp +++ b/tools/wivrnctl/main.cpp @@ -336,19 +336,19 @@ int main(int argc, char ** argv) int pairing_duration; auto pair_command = app.add_subcommand("pair", "Allow a new headset to connect") ->callback([&]() { return pair(pairing_duration); }); - auto duration = pair_command - ->add_option("--duration,-d", pairing_duration, "Duration in minutes to allow new connections") - ->transform(CLI::Validator([](std::string & input) { - if (input.starts_with("-")) - throw CLI::ValidationError("duration must be positive"); - if (input == "unlimited") - input = "-1"; - return ""; - }, - "", - "")) - ->default_val(2) - ->option_text("INT|unlimited"); + pair_command + ->add_option("--duration,-d", pairing_duration, "Duration in minutes to allow new connections") + ->transform(CLI::Validator([](std::string & input) { + if (input.starts_with("-")) + throw CLI::ValidationError("duration must be positive"); + if (input == "unlimited") + input = "-1"; + return ""; + }, + "", + "")) + ->default_val(2) + ->option_text("INT|unlimited"); size_t headset_id; auto unpair_command = app.add_subcommand("unpair", "Remove a headset")