Merge branch 'sync' of https://github.com/Vindicus999/WiVRn into sync
This commit is contained in:
@@ -241,6 +241,9 @@ configuration::configuration(xr::system & system, xr::session & session)
|
||||
if (auto val = root["high_power_mode"]; val.is_bool())
|
||||
high_power_mode = val.get_bool();
|
||||
|
||||
if (auto val = root["fps_divider"]; val.is_uint64())
|
||||
fps_divider = (uint32_t)val.get_uint64();
|
||||
|
||||
if (auto val = root["extended_config"]; val.is_bool())
|
||||
extended_config = val.get_bool();
|
||||
}
|
||||
@@ -329,6 +332,7 @@ void configuration::save()
|
||||
json << ",\"locale\":" << json_string(locale);
|
||||
json << ",\"environment_model\":" << json_string(environment_model);
|
||||
json << ",\"high_power_mode\":" << std::boolalpha << high_power_mode;
|
||||
json << ",\"fps_divider\":" << fps_divider;
|
||||
json << ",\"extended_config\":" << std::boolalpha << extended_config;
|
||||
json << "}";
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ public:
|
||||
float override_foveation_distance = 3;
|
||||
|
||||
bool high_power_mode;
|
||||
uint32_t fps_divider = 1;
|
||||
|
||||
// Allow unsafe config values
|
||||
bool extended_config = false;
|
||||
|
||||
@@ -35,6 +35,8 @@ static std::string get_property(const char * property)
|
||||
{
|
||||
auto info = __system_property_find(property);
|
||||
std::string result;
|
||||
if (not info)
|
||||
return result;
|
||||
wrap_lambda cb = [&result](const char * name, const char * value, uint32_t serial) {
|
||||
result = value;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2022-2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
* Copyright (C) 2022-2026 Patrick Nicolas <patricknicolas@laposte.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gui_common.h"
|
||||
|
||||
#include "configuration.h"
|
||||
#include "render/imgui_impl.h"
|
||||
#include "utils/i18n.h"
|
||||
|
||||
#include "xr/instance.h"
|
||||
#include "xr/session.h"
|
||||
|
||||
#include "imgui.h"
|
||||
#include "imgui_internal.h"
|
||||
|
||||
namespace wivrn::gui
|
||||
{
|
||||
|
||||
std::string rate_label(float rate, uint32_t divider)
|
||||
{
|
||||
if (rate == 0)
|
||||
return _C("automatic refresh rate", "Automatic");
|
||||
if (divider == 1)
|
||||
return fmt::format("{}", rate);
|
||||
|
||||
return fmt::format(_cF("refresh rate selection, with reprojection", "{} ({} with space warp)"), rate / divider, rate);
|
||||
}
|
||||
|
||||
bool refresh_rate(
|
||||
xr::instance & instance,
|
||||
xr::session & session,
|
||||
imgui_context & imgui_ctx,
|
||||
configuration & config)
|
||||
{
|
||||
if (not instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
|
||||
return false;
|
||||
|
||||
const auto & refresh_rates = session.get_refresh_rates();
|
||||
if (refresh_rates.empty())
|
||||
return false;
|
||||
|
||||
bool changed = false;
|
||||
if (ImGui::BeginCombo(
|
||||
_S("Refresh rate"),
|
||||
rate_label(config.preferred_refresh_rate, config.fps_divider).c_str()))
|
||||
{
|
||||
if (ImGui::Selectable(
|
||||
_cS("automatic refresh rate", "Automatic"),
|
||||
config.preferred_refresh_rate == 0,
|
||||
ImGuiSelectableFlags_SelectOnRelease))
|
||||
{
|
||||
config.preferred_refresh_rate = 0;
|
||||
config.fps_divider = 1;
|
||||
config.save();
|
||||
changed = true;
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
imgui_ctx.tooltip(_("Select refresh rate based on measured application performance.\n"
|
||||
"May cause flicker when a change happens."));
|
||||
|
||||
for (uint32_t divider: {1, 2})
|
||||
{
|
||||
for (float rate: refresh_rates)
|
||||
{
|
||||
if (ImGui::Selectable(
|
||||
rate_label(rate, divider).c_str(),
|
||||
rate == config.preferred_refresh_rate and divider == config.fps_divider,
|
||||
ImGuiSelectableFlags_SelectOnRelease))
|
||||
{
|
||||
session.set_refresh_rate(rate);
|
||||
config.preferred_refresh_rate = rate;
|
||||
config.fps_divider = divider;
|
||||
config.save();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
imgui_ctx.vibrate_on_hover();
|
||||
|
||||
if (config.preferred_refresh_rate == 0 and refresh_rates.size() > 2)
|
||||
{
|
||||
float min_rate = config.minimum_refresh_rate.value_or(refresh_rates.front());
|
||||
if (ImGui::BeginCombo(_S("Minimum refresh rate"), fmt::format("{}", min_rate).c_str()))
|
||||
{
|
||||
for (float rate: refresh_rates | std::views::take(refresh_rates.size() - 1))
|
||||
{
|
||||
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == config.minimum_refresh_rate, ImGuiSelectableFlags_SelectOnRelease))
|
||||
{
|
||||
config.minimum_refresh_rate = rate;
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
imgui_ctx.vibrate_on_hover();
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
} // namespace wivrn::gui
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* WiVRn VR streaming
|
||||
* Copyright (C) 2022-2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
|
||||
* Copyright (C) 2022-2026 Patrick Nicolas <patricknicolas@laposte.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
class configuration;
|
||||
class imgui_context;
|
||||
|
||||
namespace xr
|
||||
{
|
||||
class instance;
|
||||
class session;
|
||||
} // namespace xr
|
||||
|
||||
namespace wivrn
|
||||
{
|
||||
|
||||
namespace gui
|
||||
{
|
||||
|
||||
bool refresh_rate(
|
||||
xr::instance & instance,
|
||||
xr::session & session,
|
||||
imgui_context & imgui_ctx,
|
||||
configuration & config);
|
||||
|
||||
}
|
||||
} // namespace wivrn
|
||||
@@ -1320,7 +1320,6 @@ void scenes::lobby::on_focused()
|
||||
std::ranges::sort(local_environments, std::less{});
|
||||
|
||||
setup_passthrough();
|
||||
multicast = application::get_wifi_lock().get_multicast_lock();
|
||||
discover.emplace();
|
||||
|
||||
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_CPU_EXT, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT);
|
||||
@@ -1352,8 +1351,6 @@ void scenes::lobby::on_unfocused()
|
||||
left_hand.reset();
|
||||
right_hand.reset();
|
||||
face_tracker.emplace<std::monostate>();
|
||||
|
||||
multicast.reset();
|
||||
}
|
||||
|
||||
void scenes::lobby::on_xr_event(const xr::event & event)
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include "scenes/lobby_keyboard.h"
|
||||
#include "utils/mapped_file.h"
|
||||
#include "utils/thread_safe.h"
|
||||
#include "wifi_lock.h"
|
||||
#include "wivrn_config.h"
|
||||
#include "wivrn_discover.h"
|
||||
#include "xr/face_tracker.h"
|
||||
@@ -51,7 +50,6 @@ class stream;
|
||||
class lobby : public scene_impl<lobby>
|
||||
{
|
||||
std::optional<wivrn_discover> discover;
|
||||
wifi_lock::multicast multicast;
|
||||
|
||||
std::string add_server_window_prettyname;
|
||||
std::string add_server_window_hostname;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "application.h"
|
||||
#include "configuration.h"
|
||||
#include "constants.h"
|
||||
#include "gui_common.h"
|
||||
#include "imgui.h"
|
||||
#include "lobby.h"
|
||||
#include "scenes/stream.h" // IWYU pragma: keep
|
||||
@@ -614,54 +615,7 @@ void scenes::lobby::gui_settings()
|
||||
imgui_ctx->vibrate_on_hover();
|
||||
}
|
||||
|
||||
if (instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
|
||||
{
|
||||
const auto & refresh_rates = session.get_refresh_rates();
|
||||
if (not refresh_rates.empty())
|
||||
{
|
||||
float active_rate = config.preferred_refresh_rate;
|
||||
if (ImGui::BeginCombo(_S("Refresh rate"), active_rate ? fmt::format("{}", active_rate).c_str() : _cS("automatic refresh rate", "Automatic")))
|
||||
{
|
||||
if (ImGui::Selectable(_cS("automatic refresh rate", "Automatic"), active_rate == 0, ImGuiSelectableFlags_SelectOnRelease))
|
||||
{
|
||||
session.set_refresh_rate(0);
|
||||
config.preferred_refresh_rate = 0;
|
||||
config.save();
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
imgui_ctx->tooltip(_("Select refresh rate based on measured application performance.\nMay cause flicker when a change happens."));
|
||||
for (float rate: refresh_rates)
|
||||
{
|
||||
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == active_rate, ImGuiSelectableFlags_SelectOnRelease))
|
||||
{
|
||||
session.set_refresh_rate(rate);
|
||||
config.preferred_refresh_rate = rate;
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
imgui_ctx->vibrate_on_hover();
|
||||
|
||||
if (active_rate == 0 and refresh_rates.size() > 2)
|
||||
{
|
||||
float min_rate = config.minimum_refresh_rate.value_or(refresh_rates.front());
|
||||
if (ImGui::BeginCombo(_S("Minimum refresh rate"), fmt::format("{}", min_rate).c_str()))
|
||||
{
|
||||
for (float rate: refresh_rates | std::views::take(refresh_rates.size() - 1))
|
||||
{
|
||||
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == config.minimum_refresh_rate, ImGuiSelectableFlags_SelectOnRelease))
|
||||
{
|
||||
config.minimum_refresh_rate = rate;
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
imgui_ctx->vibrate_on_hover();
|
||||
}
|
||||
}
|
||||
}
|
||||
gui::refresh_rate(instance, session, *imgui_ctx, config);
|
||||
|
||||
// Render resolution
|
||||
{
|
||||
|
||||
+33
-31
@@ -235,6 +235,7 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
|
||||
info.settings.preferred_refresh_rate = config.preferred_refresh_rate;
|
||||
info.settings.minimum_refresh_rate = config.minimum_refresh_rate.value_or(0);
|
||||
}
|
||||
info.settings.fps_divider = config.fps_divider;
|
||||
|
||||
if (info.available_refresh_rates.empty())
|
||||
{
|
||||
@@ -977,10 +978,39 @@ void scenes::stream::render(const XrFrameState & frame_state)
|
||||
}
|
||||
}
|
||||
assert(swapchain);
|
||||
// defoveate the image
|
||||
// defoveate the image, apply scale/bias
|
||||
int image_index = swapchain.acquire();
|
||||
swapchain.wait();
|
||||
defoveator->defoveate(command_buffer, foveation, images, image_index);
|
||||
|
||||
switch (gui_status)
|
||||
{
|
||||
case stream_tab::hidden:
|
||||
case stream_tab::bitrate_settings:
|
||||
case stream_tab::foveation_settings:
|
||||
case stream_tab::compact:
|
||||
case stream_tab::overlay_only:
|
||||
dimming = dimming - frame_state.predictedDisplayPeriod / (1e9 * constants::stream::fade_duration);
|
||||
break;
|
||||
case stream_tab::stats:
|
||||
case stream_tab::settings:
|
||||
case stream_tab::applications:
|
||||
case stream_tab::application_launcher:
|
||||
dimming = dimming + frame_state.predictedDisplayPeriod / (1e9 * constants::stream::fade_duration);
|
||||
break;
|
||||
}
|
||||
|
||||
dimming = std::clamp<float>(dimming, 0, 1);
|
||||
float x = dimming * dimming * (3 - 2 * dimming); // Easing function
|
||||
|
||||
const float scale = std::lerp(1, constants::stream::dimming_scale, x);
|
||||
const float bias = std::lerp(0, constants::stream::dimming_bias, x);
|
||||
|
||||
defoveator->defoveate(command_buffer,
|
||||
foveation,
|
||||
images,
|
||||
{scale, scale, scale, 1.},
|
||||
{bias, bias, bias, 0.},
|
||||
image_index);
|
||||
|
||||
command_buffer.writeTimestamp(vk::PipelineStageFlagBits::eBottomOfPipe, *query_pool, 1);
|
||||
|
||||
@@ -1043,38 +1073,10 @@ void scenes::stream::render(const XrFrameState & frame_state)
|
||||
};
|
||||
}
|
||||
add_projection_layer(
|
||||
XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT,
|
||||
use_alpha ? XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT : 0,
|
||||
application::space(xr::spaces::world),
|
||||
layer_view);
|
||||
|
||||
if (composition_layer_color_scale_bias_supported)
|
||||
{
|
||||
switch (gui_status)
|
||||
{
|
||||
case stream_tab::hidden:
|
||||
case stream_tab::bitrate_settings:
|
||||
case stream_tab::foveation_settings:
|
||||
case stream_tab::compact:
|
||||
case stream_tab::overlay_only:
|
||||
dimming = dimming - frame_state.predictedDisplayPeriod / (1e9 * constants::stream::fade_duration);
|
||||
break;
|
||||
case stream_tab::stats:
|
||||
case stream_tab::settings:
|
||||
case stream_tab::applications:
|
||||
case stream_tab::application_launcher:
|
||||
dimming = dimming + frame_state.predictedDisplayPeriod / (1e9 * constants::stream::fade_duration);
|
||||
break;
|
||||
}
|
||||
|
||||
dimming = std::clamp<float>(dimming, 0, 1);
|
||||
float x = dimming * dimming * (3 - 2 * dimming); // Easing function
|
||||
|
||||
float scale = std::lerp(1, constants::stream::dimming_scale, x);
|
||||
float bias = std::lerp(0, constants::stream::dimming_bias, x);
|
||||
|
||||
set_color_scale_bias({scale, scale, scale, 1}, {bias, bias, bias, 0});
|
||||
}
|
||||
|
||||
if (const configuration::openxr_post_processing_settings openxr_post_processing = application::get_config().openxr_post_processing;
|
||||
(openxr_post_processing.sharpening | openxr_post_processing.super_sampling) > 0)
|
||||
set_layer_settings(openxr_post_processing.sharpening | openxr_post_processing.super_sampling);
|
||||
|
||||
@@ -43,6 +43,8 @@ struct vert_pc
|
||||
{
|
||||
glm::ivec4 rgb_rect;
|
||||
glm::ivec4 a_rect;
|
||||
std::array<float, 4> scale;
|
||||
std::array<float, 4> bias;
|
||||
};
|
||||
|
||||
void stream_defoveator::ensure_vertices(size_t num_vertices)
|
||||
@@ -104,7 +106,7 @@ stream_defoveator::pipeline_t & stream_defoveator::ensure_pipeline(size_t view,
|
||||
|
||||
// pipeline layout
|
||||
vk::PushConstantRange pc_range{
|
||||
.stageFlags = vk::ShaderStageFlagBits::eVertex,
|
||||
.stageFlags = vk::ShaderStageFlagBits::eVertex | vk::ShaderStageFlagBits::eFragment,
|
||||
.size = sizeof(vert_pc),
|
||||
};
|
||||
|
||||
@@ -304,6 +306,8 @@ static size_t required_vertices(const wivrn::to_headset::foveation_parameter & p
|
||||
void stream_defoveator::defoveate(vk::raii::CommandBuffer & command_buffer,
|
||||
const std::array<wivrn::to_headset::foveation_parameter, 2> & foveation,
|
||||
const std::array<input, 2> & inputs,
|
||||
std::array<float, 4> scale,
|
||||
std::array<float, 4> bias,
|
||||
int destination)
|
||||
{
|
||||
if (destination < 0 || destination >= (int)output_images.size())
|
||||
@@ -424,6 +428,8 @@ void stream_defoveator::defoveate(vk::raii::CommandBuffer & command_buffer,
|
||||
input.rect_a.offset.y,
|
||||
input.rect_a.extent.width,
|
||||
input.rect_a.extent.height),
|
||||
.scale = scale,
|
||||
.bias = bias,
|
||||
};
|
||||
|
||||
device.updateDescriptorSets(descriptor_writes, {});
|
||||
@@ -431,7 +437,7 @@ void stream_defoveator::defoveate(vk::raii::CommandBuffer & command_buffer,
|
||||
command_buffer.beginRenderPass(begin_info, vk::SubpassContents::eInline);
|
||||
command_buffer.bindPipeline(vk::PipelineBindPoint::eGraphics, *pipeline.pipeline);
|
||||
command_buffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, *pipeline.layout, 0, pipeline.ds, {});
|
||||
command_buffer.pushConstants<vert_pc>(*pipeline.layout, vk::ShaderStageFlagBits::eVertex, 0, pc);
|
||||
command_buffer.pushConstants<vert_pc>(*pipeline.layout, vk::ShaderStageFlagBits::eVertex | vk::ShaderStageFlagBits::eFragment, 0, pc);
|
||||
command_buffer.bindVertexBuffers(0, vk::Buffer(buffer), vertices_size * view);
|
||||
command_buffer.draw(required_vertices(foveation[view]), 1, 0, 0);
|
||||
command_buffer.endRenderPass();
|
||||
|
||||
@@ -87,6 +87,8 @@ public:
|
||||
vk::raii::CommandBuffer & command_buffer,
|
||||
const std::array<wivrn::to_headset::foveation_parameter, 2> & foveation,
|
||||
const std::array<input, 2> & inputs,
|
||||
std::array<float, 4> scale,
|
||||
std::array<float, 4> bias,
|
||||
int destination);
|
||||
|
||||
static XrExtent2Di defoveated_size(const wivrn::to_headset::foveation_parameter &);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "application.h"
|
||||
#include "constants.h"
|
||||
#include "gui_common.h"
|
||||
#include "imgui.h"
|
||||
#include "imgui_internal.h"
|
||||
#include "implot.h"
|
||||
@@ -377,21 +378,14 @@ void scenes::stream::gui_compact_view()
|
||||
}
|
||||
}
|
||||
|
||||
static void send_settings_changed_packet(xr::session & session, wivrn_session * network, const configuration & config, float predicted_display_period)
|
||||
static void send_settings_changed_packet(xr::session & session, wivrn_session * network, const configuration & config)
|
||||
{
|
||||
const auto & refresh_rates = session.get_refresh_rates();
|
||||
from_headset::settings_changed packet{
|
||||
.preferred_refresh_rate = config.preferred_refresh_rate,
|
||||
.minimum_refresh_rate = config.minimum_refresh_rate.value_or(0),
|
||||
.fps_divider = config.fps_divider,
|
||||
.bitrate_bps = config.bitrate_bps,
|
||||
};
|
||||
if (not refresh_rates.empty())
|
||||
{
|
||||
packet.preferred_refresh_rate = config.preferred_refresh_rate;
|
||||
packet.minimum_refresh_rate = config.minimum_refresh_rate.value_or(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
packet.preferred_refresh_rate = predicted_display_period;
|
||||
}
|
||||
network->send_control(std::move(packet));
|
||||
}
|
||||
|
||||
@@ -403,56 +397,8 @@ void scenes::stream::gui_settings(float predicted_display_period)
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(20, 20));
|
||||
|
||||
if (instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
|
||||
{
|
||||
const auto & refresh_rates = session.get_refresh_rates();
|
||||
if (not refresh_rates.empty())
|
||||
{
|
||||
float active_rate = config.preferred_refresh_rate;
|
||||
if (ImGui::BeginCombo(_S("Refresh rate"), active_rate ? fmt::format("{}", active_rate).c_str() : _cS("automatic refresh rate", "Automatic")))
|
||||
{
|
||||
if (ImGui::Selectable(_cS("automatic refresh rate", "Automatic"), active_rate == 0, ImGuiSelectableFlags_SelectOnRelease))
|
||||
{
|
||||
config.preferred_refresh_rate = 0;
|
||||
send_settings_changed_packet(session, network_session.get(), config, predicted_display_period);
|
||||
config.save();
|
||||
}
|
||||
if (ImGui::IsItemHovered())
|
||||
imgui_ctx->tooltip(_("Select refresh rate based on measured application performance.\nMay cause flicker when a change happens."));
|
||||
for (float rate: refresh_rates)
|
||||
{
|
||||
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == active_rate, ImGuiSelectableFlags_SelectOnRelease))
|
||||
{
|
||||
session.set_refresh_rate(rate);
|
||||
config.preferred_refresh_rate = rate;
|
||||
send_settings_changed_packet(session, network_session.get(), config, predicted_display_period);
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
imgui_ctx->vibrate_on_hover();
|
||||
|
||||
if (active_rate == 0 and refresh_rates.size() > 2)
|
||||
{
|
||||
float min_rate = config.minimum_refresh_rate.value_or(refresh_rates.front());
|
||||
if (ImGui::BeginCombo(_S("Minimum refresh rate"), fmt::format("{}", min_rate).c_str()))
|
||||
{
|
||||
for (float rate: refresh_rates | std::views::take(refresh_rates.size() - 1))
|
||||
{
|
||||
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == config.minimum_refresh_rate, ImGuiSelectableFlags_SelectOnRelease))
|
||||
{
|
||||
config.minimum_refresh_rate = rate;
|
||||
send_settings_changed_packet(session, network_session.get(), config, predicted_display_period);
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
imgui_ctx->vibrate_on_hover();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gui::refresh_rate(instance, session, *imgui_ctx, config))
|
||||
send_settings_changed_packet(session, network_session.get(), config);
|
||||
|
||||
{
|
||||
const auto text = _("Bitrate:");
|
||||
@@ -603,7 +549,7 @@ void scenes::stream::gui_bitrate_settings(float predicted_display_period)
|
||||
next_gui_status = stream_tab::settings;
|
||||
}
|
||||
|
||||
send_settings_changed_packet(session, network_session.get(), application::get_config(), predicted_display_period);
|
||||
send_settings_changed_packet(session, network_session.get(), application::get_config());
|
||||
}
|
||||
|
||||
void scenes::stream::gui_foveation_settings(float predicted_display_period)
|
||||
|
||||
@@ -18,6 +18,14 @@
|
||||
*/
|
||||
#version 450
|
||||
|
||||
layout(push_constant) uniform pc
|
||||
{
|
||||
ivec4 rgb_rect;
|
||||
ivec4 a_rect;
|
||||
vec4 scale;
|
||||
vec4 bias;
|
||||
};
|
||||
|
||||
#ifdef VERT_SHADER
|
||||
|
||||
layout (location = 0) in vec2 vPosition;
|
||||
@@ -25,12 +33,6 @@ layout (location = 1) in uvec2 vUV;
|
||||
|
||||
layout(location = 0) out vec4 outUV;
|
||||
|
||||
layout(push_constant) uniform pc
|
||||
{
|
||||
ivec4 rgb_rect;
|
||||
ivec4 a_rect;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(vPosition, 0.0, 1.0);
|
||||
@@ -70,7 +72,14 @@ vec4 sRGB_to_linear_rgba(vec4 x)
|
||||
void main()
|
||||
{
|
||||
if (alpha == 1)
|
||||
outColor = vec4(texture(rgb[0], inUV.xy).rgb, texture(rgb[1], inUV.zw).r);
|
||||
{
|
||||
// Avoid sampling between the eyes
|
||||
vec2 a = inUV.zw;
|
||||
float d = a.x - 0.5;
|
||||
if (abs(d) *a_rect.z < 1)
|
||||
a.x += (d > 0 ? 1 : -1) / float(a_rect.z);
|
||||
outColor = vec4(texture(rgb[0], inUV.xy).rgb, texture(rgb[1], a).r);
|
||||
}
|
||||
else
|
||||
outColor = texture(rgb[0], inUV.xy).rgba;
|
||||
|
||||
@@ -78,6 +87,21 @@ void main()
|
||||
{
|
||||
outColor = sRGB_to_linear_rgba(outColor);
|
||||
}
|
||||
|
||||
if (alpha == 0)
|
||||
{
|
||||
outColor = outColor * scale + bias;
|
||||
}
|
||||
else if (outColor.a < 0.02)
|
||||
{
|
||||
outColor = vec4(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
outColor.rgb /= outColor.a;
|
||||
outColor = outColor * scale + bias;
|
||||
outColor.rgb *= outColor.a;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#define _(x) boost::locale::gettext(x)
|
||||
#define _F(x) fmt::runtime(boost::locale::gettext(x))
|
||||
#define _cF(c, x) fmt::runtime(boost::locale::pgettext(c, x))
|
||||
#define _S(x) boost::locale::gettext(x).c_str()
|
||||
#define _C(c, x) boost::locale::pgettext(c, x)
|
||||
#define _cS(c, x) _C(c, x).c_str()
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "wivrn_discover.h"
|
||||
|
||||
#include "application.h"
|
||||
#include "mdns.h"
|
||||
#include "utils/named_thread.h"
|
||||
#include <arpa/inet.h>
|
||||
@@ -117,6 +119,7 @@ private:
|
||||
|
||||
for (ifaddrs * i = addresses; i; i = i->ifa_next)
|
||||
{
|
||||
spdlog::debug("address {} flags 0x{:x} required 0x{:x} forbidden 0x{:x}", uintptr_t(i->ifa_addr), i->ifa_flags, required_flags, forbidden_flags);
|
||||
if (i->ifa_addr == nullptr)
|
||||
continue;
|
||||
|
||||
@@ -135,7 +138,7 @@ private:
|
||||
// Ignore link-local addresses
|
||||
if (saddr->sin6_scope_id)
|
||||
{
|
||||
spdlog::trace("Ignoring link-local address {}", ip_address_to_string(i->ifa_addr));
|
||||
spdlog::debug("Ignoring link-local address {}", ip_address_to_string(i->ifa_addr));
|
||||
continue;
|
||||
}
|
||||
static const unsigned char localhost[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
|
||||
@@ -154,9 +157,11 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
spdlog::info("Cannot open socket bound to {}: {}", ip_address_to_string(i->ifa_addr), strerror(errno));
|
||||
spdlog::warn("Cannot open socket bound to {}: {}", ip_address_to_string(i->ifa_addr), strerror(errno));
|
||||
}
|
||||
}
|
||||
else
|
||||
spdlog::debug("ignore localhost (IPv6)");
|
||||
}
|
||||
else if (i->ifa_addr->sa_family == AF_INET)
|
||||
{
|
||||
@@ -177,9 +182,15 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
spdlog::info("Cannot open socket bound to {}: {}", ip_address_to_string(i->ifa_addr), strerror(errno));
|
||||
spdlog::warn("Cannot open socket bound to {}: {}", ip_address_to_string(i->ifa_addr), strerror(errno));
|
||||
}
|
||||
}
|
||||
else
|
||||
spdlog::debug("ignore localhost (IPv4)");
|
||||
}
|
||||
else
|
||||
{
|
||||
spdlog::warn("unknown family {}", i->ifa_addr->sa_family);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,6 +402,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (pollfds.size() < 2)
|
||||
open_client_sockets(5353);
|
||||
|
||||
log_query(record, service_name);
|
||||
std::array<uint8_t, 2048> buffer;
|
||||
for (size_t i = 1; i < pollfds.size(); i++)
|
||||
@@ -567,7 +581,9 @@ void wivrn_discover::discover(std::string service_name)
|
||||
}
|
||||
|
||||
wivrn_discover::wivrn_discover(std::string service_name) :
|
||||
cache(std::make_unique<dnssd_cache>()), dnssd_thread(utils::named_thread("dnssd_thread", &wivrn_discover::discover, this, service_name))
|
||||
multicast{application::get_wifi_lock().get_multicast_lock()},
|
||||
cache(std::make_unique<dnssd_cache>()),
|
||||
dnssd_thread(utils::named_thread("dnssd_thread", &wivrn_discover::discover, this, service_name))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "wifi_lock.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
@@ -32,6 +34,7 @@ public:
|
||||
static inline const std::chrono::milliseconds discover_period{5000};
|
||||
|
||||
private:
|
||||
wifi_lock::multicast multicast;
|
||||
std::unique_ptr<dnssd_cache> cache;
|
||||
|
||||
std::thread dnssd_thread;
|
||||
|
||||
@@ -240,6 +240,7 @@ struct settings_changed
|
||||
// for automatic
|
||||
float minimum_refresh_rate;
|
||||
|
||||
uint32_t fps_divider = 1;
|
||||
uint32_t bitrate_bps;
|
||||
};
|
||||
|
||||
|
||||
@@ -187,6 +187,14 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
|
||||
Dialogs.FolderDialog{
|
||||
id: openvr_browse
|
||||
onAccepted: {
|
||||
currentFolder = selectedFolder
|
||||
openvr_text.text = WivrnServer.host_path(new URL(selectedFolder).pathname);
|
||||
openvr_text.text = openvr_text.text.replace(/\/linux64$/, "").replace(/\/bin$/, "")
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
Kirigami.FormData.label: i18n("OpenVR compatibility library:")
|
||||
Layout.fillWidth: true
|
||||
@@ -211,6 +219,10 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
}
|
||||
onActivated: index => {
|
||||
if (openvr_libs.get(index).is_custom && openvr_text.text == "")
|
||||
openvr_browse.open()
|
||||
}
|
||||
}
|
||||
Controls.TextField {
|
||||
id: openvr_text
|
||||
@@ -218,6 +230,11 @@ Kirigami.ScrollablePage {
|
||||
visible: !!openvr_combobox.model.get(openvr_combobox.currentIndex)?.is_custom
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Controls.Button {
|
||||
text: i18nc("browse to choose the OpenVR compatility to use", "Browse")
|
||||
visible: openvr_text.visible
|
||||
onClicked: openvr_browse.open()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
# Keep in sync with CMakeLists.txt monado rev
|
||||
rev = lib.strings.trim (builtins.readFile ./monado-rev);
|
||||
# Nix will output the correct hash when it doesn't match
|
||||
hash = "sha256-M0SQMu1rgY++a+4r0DK//ralFEO5w7I3UrgLecoLO+A=";
|
||||
hash = "sha256-x8VuG9N1P0UL3Hy3XSI0gVVyF3sbWIhr6t2iu5Z+Flc=";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -256,16 +256,6 @@ modules:
|
||||
cleanup:
|
||||
- '*'
|
||||
|
||||
- name: qcoro
|
||||
buildsystem: cmake-ninja
|
||||
config-opts:
|
||||
- -DQCORO_BUILD_EXAMPLES=OFF
|
||||
- -DQCORO_BUILD_TESTING=OFF
|
||||
sources:
|
||||
- type: git
|
||||
url: https://github.com/qcoro/qcoro.git
|
||||
tag: v0.11.0
|
||||
|
||||
- name: opencomposite
|
||||
buildsystem: cmake-ninja
|
||||
build-options:
|
||||
|
||||
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WiVRn-dashboard\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-02-26 15:00+0100\n"
|
||||
"POT-Creation-Date: 2026-04-11 08:03+0200\n"
|
||||
"PO-Revision-Date: 2025-11-19 20:20+0100\n"
|
||||
"Last-Translator: Álvaro De Quinta <blackcherry@danwin1210.de>\n"
|
||||
"Language-Team: Spanish <>\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Qt Linguist 6.10.2\n"
|
||||
"X-Generator: Qt Linguist 6.11.0\n"
|
||||
"X-Language: es_ES\n"
|
||||
"X-Source-Language: en_US\n"
|
||||
|
||||
@@ -135,13 +135,13 @@ msgstr ""
|
||||
#: dashboard/qml/ApkInstallPage.qml:51 dashboard/qml/WizardPage.qml:204
|
||||
#, kde-format
|
||||
msgid ""
|
||||
"Follow the instructions in the <a href=\"https://github.com/WiVRn/WiVRn/blob/"
|
||||
"master/docs/building.md#client-headset\">documentation</a> to build your own "
|
||||
"client."
|
||||
"Follow the instructions in the <a "
|
||||
"href=\"https://github.com/WiVRn/WiVRn/blob/master/docs/building.md#client-headset\">documentation</a> "
|
||||
"to build your own client."
|
||||
msgstr ""
|
||||
"Sigue las instrucciones en la <a href=\"https://github.com/WiVRn/WiVRn/blob/"
|
||||
"master/docs/building.md#client-headset\">documentación</a> para compilar tu "
|
||||
"propio cliente."
|
||||
"Sigue las instrucciones en la <a "
|
||||
"href=\"https://github.com/WiVRn/WiVRn/blob/master/docs/building.md#client-headset\">documentación</a> "
|
||||
"para compilar tu propio cliente."
|
||||
|
||||
#: dashboard/qml/ConnectUsbDialog.qml:11
|
||||
#, kde-format
|
||||
@@ -620,16 +620,22 @@ msgstr "Personalizado"
|
||||
msgid "Disabled"
|
||||
msgstr "Deshabilitado"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:191
|
||||
#: dashboard/qml/SettingsPage.qml:199
|
||||
#, kde-format
|
||||
msgid "OpenVR compatibility library:"
|
||||
msgstr "Librería de compatibilidad para OpenVR:"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:217
|
||||
#: dashboard/qml/SettingsPage.qml:229
|
||||
#, kde-format
|
||||
msgid "Library path, excluding bin/linux64/vrclient.so"
|
||||
msgstr "Ruta de librería, excluyendo bin/linux64/vrclient.so"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:234
|
||||
#, kde-format
|
||||
msgctxt "browse to choose the OpenVR compatility to use"
|
||||
msgid "Browse"
|
||||
msgstr "Explorar"
|
||||
|
||||
#: dashboard/qml/SteamLaunchOptions.qml:8
|
||||
#, kde-format
|
||||
msgid ""
|
||||
@@ -708,9 +714,9 @@ msgstr "Tengo un error de \"Servidor WiVRn incompatible\" en mi visor"
|
||||
#: dashboard/qml/TroubleshootPage.qml:37
|
||||
#, kde-format
|
||||
msgid ""
|
||||
"<p>The version of the headset app and the server on your computer must match."
|
||||
"</p><ul><li>The headset app version is in the \"About\" page</li><li>The "
|
||||
"server version is <b>%1</b></li></ul>"
|
||||
"<p>The version of the headset app and the server on your computer must "
|
||||
"match.</p><ul><li>The headset app version is in the \"About\" "
|
||||
"page</li><li>The server version is <b>%1</b></li></ul>"
|
||||
msgstr ""
|
||||
"<p>La versión de la aplicación del visor y la del servidor en tu computadora "
|
||||
"deben coincidir.</p><ul><li>La versión de la aplicación del visor está en la "
|
||||
@@ -762,12 +768,13 @@ msgstr "Algunos juegos fallan al abrirse o tienen problemas de input"
|
||||
#: dashboard/qml/TroubleshootPage.qml:62
|
||||
#, kde-format
|
||||
msgid ""
|
||||
"For game specific issues, check on <a href=\"https://db.vronlinux.org/"
|
||||
"\">vronlinux DB</a> if there are known bugs or workarounds."
|
||||
"For game specific issues, check on <a "
|
||||
"href=\"https://db.vronlinux.org/\">vronlinux DB</a> if there are known bugs "
|
||||
"or workarounds."
|
||||
msgstr ""
|
||||
"Para problemas específicos de un juego, mirar en <a href=\"https://"
|
||||
"db.vronlinux.org/\">vronlinux DB</a> por si hubiese algún problema conocido "
|
||||
"o por soluciones."
|
||||
"Para problemas específicos de un juego, mirar en <a "
|
||||
"href=\"https://db.vronlinux.org/\">vronlinux DB</a> por si hubiese algún "
|
||||
"problema conocido o por soluciones."
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:79
|
||||
#, kde-format
|
||||
|
||||
+296
-292
File diff suppressed because it is too large
Load Diff
@@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WiVRn-dashboard\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-02-16 18:43+0100\n"
|
||||
"PO-Revision-Date: 2026-02-16 21:47+0100\n"
|
||||
"POT-Creation-Date: 2026-04-11 08:04+0200\n"
|
||||
"PO-Revision-Date: 2026-04-11 08:04+0200\n"
|
||||
"Last-Translator: Guillaume Meunier <guillaume.meunier@centraliens.net>\n"
|
||||
"Language-Team: French <>\n"
|
||||
"Language: French\n"
|
||||
@@ -468,19 +468,19 @@ msgstr "Dépannage"
|
||||
msgid "Version %1"
|
||||
msgstr "Version %1"
|
||||
|
||||
#: dashboard/qml/SelectGame.qml:14
|
||||
#: dashboard/qml/SelectGame.qml:12
|
||||
#, kde-format
|
||||
msgctxt "don't start an application automatically"
|
||||
msgid "None"
|
||||
msgstr "Aucune"
|
||||
|
||||
#: dashboard/qml/SelectGame.qml:20
|
||||
#: dashboard/qml/SelectGame.qml:18
|
||||
#, kde-format
|
||||
msgctxt "choose a custom application to start"
|
||||
msgid "Custom"
|
||||
msgstr "Personnalisé"
|
||||
|
||||
#: dashboard/qml/SelectGame.qml:72
|
||||
#: dashboard/qml/SelectGame.qml:70
|
||||
#, kde-format
|
||||
msgctxt "browse a file to choose the application to start"
|
||||
msgid "Browse"
|
||||
@@ -620,16 +620,22 @@ msgstr "Personnalisé"
|
||||
msgid "Disabled"
|
||||
msgstr "Désactivé"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:191
|
||||
#: dashboard/qml/SettingsPage.qml:199
|
||||
#, kde-format
|
||||
msgid "OpenVR compatibility library:"
|
||||
msgstr "Compatibilité OpenVR :"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:217
|
||||
#: dashboard/qml/SettingsPage.qml:229
|
||||
#, kde-format
|
||||
msgid "Library path, excluding bin/linux64/vrclient.so"
|
||||
msgstr "Chemin de la bibliothèque, en enlevant bin/linux64/vrclient.so"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:234
|
||||
#, kde-format
|
||||
msgctxt "browse to choose the OpenVR compatility to use"
|
||||
msgid "Browse"
|
||||
msgstr "Parcourir"
|
||||
|
||||
#: dashboard/qml/SteamLaunchOptions.qml:8
|
||||
#, kde-format
|
||||
msgid ""
|
||||
|
||||
+295
-306
File diff suppressed because it is too large
Load Diff
+293
-377
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WiVRn-dashboard\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-03-03 13:37+0900\n"
|
||||
"POT-Creation-Date: 2026-04-20 13:21+0900\n"
|
||||
"PO-Revision-Date: 2025-04-10 07:14+0900\n"
|
||||
"Last-Translator: Mitsuami Megane <hello@mitsua.me>\n"
|
||||
"Language-Team: Japanese <>\n"
|
||||
@@ -603,16 +603,22 @@ msgstr "カスタム"
|
||||
msgid "Disabled"
|
||||
msgstr "無し"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:191
|
||||
#: dashboard/qml/SettingsPage.qml:199
|
||||
#, kde-format
|
||||
msgid "OpenVR compatibility library:"
|
||||
msgstr "OpenVR実装ライブラリー"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:217
|
||||
#: dashboard/qml/SettingsPage.qml:229
|
||||
#, kde-format
|
||||
msgid "Library path, excluding bin/linux64/vrclient.so"
|
||||
msgstr "ライブラリーの場所(bin/linux64/vrclient.so 無し)"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:234
|
||||
#, kde-format
|
||||
msgctxt "browse to choose the OpenVR compatility to use"
|
||||
msgid "Browse"
|
||||
msgstr "検索"
|
||||
|
||||
#: dashboard/qml/SteamLaunchOptions.qml:8
|
||||
#, kde-format
|
||||
msgid ""
|
||||
|
||||
+168
-163
@@ -2,7 +2,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WiVRn 0.16\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-03-03 13:37+0900\n"
|
||||
"POT-Creation-Date: 2026-04-20 13:21+0900\n"
|
||||
"PO-Revision-Date: 2024-06-20 10:33+0900\n"
|
||||
"Last-Translator: Mitsuami Megane <hello@mitsua.me>\n"
|
||||
"Language: Japanese\n"
|
||||
@@ -36,6 +36,33 @@ msgstr "パソコンでVRアプリを起動するか、ここからアプリを
|
||||
msgid "Start an application on {} or select one to start streaming."
|
||||
msgstr "{}でVRアプリを起動するか、ここからアプリを選択しましょう。"
|
||||
|
||||
#: client/scenes/gui_common.cpp:38 client/scenes/gui_common.cpp:64
|
||||
msgctxt "automatic refresh rate"
|
||||
msgid "Automatic"
|
||||
msgstr "自動"
|
||||
|
||||
#: client/scenes/gui_common.cpp:42
|
||||
#, c++-format
|
||||
msgctxt "refresh rate selection, with reprojection"
|
||||
msgid "{} ({} with space warp)"
|
||||
msgstr "{} ({}、スペースワープ有効)"
|
||||
|
||||
#: client/scenes/gui_common.cpp:60
|
||||
msgid "Refresh rate"
|
||||
msgstr "リフレッシュレート"
|
||||
|
||||
#: client/scenes/gui_common.cpp:74
|
||||
msgid ""
|
||||
"Select refresh rate based on measured application performance.\n"
|
||||
"May cause flicker when a change happens."
|
||||
msgstr ""
|
||||
"アプリケーションのパフォーマンスを基づいて自動的に設定します。\n"
|
||||
"変更時にチラツキが発生する可能性があります。"
|
||||
|
||||
#: client/scenes/gui_common.cpp:101
|
||||
msgid "Minimum refresh rate"
|
||||
msgstr "最低リフレッシュレート"
|
||||
|
||||
#: client/scenes/lobby.cpp:221
|
||||
msgid "Incompatible WiVRn server: no protocol field in TXT"
|
||||
msgstr "互換性のないサーバー(プロトコルのフィールドは欠落)"
|
||||
@@ -67,85 +94,85 @@ msgstr "パススルー"
|
||||
msgid "Default environment"
|
||||
msgstr "デフォルトのホーム環境"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:101
|
||||
#: client/scenes/lobby_gui.cpp:102
|
||||
msgctxt "openxr_post_processing"
|
||||
msgid "Normal"
|
||||
msgstr "ノーマル"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:104
|
||||
#: client/scenes/lobby_gui.cpp:105
|
||||
msgctxt "openxr_post_processing"
|
||||
msgid "Quality"
|
||||
msgstr "クオリティ"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:106
|
||||
#: client/scenes/lobby_gui.cpp:107
|
||||
msgctxt "openxr_post_processing"
|
||||
msgid "Disabled"
|
||||
msgstr "無効"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:114 client/scenes/lobby_gui.cpp:254
|
||||
#: client/scenes/stream_gui.cpp:1026
|
||||
#: client/scenes/lobby_gui.cpp:115 client/scenes/lobby_gui.cpp:255
|
||||
#: client/scenes/stream_gui.cpp:973
|
||||
msgid "Disconnect"
|
||||
msgstr "切断する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:134 client/scenes/lobby_gui.cpp:264
|
||||
#: client/scenes/lobby_gui.cpp:135 client/scenes/lobby_gui.cpp:265
|
||||
#: client/scenes/lobby_gui_customize.cpp:752
|
||||
#: client/scenes/lobby_gui_customize.cpp:843
|
||||
#: client/scenes/lobby_gui_customize.cpp:899 client/scenes/stream_gui.cpp:1022
|
||||
#: client/scenes/lobby_gui_customize.cpp:899 client/scenes/stream_gui.cpp:969
|
||||
msgid "Close"
|
||||
msgstr "閉じる"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:140
|
||||
#: client/scenes/lobby_gui.cpp:141
|
||||
msgid "Connection"
|
||||
msgstr "接続"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:142
|
||||
#: client/scenes/lobby_gui.cpp:143
|
||||
#, c++-format
|
||||
msgid "Connection to {}"
|
||||
msgstr "{}に接続中"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:172
|
||||
#: client/scenes/lobby_gui.cpp:173
|
||||
msgid "PIN"
|
||||
msgstr "暗証番号"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:194
|
||||
#: client/scenes/lobby_gui.cpp:195
|
||||
msgid "Input the PIN displayed on the dashboard"
|
||||
msgstr "パソコンで表示された暗証番号を入力してください"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:282
|
||||
#: client/scenes/lobby_gui.cpp:283
|
||||
msgid "Disconnected"
|
||||
msgstr "切断されました"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:284
|
||||
#: client/scenes/lobby_gui.cpp:285
|
||||
#, c++-format
|
||||
msgid "Disconnected from {}"
|
||||
msgstr "{}から切断されました"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:316
|
||||
#: client/scenes/lobby_gui.cpp:317
|
||||
msgid "Name"
|
||||
msgstr "表示名"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:327
|
||||
#: client/scenes/lobby_gui.cpp:328
|
||||
msgid "Address"
|
||||
msgstr "アドレス"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:336
|
||||
#: client/scenes/lobby_gui.cpp:337
|
||||
msgid "Port"
|
||||
msgstr "ポート番号"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:344
|
||||
#: client/scenes/lobby_gui.cpp:345
|
||||
msgid "TCP only"
|
||||
msgstr "TCPのみを使用"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:351 client/scenes/lobby_gui_customize.cpp:654
|
||||
#: client/scenes/stream_gui.cpp:978
|
||||
#: client/scenes/lobby_gui.cpp:352 client/scenes/lobby_gui_customize.cpp:654
|
||||
#: client/scenes/stream_gui.cpp:924
|
||||
msgid "Cancel"
|
||||
msgstr "キャンセル"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:365
|
||||
#: client/scenes/lobby_gui.cpp:366
|
||||
msgid "Save"
|
||||
msgstr "保存する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:418
|
||||
#: client/scenes/lobby_gui.cpp:419
|
||||
msgid ""
|
||||
"Start a WiVRn server on your\n"
|
||||
"local network"
|
||||
@@ -153,82 +180,60 @@ msgstr ""
|
||||
"ローカルネットワークでWiVRnサーバーを\n"
|
||||
"起動してみて下さい"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:450
|
||||
#: client/scenes/lobby_gui.cpp:451
|
||||
msgid "Autoconnect"
|
||||
msgstr "自動接続"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:476
|
||||
#: client/scenes/lobby_gui.cpp:477
|
||||
msgid "Connect"
|
||||
msgstr "接続する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:486 client/wivrn_client.cpp:186
|
||||
#: client/scenes/lobby_gui.cpp:487 client/wivrn_client.cpp:186
|
||||
msgid "Incompatible server version"
|
||||
msgstr "互換性のないサーバーです"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:488
|
||||
#: client/scenes/lobby_gui.cpp:489
|
||||
msgid "Server not available"
|
||||
msgstr "サーバーは利用不可です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:581
|
||||
#: client/scenes/lobby_gui.cpp:582
|
||||
msgctxt "language selection, replace with the name of the language"
|
||||
msgid "English"
|
||||
msgstr "日本語"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:595
|
||||
#: client/scenes/lobby_gui.cpp:596
|
||||
msgid "Language"
|
||||
msgstr "言語"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:595 client/scenes/lobby_gui.cpp:597
|
||||
#: client/scenes/lobby_gui.cpp:596 client/scenes/lobby_gui.cpp:598
|
||||
msgid "System language"
|
||||
msgstr "デバイス言語"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:623 client/scenes/stream_gui.cpp:412
|
||||
msgid "Refresh rate"
|
||||
msgstr "リフレッシュレート"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:623 client/scenes/lobby_gui.cpp:625
|
||||
#: client/scenes/stream_gui.cpp:412 client/scenes/stream_gui.cpp:414
|
||||
msgctxt "automatic refresh rate"
|
||||
msgid "Automatic"
|
||||
msgstr "自動"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:632 client/scenes/stream_gui.cpp:421
|
||||
msgid ""
|
||||
"Select refresh rate based on measured application performance.\n"
|
||||
"May cause flicker when a change happens."
|
||||
msgstr ""
|
||||
"アプリケーションのパフォーマンスを基づいて自動的に設定します。\n"
|
||||
"変更時にチラツキが発生する可能性があります。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:649 client/scenes/stream_gui.cpp:439
|
||||
msgid "Minimum refresh rate"
|
||||
msgstr "最低リフレッシュレート"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:673
|
||||
#: client/scenes/lobby_gui.cpp:627
|
||||
msgid "Render resolution"
|
||||
msgstr "レンダー解像度"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:677
|
||||
#: client/scenes/lobby_gui.cpp:631
|
||||
#, c-format, c++-format
|
||||
msgid "{}%% - {}x{} per eye"
|
||||
msgstr "{}%% - 目あたり{}x{}"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:688
|
||||
#: client/scenes/lobby_gui.cpp:642
|
||||
#, c++-format
|
||||
msgid "Resolution larger than {}x{} may not be supported by the headset"
|
||||
msgstr ""
|
||||
"{}x{}以上の解像度は、お使いのヘッドセットではサポートされない場合があります。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:698
|
||||
#: client/scenes/lobby_gui.cpp:652
|
||||
msgid "Foveated encoding"
|
||||
msgstr "エンコード・フォビエーション"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:702
|
||||
#: client/scenes/lobby_gui.cpp:656
|
||||
#, c-format, c++-format
|
||||
msgid "{}%%"
|
||||
msgstr "{}%%"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:715
|
||||
#: client/scenes/lobby_gui.cpp:669
|
||||
msgid ""
|
||||
"Higher values focus image quality where you look at,\n"
|
||||
"improving latency, power efficiency and quality."
|
||||
@@ -236,7 +241,7 @@ msgstr ""
|
||||
"高い方は、視線方向の画質を最適化し、\n"
|
||||
"応答速度、電力効率、画質を向上させます。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:718
|
||||
#: client/scenes/lobby_gui.cpp:672
|
||||
msgid ""
|
||||
"Higher values focus image quality at the center,\n"
|
||||
"improving latency, power efficiency and quality."
|
||||
@@ -244,86 +249,86 @@ msgstr ""
|
||||
"高い方は、画面の中央の画質を最適化し、\n"
|
||||
"応答速度、電力効率、画質を向上させます。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:727
|
||||
#: client/scenes/lobby_gui.cpp:681
|
||||
msgctxt "Codec"
|
||||
msgid "Automatic"
|
||||
msgstr "自動"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:731
|
||||
#: client/scenes/lobby_gui.cpp:685
|
||||
msgctxt "Codec"
|
||||
msgid "H.264"
|
||||
msgstr "H.264"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:733
|
||||
#: client/scenes/lobby_gui.cpp:687
|
||||
msgctxt "Codec"
|
||||
msgid "H.265"
|
||||
msgstr "H.265"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:735
|
||||
#: client/scenes/lobby_gui.cpp:689
|
||||
msgctxt "Codec"
|
||||
msgid "AV1"
|
||||
msgstr "AV1"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:743
|
||||
#: client/scenes/lobby_gui.cpp:697
|
||||
msgid "Codec"
|
||||
msgstr "コーデック"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:771
|
||||
#: client/scenes/lobby_gui.cpp:725
|
||||
msgid "10-bit"
|
||||
msgstr "10ビット"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:787
|
||||
#: client/scenes/lobby_gui.cpp:741
|
||||
msgid "Bitrate"
|
||||
msgstr "ビットレート"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:791
|
||||
#: client/scenes/lobby_gui.cpp:745
|
||||
#, c++-format
|
||||
msgid "{}Mbit/s"
|
||||
msgstr "{}Mbps"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:802
|
||||
#: client/scenes/lobby_gui.cpp:756
|
||||
msgid "High power mode"
|
||||
msgstr "高電力モード"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:805
|
||||
#: client/scenes/lobby_gui.cpp:759
|
||||
msgid "Increase power usage to allow higher resolution and refresh rate"
|
||||
msgstr "HMDの性能問題を緩和するため、電力を増加させます。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:811
|
||||
#: client/scenes/lobby_gui.cpp:765
|
||||
msgid "Enable microphone"
|
||||
msgstr "マイクを有効する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:820
|
||||
#: client/scenes/lobby_gui.cpp:774
|
||||
msgid "Unprocessed Microphone Audio"
|
||||
msgstr "未処理のマイク音声"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:826
|
||||
#: client/scenes/lobby_gui.cpp:780
|
||||
msgid "Force disable audio filters, such as noise cancellation"
|
||||
msgstr "ノイズ除去などのフィルターを無効化する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:833
|
||||
#: client/scenes/lobby_gui.cpp:787
|
||||
msgid "Enable hand tracking"
|
||||
msgstr "ハンドトラッキングを有効する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:839 client/scenes/lobby_gui.cpp:850
|
||||
#: client/scenes/lobby_gui.cpp:860 client/scenes/lobby_gui.cpp:875
|
||||
#: client/scenes/lobby_gui.cpp:793 client/scenes/lobby_gui.cpp:804
|
||||
#: client/scenes/lobby_gui.cpp:814 client/scenes/lobby_gui.cpp:829
|
||||
#: client/scenes/lobby_gui_customize.cpp:639
|
||||
msgid "This feature is not supported by your headset"
|
||||
msgstr "デバイスはこの機能をサポートしていません"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:844
|
||||
#: client/scenes/lobby_gui.cpp:798
|
||||
msgid "Enable eye tracking"
|
||||
msgstr "アイトラッキングを有効する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:855
|
||||
#: client/scenes/lobby_gui.cpp:809
|
||||
msgid "Enable face tracking"
|
||||
msgstr "顔トラッキングを有効する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:867
|
||||
#: client/scenes/lobby_gui.cpp:821
|
||||
msgid "Enable body tracking"
|
||||
msgstr "ボディラッキングを有効する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:880
|
||||
#: client/scenes/lobby_gui.cpp:834
|
||||
msgid ""
|
||||
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
|
||||
"tracking settings,\n"
|
||||
@@ -334,11 +339,11 @@ msgstr ""
|
||||
"そうでなければ、トラッキングデータはHMDとコントローラーの情報から推測されるこ"
|
||||
"とになる。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:890
|
||||
#: client/scenes/lobby_gui.cpp:844
|
||||
msgid "Enable lower body tracking"
|
||||
msgstr "下半身トラッキングを有効する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:896
|
||||
#: client/scenes/lobby_gui.cpp:850
|
||||
msgid ""
|
||||
"Estimate lower body joint positions using Generative Legs\n"
|
||||
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
|
||||
@@ -348,11 +353,11 @@ msgstr ""
|
||||
"Quest設定・動きのトラッキング・ジェスチャーコントロールとボディトラッキングを"
|
||||
"有効する必要がある。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:899
|
||||
#: client/scenes/lobby_gui.cpp:853
|
||||
msgid "Enable hip tracking"
|
||||
msgstr "腰のトラッキングを有効する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:905
|
||||
#: client/scenes/lobby_gui.cpp:859
|
||||
msgid ""
|
||||
"Only takes affect with lower body tracking enabled\n"
|
||||
"May be desired when using another source of hip tracking"
|
||||
@@ -360,11 +365,11 @@ msgstr ""
|
||||
"下半身トラッキングが有効な場合に使用可能。\n"
|
||||
"腰トラッカーを持ってる方は無効にしましょう。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:914
|
||||
#: client/scenes/lobby_gui.cpp:868
|
||||
msgid "Enable in-stream window"
|
||||
msgstr "ストリーミング中の設定パネル"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:917
|
||||
#: client/scenes/lobby_gui.cpp:871
|
||||
msgid ""
|
||||
"Enables the configuration window to be shown while the game is streaming.\n"
|
||||
"If enabled, the window is activated by pressing both thumbsticks."
|
||||
@@ -372,23 +377,23 @@ msgstr ""
|
||||
"ストリーミング中にも設定パネルを表示できるようにします。\n"
|
||||
"両方のサムスティックを同時に押して切り替えることができます。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:921
|
||||
#: client/scenes/lobby_gui.cpp:875
|
||||
msgid "Extended configuration values"
|
||||
msgstr "設定に対する制限の緩和"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:924
|
||||
#: client/scenes/lobby_gui.cpp:878
|
||||
msgid "Allows unsafe configuration values, use at your own risk."
|
||||
msgstr "不安定な状態が発生しないよう、十分にご注意ください。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:938 client/scenes/stream_gui.cpp:473
|
||||
#: client/scenes/lobby_gui.cpp:892 client/scenes/stream_gui.cpp:419
|
||||
msgid "OpenXR post-processing"
|
||||
msgstr "OpenXRポストエフェクト"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:942 client/scenes/stream_gui.cpp:477
|
||||
#: client/scenes/lobby_gui.cpp:896 client/scenes/stream_gui.cpp:423
|
||||
msgid "Supersampling"
|
||||
msgstr "スーパーサンプリング"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:962 client/scenes/stream_gui.cpp:498
|
||||
#: client/scenes/lobby_gui.cpp:916 client/scenes/stream_gui.cpp:444
|
||||
msgid ""
|
||||
"Reduce flicker for high contrast edges.\n"
|
||||
"Useful when the input resolution is high compared to the headset display"
|
||||
@@ -396,11 +401,11 @@ msgstr ""
|
||||
"コントラストが高い部分のギザギザを低減する。\n"
|
||||
"ストリームの解像度は、HMDの解像度より高い場合は有用です。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:967 client/scenes/stream_gui.cpp:503
|
||||
#: client/scenes/lobby_gui.cpp:921 client/scenes/stream_gui.cpp:449
|
||||
msgid "Sharpening"
|
||||
msgstr "シャープ"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:987 client/scenes/stream_gui.cpp:524
|
||||
#: client/scenes/lobby_gui.cpp:941 client/scenes/stream_gui.cpp:470
|
||||
msgid ""
|
||||
"Improve clarity of high contrast edges and counteract blur.\n"
|
||||
"Useful when the input resolution is low compared to the headset display"
|
||||
@@ -408,129 +413,129 @@ msgstr ""
|
||||
"ぼかしを低減し、コントラストが高い部分の鮮明度を向上する。\n"
|
||||
"ストリームの解像度は、HMDの解像度より低い場合に有用です。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1171 client/scenes/lobby_gui.cpp:1179
|
||||
#: client/scenes/stream_gui.cpp:173 client/scenes/stream_gui.cpp:371
|
||||
#: client/scenes/lobby_gui.cpp:1125 client/scenes/lobby_gui.cpp:1133
|
||||
#: client/scenes/stream_gui.cpp:174 client/scenes/stream_gui.cpp:372
|
||||
msgid "CPU time"
|
||||
msgstr "CPU使用時間"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1175
|
||||
#: client/scenes/lobby_gui.cpp:1129
|
||||
msgid "CPU time [ms]"
|
||||
msgstr "CPU使用時間、ミリ秒"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1185 client/scenes/lobby_gui.cpp:1193
|
||||
#: client/scenes/stream_gui.cpp:175 client/scenes/stream_gui.cpp:372
|
||||
#: client/scenes/lobby_gui.cpp:1139 client/scenes/lobby_gui.cpp:1147
|
||||
#: client/scenes/stream_gui.cpp:176 client/scenes/stream_gui.cpp:373
|
||||
msgid "GPU time"
|
||||
msgstr "GPU使用時間"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1189
|
||||
#: client/scenes/lobby_gui.cpp:1143
|
||||
msgid "GPU time [ms]"
|
||||
msgstr "GPU使用時間、ミリ秒"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1253
|
||||
#: client/scenes/lobby_gui.cpp:1207
|
||||
msgid "Enable the microphone?"
|
||||
msgstr "マイクを有効にしますか?"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1258
|
||||
#: client/scenes/lobby_gui.cpp:1212
|
||||
msgid "Enable eye tracking?"
|
||||
msgstr "アイトラッキングを有効にしますか?"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1263
|
||||
#: client/scenes/lobby_gui.cpp:1217
|
||||
msgid "Enable face tracking?"
|
||||
msgstr "フェースラッキングを有効にしますか?"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1268
|
||||
#: client/scenes/lobby_gui.cpp:1222
|
||||
msgid "Enable body tracking?"
|
||||
msgstr "ボディトラッキングを有効にしますか?"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1276
|
||||
#: client/scenes/lobby_gui.cpp:1230
|
||||
msgid "Welcome to WiVRn"
|
||||
msgstr "WiVRnへようこそ!"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1304
|
||||
#: client/scenes/lobby_gui.cpp:1258
|
||||
msgid "Yes"
|
||||
msgstr "はい"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1311
|
||||
#: client/scenes/lobby_gui.cpp:1265
|
||||
msgid "No"
|
||||
msgstr "いいえ"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1330 client/scenes/lobby_gui.cpp:1976
|
||||
#: client/scenes/lobby_gui.cpp:1284 client/scenes/lobby_gui.cpp:1930
|
||||
msgid "Licenses"
|
||||
msgstr "ライセンス"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1606
|
||||
#: client/scenes/lobby_gui.cpp:1560
|
||||
msgid "Microphone is enabled"
|
||||
msgstr "マイクは有効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1607
|
||||
#: client/scenes/lobby_gui.cpp:1561
|
||||
msgid "Microphone is disabled"
|
||||
msgstr "マイクは無効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1616
|
||||
#: client/scenes/lobby_gui.cpp:1570
|
||||
msgid "Hand tracking is enabled"
|
||||
msgstr "ハンドトラッキングは有効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1617
|
||||
#: client/scenes/lobby_gui.cpp:1571
|
||||
msgid "Hand tracking is disabled"
|
||||
msgstr "ハンドラッキングは無効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1626
|
||||
#: client/scenes/lobby_gui.cpp:1580
|
||||
msgid "Eye tracking is enabled"
|
||||
msgstr "アイトラッキングは有効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1627
|
||||
#: client/scenes/lobby_gui.cpp:1581
|
||||
msgid "Eye tracking is disabled"
|
||||
msgstr "アイトラッキングは無効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1637
|
||||
#: client/scenes/lobby_gui.cpp:1591
|
||||
msgid "Face tracking is enabled"
|
||||
msgstr "フェーストラッキングは有効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1638
|
||||
#: client/scenes/lobby_gui.cpp:1592
|
||||
msgid "Face tracking is disabled"
|
||||
msgstr "フェーストラッキングは無効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1652
|
||||
#: client/scenes/lobby_gui.cpp:1606
|
||||
msgid "Body tracking is enabled"
|
||||
msgstr "ボディトラッキングは有効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1653
|
||||
#: client/scenes/lobby_gui.cpp:1607
|
||||
msgid "Body tracking is disabled"
|
||||
msgstr "ボディトラッキングは無効です"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1669
|
||||
#: client/scenes/lobby_gui.cpp:1623
|
||||
msgid "Add server"
|
||||
msgstr "サーバーを追加する"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1955
|
||||
#: client/scenes/lobby_gui.cpp:1909
|
||||
msgid "Server list"
|
||||
msgstr "サーバー"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1958 client/scenes/stream_gui.cpp:1007
|
||||
#: client/scenes/lobby_gui.cpp:1912 client/scenes/stream_gui.cpp:954
|
||||
msgid "Settings"
|
||||
msgstr "設定"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1961
|
||||
#: client/scenes/lobby_gui.cpp:1915
|
||||
msgid "Post-processing"
|
||||
msgstr "ポストエフェクト"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1964
|
||||
#: client/scenes/lobby_gui.cpp:1918
|
||||
msgid "Customize"
|
||||
msgstr "カスタマイズ"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1968
|
||||
#: client/scenes/lobby_gui.cpp:1922
|
||||
msgid "Debug"
|
||||
msgstr "デバッグ"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1973
|
||||
#: client/scenes/lobby_gui.cpp:1927
|
||||
msgid "About"
|
||||
msgstr "WiVRnについて"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1979
|
||||
#: client/scenes/lobby_gui.cpp:1933
|
||||
msgid "Exit"
|
||||
msgstr "完了"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1996
|
||||
#: client/scenes/lobby_gui.cpp:1950
|
||||
msgid ""
|
||||
"Press the grip button or put your palm up\n"
|
||||
"to move the main window"
|
||||
@@ -538,7 +543,7 @@ msgstr ""
|
||||
"メイン・パネルを動かすには、グリップを握るか、\n"
|
||||
"手のひらを上向きにしましょう。"
|
||||
|
||||
#: client/scenes/lobby_gui.cpp:1998
|
||||
#: client/scenes/lobby_gui.cpp:1952
|
||||
msgid "Press the grip button to move the main window"
|
||||
msgstr "グリップを握ってパネルを動かしましょう。"
|
||||
|
||||
@@ -617,160 +622,160 @@ msgstr "ホーム環境をダウンロード"
|
||||
msgid "Open local glTF model"
|
||||
msgstr "glTFファイルを開く"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:175
|
||||
#: client/scenes/stream_gui.cpp:176
|
||||
msgid "Defoveate"
|
||||
msgstr "フォビエーション解除"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:177
|
||||
#: client/scenes/stream_gui.cpp:178
|
||||
msgid "Network"
|
||||
msgstr "ネットワーク"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:177 client/scenes/stream_gui.cpp:369
|
||||
#: client/scenes/stream_gui.cpp:178 client/scenes/stream_gui.cpp:370
|
||||
msgid "Download"
|
||||
msgstr "ダウンロード"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:178 client/scenes/stream_gui.cpp:370
|
||||
#: client/scenes/stream_gui.cpp:179 client/scenes/stream_gui.cpp:371
|
||||
msgid "Upload"
|
||||
msgstr "アップロード"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:247
|
||||
#: client/scenes/stream_gui.cpp:248
|
||||
#, c++-format
|
||||
msgid "Decoder {}"
|
||||
msgstr "デコーダー {}"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:259
|
||||
#: client/scenes/stream_gui.cpp:260
|
||||
msgid "Timings [ms]"
|
||||
msgstr "タイミング、ミリ秒"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:319
|
||||
#: client/scenes/stream_gui.cpp:320
|
||||
msgid "Encode"
|
||||
msgstr "動画エンコード"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:320
|
||||
#: client/scenes/stream_gui.cpp:321
|
||||
msgid "Send"
|
||||
msgstr "送信"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:321
|
||||
#: client/scenes/stream_gui.cpp:322
|
||||
msgid "Receive"
|
||||
msgstr "受信"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:322
|
||||
#: client/scenes/stream_gui.cpp:323
|
||||
msgid "Decode"
|
||||
msgstr "デコード"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:323
|
||||
#: client/scenes/stream_gui.cpp:324
|
||||
msgid "Blitted"
|
||||
msgstr "描画"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:324
|
||||
#: client/scenes/stream_gui.cpp:325
|
||||
msgid "Displayed"
|
||||
msgstr "表示"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:325
|
||||
#: client/scenes/stream_gui.cpp:326
|
||||
msgid "Predicted"
|
||||
msgstr "予測時間"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:344
|
||||
#: client/scenes/stream_gui.cpp:345
|
||||
#, c++-format
|
||||
msgid "Estimated motion to photons latency: {}ms"
|
||||
msgstr "「Motion-to-photon」推定遅延 {}ミリ秒"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:349
|
||||
#: client/scenes/stream_gui.cpp:350
|
||||
msgid "Press the grip button to move the window"
|
||||
msgstr "グリップを握ってパネルを動かしましょう。"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:351 client/scenes/stream_gui.cpp:738
|
||||
#: client/scenes/stream_gui.cpp:352 client/scenes/stream_gui.cpp:684
|
||||
msgid "Press both thumbsticks to display the WiVRn window"
|
||||
msgstr "両方のサムスティックを同時に押すことで設定表示"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:373
|
||||
#: client/scenes/stream_gui.cpp:374
|
||||
msgid "Motion to photon latency"
|
||||
msgstr "「Motion-to-photon」遅延"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:458
|
||||
#: client/scenes/stream_gui.cpp:404
|
||||
msgid "Bitrate:"
|
||||
msgstr "ビットレート:"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:468
|
||||
#: client/scenes/stream_gui.cpp:414
|
||||
msgid "Click to adjust bitrate"
|
||||
msgstr "クリックしてビットレートを調整"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:532
|
||||
#: client/scenes/stream_gui.cpp:478
|
||||
msgid "Foveation center override"
|
||||
msgstr "光学中心の調整"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:535
|
||||
#: client/scenes/stream_gui.cpp:481
|
||||
msgid "Enable"
|
||||
msgstr "有効"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:543 client/scenes/stream_gui.cpp:614
|
||||
#: client/scenes/stream_gui.cpp:489 client/scenes/stream_gui.cpp:560
|
||||
#, c++-format
|
||||
msgid "Height {:.1f} deg"
|
||||
msgstr "仰角 {:.1f}°"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:544 client/scenes/stream_gui.cpp:615
|
||||
#: client/scenes/stream_gui.cpp:490 client/scenes/stream_gui.cpp:561
|
||||
#, c++-format
|
||||
msgid "Distance {:.2f} m"
|
||||
msgstr "距離 {:.2f}m"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:545
|
||||
#: client/scenes/stream_gui.cpp:491
|
||||
msgid "Default"
|
||||
msgstr "デフォルト"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:556
|
||||
#: client/scenes/stream_gui.cpp:502
|
||||
msgid "Change"
|
||||
msgstr "編集"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:588
|
||||
#: client/scenes/stream_gui.cpp:534
|
||||
msgid "Use the right thumbstick to adjust the bitrate"
|
||||
msgstr "右スティックでビットレートを調整しましょう"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:589
|
||||
#: client/scenes/stream_gui.cpp:535
|
||||
msgid "Press A to go back"
|
||||
msgstr "「A」を押して戻る"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:590
|
||||
#: client/scenes/stream_gui.cpp:536
|
||||
#, c++-format
|
||||
msgid "Bitrate: {}Mbit/s"
|
||||
msgstr "ビットレート:{}Mbps"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:612
|
||||
#: client/scenes/stream_gui.cpp:558
|
||||
msgid "Use the thumbsticks to move the foveation center"
|
||||
msgstr "ジョイスティックを使って中心点を調整しましょう。"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:613
|
||||
#: client/scenes/stream_gui.cpp:559
|
||||
msgid "Press A to save or B to cancel"
|
||||
msgstr "AかBを押してキャンセル。"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:671
|
||||
#: client/scenes/stream_gui.cpp:617
|
||||
msgid "Running XR applications:"
|
||||
msgstr "XRアプリの実行"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:688
|
||||
#: client/scenes/stream_gui.cpp:634
|
||||
msgid "Overlays"
|
||||
msgstr "オーバーレイ"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:727
|
||||
#: client/scenes/stream_gui.cpp:673
|
||||
msgid "Request to quit, may be ignored by the application"
|
||||
msgstr "終了シグナルを送信する"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:993
|
||||
#: client/scenes/stream_gui.cpp:940
|
||||
msgid "Applications"
|
||||
msgstr "アプリ"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:996
|
||||
#: client/scenes/stream_gui.cpp:943
|
||||
msgid "Start"
|
||||
msgstr "実行する"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:1010
|
||||
#: client/scenes/stream_gui.cpp:957
|
||||
msgid "Stats"
|
||||
msgstr "統計情報"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:1016
|
||||
#: client/scenes/stream_gui.cpp:963
|
||||
msgid "Statistics overlay"
|
||||
msgstr "統計オーバーレイ"
|
||||
|
||||
#: client/scenes/stream_gui.cpp:1019
|
||||
#: client/scenes/stream_gui.cpp:966
|
||||
msgid "Compact view"
|
||||
msgstr "コンパクト・モード"
|
||||
|
||||
|
||||
+301
-299
File diff suppressed because it is too large
Load Diff
@@ -8,31 +8,31 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WiVRn-dashboard\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-02-18 16:24+0800\n"
|
||||
"PO-Revision-Date: 2026-02-25 21:21+0800\n"
|
||||
"POT-Creation-Date: 2026-04-11 14:03+0800\n"
|
||||
"PO-Revision-Date: 2026-04-20 13:44+0800\n"
|
||||
"Last-Translator: BERADQ <adqber123@outlook.com>\n"
|
||||
"Language-Team: Chinese (China)\n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Gtranslator 49.0\n"
|
||||
"X-Generator: Gtranslator 50.0\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
#: dashboard/apk_installer.cpp:137
|
||||
#, kde-format
|
||||
msgid "Cannot save APK file: %1"
|
||||
msgstr "无法保存 APK 文件: %1"
|
||||
msgstr "无法保存 APK 文件:%1"
|
||||
|
||||
#: dashboard/apk_installer.cpp:171
|
||||
#, kde-format
|
||||
msgid "Downloading APK: %1 MB / %2 MB"
|
||||
msgstr "正在下载 APK: %1 MB / %2 MB"
|
||||
msgstr "正在下载 APK:%1 MB / %2 MB"
|
||||
|
||||
#: dashboard/apk_installer.cpp:173
|
||||
#, kde-format
|
||||
msgid "Downloading APK: %1 MB"
|
||||
msgstr "正在下载 APK: %1 MB"
|
||||
msgstr "正在下载 APK:%1 MB"
|
||||
|
||||
#: dashboard/apk_installer.cpp:182
|
||||
#, kde-format
|
||||
@@ -42,7 +42,7 @@ msgstr "下载已取消"
|
||||
#: dashboard/apk_installer.cpp:198
|
||||
#, kde-format
|
||||
msgid "Cannot download APK: %1"
|
||||
msgstr "无法下载 APK: %1"
|
||||
msgstr "无法下载 APK:%1"
|
||||
|
||||
#: dashboard/apk_installer.cpp:221
|
||||
#, kde-format
|
||||
@@ -52,17 +52,17 @@ msgstr "正在安装 APK"
|
||||
#: dashboard/apk_installer.cpp:225
|
||||
#, kde-format
|
||||
msgid "adb failed to start: %1"
|
||||
msgstr "adb 启动失败: %1"
|
||||
msgstr "adb 启动失败:%1"
|
||||
|
||||
#: dashboard/apk_installer.cpp:235
|
||||
#, kde-format
|
||||
msgid "adb exited abnormally: %1"
|
||||
msgstr "adb 异常终止: %1"
|
||||
msgstr "adb 异常终止:%1"
|
||||
|
||||
#: dashboard/apk_installer.cpp:243
|
||||
#, kde-format
|
||||
msgid "The 'adb install' command failed: exit code %1"
|
||||
msgstr "'adb install' 执行失败: 终止代码 %1"
|
||||
msgstr "'adb install' 执行失败:终止代码 %1"
|
||||
|
||||
#: dashboard/apk_installer.cpp:248
|
||||
#, kde-format
|
||||
@@ -112,7 +112,7 @@ msgstr "在您的头显上安装 WiVRn 应用程序"
|
||||
#: dashboard/qml/WizardPage.qml:192
|
||||
#, kde-format
|
||||
msgid "Checking latest release..."
|
||||
msgstr "正在检查最新版本..."
|
||||
msgstr "正在检查最新版本…"
|
||||
|
||||
#: dashboard/qml/ApkInstallPage.qml:43 dashboard/qml/WizardPage.qml:198
|
||||
#, kde-format
|
||||
@@ -139,7 +139,7 @@ msgid ""
|
||||
"client."
|
||||
msgstr ""
|
||||
"请按照 <a href=\"https://github.com/WiVRn/WiVRn/blob/master/docs/"
|
||||
"building.md#client-headset\">文档</a>中的说明构建您自己的客户端。"
|
||||
"building.md#client-headset\">文档</a>中的说明来构建您自己的客户端。"
|
||||
|
||||
#: dashboard/qml/ConnectUsbDialog.qml:11
|
||||
#, kde-format
|
||||
@@ -170,25 +170,25 @@ msgstr "头显"
|
||||
#, kde-format
|
||||
msgid "Last connection: %1 second ago"
|
||||
msgid_plural "Last connection: %1 seconds ago"
|
||||
msgstr[0] "上次连接时间:%1 秒前"
|
||||
msgstr[0] "上次连接:%1 秒前"
|
||||
|
||||
#: dashboard/qml/HeadsetsPage.qml:31
|
||||
#, kde-format
|
||||
msgid "Last connection: %1 minute ago"
|
||||
msgid_plural "Last connection: %1 minutes ago"
|
||||
msgstr[0] "上次连接时间:%1 分鐘前"
|
||||
msgstr[0] "上次连接:%1 分钟前"
|
||||
|
||||
#: dashboard/qml/HeadsetsPage.qml:33
|
||||
#, kde-format
|
||||
msgid "Last connection: %1 hour ago"
|
||||
msgid_plural "Last connection: %1 hours ago"
|
||||
msgstr[0] "上次连接时间:%1 小時前"
|
||||
msgstr[0] "上次连接:%1 小时前"
|
||||
|
||||
#: dashboard/qml/HeadsetsPage.qml:35
|
||||
#, kde-format
|
||||
msgid "Last connection: %1 day ago"
|
||||
msgid_plural "Last connection: %1 days ago"
|
||||
msgstr[0] "上次连接时间:%1 天前"
|
||||
msgstr[0] "上次连接:%1 天前"
|
||||
|
||||
#: dashboard/qml/HeadsetsPage.qml:40
|
||||
#, kde-format
|
||||
@@ -306,12 +306,12 @@ msgstr "更多信息"
|
||||
#: dashboard/qml/Main.qml:193
|
||||
#, kde-format
|
||||
msgid "Vulkan drivers cannot be found, you may need to run \"flatpak update\""
|
||||
msgstr "找不到 Vulkan 设备,您或许需要执行 \"flatpak update\""
|
||||
msgstr "无法找到 Vulkan 驱动,您或许需要执行「flatpak update」"
|
||||
|
||||
#: dashboard/qml/Main.qml:193
|
||||
#, kde-format
|
||||
msgid "Vulkan drivers cannot be found"
|
||||
msgstr "无法找到 Vulkan 设备"
|
||||
msgstr "无法找到 Vulkan 驱动"
|
||||
|
||||
#: dashboard/qml/Main.qml:201
|
||||
#, kde-format
|
||||
@@ -329,7 +329,7 @@ msgid ""
|
||||
"Install xrizer or OpenComposite."
|
||||
msgstr ""
|
||||
"系统未检测到 OpenVR 兼容层,Steam 平台上的 VR 游戏无法正常加载。\n"
|
||||
"请安装 xrizer 或 OpenComposite"
|
||||
"请安装 xrizer 或 OpenComposite。"
|
||||
|
||||
#: dashboard/qml/Main.qml:217
|
||||
#, kde-format
|
||||
@@ -412,7 +412,7 @@ msgstr "USB"
|
||||
#, kde-format
|
||||
msgctxt "usb connect button"
|
||||
msgid "Connect (wired)"
|
||||
msgstr "链接 (有线)"
|
||||
msgstr "连接 (有线)"
|
||||
|
||||
#: dashboard/qml/Main.qml:383 dashboard/qml/WizardPage.qml:339
|
||||
#, kde-format
|
||||
@@ -485,7 +485,7 @@ msgstr "重置"
|
||||
#: dashboard/qml/SettingsPage.qml:40
|
||||
#, kde-format
|
||||
msgid "Encoder:"
|
||||
msgstr "编码:"
|
||||
msgstr "编码器:"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:46
|
||||
#, kde-format
|
||||
@@ -496,17 +496,17 @@ msgstr "自动"
|
||||
#: dashboard/qml/SettingsPage.qml:50
|
||||
#, kde-format
|
||||
msgid "nvenc (NVIDIA GPUs)"
|
||||
msgstr "nvenc (NVIDIA GPUs)"
|
||||
msgstr "nvenc (NVIDIA 显卡)"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:54
|
||||
#, kde-format
|
||||
msgid "vaapi (AMD and Intel GPUs)"
|
||||
msgstr "vaapi (AMD 和 Intel GPUs)"
|
||||
msgstr "vaapi (AMD 和 Intel 显卡)"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:58
|
||||
#, kde-format
|
||||
msgid "Vulkan (Any modern GPU)"
|
||||
msgstr "Vulkan (任何现代 GPU)"
|
||||
msgstr "Vulkan (任何现代显卡)"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:62
|
||||
#, kde-format
|
||||
@@ -579,7 +579,7 @@ msgstr "自定义 adb 路径"
|
||||
#: dashboard/qml/SettingsPage.qml:145
|
||||
#, kde-format
|
||||
msgid "Adb location:"
|
||||
msgstr "adb 路径:"
|
||||
msgstr "ADB 路径:"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:154
|
||||
#, kde-format
|
||||
@@ -603,16 +603,22 @@ msgstr "自定义"
|
||||
msgid "Disabled"
|
||||
msgstr "已停用"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:191
|
||||
#: dashboard/qml/SettingsPage.qml:199
|
||||
#, kde-format
|
||||
msgid "OpenVR compatibility library:"
|
||||
msgstr "OpenVR 兼容层:"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:217
|
||||
#: dashboard/qml/SettingsPage.qml:229
|
||||
#, kde-format
|
||||
msgid "Library path, excluding bin/linux64/vrclient.so"
|
||||
msgstr "兼容层路径,不包含 bin/linux64/vrclient.so"
|
||||
|
||||
#: dashboard/qml/SettingsPage.qml:234
|
||||
#, kde-format
|
||||
msgctxt "browse to choose the OpenVR compatility to use"
|
||||
msgid "Browse"
|
||||
msgstr "浏览"
|
||||
|
||||
#: dashboard/qml/SteamLaunchOptions.qml:8
|
||||
#, kde-format
|
||||
msgid ""
|
||||
@@ -620,7 +626,7 @@ msgid ""
|
||||
"General and paste this in \"Launch options\":"
|
||||
msgstr ""
|
||||
"对于 Steam 游戏,在 Steam 中右键点击游戏,前往「属性」>「通用」,然后将此文本"
|
||||
"粘贴到「启动选项」中:"
|
||||
"粘贴到「启动选项」中:"
|
||||
|
||||
#: dashboard/qml/SteamLaunchOptions.qml:20
|
||||
#, kde-format
|
||||
@@ -636,12 +642,12 @@ msgstr "复制"
|
||||
#: dashboard/qml/SteamLaunchOptions.qml:30
|
||||
#, kde-format
|
||||
msgid "Copied Steam launch command"
|
||||
msgstr "已复制 Steam 自动指令"
|
||||
msgstr "已复制 Steam 启动命令"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:20
|
||||
#, kde-format
|
||||
msgid "I cannot find the WiVRn app on my headset"
|
||||
msgstr "我在我的头显上找不到 WiVRn 应用程序。"
|
||||
msgstr "在头显上找不到 WiVRn 应用程序。"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:21 dashboard/qml/WizardPage.qml:353
|
||||
#, kde-format
|
||||
@@ -649,34 +655,34 @@ msgid ""
|
||||
"If you installed WiVRn over USB on a Meta headset, the app is in the "
|
||||
"\"unknown sources\" section."
|
||||
msgstr ""
|
||||
"如果您通过 USB 在 Meta 头显上安裝了 WiVRn,该应用程序将在「未知来源」中。"
|
||||
"如果您通过 USB 在 Meta 头显上安装了 WiVRn,该应用程序将在「未知来源」中。"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:24
|
||||
#, kde-format
|
||||
msgid "I cannot see my computer in the WiVRn app"
|
||||
msgstr "我在 WiVRn 应用程序中看不到我的计算机。"
|
||||
msgstr "在 WiVRn 应用程序中看不到计算机。"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:25
|
||||
#, kde-format
|
||||
msgid "If you have a firewall, make sure that port 5353/UDP is open."
|
||||
msgstr "如果你有防火墙,请确保端口 5353/UDP 是开放的。"
|
||||
msgstr "如果您有防火墙,请确保端口 5353/UDP 是开放的。"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:28
|
||||
#, kde-format
|
||||
msgid "Connecting remains stuck on \"Connection to ...\""
|
||||
msgstr "连接过程一直停留在 \"正在连接到 …\""
|
||||
msgstr "连接过程一直停留在「正在连接到 …」"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:29 dashboard/qml/TroubleshootPage.qml:33
|
||||
#, kde-format
|
||||
msgid ""
|
||||
"If you have a firewall, make sure that port 9757 is open both for TCP and "
|
||||
"UDP."
|
||||
msgstr "如果你有防火墙,请确保端口 9757 在 TCP 和 UDP 下都是开放的。"
|
||||
msgstr "如果您有防火墙,请确保端口 9757 在 TCP 和 UDP 下都是开放的。"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:32
|
||||
#, kde-format
|
||||
msgid "Connection fails with \"no route to host\""
|
||||
msgstr "连接失败,错误信息为 \"no route to host\""
|
||||
msgstr "连接失败,错误信息为「no route to host」"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:36
|
||||
#, kde-format
|
||||
@@ -691,7 +697,7 @@ msgid ""
|
||||
"server version is <b>%1</b></li></ul>"
|
||||
msgstr ""
|
||||
"<p>头显应用程序与计算机上服务器的版本必须一致。</p><ul><li>头显应用程序版本位"
|
||||
"于\"关于\"页面</li><li>服务器版本是<b>%1</b></li></ul>"
|
||||
"于「关于」页面</li><li>服务器版本是<b>%1</b></li></ul>"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:40
|
||||
#, kde-format
|
||||
@@ -704,7 +710,7 @@ msgid ""
|
||||
"If you have reinstalled the server or the client or if you want to connect "
|
||||
"another headset, you must enable pairing before connecting."
|
||||
msgstr ""
|
||||
"如果您已重新安装服务器或客户端,或如果您想连接另一个头显,您必须在连接前启用"
|
||||
"如果您已重新安装服务器或客户端,或想连接另一个头显,必须在连接前启用"
|
||||
"配对。"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:41
|
||||
@@ -715,7 +721,7 @@ msgstr "目前已启用配对,身份识别码为 %1。"
|
||||
#: dashboard/qml/TroubleshootPage.qml:41
|
||||
#, kde-format
|
||||
msgid "Pairing is currently disabled."
|
||||
msgstr "目前已停用配对"
|
||||
msgstr "目前已停用配对。"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:57
|
||||
#, kde-format
|
||||
@@ -727,7 +733,7 @@ msgstr "我的头显没有声音"
|
||||
msgid ""
|
||||
"When the headset is connected, select \"WiVRn\" as the default audio output "
|
||||
"device for applications to use it."
|
||||
msgstr "连接头显后,选择 \"WiVRn\" 作为应用程序的预设音频输出设备。"
|
||||
msgstr "连接头显后,选择「WiVRn」作为应用程序的预设音频输出设备。"
|
||||
|
||||
#: dashboard/qml/TroubleshootPage.qml:61
|
||||
#, kde-format
|
||||
@@ -791,7 +797,7 @@ msgstr "如何启用开发者模式"
|
||||
#: dashboard/qml/WizardPage.qml:119
|
||||
#, kde-format
|
||||
msgid "Follow the manufacturer's instructions below:"
|
||||
msgstr "请按照以下设备提供商的说明操作:"
|
||||
msgstr "请按照以下设备提供商的说明操作:"
|
||||
|
||||
#: dashboard/qml/WizardPage.qml:142
|
||||
#, kde-format
|
||||
@@ -815,7 +821,7 @@ msgid ""
|
||||
"href=\"https://www.meta.com/experiences/7959676140827574/\">Meta store</a>."
|
||||
msgstr ""
|
||||
"对于 Quest 2、3、3S 和 Pro,您可以从 <a href=\"https://www.meta.com/"
|
||||
"experiences/7959676140827574/\">Meta 商店</a>获取应用程序."
|
||||
"experiences/7959676140827574/\">Meta 商店</a>获取应用程序。"
|
||||
|
||||
#: dashboard/qml/WizardPage.qml:164
|
||||
#, kde-format
|
||||
@@ -849,8 +855,8 @@ msgid ""
|
||||
"<ul><li>The ADB udev rules are installed</li><li>The headset is in <a "
|
||||
"href=\"#\">developer mode</a></li></ul></p>"
|
||||
msgstr ""
|
||||
"<p>未检测到头显。请确认:\n"
|
||||
"<ul><li>已安裝 ADB udev 规则</li><li>头显已启用 <a href=\"#\">开发者模式</"
|
||||
"<p>未检测到头显。请确认:\n"
|
||||
"<ul><li>已安装 ADB udev 规则</li><li>头显已启用 <a href=\"#\">开发者模式</"
|
||||
"a></li></ul></p>"
|
||||
|
||||
#: dashboard/qml/WizardPage.qml:295
|
||||
@@ -863,7 +869,7 @@ msgstr "重要信息"
|
||||
msgid ""
|
||||
"WiVRn entirely replaces SteamVR, you should not start SteamVR while WiVRn is "
|
||||
"running."
|
||||
msgstr "WiVRn 完全取代了 SteamVR,在 WiVRn 运行时,请勿启动 SteamVR"
|
||||
msgstr "WiVRn 完全取代了 SteamVR,在 WiVRn 运行时,请勿启动 SteamVR。"
|
||||
|
||||
#: dashboard/qml/WizardPage.qml:313
|
||||
#, kde-format
|
||||
@@ -876,13 +882,13 @@ msgid ""
|
||||
"To connect over WiFi, start the WiVRn app on your headset, connect to \"%1\" "
|
||||
"and enter PIN \"%2\"."
|
||||
msgstr ""
|
||||
"要通过 WiFi 连接,请在您的头显上启动 WiVRn 应用程序,连接至 \"%1\" 并输入身份"
|
||||
"识别码 \"%2\"。"
|
||||
"要通过 WiFi 连接,请在您的头显上启动 WiVRn 应用程序,连接至「%1」并输入身份"
|
||||
"识别码「%2」。"
|
||||
|
||||
#: dashboard/qml/WizardPage.qml:326
|
||||
#, kde-format
|
||||
msgid "To connect over USB, click on \"Connect by USB\"."
|
||||
msgstr "要通过 USB 连接,请点击 \"通过 USB 连接\"。"
|
||||
msgstr "要通过 USB 连接,请点击「通过 USB 连接」。"
|
||||
|
||||
#: dashboard/qml/WizardPage.qml:329
|
||||
#, kde-format
|
||||
@@ -900,8 +906,8 @@ msgid ""
|
||||
"If the server is not visible or the connection fails, check that ports 5353 "
|
||||
"(UDP) and 9757 (TCP and UDP) are open in your firewall."
|
||||
msgstr ""
|
||||
"如果服务器不可见或连接失败,请检查防火墙中端口 5353(UDP)和 9757(TCP 和 "
|
||||
"UDP)是否开放。"
|
||||
"如果服务器不可见或连接失败,请检查防火墙是否开放了端口 5353(UDP)和 9757(TCP 和 "
|
||||
"UDP)。"
|
||||
|
||||
#: dashboard/qml/WizardPage.qml:371
|
||||
#, kde-format
|
||||
@@ -923,7 +929,7 @@ msgstr "已连接您的头显。"
|
||||
msgid ""
|
||||
"To connect another headset, make sure pairing is enabled in the dashboard "
|
||||
"before connecting."
|
||||
msgstr "如果要连接其他头显,请确保在连接之前在控制面板中启用配对。"
|
||||
msgstr "如果要连接其他头显,请确保连接前在控制面板中启用配对。"
|
||||
|
||||
#: dashboard/qml/WizardPage.qml:423 dashboard/qml/WizardPage.qml:460
|
||||
#, kde-format
|
||||
@@ -947,7 +953,7 @@ msgstr "Open Composite"
|
||||
|
||||
#, kde-format
|
||||
#~ msgid "PIN: %1"
|
||||
#~ msgstr "身份识别码: %1"
|
||||
#~ msgstr "身份识别码:%1"
|
||||
|
||||
#, kde-format
|
||||
#~ msgctxt "automatically started application"
|
||||
@@ -971,7 +977,7 @@ msgstr "Open Composite"
|
||||
|
||||
#, kde-format
|
||||
#~ msgid "Foveation strength:"
|
||||
#~ msgstr "注视点渲染强度:"
|
||||
#~ msgstr "注视点渲染强度:"
|
||||
|
||||
#, kde-format
|
||||
#~ msgid "%1 %"
|
||||
@@ -1008,7 +1014,7 @@ msgstr "Open Composite"
|
||||
|
||||
#, kde-format
|
||||
#~ msgid "Bitrate:"
|
||||
#~ msgstr "码率:"
|
||||
#~ msgstr "码率:"
|
||||
|
||||
#, kde-format
|
||||
#~ msgctxt "bitrate"
|
||||
@@ -1017,7 +1023,7 @@ msgstr "Open Composite"
|
||||
|
||||
#, kde-format
|
||||
#~ msgid "Codec:"
|
||||
#~ msgstr "编码器:"
|
||||
#~ msgstr "编码器:"
|
||||
|
||||
#, kde-format
|
||||
#~ msgctxt "automatic codec setup"
|
||||
@@ -1048,12 +1054,12 @@ msgstr "Open Composite"
|
||||
|
||||
#, kde-format
|
||||
#~ msgid "The server does not have CAP_SYS_NICE capabilities"
|
||||
#~ msgstr "服务器没有 CAP_SYS_NICE 权限"
|
||||
#~ msgstr "服务器没有 CAP_SYS_NICE 能力"
|
||||
|
||||
#, kde-format
|
||||
#~ msgid ""
|
||||
#~ "The CAP_SYS_NICE capability will be used when the server is restarted"
|
||||
#~ msgstr "CAP_SYS_NICE 权限将在服务器重新启动时生效"
|
||||
#~ msgstr "CAP_SYS_NICE 能力将在服务器重新启动时生效"
|
||||
|
||||
#, kde-format
|
||||
#~ msgid "No precompiled APK is available for this version"
|
||||
@@ -1061,7 +1067,7 @@ msgstr "Open Composite"
|
||||
|
||||
#, kde-format
|
||||
#~ msgid "Encoder layout:"
|
||||
#~ msgstr "编码器布局:"
|
||||
#~ msgstr "编码器布局:"
|
||||
|
||||
#, kde-format
|
||||
#~ msgctxt "encoder preset"
|
||||
|
||||
+314
-310
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1 +1 @@
|
||||
ef152c973b94a313e1ba9552162818b5151ac671
|
||||
6578e7ec7f971deaa96d87c91427f1c4b09c10e4
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 0fe5a8e72f2ba178e155d2ab87e79f34294248dd Mon Sep 17 00:00:00 2001
|
||||
From 56bc78165b70a84e40bfc22ca5c2b95b0612d0cd Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Nicolas <patricknicolas@laposte.net>
|
||||
Date: Tue, 22 Oct 2024 15:23:19 +0200
|
||||
Subject: [PATCH 1/8] c/multi: early wake of compositor
|
||||
@@ -36,10 +36,10 @@ index 1fc135ce4..25b64aca8 100644
|
||||
|
||||
static void *
|
||||
diff --git a/src/xrt/compositor/multi/comp_multi_private.h b/src/xrt/compositor/multi/comp_multi_private.h
|
||||
index 3351defa4..e8f0c8295 100644
|
||||
index 0e777f442..d39b8d76d 100644
|
||||
--- a/src/xrt/compositor/multi/comp_multi_private.h
|
||||
+++ b/src/xrt/compositor/multi/comp_multi_private.h
|
||||
@@ -359,6 +359,10 @@ struct multi_system_compositor
|
||||
@@ -364,6 +364,10 @@ struct multi_system_compositor
|
||||
*/
|
||||
struct os_mutex list_and_timing_lock;
|
||||
|
||||
@@ -51,7 +51,7 @@ index 3351defa4..e8f0c8295 100644
|
||||
{
|
||||
int64_t predicted_display_time_ns;
|
||||
diff --git a/src/xrt/compositor/multi/comp_multi_system.c b/src/xrt/compositor/multi/comp_multi_system.c
|
||||
index 4db923457..80cbbbc26 100644
|
||||
index e673afcb0..cf07a2d1c 100644
|
||||
--- a/src/xrt/compositor/multi/comp_multi_system.c
|
||||
+++ b/src/xrt/compositor/multi/comp_multi_system.c
|
||||
@@ -24,6 +24,8 @@
|
||||
@@ -109,7 +109,7 @@ index 4db923457..80cbbbc26 100644
|
||||
|
||||
// Now we know the diff, broadcast to pacers.
|
||||
broadcast_timings_to_pacers(msc, predicted_display_time_ns, predicted_display_period_ns, diff_ns);
|
||||
@@ -721,6 +733,8 @@ system_compositor_destroy(struct xrt_system_compositor *xsc)
|
||||
@@ -731,6 +743,8 @@ system_compositor_destroy(struct xrt_system_compositor *xsc)
|
||||
xrt_comp_native_destroy(&msc->xcn);
|
||||
|
||||
os_mutex_destroy(&msc->list_and_timing_lock);
|
||||
@@ -118,8 +118,8 @@ index 4db923457..80cbbbc26 100644
|
||||
|
||||
free(msc);
|
||||
}
|
||||
@@ -775,6 +789,8 @@ comp_multi_create_system_compositor(struct xrt_compositor_native *xcn,
|
||||
msc->sessions.state = do_warm_start ? MULTI_SYSTEM_STATE_INIT_WARM_START : MULTI_SYSTEM_STATE_STOPPED;
|
||||
@@ -788,6 +802,8 @@ comp_multi_create_system_compositor(struct xrt_compositor_native *xcn,
|
||||
msc->get_view_config_callback = get_view_config_callback;
|
||||
|
||||
os_mutex_init(&msc->list_and_timing_lock);
|
||||
+ os_mutex_init(&msc->wake_mutex);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From c0019c2e8822db5efa7d6baf51b9773cc7bdc537 Mon Sep 17 00:00:00 2001
|
||||
From 8d323aae4c6436644e62a8e50f536672e09e7df1 Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Nicolas <patricknicolas@laposte.net>
|
||||
Date: Tue, 8 Oct 2024 22:13:15 +0200
|
||||
Subject: [PATCH 2/8] Use extern socket fd
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH 2/8] Use extern socket fd
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/xrt/ipc/server/ipc_server_mainloop_linux.c b/src/xrt/ipc/server/ipc_server_mainloop_linux.c
|
||||
index 777a31e96..9235375e6 100644
|
||||
index a0bef3dde..453dd38ca 100644
|
||||
--- a/src/xrt/ipc/server/ipc_server_mainloop_linux.c
|
||||
+++ b/src/xrt/ipc/server/ipc_server_mainloop_linux.c
|
||||
@@ -49,6 +49,8 @@
|
||||
@@ -50,6 +50,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ index 777a31e96..9235375e6 100644
|
||||
/*
|
||||
*
|
||||
* Static functions.
|
||||
@@ -57,6 +59,12 @@
|
||||
@@ -58,6 +60,12 @@
|
||||
static int
|
||||
get_systemd_socket(struct ipc_server_mainloop *ml, int *out_fd)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 004623b9038b3043365061e77a0e3cc430fb2dd9 Mon Sep 17 00:00:00 2001
|
||||
From 021c00d87dc8a956984a255c651658f4b6f76cc6 Mon Sep 17 00:00:00 2001
|
||||
From: galister <85970-galister@users.noreply.gitlab.freedesktop.org>
|
||||
Date: Sat, 23 Nov 2024 02:42:12 +0900
|
||||
Subject: [PATCH 3/8] change environment blend mode selection logic
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH 3/8] change environment blend mode selection logic
|
||||
1 file changed, 17 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/xrt/compositor/multi/comp_multi_system.c b/src/xrt/compositor/multi/comp_multi_system.c
|
||||
index 80cbbbc26..4a397d7ec 100644
|
||||
index cf07a2d1c..417964770 100644
|
||||
--- a/src/xrt/compositor/multi/comp_multi_system.c
|
||||
+++ b/src/xrt/compositor/multi/comp_multi_system.c
|
||||
@@ -233,23 +233,31 @@ find_active_blend_mode(struct multi_compositor **overlay_sorted_clients, size_t
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From c0d86e77f011f0d75f17e5c30fb20bbf166dfc08 Mon Sep 17 00:00:00 2001
|
||||
From acd0e5bd5845f43fe443f70d54ae2df27bbec823 Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Nicolas <patricknicolas@laposte.net>
|
||||
Date: Sat, 15 Mar 2025 22:19:48 +0100
|
||||
Subject: [PATCH 4/8] st/oxr: forward 0 refresh rate
|
||||
@@ -9,10 +9,10 @@ Subject: [PATCH 4/8] st/oxr: forward 0 refresh rate
|
||||
2 files changed, 2 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/xrt/compositor/main/comp_compositor.c b/src/xrt/compositor/main/comp_compositor.c
|
||||
index 3364aaead..deec90a73 100644
|
||||
index 0d35fcb42..b54a8f048 100644
|
||||
--- a/src/xrt/compositor/main/comp_compositor.c
|
||||
+++ b/src/xrt/compositor/main/comp_compositor.c
|
||||
@@ -377,7 +377,7 @@ compositor_request_display_refresh_rate(struct xrt_compositor *xc, float display
|
||||
@@ -380,7 +380,7 @@ compositor_request_display_refresh_rate(struct xrt_compositor *xc, float display
|
||||
if (c->target && c->target->request_refresh_rate) {
|
||||
xrt_result_t result = comp_target_request_refresh_rate(c->target, display_refresh_rate_hz);
|
||||
// Assume refresh rate change is immediate
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 80007ab047cb486e78eb0527dc97de56574bc8e2 Mon Sep 17 00:00:00 2001
|
||||
From f592eb8af17a15b8cd6a20c308ee0f254c88463f Mon Sep 17 00:00:00 2001
|
||||
From: no name <git-am@invalid>
|
||||
Date: Sun, 28 Sep 2025 11:33:10 +0200
|
||||
Subject: [PATCH 5/8] d/steamvr_lh: prevent crash on vive pro2/WiVRn
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH 5/8] d/steamvr_lh: prevent crash on vive pro2/WiVRn
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp
|
||||
index 0fbe4f563..dc9e3d3a5 100644
|
||||
index 5c36e4e89..b77288bd0 100644
|
||||
--- a/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp
|
||||
+++ b/src/xrt/drivers/steamvr_lh/steamvr_lh.cpp
|
||||
@@ -954,7 +954,7 @@ steamvr_lh_create_devices(struct xrt_prober *xp, struct xrt_system_devices **out
|
||||
@@ -956,7 +956,7 @@ steamvr_lh_create_devices(struct xrt_prober *xp, struct xrt_system_devices **out
|
||||
|
||||
// Include the HMD
|
||||
if (svrs->ctx->hmd) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 659f5782066f77bb027accfcfe9ac4a810d27903 Mon Sep 17 00:00:00 2001
|
||||
From e013455ead67f79e18afc5a6bbb453caae76dac9 Mon Sep 17 00:00:00 2001
|
||||
From: Sapphire <imsapphire0@gmail.com>
|
||||
Date: Fri, 7 Nov 2025 20:41:16 -0600
|
||||
Subject: [PATCH 6/8] st/oxr: push XrEventDataInteractionProfileChanged when
|
||||
@@ -9,7 +9,7 @@ Subject: [PATCH 6/8] st/oxr: push XrEventDataInteractionProfileChanged when
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/src/xrt/state_trackers/oxr/actions/oxr_input.c b/src/xrt/state_trackers/oxr/actions/oxr_input.c
|
||||
index 51ae13b05..192833639 100644
|
||||
index 2bd3ea009..93659ba35 100644
|
||||
--- a/src/xrt/state_trackers/oxr/actions/oxr_input.c
|
||||
+++ b/src/xrt/state_trackers/oxr/actions/oxr_input.c
|
||||
@@ -1932,9 +1932,6 @@ session_update_action_bindings(struct oxr_logger *log,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 5dbb5983ab7f5ec1204ff8fe932519c0df7feeed Mon Sep 17 00:00:00 2001
|
||||
From 6834120e579093e2f2bfa0d4269a051e7047b9ee Mon Sep 17 00:00:00 2001
|
||||
From: no name <git-am@invalid>
|
||||
Date: Sun, 25 Jan 2026 10:09:10 +0100
|
||||
Subject: [PATCH 7/8] don't verify GL stuff
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 11fdc5a904db55867ed567bbc89ee5207e5741f0 Mon Sep 17 00:00:00 2001
|
||||
From c28b6f2c536e1a0db93389f050cf61a506b286e4 Mon Sep 17 00:00:00 2001
|
||||
From: no name <git-am@invalid>
|
||||
Date: Fri, 20 Mar 2026 16:51:18 +0100
|
||||
Subject: [PATCH 8/8] configure u_git_tag in WiVRn
|
||||
@@ -8,7 +8,7 @@ Subject: [PATCH 8/8] configure u_git_tag in WiVRn
|
||||
1 file changed, 1 insertion(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/xrt/auxiliary/util/CMakeLists.txt b/src/xrt/auxiliary/util/CMakeLists.txt
|
||||
index d45cd60c9..ec0d45434 100644
|
||||
index a30c3c5a6..983d44f04 100644
|
||||
--- a/src/xrt/auxiliary/util/CMakeLists.txt
|
||||
+++ b/src/xrt/auxiliary/util/CMakeLists.txt
|
||||
@@ -10,11 +10,6 @@
|
||||
@@ -23,7 +23,7 @@ index d45cd60c9..ec0d45434 100644
|
||||
add_library(
|
||||
aux_util STATIC
|
||||
u_autoexpgain.c
|
||||
@@ -118,7 +113,7 @@ add_library(
|
||||
@@ -116,7 +111,7 @@ add_library(
|
||||
u_worker.cpp
|
||||
u_worker.h
|
||||
u_worker.hpp
|
||||
|
||||
@@ -228,10 +228,12 @@ if (WIVRN_BUILD_SERVER)
|
||||
aux_os
|
||||
aux_util
|
||||
aux_vk
|
||||
base
|
||||
comp_multi
|
||||
comp_render
|
||||
comp_util
|
||||
ipc_server
|
||||
target_helpers
|
||||
xrt-external-openxr
|
||||
xrt-interfaces
|
||||
|
||||
|
||||
+235
-154
@@ -33,8 +33,34 @@
|
||||
|
||||
#include "driver/wivrn_session.h"
|
||||
#include "encoder/video_encoder.h"
|
||||
#include "inplace_vector.hpp"
|
||||
#include "utils/method.h"
|
||||
|
||||
#include "xrt/xrt_config_build.h" // IWYU pragma: keep
|
||||
#ifdef XRT_FEATURE_RENDERDOC
|
||||
#include "renderdoc_app.h"
|
||||
|
||||
static auto renderdoc()
|
||||
{
|
||||
auto x = []() {
|
||||
RENDERDOC_API_1_5_0 * rdoc_api = nullptr;
|
||||
const char * env = std::getenv("ENABLE_VULKAN_RENDERDOC_CAPTURE");
|
||||
if (not env or env != std::string_view("1"))
|
||||
return rdoc_api;
|
||||
void * mod = dlopen("librenderdoc.so", RTLD_NOW | RTLD_NOLOAD);
|
||||
if (mod)
|
||||
{
|
||||
pRENDERDOC_GetAPI RENDERDOC_GetAPI = (pRENDERDOC_GetAPI)dlsym(mod, "RENDERDOC_GetAPI");
|
||||
XRT_MAYBE_UNUSED int ret = RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_5_0, (void **)&rdoc_api);
|
||||
assert(ret == 1);
|
||||
}
|
||||
return rdoc_api;
|
||||
};
|
||||
static auto res = x();
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUG_GET_ONCE_LOG_OPTION(log, "XRT_COMPOSITOR_LOG", U_LOGGING_INFO)
|
||||
|
||||
namespace details
|
||||
@@ -128,11 +154,6 @@ std::array<wivrn::compositor::image, 2> make_images(wivrn::vk_bundle & vk, vk::C
|
||||
}
|
||||
#endif
|
||||
|
||||
auto bufs = vk.device.allocateCommandBuffers({
|
||||
.commandPool = command_pool,
|
||||
.commandBufferCount = 2,
|
||||
});
|
||||
|
||||
auto make_image = [&](int i) {
|
||||
vk::ImageViewUsageCreateInfo usage{
|
||||
.usage = vk::ImageUsageFlagBits::eStorage,
|
||||
@@ -145,9 +166,6 @@ std::array<wivrn::compositor::image, 2> make_images(wivrn::vk_bundle & vk, vk::C
|
||||
};
|
||||
vk::Image vk_image{image};
|
||||
return wivrn::compositor::image{
|
||||
.sem{vk.device, vk::SemaphoreCreateInfo{}},
|
||||
.fence{vk.device, vk::FenceCreateInfo{}},
|
||||
.cmd{std::move(bufs[i])},
|
||||
.image{std::move(image)},
|
||||
.view_y{
|
||||
vk.device,
|
||||
@@ -182,15 +200,19 @@ std::array<wivrn::compositor::image, 2> make_images(wivrn::vk_bundle & vk, vk::C
|
||||
return {make_image(0), make_image(1)};
|
||||
}
|
||||
|
||||
vk::raii::Fence make_fence(wivrn::vk_bundle & vk, const char * name)
|
||||
vk::raii::Semaphore make_semaphore(wivrn::vk_bundle & vk)
|
||||
{
|
||||
vk::raii::Fence res{
|
||||
vk::raii::Semaphore res{
|
||||
vk.device,
|
||||
vk::FenceCreateInfo{
|
||||
.flags = vk::FenceCreateFlagBits::eSignaled,
|
||||
},
|
||||
vk::StructureChain{
|
||||
vk::SemaphoreCreateInfo{},
|
||||
vk::SemaphoreTypeCreateInfo{
|
||||
.semaphoreType = vk::SemaphoreType::eTimeline,
|
||||
},
|
||||
}
|
||||
.get(),
|
||||
};
|
||||
vk.name(res, name);
|
||||
vk.name(res, "compositor semaphore");
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -208,6 +230,13 @@ vk::Extent3D render_extent(const wivrn::from_headset::headset_info_packet & info
|
||||
namespace wivrn
|
||||
{
|
||||
|
||||
void compositor::timings::add(float us)
|
||||
{
|
||||
int index = this->index;
|
||||
this->index = (this->index + 1) % values.size();
|
||||
values[index] = us;
|
||||
}
|
||||
|
||||
xrt_result_t compositor::predict_frame(int64_t * out_frame_id,
|
||||
int64_t * out_wake_time_ns,
|
||||
int64_t * out_predicted_gpu_time_ns,
|
||||
@@ -263,10 +292,8 @@ xrt_result_t compositor::layer_commit(xrt_graphics_sync_handle_t sync_handle)
|
||||
|
||||
U_LOG_IFL_D(log_level, "frame %ld commit %d layers", frame.rendering.id, layer_accum.layer_count);
|
||||
|
||||
auto _ = vk.device.waitForFences(*fence, true, INT64_MAX);
|
||||
|
||||
if (encode_request >= 0 // encoders have not picked up the previous frame
|
||||
or layer_accum.layer_count == 0 or not session.connected())
|
||||
or layer_accum.layer_count == 0 or not session.connected() or not session.get_offset())
|
||||
{
|
||||
comp_frame_clear_locked(&frame.rendering);
|
||||
return XRT_SUCCESS;
|
||||
@@ -278,7 +305,11 @@ xrt_result_t compositor::layer_commit(xrt_graphics_sync_handle_t sync_handle)
|
||||
comp_frame_clear_locked(&frame.rendering);
|
||||
return XRT_SUCCESS;
|
||||
}
|
||||
assert(images[i].fence.getStatus() == vk::Result::eNotReady);
|
||||
|
||||
#ifdef XRT_FEATURE_RENDERDOC
|
||||
if (auto r = renderdoc())
|
||||
r->StartFrameCapture(NULL, NULL);
|
||||
#endif
|
||||
|
||||
auto & view_info = images[i].view_info;
|
||||
images[i].frame_index = frame.rendering.id;
|
||||
@@ -289,14 +320,19 @@ xrt_result_t compositor::layer_commit(xrt_graphics_sync_handle_t sync_handle)
|
||||
|
||||
session.dump_time("begin", frame.rendering.id, os_monotonic_get_ns());
|
||||
|
||||
cmd.reset();
|
||||
cmd_pool.reset();
|
||||
cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
cmd.resetQueryPool(*query_pool, 0, 3);
|
||||
cmd.writeTimestamp(vk::PipelineStageFlagBits::eTopOfPipe, *query_pool, 0);
|
||||
|
||||
bool flip_y = false;
|
||||
std::array<vk::ImageView, 2> src;
|
||||
std::array<xrt_rect, 2> src_rect;
|
||||
std::array<xrt_fov, 2> src_fov;
|
||||
|
||||
beman::inplace_vector::inplace_vector<vk::ImageMemoryBarrier2, 3> image_barriers;
|
||||
|
||||
// Check if we can pass a layer directly to foveation
|
||||
if (layer_accum.layer_count == 1 and
|
||||
(layer_accum.layers[0].data.type == XRT_LAYER_PROJECTION or
|
||||
@@ -338,27 +374,45 @@ xrt_result_t compositor::layer_commit(xrt_graphics_sync_handle_t sync_handle)
|
||||
view_info.pose[view] = xrt_cast(poses[view]);
|
||||
view_info.fov[view] = xrt_cast(src_fov[view]);
|
||||
}
|
||||
|
||||
image_barriers.push_back(
|
||||
vk::ImageMemoryBarrier2{
|
||||
.srcStageMask = vk::PipelineStageFlagBits2::eComputeShader,
|
||||
.srcAccessMask = vk::AccessFlagBits2::eShaderStorageWrite,
|
||||
.dstStageMask = vk::PipelineStageFlagBits2::eComputeShader,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eShaderSampledRead,
|
||||
.oldLayout = vk::ImageLayout::eGeneral,
|
||||
.newLayout = vk::ImageLayout::eShaderReadOnlyOptimal,
|
||||
.image = squasher.get_image(),
|
||||
.subresourceRange = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.levelCount = 1,
|
||||
.layerCount = vk::RemainingArrayLayers,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
vk::ImageMemoryBarrier2 target_barrier{
|
||||
.dstStageMask = vk::PipelineStageFlagBits2::eComputeShader,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eShaderStorageWrite,
|
||||
.oldLayout = vk::ImageLayout::eUndefined,
|
||||
.newLayout = vk::ImageLayout::eGeneral,
|
||||
.image = images[i].image,
|
||||
.subresourceRange = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = 0,
|
||||
.layerCount = vk::RemainingArrayLayers,
|
||||
},
|
||||
};
|
||||
image_barriers.push_back(
|
||||
vk::ImageMemoryBarrier2{
|
||||
.dstStageMask = vk::PipelineStageFlagBits2::eComputeShader,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eShaderStorageWrite,
|
||||
.oldLayout = vk::ImageLayout::eUndefined,
|
||||
.newLayout = vk::ImageLayout::eGeneral,
|
||||
.image = images[i].image,
|
||||
.subresourceRange = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.levelCount = 1,
|
||||
.layerCount = vk::RemainingArrayLayers,
|
||||
},
|
||||
});
|
||||
|
||||
cmd.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = 1,
|
||||
.pImageMemoryBarriers = &target_barrier,
|
||||
.imageMemoryBarrierCount = uint32_t(image_barriers.size()),
|
||||
.pImageMemoryBarriers = image_barriers.data(),
|
||||
});
|
||||
image_barriers.clear();
|
||||
|
||||
cmd.writeTimestamp(vk::PipelineStageFlagBits::eBottomOfPipe, *query_pool, 1);
|
||||
|
||||
if (session.get_info().eye_gaze)
|
||||
{
|
||||
@@ -373,110 +427,109 @@ xrt_result_t compositor::layer_commit(xrt_graphics_sync_handle_t sync_handle)
|
||||
flip_y,
|
||||
src,
|
||||
src_rect,
|
||||
src_fov);
|
||||
src_fov,
|
||||
view_info.alpha);
|
||||
|
||||
if (std::ranges::any_of(encoders, &video_encoder::need_copy))
|
||||
{
|
||||
target_barrier.srcAccessMask = target_barrier.dstAccessMask;
|
||||
target_barrier.srcStageMask = target_barrier.dstStageMask;
|
||||
target_barrier.oldLayout = target_barrier.newLayout;
|
||||
target_barrier.dstAccessMask = vk::AccessFlagBits2::eTransferRead;
|
||||
target_barrier.dstStageMask = vk::PipelineStageFlagBits2::eTransfer;
|
||||
target_barrier.newLayout = vk::ImageLayout::eTransferSrcOptimal;
|
||||
|
||||
cmd.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = 1,
|
||||
.pImageMemoryBarriers = &target_barrier,
|
||||
});
|
||||
}
|
||||
cmd.end();
|
||||
|
||||
vk.device.resetFences(*fence);
|
||||
{
|
||||
std::unique_lock lock{vk.queue_mutex};
|
||||
vk.queue.submit(
|
||||
vk::SubmitInfo{
|
||||
.commandBufferCount = 1,
|
||||
.pCommandBuffers = &*cmd,
|
||||
.signalSemaphoreCount = 1,
|
||||
.pSignalSemaphores = &*images[i].sem,
|
||||
},
|
||||
*fence);
|
||||
}
|
||||
|
||||
images[i].cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
auto info = pacer.present_to_info(frame.rendering.desired_present_time_ns);
|
||||
|
||||
bool need_queue_transfer = false;
|
||||
std::vector<vk::Semaphore> present_done_sem;
|
||||
for (auto & encoder: encoders)
|
||||
{
|
||||
if (encoder->stream_idx == 2 and not view_info.alpha)
|
||||
continue;
|
||||
auto [transfer, sem] = encoder->present_image(
|
||||
images[i].image,
|
||||
need_queue_transfer,
|
||||
images[i].cmd,
|
||||
info.frame_id);
|
||||
need_queue_transfer |= transfer;
|
||||
if (sem)
|
||||
present_done_sem.push_back(sem);
|
||||
else if (encoder->need_transfer or encoder->target_queue == vk.queue_family_index)
|
||||
{
|
||||
image_barriers.push_back(
|
||||
vk::ImageMemoryBarrier2{
|
||||
.srcStageMask = vk::PipelineStageFlagBits2KHR::eComputeShader,
|
||||
.srcAccessMask = vk::AccessFlagBits2::eShaderStorageWrite,
|
||||
.dstStageMask = vk::PipelineStageFlagBits2::eAllCommands,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eMemoryRead,
|
||||
.srcQueueFamilyIndex = vk.queue_family_index,
|
||||
.dstQueueFamilyIndex = encoder->target_queue,
|
||||
.image = images[i].image,
|
||||
.subresourceRange = {.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = encoder->stream_idx,
|
||||
.layerCount = 1},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
vk::PipelineStageFlags stages = vk::PipelineStageFlagBits::eAllCommands;
|
||||
cmd.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = uint32_t(image_barriers.size()),
|
||||
.pImageMemoryBarriers = image_barriers.data(),
|
||||
});
|
||||
cmd.writeTimestamp(vk::PipelineStageFlagBits::eBottomOfPipe, *query_pool, 2);
|
||||
|
||||
vk::SubmitInfo submit_info{
|
||||
.waitSemaphoreCount = 1,
|
||||
.pWaitSemaphores = &*images[i].sem,
|
||||
.pWaitDstStageMask = &stages,
|
||||
cmd.end();
|
||||
|
||||
const vk::SemaphoreSubmitInfo sem_info{
|
||||
.semaphore = *sem,
|
||||
.value = ++sem_value,
|
||||
.stageMask = vk::PipelineStageFlagBits2::eComputeShader,
|
||||
};
|
||||
|
||||
#if WIVRN_USE_VULKAN_ENCODE
|
||||
if (need_queue_transfer)
|
||||
{
|
||||
vk::ImageMemoryBarrier2 video_barrier{
|
||||
.srcStageMask = vk::PipelineStageFlagBits2KHR::eTransfer,
|
||||
.srcAccessMask = vk::AccessFlagBits2::eMemoryRead,
|
||||
.dstStageMask = vk::PipelineStageFlagBits2KHR::eVideoEncodeKHR,
|
||||
.oldLayout = target_barrier.newLayout,
|
||||
.newLayout = vk::ImageLayout::eVideoEncodeSrcKHR,
|
||||
.srcQueueFamilyIndex = vk.queue_family_index,
|
||||
.dstQueueFamilyIndex = vk.encode_queue_family_index,
|
||||
.image = images[i].image,
|
||||
.subresourceRange = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = 0,
|
||||
.layerCount = vk::RemainingArrayLayers,
|
||||
},
|
||||
vk::CommandBufferSubmitInfo cmd_info{
|
||||
.commandBuffer = cmd,
|
||||
};
|
||||
images[i].cmd.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = 1,
|
||||
.pImageMemoryBarriers = &video_barrier,
|
||||
std::unique_lock lock{vk.queue_mutex};
|
||||
vk.queue.submit2(vk::SubmitInfo2{
|
||||
.commandBufferInfoCount = 1,
|
||||
.pCommandBufferInfos = &cmd_info,
|
||||
.signalSemaphoreInfoCount = 1,
|
||||
.pSignalSemaphoreInfos = &sem_info,
|
||||
});
|
||||
}
|
||||
submit_info.setSignalSemaphores(present_done_sem);
|
||||
#endif
|
||||
images[i].cmd.end();
|
||||
submit_info.setCommandBuffers(*images[i].cmd);
|
||||
|
||||
auto info = pacer.present_to_info(frame.rendering.desired_present_time_ns);
|
||||
|
||||
for (auto & encoder: encoders)
|
||||
{
|
||||
std::unique_lock lock{vk.queue_mutex};
|
||||
vk.queue.submit(submit_info, *images[i].fence);
|
||||
for (auto & encoder: encoders)
|
||||
{
|
||||
if (encoder->stream_idx == 2 and not view_info.alpha)
|
||||
continue;
|
||||
encoder->post_submit();
|
||||
}
|
||||
if (encoder->stream_idx == 2 and not view_info.alpha)
|
||||
continue;
|
||||
encoder->present_image(
|
||||
images[i].image,
|
||||
sem_info,
|
||||
info.frame_id);
|
||||
}
|
||||
|
||||
auto j = encode_request.exchange(i);
|
||||
encode_request.notify_all();
|
||||
assert(j == -1);
|
||||
|
||||
#ifdef XRT_FEATURE_RENDERDOC
|
||||
if (auto r = renderdoc())
|
||||
r->EndFrameCapture(NULL, NULL);
|
||||
#endif
|
||||
|
||||
comp_frame_clear_locked(&frame.rendering);
|
||||
|
||||
if (vk.device.waitSemaphores(vk::SemaphoreWaitInfo{
|
||||
.semaphoreCount = 1,
|
||||
.pSemaphores = &*sem,
|
||||
.pValues = &sem_info.value,
|
||||
},
|
||||
U_TIME_1S_IN_NS) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_IFL_W(log_level, "compositor timeout");
|
||||
}
|
||||
else
|
||||
{
|
||||
auto [res, ts] = query_pool.getResults<uint64_t>(
|
||||
0,
|
||||
3,
|
||||
3 * sizeof(uint64_t),
|
||||
sizeof(uint64_t),
|
||||
vk::QueryResultFlagBits::e64 | vk::QueryResultFlagBits::eWait);
|
||||
|
||||
if (res == vk::Result::eSuccess)
|
||||
{
|
||||
static const auto period = vk.physical_device.getProperties().limits.timestampPeriod;
|
||||
squasher_times.add((ts[1] - ts[0]) * period / 1e3);
|
||||
foveation_times.add((ts[2] - ts[1]) * period / 1e3);
|
||||
}
|
||||
}
|
||||
|
||||
// Now is a good point to garbage collect.
|
||||
comp_swapchain_shared_garbage_collect(&cscs);
|
||||
|
||||
@@ -485,7 +538,10 @@ xrt_result_t compositor::layer_commit(xrt_graphics_sync_handle_t sync_handle)
|
||||
|
||||
xrt_result_t compositor::get_display_refresh_rate(float * hz)
|
||||
{
|
||||
*hz = refresh_rate;
|
||||
auto settings = session.get_settings();
|
||||
// there should not be rounding errors, hz must be one of the available refresh rates
|
||||
*hz = frame_rate * settings->fps_divider;
|
||||
assert(std::ranges::contains(session.headset_info_packet.available_refresh_rates, *hz));
|
||||
return XRT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -493,6 +549,7 @@ xrt_result_t compositor::request_display_refresh_rate(float hz)
|
||||
{
|
||||
try
|
||||
{
|
||||
requested_refresh_rate = hz;
|
||||
session.send_control(to_headset::refresh_rate_change{.fps = hz});
|
||||
}
|
||||
catch (std::exception & e)
|
||||
@@ -502,6 +559,42 @@ xrt_result_t compositor::request_display_refresh_rate(float hz)
|
||||
return XRT_SUCCESS;
|
||||
}
|
||||
|
||||
xrt_result_t compositor::get_view_config(
|
||||
xrt_compositor_native * self,
|
||||
xrt_view_type view_type,
|
||||
xrt_view_config * out_view_config)
|
||||
{
|
||||
const auto & session = reinterpret_cast<compositor *>(self)->session;
|
||||
const auto extent = render_extent(session.get_info());
|
||||
switch (view_type)
|
||||
{
|
||||
case XRT_VIEW_TYPE_MONO:
|
||||
return XRT_ERROR_UNSUPPORTED_VIEW_TYPE;
|
||||
case XRT_VIEW_TYPE_STEREO:
|
||||
*out_view_config = {
|
||||
.view_type = XRT_VIEW_TYPE_STEREO,
|
||||
.view_count = 2,
|
||||
.views = {}};
|
||||
for (auto & view: std::span(out_view_config->views, out_view_config->view_count))
|
||||
{
|
||||
view = {
|
||||
.recommended = {
|
||||
.width_pixels = extent.width,
|
||||
.height_pixels = extent.height,
|
||||
.sample_count = 1,
|
||||
},
|
||||
.max = {
|
||||
.width_pixels = extent.width * 2u,
|
||||
.height_pixels = extent.height * 2u,
|
||||
.sample_count = 1,
|
||||
},
|
||||
};
|
||||
}
|
||||
return XRT_SUCCESS;
|
||||
}
|
||||
return XRT_ERROR_UNSUPPORTED_VIEW_TYPE;
|
||||
}
|
||||
|
||||
int compositor::acquire_image()
|
||||
{
|
||||
for (auto [i, image]: std::ranges::enumerate_view(images))
|
||||
@@ -526,9 +619,6 @@ void compositor::encoder_work(std::stop_token tok)
|
||||
assert(req < images.size());
|
||||
auto & image = images[req];
|
||||
|
||||
auto _ = vk.device.waitForFences(*image.fence, true, UINT64_MAX);
|
||||
vk.device.resetFences(*image.fence);
|
||||
|
||||
try
|
||||
{
|
||||
for (auto & encoder: encoders)
|
||||
@@ -579,18 +669,21 @@ compositor::compositor(wivrn_session & session) :
|
||||
log_level(debug_get_log_option_log()),
|
||||
session(session),
|
||||
cmd_pool(vk.device, vk::CommandPoolCreateInfo{
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer,
|
||||
.flags = vk::CommandPoolCreateFlagBits::eTransient,
|
||||
.queueFamilyIndex = vk.queue_family_index,
|
||||
}),
|
||||
query_pool(vk.device, vk::QueryPoolCreateInfo{
|
||||
.queryType = vk::QueryType::eTimestamp,
|
||||
.queryCount = 3,
|
||||
}),
|
||||
settings(get_encoder_settings(vk, session)),
|
||||
images{make_images(vk, cmd_pool, settings)},
|
||||
cmd{std::move(vk.device.allocateCommandBuffers({.commandPool = *cmd_pool, .commandBufferCount = 1})[0])},
|
||||
fence{make_fence(vk, "compositor fence")},
|
||||
refresh_rate(settings[0].fps),
|
||||
pacer(U_TIME_1S_IN_NS / refresh_rate),
|
||||
sem{make_semaphore(vk)},
|
||||
frame_rate(settings[0].fps),
|
||||
pacer(U_TIME_1S_IN_NS / frame_rate),
|
||||
squasher(vk, render_extent(session.get_info())),
|
||||
foveation(vk, images[0].image.info().extent),
|
||||
encoder_thread{[&](std::stop_token t) { encoder_work(t); }}
|
||||
foveation(vk, images[0].image.info().extent)
|
||||
{
|
||||
comp_base * c_base = this;
|
||||
// Ensure we can safely cast pointers
|
||||
@@ -637,10 +730,18 @@ compositor::compositor(wivrn_session & session) :
|
||||
for (auto [i, settings]: std::ranges::enumerate_view(settings))
|
||||
encoders[i] = video_encoder::create(vk, settings, i);
|
||||
send_video_stream_description();
|
||||
|
||||
u_var_add_root(this, "Compositor", false);
|
||||
u_var_add_f32_timing(this, &squasher_times.var, "layers processing");
|
||||
u_var_add_f32_timing(this, &foveation_times.var, "foveation");
|
||||
|
||||
// Start the thread after everything is initialized
|
||||
encoder_thread = std::jthread{[&](std::stop_token t) { encoder_work(t); }};
|
||||
}
|
||||
|
||||
compositor::~compositor()
|
||||
{
|
||||
u_var_remove_root(this);
|
||||
encoder_thread.request_stop();
|
||||
encode_request = -2;
|
||||
encode_request.notify_all();
|
||||
@@ -655,13 +756,9 @@ xrt_system_compositor_info compositor::sys_info() const
|
||||
const auto & info = session.get_info();
|
||||
auto [prop, dev_id] = vk.physical_device.getProperties2<vk::PhysicalDeviceProperties2, vk::PhysicalDeviceIDProperties>();
|
||||
xrt_system_compositor_info res{
|
||||
.view_config_count = 1,
|
||||
.view_configs = {
|
||||
{
|
||||
.view_type = XRT_VIEW_TYPE_STEREO,
|
||||
.view_count = 2,
|
||||
.views = {},
|
||||
},
|
||||
.view_type_count = 1,
|
||||
.view_types = {
|
||||
XRT_VIEW_TYPE_STEREO,
|
||||
},
|
||||
.max_layers = squasher.max_layers(prop.properties),
|
||||
.supported_blend_modes = {
|
||||
@@ -676,23 +773,6 @@ xrt_system_compositor_info compositor::sys_info() const
|
||||
std::ranges::copy(dev_id.deviceUUID, res.compositor_vk_deviceUUID.data);
|
||||
std::ranges::copy(dev_id.deviceUUID, res.client_vk_deviceUUID.data);
|
||||
std::ranges::copy(std::span(info.available_refresh_rates).subspan(0, res.refresh_rate_count), res.refresh_rates_hz);
|
||||
|
||||
const auto extent = render_extent(info);
|
||||
for (auto & view: std::span(res.view_configs[0].views, res.view_configs[0].view_count))
|
||||
{
|
||||
view = {
|
||||
.recommended = {
|
||||
.width_pixels = extent.width,
|
||||
.height_pixels = extent.height,
|
||||
.sample_count = 1,
|
||||
},
|
||||
.max = {
|
||||
.width_pixels = extent.width * 2u,
|
||||
.height_pixels = extent.height * 2u,
|
||||
.sample_count = 1,
|
||||
},
|
||||
};
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -702,10 +782,11 @@ void compositor::set_bitrate(uint32_t bitrate)
|
||||
encoder->set_bitrate(bitrate);
|
||||
}
|
||||
|
||||
void compositor::set_refresh_rate(float hz)
|
||||
void compositor::set_framerate(float hz)
|
||||
{
|
||||
U_LOG_IFL_D(log_level, "Refresh rate change from %.0f to %.0f", refresh_rate.load(), hz);
|
||||
refresh_rate = hz;
|
||||
if (frame_rate.exchange(hz) == hz)
|
||||
return;
|
||||
U_LOG_IFL_D(log_level, "Framerate change from %.0f to %.0f", frame_rate.load(), hz);
|
||||
pacer.set_frame_duration(U_TIME_1S_IN_NS / hz);
|
||||
for (auto & encoder: encoders)
|
||||
encoder->set_framerate(hz);
|
||||
|
||||
@@ -49,9 +49,6 @@ public:
|
||||
struct image
|
||||
{
|
||||
std::atomic<bool> busy = false;
|
||||
vk::raii::Semaphore sem;
|
||||
vk::raii::Fence fence;
|
||||
vk::raii::CommandBuffer cmd;
|
||||
image_allocation image;
|
||||
vk::raii::ImageView view_y;
|
||||
vk::raii::ImageView view_cbcr;
|
||||
@@ -60,19 +57,41 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
struct timings
|
||||
{
|
||||
std::array<float, 50> values{};
|
||||
int index = 0;
|
||||
u_var_timing var{
|
||||
.values = {
|
||||
.data = values.data(),
|
||||
.index_ptr = &index,
|
||||
.length = int(values.size()),
|
||||
},
|
||||
.range = 1000,
|
||||
.dynamic_rescale = true,
|
||||
.unit = "µs",
|
||||
};
|
||||
|
||||
void add(float us);
|
||||
};
|
||||
|
||||
const u_logging_level log_level;
|
||||
timings squasher_times;
|
||||
timings foveation_times;
|
||||
wivrn_session & session;
|
||||
vk_bundle vk;
|
||||
vk::raii::CommandPool cmd_pool;
|
||||
vk::raii::QueryPool query_pool;
|
||||
|
||||
std::array<encoder_settings, 3> settings;
|
||||
|
||||
std::array<image, 2> images;
|
||||
vk::raii::CommandBuffer cmd;
|
||||
vk::raii::Fence fence;
|
||||
vk::raii::Semaphore sem;
|
||||
uint64_t sem_value = 0;
|
||||
|
||||
std::atomic<float> requested_refresh_rate;
|
||||
std::atomic<float> refresh_rate;
|
||||
std::atomic<float> frame_rate;
|
||||
wivrn::pacer pacer;
|
||||
|
||||
layer_squasher squasher;
|
||||
@@ -129,6 +148,10 @@ private:
|
||||
public:
|
||||
xrt_result_t request_display_refresh_rate(float display_refresh_rate_hz);
|
||||
|
||||
static xrt_result_t get_view_config(xrt_compositor_native *,
|
||||
xrt_view_type view_type,
|
||||
xrt_view_config * out_view_config);
|
||||
|
||||
private:
|
||||
void destroy()
|
||||
{
|
||||
@@ -158,11 +181,11 @@ public:
|
||||
return requested_refresh_rate;
|
||||
}
|
||||
|
||||
float get_refresh_rate() const
|
||||
float get_framerate() const
|
||||
{
|
||||
return refresh_rate;
|
||||
return frame_rate;
|
||||
}
|
||||
void set_refresh_rate(float hz);
|
||||
void set_framerate(float hz);
|
||||
|
||||
void set_bitrate(uint32_t);
|
||||
void update_tracking(const from_headset::tracking &);
|
||||
|
||||
@@ -42,6 +42,7 @@ struct ubo_data
|
||||
uint32_t x[XRT_MAX_VIEWS * RENDER_FOVEATION_BUFFER_DIMENSIONS];
|
||||
uint32_t y[XRT_MAX_VIEWS * RENDER_FOVEATION_BUFFER_DIMENSIONS];
|
||||
uint32_t alpha_width;
|
||||
VkBool32 alpha;
|
||||
};
|
||||
|
||||
vk::raii::Sampler make_sampler(wivrn::vk_bundle & vk)
|
||||
@@ -384,8 +385,8 @@ foveation::foveation(wivrn::vk_bundle & bundle, vk::Extent3D foveated_size) :
|
||||
.usage = vk::BufferUsageFlagBits::eTransferDst | vk::BufferUsageFlagBits::eStorageBuffer,
|
||||
},
|
||||
VmaAllocationCreateInfo{
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE,
|
||||
},
|
||||
"foveation storage buffer"),
|
||||
sampler(make_sampler(bundle)),
|
||||
@@ -400,21 +401,6 @@ foveation::foveation(wivrn::vk_bundle & bundle, vk::Extent3D foveated_size) :
|
||||
})[0]
|
||||
.release())
|
||||
{
|
||||
if (not(gpu_buffer.properties() & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT))
|
||||
{
|
||||
host_buffer = buffer_allocation(
|
||||
bundle.device,
|
||||
{
|
||||
.size = gpu_buffer.info().size,
|
||||
.usage = vk::BufferUsageFlagBits::eTransferSrc,
|
||||
},
|
||||
{
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST,
|
||||
},
|
||||
"foveation staging buffer");
|
||||
}
|
||||
|
||||
bundle.name(descriptor_set, "foveation descriptor set");
|
||||
}
|
||||
|
||||
@@ -515,9 +501,6 @@ void foveation::update_ubo(
|
||||
std::abs(last.manual_foveation.distance - manual_foveation.distance) < 0.0005)
|
||||
return;
|
||||
|
||||
if (host_buffer)
|
||||
cmd.copyBuffer(host_buffer, gpu_buffer, vk::BufferCopy{.size = sizeof(ubo_data)});
|
||||
|
||||
last = {
|
||||
.gaze = gaze,
|
||||
.flip_y = flip_y,
|
||||
@@ -529,8 +512,7 @@ void foveation::update_ubo(
|
||||
|
||||
compute_params();
|
||||
|
||||
auto ubo = host_buffer ? host_buffer.data<ubo_data>() : gpu_buffer.data<ubo_data>();
|
||||
ubo->alpha_width = foveated_size.width / 2;
|
||||
auto ubo = gpu_buffer.data<ubo_data>();
|
||||
for (size_t view = 0; view < 2; ++view)
|
||||
{
|
||||
bool flip = false;
|
||||
@@ -583,9 +565,13 @@ std::array<to_headset::foveation_parameter, 2> foveation::foveate(
|
||||
bool flip_y,
|
||||
std::array<vk::ImageView, 2> src,
|
||||
std::array<xrt_rect, 2> src_rect,
|
||||
std::array<xrt_fov, 2> src_fov)
|
||||
std::array<xrt_fov, 2> src_fov,
|
||||
bool alpha)
|
||||
{
|
||||
update_ubo(cmd, flip_y, src_rect, src_fov);
|
||||
auto ubo = gpu_buffer.data<ubo_data>();
|
||||
ubo->alpha_width = foveated_size.width / 2;
|
||||
ubo->alpha = alpha;
|
||||
|
||||
std::array src_image_info{
|
||||
vk::DescriptorImageInfo{
|
||||
|
||||
@@ -51,7 +51,6 @@ class foveation
|
||||
std::array<to_headset::foveation_parameter, 2> params;
|
||||
|
||||
buffer_allocation gpu_buffer;
|
||||
buffer_allocation host_buffer;
|
||||
vk::raii::Sampler sampler;
|
||||
|
||||
vk::raii::DescriptorSetLayout ds_layout;
|
||||
@@ -97,6 +96,7 @@ public:
|
||||
bool flip_y,
|
||||
std::array<vk::ImageView, 2> src,
|
||||
std::array<xrt_rect, 2> src_rect,
|
||||
std::array<xrt_fov, 2> src_fov);
|
||||
std::array<xrt_fov, 2> src_fov,
|
||||
bool alpha);
|
||||
};
|
||||
} // namespace wivrn
|
||||
|
||||
@@ -349,7 +349,9 @@ layer_squasher::layer_squasher(vk_bundle & vk, vk::Extent3D target_size) :
|
||||
|
||||
}
|
||||
.get(),
|
||||
VmaAllocationCreateInfo{},
|
||||
VmaAllocationCreateInfo{
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
},
|
||||
"layer squasher target"},
|
||||
render_view_srgb{make_view(vk, render_target, vk::ImageUsageFlagBits::eSampled, 0), make_view(vk, render_target, vk::ImageUsageFlagBits::eSampled, 1)},
|
||||
render_view_unorm{make_view(vk, render_target, vk::ImageUsageFlagBits::eStorage, 0), make_view(vk, render_target, vk::ImageUsageFlagBits::eStorage, 1)},
|
||||
@@ -405,7 +407,7 @@ layer_squasher::do_layers(
|
||||
.subresourceRange = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.levelCount = 1,
|
||||
.layerCount = vk::RemainingArrayLayers,
|
||||
.layerCount = view_count,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -619,18 +621,6 @@ layer_squasher::do_layers(
|
||||
cmd.dispatch(w, h, 1);
|
||||
}
|
||||
|
||||
im_barrier.oldLayout = im_barrier.newLayout;
|
||||
im_barrier.newLayout = vk::ImageLayout::eShaderReadOnlyOptimal;
|
||||
im_barrier.srcAccessMask = im_barrier.dstAccessMask;
|
||||
im_barrier.dstAccessMask = vk::AccessFlagBits::eShaderRead;
|
||||
cmd.pipelineBarrier(
|
||||
vk::PipelineStageFlagBits::eComputeShader,
|
||||
vk::PipelineStageFlagBits::eComputeShader,
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
im_barrier);
|
||||
|
||||
std::array<xrt_rect, 2> rect;
|
||||
for (auto [v, r]: std::ranges::zip_view(viewports, rect))
|
||||
r = {.extent = {.w = int(v.w), .h = int(v.h)}};
|
||||
@@ -689,6 +679,21 @@ xrt_fov layer_squasher::do_projection_layer(
|
||||
ubo.layers[cur_layer].image_info.depth_image_index = cur_image++;
|
||||
}
|
||||
|
||||
// Chroma key - per layer settings
|
||||
const xrt_layer_chroma_key_data & ck = (layer_data.type == XRT_LAYER_PROJECTION_DEPTH)
|
||||
? layer_data.depth.chroma_key
|
||||
: layer_data.proj.chroma_key;
|
||||
ubo.layers[cur_layer].chroma_key = {
|
||||
.hsv_min_h = ck.hsv_min.h,
|
||||
.hsv_min_s = ck.hsv_min.s,
|
||||
.hsv_min_v = ck.hsv_min.v,
|
||||
.hsv_max_h = ck.hsv_max.h,
|
||||
.hsv_max_s = ck.hsv_max.s,
|
||||
.hsv_max_v = ck.hsv_max.v,
|
||||
.curve = ck.curve,
|
||||
.despill = ck.despill,
|
||||
};
|
||||
|
||||
set_post_transform_rect(
|
||||
&layer_data,
|
||||
&vd.sub.norm_rect,
|
||||
@@ -799,8 +804,6 @@ xrt_fov layer_squasher::do_quad_layer(const comp_layer & layer,
|
||||
.angle_right = -M_PI,
|
||||
.angle_up = -M_PI,
|
||||
.angle_down = M_PI};
|
||||
if (normal_view_space.z < 0)
|
||||
return layer_fov; // back face is not visible
|
||||
for (auto & c: corners)
|
||||
{
|
||||
math_matrix_4x4_transform_vec3(&quad_pose, &c, &c);
|
||||
@@ -846,9 +849,6 @@ xrt_fov layer_squasher::do_cylinder_layer(const comp_layer & layer,
|
||||
false,
|
||||
&ubo.layers[cur_layer].post_transforms);
|
||||
|
||||
ubo.layers[cur_layer].cylinder_data.central_angle = c.central_angle;
|
||||
ubo.layers[cur_layer].cylinder_data.aspect_ratio = c.aspect_ratio;
|
||||
|
||||
xrt_vec3 scale{1.f, 1.f, 1.f};
|
||||
|
||||
xrt_matrix_4x4 model;
|
||||
@@ -880,7 +880,7 @@ xrt_fov layer_squasher::do_cylinder_layer(const comp_layer & layer,
|
||||
math_matrix_4x4_multiply(&v, &quad_pose, &quad_pose);
|
||||
|
||||
const float w = sin(c.central_angle / 2) * c.radius;
|
||||
const float h = c.radius * c.central_angle / 2 * c.aspect_ratio;
|
||||
const float h = c.radius * c.central_angle / (2 * c.aspect_ratio);
|
||||
const float d = c.radius * cos(c.central_angle / 2);
|
||||
std::array corners{
|
||||
xrt_vec3{-w, -h, -c.radius},
|
||||
|
||||
@@ -68,6 +68,10 @@ public:
|
||||
const xrt_rect & min_size);
|
||||
|
||||
std::array<vk::ImageView, 2> get_views();
|
||||
vk::Image get_image()
|
||||
{
|
||||
return render_target;
|
||||
}
|
||||
|
||||
uint32_t max_layers(const vk::PhysicalDeviceProperties &) const;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#version 460
|
||||
#extension GL_KHR_shader_subgroup_basic: require
|
||||
#extension GL_KHR_shader_subgroup_shuffle: require
|
||||
#extension GL_KHR_shader_subgroup_shuffle_relative: require
|
||||
|
||||
layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
|
||||
|
||||
@@ -37,6 +37,7 @@ layout(set = 0, binding = 1, std430) buffer restrict Config
|
||||
uint y[2*MAX_DIM];
|
||||
// output parameters
|
||||
uint alpha_width;
|
||||
bool alpha;
|
||||
} ubo;
|
||||
|
||||
layout(set = 0, binding = 2) uniform writeonly restrict image2DArray luma;
|
||||
@@ -75,23 +76,32 @@ void main()
|
||||
{
|
||||
uint iz = gl_GlobalInvocationID.z;
|
||||
|
||||
uint iy = gl_GlobalInvocationID.y;
|
||||
// In order to know how subgroup are mapped, we have to do the swizzling ourselves
|
||||
// in the work group, consider pixels in the following order:
|
||||
//
|
||||
// 0 1 4 5 8 9 12 13
|
||||
// 2 3 6 7 10 11 14 15
|
||||
// 16 17 20 21 24 25 28 29
|
||||
// 18 19 22 23 26 27 30 31
|
||||
// ...
|
||||
|
||||
uint id = gl_SubgroupID * gl_SubgroupSize + gl_SubgroupInvocationID;
|
||||
uint quad = id / 4;
|
||||
id -= 4 * quad;
|
||||
|
||||
uint iy = gl_WorkGroupID.y * gl_WorkGroupSize.y + 2 * uint(quad / (gl_WorkGroupSize.y / 2)) + id / 2;
|
||||
uint ymin = ubo.y[MAX_DIM * iz + iy];
|
||||
uint ymax = ubo.y[MAX_DIM * iz + iy + 1];
|
||||
if (ymin == ymax)
|
||||
return;
|
||||
if (ymin > ymax)
|
||||
{
|
||||
uint tmp = ymin;
|
||||
ymin = ymax;
|
||||
ymax = tmp;
|
||||
}
|
||||
uint ix = gl_GlobalInvocationID.x;
|
||||
uint ix = gl_WorkGroupID.x * gl_WorkGroupSize.x + 2 * (quad % (gl_WorkGroupSize.y / 2)) + (id % 2);
|
||||
|
||||
uint xmin = ubo.x[MAX_DIM * iz + ix];
|
||||
uint xmax = ubo.x[MAX_DIM * iz + ix + 1];
|
||||
if (xmin == xmax)
|
||||
return;
|
||||
|
||||
uint xstep = (xmax - xmin + MAX_SAMPLES - 1) / MAX_SAMPLES;
|
||||
uint ystep = (ymax - ymin + MAX_SAMPLES - 1) / MAX_SAMPLES;
|
||||
@@ -104,33 +114,24 @@ void main()
|
||||
++count;
|
||||
}
|
||||
}
|
||||
colour /= count;
|
||||
colour /= max(count, 1);
|
||||
colour.xyz = rgb_to_ycbcr(from_linear_to_srgb(colour.rgb));
|
||||
|
||||
imageStore(luma, ivec3(ix, iy, iz), vec4(colour.x));
|
||||
|
||||
vec4 sum = colour;
|
||||
for (uint i = 0 ; i < gl_SubgroupSize; ++i)
|
||||
{
|
||||
uvec3 other = subgroupShuffle(gl_GlobalInvocationID, i);
|
||||
vec4 c = subgroupShuffle(colour, i);
|
||||
if (
|
||||
other == gl_GlobalInvocationID + uvec3(1, 0, 0)
|
||||
|| other == gl_GlobalInvocationID + uvec3(0, 1, 0)
|
||||
|| other == gl_GlobalInvocationID + uvec3(1, 1, 0))
|
||||
{
|
||||
sum += c;
|
||||
}
|
||||
}
|
||||
vec4 sum = colour + subgroupShuffleDown(colour, 1) + subgroupShuffleDown(colour, 2) + subgroupShuffleDown(colour, 3);
|
||||
|
||||
if (ix %2 == 0 && iy %2 == 0)
|
||||
if (id == 0)
|
||||
{
|
||||
// actual chroma
|
||||
imageStore(chroma, ivec3(gl_GlobalInvocationID.xy/2, iz), vec4(sum.y, sum.z, 0, 0) / 4);
|
||||
imageStore(chroma, ivec3(ix/2, iy/2, iz), vec4(sum.y, sum.z, 0, 0) / 4);
|
||||
|
||||
// alpha in luma
|
||||
ivec2 offset = ivec2(ubo.alpha_width * iz, 0);
|
||||
imageStore(luma, ivec3(offset.xy + gl_GlobalInvocationID.xy/2, 2), vec4(sum.w, 0, 0, 0) / 4);
|
||||
imageStore(chroma, ivec3(offset.xy + gl_GlobalInvocationID.xy/2, 2), vec4(0.5, 0.5, 0, 0));
|
||||
if (ubo.alpha)
|
||||
{
|
||||
// alpha in luma
|
||||
int offset = int(ubo.alpha_width * iz);
|
||||
imageStore(luma, ivec3(offset + ix/2, iy/2, 2), vec4(sum.w, 0, 0, 0) / 4);
|
||||
imageStore(chroma, ivec3(offset + ix/2, iy/2, 2), vec4(0.5, 0.5, 0, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,6 @@
|
||||
#include "configuration.h"
|
||||
#include "driver/app_pacer.h"
|
||||
#include "server/ipc_server.h"
|
||||
#include "util/u_builders.h"
|
||||
#include "util/u_logging.h"
|
||||
#include "util/u_system.h"
|
||||
#include "utils/load_icon.h"
|
||||
#include "utils/method.h"
|
||||
#include "utils/scoped_lock.h"
|
||||
@@ -40,12 +37,16 @@
|
||||
#include "wivrn_generic_tracker.h"
|
||||
#include "wivrn_htc_face_tracker.h"
|
||||
#include "wivrn_ipc.h"
|
||||
|
||||
#include "wivrn_packets.h"
|
||||
#include "xr/to_string.h"
|
||||
|
||||
#include "b_system.h"
|
||||
#include "target_builder_helpers.h"
|
||||
#include "util/u_logging.h"
|
||||
#include "xrt/xrt_defines.h"
|
||||
#include "xrt/xrt_device.h"
|
||||
#include "xrt/xrt_session.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <magic_enum.hpp>
|
||||
@@ -74,7 +75,7 @@ bool is_forced_extension(const char * ext_name)
|
||||
return strstr(val, ext_name);
|
||||
}
|
||||
|
||||
wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection, u_system & system) :
|
||||
wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection, b_system & system) :
|
||||
xrt_system_devices{
|
||||
.get_roles = method_pointer<&wivrn_session::get_roles>,
|
||||
.feature_inc = method_pointer<&wivrn_session::feature_inc>,
|
||||
@@ -109,18 +110,18 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
|
||||
throw;
|
||||
}
|
||||
|
||||
static_roles.head = xdevs[xdev_count++] = &hmd;
|
||||
static_roles.head = static_xdevs[static_xdev_count++] = &hmd;
|
||||
|
||||
if (hmd.supported.face_tracking)
|
||||
static_roles.face = &hmd;
|
||||
|
||||
roles.left = left_controller_index = xdev_count++;
|
||||
static_roles.hand_tracking.unobstructed.left = xdevs[left_controller_index] = &left_controller;
|
||||
xdevs[left_hand_interaction_index = xdev_count++] = &left_hand_interaction;
|
||||
roles.left = left_controller_index = static_xdev_count++;
|
||||
static_roles.hand_tracking.unobstructed.left = static_xdevs[left_controller_index] = &left_controller;
|
||||
static_xdevs[left_hand_interaction_index = static_xdev_count++] = &left_hand_interaction;
|
||||
|
||||
roles.right = right_controller_index = xdev_count++;
|
||||
static_roles.hand_tracking.unobstructed.right = xdevs[right_controller_index] = &right_controller;
|
||||
xdevs[right_hand_interaction_index = xdev_count++] = &right_hand_interaction;
|
||||
roles.right = right_controller_index = static_xdev_count++;
|
||||
static_roles.hand_tracking.unobstructed.right = static_xdevs[right_controller_index] = &right_controller;
|
||||
static_xdevs[right_hand_interaction_index = static_xdev_count++] = &right_hand_interaction;
|
||||
|
||||
#if WIVRN_FEATURE_STEAMVR_LIGHTHOUSE
|
||||
auto use_steamvr_lh = configuration().use_steamvr_lh || std::getenv("WIVRN_USE_STEAMVR_LH");
|
||||
@@ -134,31 +135,31 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
|
||||
U_LOG_W("=====================");
|
||||
if (steamvr_lh_create_devices(nullptr, &lhdevs) == XRT_SUCCESS)
|
||||
{
|
||||
for (int i = 0; i < lhdevs->xdev_count; i++)
|
||||
for (int i = 0; i < lhdevs->static_xdev_count; i++)
|
||||
{
|
||||
auto lhdev = lhdevs->xdevs[i];
|
||||
auto lhdev = lhdevs->static_xdevs[i];
|
||||
switch (lhdev->device_type)
|
||||
{
|
||||
case XRT_DEVICE_TYPE_LEFT_HAND_CONTROLLER:
|
||||
roles.left = xdev_count;
|
||||
roles.left = static_xdev_count;
|
||||
static_roles.hand_tracking.unobstructed.left = nullptr;
|
||||
static_roles.hand_tracking.conforming.left = lhdev;
|
||||
break;
|
||||
case XRT_DEVICE_TYPE_RIGHT_HAND_CONTROLLER:
|
||||
roles.right = xdev_count;
|
||||
roles.right = static_xdev_count;
|
||||
static_roles.hand_tracking.unobstructed.right = nullptr;
|
||||
static_roles.hand_tracking.conforming.right = lhdev;
|
||||
break;
|
||||
case XRT_DEVICE_TYPE_ANY_HAND_CONTROLLER:
|
||||
if (roles.left == left_controller_index)
|
||||
{
|
||||
roles.left = xdev_count;
|
||||
roles.left = static_xdev_count;
|
||||
static_roles.hand_tracking.unobstructed.left = nullptr;
|
||||
static_roles.hand_tracking.conforming.left = lhdev;
|
||||
}
|
||||
else if (roles.right == right_controller_index)
|
||||
{
|
||||
roles.right = xdev_count;
|
||||
roles.right = static_xdev_count;
|
||||
static_roles.hand_tracking.unobstructed.right = nullptr;
|
||||
static_roles.hand_tracking.conforming.right = lhdev;
|
||||
}
|
||||
@@ -166,7 +167,7 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
|
||||
default:
|
||||
break;
|
||||
}
|
||||
xdevs[xdev_count++] = lhdev;
|
||||
static_xdevs[static_xdev_count++] = lhdev;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,16 +175,16 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
|
||||
if (get_info().eye_gaze || is_forced_extension("EXT_eye_gaze_interaction"))
|
||||
{
|
||||
// The tracker space needs to be attached to the head pose once the space overseer is created
|
||||
xdevs[xdev_count++] = static_roles.eyes = &eye_tracker.emplace(*this);
|
||||
static_xdevs[static_xdev_count++] = static_roles.eyes = &eye_tracker.emplace(*this);
|
||||
}
|
||||
|
||||
auto face = get_info().face_tracking;
|
||||
if (face == from_headset::face_type::android || is_forced_extension("ANDROID_face_tracking"))
|
||||
xdevs[xdev_count++] = static_roles.face = &android_face_tracker.emplace(&hmd, *this);
|
||||
static_xdevs[static_xdev_count++] = static_roles.face = &android_face_tracker.emplace(&hmd, *this);
|
||||
else if (face == from_headset::face_type::fb2 || is_forced_extension("FB_face_tracking2"))
|
||||
xdevs[xdev_count++] = static_roles.face = &fb_face2_tracker.emplace(&hmd, *this);
|
||||
static_xdevs[static_xdev_count++] = static_roles.face = &fb_face2_tracker.emplace(&hmd, *this);
|
||||
else if (face == wivrn::from_headset::face_type::htc || is_forced_extension("HTC_facial_tracking"))
|
||||
xdevs[xdev_count++] = static_roles.face = &htc_face_tracker.emplace(&hmd, *this);
|
||||
static_xdevs[static_xdev_count++] = static_roles.face = &htc_face_tracker.emplace(&hmd, *this);
|
||||
|
||||
auto num_generic_trackers = get_info().num_generic_trackers;
|
||||
if (num_generic_trackers > 0)
|
||||
@@ -195,35 +196,35 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
|
||||
from_headset::body_tracking::max_tracked_poses);
|
||||
num_generic_trackers = from_headset::body_tracking::max_tracked_poses;
|
||||
}
|
||||
if (num_generic_trackers + xdev_count > std::size(xdevs))
|
||||
if (num_generic_trackers + static_xdev_count > std::size(static_xdevs))
|
||||
{
|
||||
U_LOG_W("Too many generic trackers: %d, only %lu will be active",
|
||||
num_generic_trackers,
|
||||
std::size(xdevs) - xdev_count);
|
||||
num_generic_trackers = std::size(xdevs) - xdev_count;
|
||||
std::size(static_xdevs) - static_xdev_count);
|
||||
num_generic_trackers = std::size(static_xdevs) - static_xdev_count;
|
||||
}
|
||||
U_LOG_I("Creating %d generic trackers", num_generic_trackers);
|
||||
|
||||
for (int i = 0; i < num_generic_trackers; ++i)
|
||||
xdevs[xdev_count++] = &generic_trackers.emplace_back(i, &hmd, *this);
|
||||
static_xdevs[static_xdev_count++] = &generic_trackers.emplace_back(i, &hmd, *this);
|
||||
}
|
||||
|
||||
#if WIVRN_FEATURE_SOLARXR
|
||||
uint32_t num_devs = solarxr_device_create_xdevs(static_cast<xrt_device>(hmd).tracking_origin, &xdevs[xdev_count], ARRAY_SIZE(xdevs) - xdev_count);
|
||||
uint32_t num_devs = solarxr_device_create_xdevs(static_cast<xrt_device>(hmd).tracking_origin, &static_xdevs[static_xdev_count], ARRAY_SIZE(static_xdevs) - static_xdev_count);
|
||||
if (num_devs != 0)
|
||||
{
|
||||
static_roles.body = xdevs[xdev_count];
|
||||
solarxr_device_set_feeder_devices(static_roles.body, xdevs, xdev_count);
|
||||
static_roles.body = static_xdevs[static_xdev_count];
|
||||
solarxr_device_set_feeder_devices(static_roles.body, static_xdevs, static_xdev_count);
|
||||
}
|
||||
xdev_count += num_devs;
|
||||
static_xdev_count += num_devs;
|
||||
#endif
|
||||
|
||||
if (roles.left >= 0)
|
||||
roles.left_profile = xdevs[roles.left]->name;
|
||||
roles.left_profile = static_xdevs[roles.left]->name;
|
||||
if (roles.right >= 0)
|
||||
roles.right_profile = xdevs[roles.right]->name;
|
||||
roles.right_profile = static_xdevs[roles.right]->name;
|
||||
if (roles.gamepad >= 0)
|
||||
roles.gamepad_profile = xdevs[roles.gamepad]->name;
|
||||
roles.gamepad_profile = static_xdevs[roles.gamepad]->name;
|
||||
|
||||
if (auto system_name = get_info().system_name; !system_name.empty())
|
||||
{
|
||||
@@ -255,16 +256,16 @@ wivrn_session::~wivrn_session()
|
||||
solarxr_device_clear_feeder_devices(static_roles.body);
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(xdevs); i++)
|
||||
for (size_t i = 0; i < ARRAY_SIZE(static_xdevs); i++)
|
||||
{
|
||||
xrt_device_destroy(&xdevs[i]);
|
||||
xrt_device_destroy(&static_xdevs[i]);
|
||||
}
|
||||
|
||||
connection->shutdown();
|
||||
}
|
||||
|
||||
xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connection> connection,
|
||||
u_system & system,
|
||||
b_system & system,
|
||||
xrt_system_devices ** out_xsysd,
|
||||
xrt_space_overseer ** out_xspovrs,
|
||||
xrt_system_compositor ** out_xsysc)
|
||||
@@ -284,7 +285,7 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
|
||||
send_to_main(info);
|
||||
|
||||
auto sys_info{self->compositor.sys_info()};
|
||||
auto xret = comp_multi_create_system_compositor(&self->compositor.base, &self->app_pacers, &sys_info, false, out_xsysc);
|
||||
auto xret = comp_multi_create_system_compositor(&self->compositor.base, &self->app_pacers, &compositor::get_view_config, &sys_info, false, out_xsysc);
|
||||
if (xret != XRT_SUCCESS)
|
||||
{
|
||||
U_LOG_E("Failed to create system compositor: %s", u_str_xrt_result(xret));
|
||||
@@ -292,15 +293,15 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
|
||||
}
|
||||
self->system_compositor = *out_xsysc;
|
||||
|
||||
u_builder_create_space_overseer_legacy(
|
||||
t_builder_create_space_overseer_legacy(
|
||||
&self->xrt_system.broadcast,
|
||||
&self->hmd,
|
||||
self->static_roles.eyes,
|
||||
&self->left_controller,
|
||||
&self->right_controller,
|
||||
nullptr,
|
||||
self->xdevs,
|
||||
self->xdev_count,
|
||||
self->static_xdevs,
|
||||
self->static_xdev_count,
|
||||
false,
|
||||
false,
|
||||
out_xspovrs);
|
||||
@@ -395,8 +396,8 @@ void wivrn_session::resume_session()
|
||||
send_control(to_headset::feature_control{to_headset::feature_control::hid_input, true});
|
||||
|
||||
{
|
||||
float target_fps = default_rate();
|
||||
auto current_fps = compositor.get_refresh_rate();
|
||||
float target_fps = default_fps();
|
||||
auto current_fps = compositor.get_framerate();
|
||||
|
||||
if (target_fps != current_fps)
|
||||
{
|
||||
@@ -438,11 +439,11 @@ bool wivrn_session::connected()
|
||||
return connection->is_active();
|
||||
}
|
||||
|
||||
float wivrn_session::default_rate()
|
||||
float wivrn_session::default_fps()
|
||||
{
|
||||
auto s = settings.lock();
|
||||
if (s->preferred_refresh_rate)
|
||||
return s->preferred_refresh_rate;
|
||||
return s->preferred_refresh_rate / s->fps_divider;
|
||||
return headset_info.available_refresh_rates.back();
|
||||
}
|
||||
|
||||
@@ -463,11 +464,15 @@ void wivrn_session::operator()(from_headset::headset_info_packet &&)
|
||||
|
||||
void wivrn_session::operator()(const from_headset::settings_changed & settings)
|
||||
{
|
||||
*this->settings.lock() = settings;
|
||||
auto locked = this->settings.lock();
|
||||
*locked = settings;
|
||||
|
||||
if (settings.bitrate_bps != 0)
|
||||
compositor.set_bitrate(settings.bitrate_bps);
|
||||
|
||||
if (settings.preferred_refresh_rate != 0)
|
||||
compositor.set_framerate(settings.preferred_refresh_rate / settings.fps_divider);
|
||||
|
||||
wivrn_ipc_socket_monado->send(std::move(settings));
|
||||
}
|
||||
|
||||
@@ -755,7 +760,8 @@ void wivrn_session::operator()(from_headset::user_presence_changed && event)
|
||||
|
||||
void wivrn_session::operator()(from_headset::refresh_rate_changed && event)
|
||||
{
|
||||
compositor.set_refresh_rate(event.to);
|
||||
auto locked = settings.lock();
|
||||
compositor.set_framerate(event.to / locked->fps_divider);
|
||||
push_event(
|
||||
{
|
||||
.display = {
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
#include <optional>
|
||||
#include <thread>
|
||||
|
||||
struct b_system;
|
||||
struct ipc_server;
|
||||
struct u_system;
|
||||
struct xrt_space_overseer;
|
||||
struct xrt_system_compositor;
|
||||
union xrt_session_event;
|
||||
@@ -70,7 +70,7 @@ class wivrn_session : public xrt_system_devices
|
||||
wivrn::compositor compositor;
|
||||
pacing_app_factory app_pacers;
|
||||
|
||||
u_system & xrt_system;
|
||||
b_system & xrt_system;
|
||||
ipc_server * mnd_ipc_server;
|
||||
xrt_space_overseer * space_overseer;
|
||||
xrt_system_compositor * system_compositor;
|
||||
@@ -115,14 +115,14 @@ class wivrn_session : public xrt_system_devices
|
||||
std::jthread net_thread;
|
||||
std::jthread worker_thread;
|
||||
|
||||
wivrn_session(std::unique_ptr<wivrn_connection> connection, u_system &);
|
||||
wivrn_session(std::unique_ptr<wivrn_connection> connection, b_system &);
|
||||
|
||||
public:
|
||||
using base_t = xrt_system_devices;
|
||||
~wivrn_session();
|
||||
|
||||
static xrt_result_t create_session(std::unique_ptr<wivrn_connection> connection,
|
||||
u_system & system,
|
||||
b_system & system,
|
||||
xrt_system_devices ** out_xsysd,
|
||||
xrt_space_overseer ** out_xspovrs,
|
||||
xrt_system_compositor ** out_xsysc);
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
return headset_info;
|
||||
};
|
||||
|
||||
float default_rate();
|
||||
float default_fps();
|
||||
|
||||
locked<from_headset::settings_changed> get_settings()
|
||||
{
|
||||
|
||||
@@ -183,8 +183,11 @@ class prober
|
||||
{
|
||||
if (*vk.encode_queue == VK_NULL_HANDLE)
|
||||
return false;
|
||||
if (not std::get<vk::PhysicalDeviceVulkan12Features>(vk.feat).timelineSemaphore)
|
||||
if (not std::get<vk::PhysicalDeviceVideoMaintenance1FeaturesKHR>(vk.feat).videoMaintenance1)
|
||||
{
|
||||
U_LOG_I("Cannot use vulkan video encode without VideoMaintenance1 feature");
|
||||
return false;
|
||||
}
|
||||
auto prop = vk.physical_device.getQueueFamilyProperties2<vk::StructureChain<vk::QueueFamilyProperties2, vk::QueueFamilyVideoPropertiesKHR>>();
|
||||
assert(vk.encode_queue_family_index < prop.size());
|
||||
const auto flags = prop.at(vk.encode_queue_family_index).get<vk::QueueFamilyVideoPropertiesKHR>().videoCodecOperations;
|
||||
@@ -281,7 +284,7 @@ std::array<encoder_settings, 3> get_encoder_settings(wivrn::vk_bundle & bundle,
|
||||
|
||||
for (auto [src, dst]: std::ranges::zip_view(config.encoders, res))
|
||||
{
|
||||
dst.fps = session.default_rate();
|
||||
dst.fps = session.default_fps();
|
||||
dst.options = src.options;
|
||||
dst.device = src.device;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "encoder/video_encoder.h"
|
||||
#include "ffmpeg_helper.h"
|
||||
#include "utils/wivrn_vk_bundle.h"
|
||||
|
||||
namespace wivrn
|
||||
{
|
||||
@@ -37,8 +38,8 @@ public:
|
||||
};
|
||||
|
||||
protected:
|
||||
video_encoder_ffmpeg(uint8_t stream_idx, const encoder_settings & settings) :
|
||||
wivrn::video_encoder(stream_idx, settings, std::make_unique<default_idr_handler>(), true) {}
|
||||
video_encoder_ffmpeg(vk_bundle & vk, uint8_t stream_idx, const encoder_settings & settings) :
|
||||
wivrn::video_encoder(vk, stream_idx, vk.queue_family_index, settings, std::make_unique<default_idr_handler>(), true) {}
|
||||
|
||||
virtual void push_frame(bool idr, uint8_t slot) = 0;
|
||||
|
||||
|
||||
@@ -153,14 +153,36 @@ vk::Format drm_to_vulkan_fmt(uint32_t drm_fourcc, int bit_depth)
|
||||
return vulkan_drm_format_map.at(drm_fourcc);
|
||||
}
|
||||
|
||||
vk::raii::CommandPool make_cmd_pool(wivrn::vk_bundle & vk, uint8_t stream_idx)
|
||||
{
|
||||
auto res = vk.device.createCommandPool(vk::CommandPoolCreateInfo{
|
||||
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer | vk::CommandPoolCreateFlagBits::eTransient,
|
||||
.queueFamilyIndex = vk.queue_family_index,
|
||||
});
|
||||
vk.name(res, std::format("vaapi encoder {} command pool", stream_idx));
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
video_encoder_va::video_encoder_va(wivrn::vk_bundle & vk,
|
||||
const wivrn::encoder_settings & settings,
|
||||
uint8_t stream_idx) :
|
||||
video_encoder_ffmpeg(stream_idx, settings),
|
||||
synchronization2(std::get<vk::PhysicalDeviceVulkan13Features>(vk.feat).synchronization2)
|
||||
video_encoder_ffmpeg(vk, stream_idx, settings),
|
||||
vk{vk},
|
||||
cmd_pool{make_cmd_pool(vk, stream_idx)}
|
||||
{
|
||||
auto command_buffers = vk.device.allocateCommandBuffers(
|
||||
{.commandPool = *cmd_pool,
|
||||
.commandBufferCount = num_slots});
|
||||
for (size_t i = 0; i < num_slots; ++i)
|
||||
{
|
||||
in[i].cmd = std::move(command_buffers[i]);
|
||||
in[i].fence = vk::raii::Fence(vk.device,
|
||||
vk::FenceCreateInfo{.flags = vk::FenceCreateFlagBits::eSignaled});
|
||||
}
|
||||
|
||||
auto drm_hw_ctx = make_drm_hw_ctx(vk.physical_device, settings.device);
|
||||
AVBufferRef * tmp;
|
||||
int err = av_hwdevice_ctx_create_derived(&tmp,
|
||||
@@ -409,8 +431,14 @@ video_encoder_va::video_encoder_va(wivrn::vk_bundle & vk,
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<bool, vk::Semaphore> video_encoder_va::present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index)
|
||||
void video_encoder_va::present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo, uint8_t slot, uint64_t)
|
||||
{
|
||||
if (vk.device.waitForFences(*in[slot].fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_E("Timeout on stream %d", stream_idx);
|
||||
return;
|
||||
}
|
||||
|
||||
std::array im_barriers = {
|
||||
vk::ImageMemoryBarrier{
|
||||
.srcAccessMask = vk::AccessFlagBits::eNone,
|
||||
@@ -435,7 +463,11 @@ std::pair<bool, vk::Semaphore> video_encoder_va::present_image(vk::Image y_cbcr,
|
||||
.layerCount = 1},
|
||||
},
|
||||
};
|
||||
cmd_buf.pipelineBarrier(
|
||||
|
||||
auto & cmd = in[slot].cmd;
|
||||
cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
cmd.pipelineBarrier(
|
||||
vk::PipelineStageFlagBits::eAllCommands,
|
||||
vk::PipelineStageFlagBits::eTransfer,
|
||||
{},
|
||||
@@ -443,9 +475,9 @@ std::pair<bool, vk::Semaphore> video_encoder_va::present_image(vk::Image y_cbcr,
|
||||
nullptr,
|
||||
im_barriers);
|
||||
|
||||
cmd_buf.copyImage(
|
||||
cmd.copyImage(
|
||||
y_cbcr,
|
||||
vk::ImageLayout::eTransferSrcOptimal,
|
||||
vk::ImageLayout::eGeneral,
|
||||
*in[slot].luma,
|
||||
vk::ImageLayout::eTransferDstOptimal,
|
||||
vk::ImageCopy{
|
||||
@@ -464,9 +496,9 @@ std::pair<bool, vk::Semaphore> video_encoder_va::present_image(vk::Image y_cbcr,
|
||||
.depth = 1,
|
||||
}});
|
||||
|
||||
cmd_buf.copyImage(
|
||||
cmd.copyImage(
|
||||
y_cbcr,
|
||||
vk::ImageLayout::eTransferSrcOptimal,
|
||||
vk::ImageLayout::eGeneral,
|
||||
*in[slot].chroma,
|
||||
vk::ImageLayout::eTransferDstOptimal,
|
||||
vk::ImageCopy{
|
||||
@@ -493,18 +525,33 @@ std::pair<bool, vk::Semaphore> video_encoder_va::present_image(vk::Image y_cbcr,
|
||||
b.newLayout = vk::ImageLayout::eGeneral;
|
||||
}
|
||||
|
||||
cmd_buf.pipelineBarrier(
|
||||
cmd.pipelineBarrier(
|
||||
vk::PipelineStageFlagBits::eTransfer,
|
||||
synchronization2 ? vk::PipelineStageFlagBits::eNone : vk::PipelineStageFlagBits::eAllCommands,
|
||||
vk::PipelineStageFlagBits::eNone,
|
||||
{},
|
||||
nullptr,
|
||||
nullptr,
|
||||
im_barriers);
|
||||
return {false, nullptr};
|
||||
|
||||
cmd.end();
|
||||
|
||||
std::unique_lock lock(vk.queue_mutex);
|
||||
vk::CommandBufferSubmitInfo cmd_info{
|
||||
.commandBuffer = *cmd,
|
||||
};
|
||||
|
||||
vk.device.resetFences(*in[slot].fence);
|
||||
vk.queue.submit2(vk::SubmitInfo2{
|
||||
.commandBufferInfoCount = 1,
|
||||
.pCommandBufferInfos = &cmd_info,
|
||||
},
|
||||
*in[slot].fence);
|
||||
}
|
||||
|
||||
void video_encoder_va::push_frame(bool idr, uint8_t slot)
|
||||
{
|
||||
if (vk.device.waitForFences(*in[slot].fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
throw std::runtime_error("timeout");
|
||||
auto & va_frame = in[slot].va_frame;
|
||||
va_frame->pict_type = idr ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
|
||||
int err = avcodec_send_frame(encoder_ctx.get(), va_frame.get());
|
||||
|
||||
@@ -32,22 +32,25 @@ struct encoder_settings;
|
||||
|
||||
class video_encoder_va : public video_encoder_ffmpeg
|
||||
{
|
||||
vk_bundle & vk;
|
||||
vk::raii::CommandPool cmd_pool;
|
||||
struct in_t
|
||||
{
|
||||
av_frame_ptr va_frame;
|
||||
av_frame_ptr drm_frame;
|
||||
vk::raii::Fence fence = nullptr;
|
||||
vk::raii::CommandBuffer cmd = nullptr;
|
||||
vk::raii::Image luma = nullptr;
|
||||
vk::raii::Image chroma = nullptr;
|
||||
std::vector<vk::raii::DeviceMemory> mem;
|
||||
};
|
||||
av_buffer_ptr drm_frame_ctx;
|
||||
std::array<in_t, num_slots> in;
|
||||
bool synchronization2 = false;
|
||||
|
||||
public:
|
||||
video_encoder_va(wivrn::vk_bundle &, const wivrn::encoder_settings & settings, uint8_t stream_index);
|
||||
|
||||
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index) override;
|
||||
void present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo info, uint8_t slot, uint64_t frame_index) override;
|
||||
|
||||
protected:
|
||||
void push_frame(bool idr, uint8_t slot) override;
|
||||
|
||||
@@ -185,11 +185,15 @@ std::unique_ptr<video_encoder> video_encoder::create(
|
||||
return res;
|
||||
}
|
||||
|
||||
video_encoder::video_encoder(uint8_t stream_idx,
|
||||
video_encoder::video_encoder(vk_bundle & vk,
|
||||
uint8_t stream_idx,
|
||||
uint32_t target_queue,
|
||||
const encoder_settings & settings,
|
||||
std::unique_ptr<idr_handler> idr,
|
||||
bool async_send) :
|
||||
stream_idx(stream_idx),
|
||||
target_queue(target_queue),
|
||||
need_transfer(not vk.optimal_transfer(vk.queue_family_index, target_queue)),
|
||||
bitrate_multiplier(settings.bitrate_multiplier),
|
||||
shared_sender(async_send ? sender::get() : nullptr),
|
||||
idr(std::move(idr)),
|
||||
@@ -228,7 +232,7 @@ void video_encoder::set_framerate(float framerate)
|
||||
pending_framerate = framerate;
|
||||
}
|
||||
|
||||
std::pair<bool, vk::Semaphore> video_encoder::present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint64_t frame_index)
|
||||
void video_encoder::present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo info, uint64_t frame_index)
|
||||
{
|
||||
// Wait for encoder to be done
|
||||
present_slot = (present_slot + 1) % num_slots;
|
||||
@@ -236,17 +240,10 @@ std::pair<bool, vk::Semaphore> video_encoder::present_image(vk::Image y_cbcr, bo
|
||||
if (idr->should_skip(frame_index))
|
||||
{
|
||||
state[present_slot] = skip;
|
||||
return {false, nullptr};
|
||||
return;
|
||||
}
|
||||
state[present_slot] = busy;
|
||||
return present_image(y_cbcr, transferred, cmd_buf, present_slot, frame_index);
|
||||
}
|
||||
|
||||
void video_encoder::post_submit()
|
||||
{
|
||||
if (state[present_slot] == skip)
|
||||
return;
|
||||
post_submit(present_slot);
|
||||
return present_image(y_cbcr, info, present_slot, frame_index);
|
||||
}
|
||||
|
||||
void video_encoder::encode(wivrn_session & cnx,
|
||||
|
||||
@@ -76,6 +76,8 @@ private:
|
||||
|
||||
public:
|
||||
const uint8_t stream_idx;
|
||||
const uint32_t target_queue;
|
||||
const bool need_transfer;
|
||||
static const uint8_t num_slots = 2;
|
||||
const double bitrate_multiplier;
|
||||
|
||||
@@ -115,23 +117,12 @@ public:
|
||||
const encoder_settings & settings,
|
||||
uint8_t stream_idx);
|
||||
|
||||
video_encoder(uint8_t stream_idx, const encoder_settings & settings, std::unique_ptr<idr_handler>, bool async_send);
|
||||
video_encoder(vk_bundle &, uint8_t stream_idx, uint32_t target_queue, const encoder_settings & settings, std::unique_ptr<idr_handler>, bool async_send);
|
||||
virtual ~video_encoder();
|
||||
|
||||
// true when present_image will perform a copy
|
||||
// and requires the image to be in transfer src layout
|
||||
virtual bool need_copy() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// return value: true if image should be transitioned to queue and layout for vulkan video encode
|
||||
// semaphore to be signaled by the compositor
|
||||
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr,
|
||||
bool transferred,
|
||||
vk::raii::CommandBuffer & cmd_buf,
|
||||
uint64_t frame_index);
|
||||
void post_submit();
|
||||
void present_image(vk::Image y_cbcr,
|
||||
vk::SemaphoreSubmitInfo sem_info,
|
||||
uint64_t frame_index);
|
||||
|
||||
void on_feedback(const from_headset::feedback &);
|
||||
void reset();
|
||||
@@ -145,14 +136,13 @@ public:
|
||||
const to_headset::video_stream_data_shard::view_info_t & view_info,
|
||||
uint64_t frame_index);
|
||||
|
||||
protected:
|
||||
// called on present to submit command buffers for the image.
|
||||
virtual std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr,
|
||||
bool transferred,
|
||||
vk::raii::CommandBuffer & cmd_buf,
|
||||
uint8_t slot,
|
||||
uint64_t frame_index) = 0;
|
||||
// called after command buffer passed in present_image was submitted
|
||||
virtual void post_submit(uint8_t slot) {}
|
||||
virtual void present_image(vk::Image y_cbcr,
|
||||
vk::SemaphoreSubmitInfo sem_info,
|
||||
uint8_t slot,
|
||||
uint64_t frame_index) = 0;
|
||||
|
||||
// called when command buffer finished executing
|
||||
virtual std::optional<data> encode(uint8_t slot, uint64_t frame_index) = 0;
|
||||
|
||||
|
||||
@@ -148,12 +148,24 @@ void video_encoder_nvenc::set_init_params_fps(float framerate)
|
||||
init_params.frameRateDen = 1;
|
||||
}
|
||||
|
||||
static vk::raii::CommandPool make_cmd_pool(wivrn::vk_bundle & vk, uint8_t stream_idx)
|
||||
{
|
||||
auto res = vk.device.createCommandPool(vk::CommandPoolCreateInfo{
|
||||
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer | vk::CommandPoolCreateFlagBits::eTransient,
|
||||
.queueFamilyIndex = vk.queue_family_index,
|
||||
});
|
||||
vk.name(res, std::format("nvenc encoder {} command pool", stream_idx));
|
||||
return res;
|
||||
}
|
||||
|
||||
video_encoder_nvenc::video_encoder_nvenc(
|
||||
wivrn::vk_bundle & vk,
|
||||
const encoder_settings & settings,
|
||||
uint8_t stream_idx) :
|
||||
video_encoder(stream_idx, settings, std::make_unique<default_idr_handler>(), true),
|
||||
video_encoder(vk, stream_idx, vk.queue_family_index, settings, std::make_unique<default_idr_handler>(), true),
|
||||
vk(vk),
|
||||
cmd_pool{make_cmd_pool(vk, stream_idx)},
|
||||
shared_state(video_encoder_nvenc_shared_state::get()),
|
||||
fps(settings.fps),
|
||||
bitrate(settings.bitrate)
|
||||
@@ -164,6 +176,16 @@ video_encoder_nvenc::video_encoder_nvenc(
|
||||
assert(extent.width % 32 == 0);
|
||||
assert(extent.height % 32 == 0);
|
||||
|
||||
auto command_buffers = vk.device.allocateCommandBuffers(
|
||||
{.commandPool = *cmd_pool,
|
||||
.commandBufferCount = num_slots});
|
||||
for (size_t i = 0; i < num_slots; ++i)
|
||||
{
|
||||
in[i].cmd = std::move(command_buffers[i]);
|
||||
in[i].fence = vk::raii::Fence(vk.device,
|
||||
vk::FenceCreateInfo{.flags = vk::FenceCreateFlagBits::eSignaled});
|
||||
}
|
||||
|
||||
NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS session_params = {
|
||||
.version = NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER,
|
||||
.deviceType = NV_ENC_DEVICE_TYPE_CUDA,
|
||||
@@ -396,11 +418,19 @@ video_encoder_nvenc::~video_encoder_nvenc()
|
||||
shared_state->fn.nvEncDestroyEncoder(session_handle);
|
||||
}
|
||||
|
||||
std::pair<bool, vk::Semaphore> video_encoder_nvenc::present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t)
|
||||
void video_encoder_nvenc::present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo, uint8_t slot, uint64_t)
|
||||
{
|
||||
cmd_buf.copyImageToBuffer(
|
||||
if (vk.device.waitForFences(*in[slot].fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_E("Timeout on stream %d", stream_idx);
|
||||
return;
|
||||
}
|
||||
auto & cmd = in[slot].cmd;
|
||||
cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
cmd.copyImageToBuffer(
|
||||
y_cbcr,
|
||||
vk::ImageLayout::eTransferSrcOptimal,
|
||||
vk::ImageLayout::eGeneral,
|
||||
*in[slot].yuv,
|
||||
std::array{
|
||||
vk::BufferImageCopy{
|
||||
@@ -429,12 +459,29 @@ std::pair<bool, vk::Semaphore> video_encoder_nvenc::present_image(vk::Image y_cb
|
||||
.depth = 1,
|
||||
},
|
||||
}});
|
||||
cmd.end();
|
||||
|
||||
return {false, nullptr};
|
||||
std::unique_lock lock(vk.queue_mutex);
|
||||
vk::CommandBufferSubmitInfo cmd_info{
|
||||
.commandBuffer = *cmd,
|
||||
};
|
||||
|
||||
vk.device.resetFences(*in[slot].fence);
|
||||
vk.queue.submit2(vk::SubmitInfo2{
|
||||
.commandBufferInfoCount = 1,
|
||||
.pCommandBufferInfos = &cmd_info,
|
||||
},
|
||||
*in[slot].fence);
|
||||
}
|
||||
|
||||
std::optional<video_encoder::data> video_encoder_nvenc::encode(uint8_t slot, uint64_t frame_index)
|
||||
{
|
||||
if (vk.device.waitForFences(*in[slot].fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_E("Timeout on stream %d", stream_idx);
|
||||
return {};
|
||||
}
|
||||
|
||||
CU_CHECK(shared_state->cuda_fn->cuCtxPushCurrent(shared_state->cuda));
|
||||
auto & idr_handler = ((default_idr_handler &)*idr);
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ class video_encoder_nvenc : public video_encoder
|
||||
{
|
||||
private:
|
||||
wivrn::vk_bundle & vk;
|
||||
vk::raii::CommandPool cmd_pool;
|
||||
|
||||
std::shared_ptr<video_encoder_nvenc_shared_state> shared_state;
|
||||
|
||||
@@ -44,6 +45,8 @@ private:
|
||||
|
||||
struct in_t
|
||||
{
|
||||
vk::raii::Fence fence = nullptr;
|
||||
vk::raii::CommandBuffer cmd = nullptr;
|
||||
vk::raii::Buffer yuv = nullptr;
|
||||
vk::raii::DeviceMemory mem = nullptr;
|
||||
NV_ENC_REGISTERED_PTR nvenc_resource;
|
||||
@@ -61,7 +64,7 @@ public:
|
||||
video_encoder_nvenc(wivrn::vk_bundle & vk, const encoder_settings & settings, uint8_t stream_idx);
|
||||
~video_encoder_nvenc();
|
||||
|
||||
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index) override;
|
||||
void present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo info, uint8_t slot, uint64_t frame_index) override;
|
||||
std::optional<data> encode(uint8_t slot, uint64_t frame_index) override;
|
||||
|
||||
static std::array<int, 2> get_max_size(video_codec);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "video_encoder_raw.h"
|
||||
|
||||
#include "encoder/encoder_settings.h"
|
||||
#include "util/u_logging.h"
|
||||
#include "utils/wivrn_vk_bundle.h"
|
||||
|
||||
namespace
|
||||
@@ -33,13 +34,30 @@ public:
|
||||
return false;
|
||||
};
|
||||
};
|
||||
vk::raii::CommandPool make_cmd_pool(wivrn::vk_bundle & vk, uint8_t stream_idx)
|
||||
{
|
||||
auto res = vk.device.createCommandPool(vk::CommandPoolCreateInfo{
|
||||
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer | vk::CommandPoolCreateFlagBits::eTransient,
|
||||
.queueFamilyIndex = *vk.transfer_queue ? vk.transfer_queue_family_index : vk.queue_family_index,
|
||||
});
|
||||
vk.name(res, std::format("raw encoder {} command pool", stream_idx));
|
||||
return res;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
wivrn::video_encoder_raw::video_encoder_raw(
|
||||
wivrn::vk_bundle & vk,
|
||||
const encoder_settings & settings,
|
||||
uint8_t stream_idx) :
|
||||
video_encoder(stream_idx, settings, std::make_unique<dummy_idr_handler>(), true)
|
||||
video_encoder(vk,
|
||||
stream_idx,
|
||||
*vk.transfer_queue ? vk.transfer_queue_family_index : vk.queue_family_index,
|
||||
settings,
|
||||
std::make_unique<dummy_idr_handler>(),
|
||||
true),
|
||||
vk{vk},
|
||||
cmd_pool{make_cmd_pool(vk, stream_idx)}
|
||||
{
|
||||
if (settings.bit_depth != 8)
|
||||
throw std::runtime_error("Raw encoding is only supported for 8 bit");
|
||||
@@ -47,9 +65,15 @@ wivrn::video_encoder_raw::video_encoder_raw(
|
||||
vk::DeviceSize buffer_size = extent.width * extent.height;
|
||||
if (stream_idx < 2)
|
||||
buffer_size += buffer_size / 2;
|
||||
for (auto & slot: buffers)
|
||||
|
||||
auto command_buffers = vk.device.allocateCommandBuffers(
|
||||
{.commandPool = *cmd_pool,
|
||||
.commandBufferCount = num_slots});
|
||||
|
||||
for (size_t i = 0; i < num_slots; ++i)
|
||||
{
|
||||
slot = buffer_allocation(
|
||||
in[i].cmd = std::move(command_buffers[i]);
|
||||
in[i].buffer = buffer_allocation(
|
||||
vk.device,
|
||||
{
|
||||
.size = buffer_size,
|
||||
@@ -57,14 +81,45 @@ wivrn::video_encoder_raw::video_encoder_raw(
|
||||
},
|
||||
{
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST,
|
||||
},
|
||||
"raw stream buffer");
|
||||
in[i].fence = vk::raii::Fence(vk.device,
|
||||
vk::FenceCreateInfo{.flags = vk::FenceCreateFlagBits::eSignaled});
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<bool, vk::Semaphore> wivrn::video_encoder_raw::present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t)
|
||||
void wivrn::video_encoder_raw::present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo compositor_sem, uint8_t slot, uint64_t)
|
||||
{
|
||||
if (vk.device.waitForFences(*in[slot].fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_E("Timeout on stream %d", stream_idx);
|
||||
return;
|
||||
}
|
||||
|
||||
auto & cmd = in[slot].cmd;
|
||||
cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
if (need_transfer)
|
||||
{
|
||||
vk::ImageMemoryBarrier2 barrier{
|
||||
.dstStageMask = vk::PipelineStageFlagBits2KHR::eTransfer,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eTransferRead,
|
||||
.srcQueueFamilyIndex = vk.queue_family_index,
|
||||
.dstQueueFamilyIndex = target_queue,
|
||||
.image = y_cbcr,
|
||||
.subresourceRange = {.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = stream_idx,
|
||||
.layerCount = 1},
|
||||
};
|
||||
cmd.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = 1,
|
||||
.pImageMemoryBarriers = &barrier,
|
||||
});
|
||||
}
|
||||
|
||||
std::array regions{
|
||||
vk::BufferImageCopy{
|
||||
.imageSubresource = {
|
||||
@@ -92,19 +147,42 @@ std::pair<bool, vk::Semaphore> wivrn::video_encoder_raw::present_image(vk::Image
|
||||
},
|
||||
},
|
||||
};
|
||||
cmd_buf.copyImageToBuffer(
|
||||
cmd.copyImageToBuffer(
|
||||
y_cbcr,
|
||||
vk::ImageLayout::eTransferSrcOptimal,
|
||||
buffers[slot],
|
||||
vk::ImageLayout::eGeneral,
|
||||
in[slot].buffer,
|
||||
std::span(regions.data(),
|
||||
stream_idx < 2 ? 2 : 1));
|
||||
return {false, nullptr};
|
||||
|
||||
cmd.end();
|
||||
|
||||
std::unique_lock lock(*vk.transfer_queue ? vk.transfer_queue_mutex : vk.queue_mutex);
|
||||
vk::CommandBufferSubmitInfo cmd_info{
|
||||
.commandBuffer = *cmd,
|
||||
};
|
||||
compositor_sem.stageMask = vk::PipelineStageFlagBits2::eTransfer;
|
||||
|
||||
vk.device.resetFences(*in[slot].fence);
|
||||
(*vk.transfer_queue ? vk.transfer_queue : vk.queue)
|
||||
.submit2(vk::SubmitInfo2{
|
||||
.waitSemaphoreInfoCount = 1,
|
||||
.pWaitSemaphoreInfos = &compositor_sem,
|
||||
.commandBufferInfoCount = 1,
|
||||
.pCommandBufferInfos = &cmd_info,
|
||||
},
|
||||
*in[slot].fence);
|
||||
}
|
||||
|
||||
std::optional<wivrn::video_encoder::data> wivrn::video_encoder_raw::encode(uint8_t slot, uint64_t frame_id)
|
||||
{
|
||||
if (vk.device.waitForFences(*in[slot].fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_W("Timeout on stream %d", stream_idx);
|
||||
return {};
|
||||
}
|
||||
|
||||
return wivrn::video_encoder::data{
|
||||
.encoder = this,
|
||||
.span = std::span<uint8_t>((uint8_t *)buffers[slot].map(), buffers[slot].info().size),
|
||||
.span = std::span<uint8_t>((uint8_t *)in[slot].buffer.map(), in[slot].buffer.info().size),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -28,12 +28,21 @@ namespace wivrn
|
||||
|
||||
class video_encoder_raw : public video_encoder
|
||||
{
|
||||
std::array<buffer_allocation, num_slots> buffers;
|
||||
vk_bundle & vk;
|
||||
vk::raii::CommandPool cmd_pool;
|
||||
|
||||
struct in_t
|
||||
{
|
||||
vk::raii::Fence fence = nullptr;
|
||||
vk::raii::CommandBuffer cmd = nullptr;
|
||||
buffer_allocation buffer;
|
||||
};
|
||||
std::array<in_t, num_slots> in;
|
||||
|
||||
public:
|
||||
video_encoder_raw(wivrn::vk_bundle & vk, const encoder_settings & settings, uint8_t stream_idx);
|
||||
|
||||
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index) override;
|
||||
void present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo info, uint8_t slot, uint64_t frame_index) override;
|
||||
|
||||
std::optional<data> encode(uint8_t slot, uint64_t frame_id) override;
|
||||
};
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
#include "video_encoder_vulkan.h"
|
||||
|
||||
#include "encoder/encoder_settings.h"
|
||||
#include "inplace_vector.hpp"
|
||||
#include "util/u_logging.h"
|
||||
#include "utils/wivrn_vk_bundle.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <ranges>
|
||||
#include <stdexcept>
|
||||
@@ -124,6 +126,7 @@ public:
|
||||
return {ref_slot, &*slot};
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
static uint32_t align(uint32_t value, uint32_t alignment)
|
||||
@@ -161,11 +164,16 @@ wivrn::video_encoder_vulkan::video_encoder_vulkan(
|
||||
const vk::VideoEncodeCapabilitiesKHR & in_encode_caps,
|
||||
uint8_t stream_idx,
|
||||
const encoder_settings & settings) :
|
||||
video_encoder(stream_idx, settings, std::make_unique<dpb_state>(), true),
|
||||
video_encoder(vk, stream_idx, vk.encode_queue_family_index, settings, std::make_unique<dpb_state>(), true),
|
||||
vk(vk),
|
||||
encode_caps(patch_capabilities(in_encode_caps)),
|
||||
num_dpb_slots(std::min(video_caps.maxDpbSlots, 16u))
|
||||
{
|
||||
if (not std::get<vk::PhysicalDeviceVulkan12Features>(vk.feat).timelineSemaphore)
|
||||
throw std::runtime_error("Cannot use vulkan video encode without timeline semaphores");
|
||||
if (not std::get<vk::PhysicalDeviceVideoMaintenance1FeaturesKHR>(vk.feat).videoMaintenance1)
|
||||
throw std::runtime_error("Cannot use vulkan video encode without VideoMaintenance1 feature");
|
||||
|
||||
// Initialize Rate control
|
||||
U_LOG_D("Supported rate control modes: %s", vk::to_string(encode_caps.rateControlModes).c_str());
|
||||
|
||||
@@ -253,6 +261,62 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
|
||||
vk::to_string(picture_format.format) +
|
||||
" for encoder input image");
|
||||
|
||||
if (not((picture_format.imageCreateFlags & vk::ImageCreateFlagBits::eMutableFormat) and
|
||||
(picture_format.imageCreateFlags & vk::ImageCreateFlagBits::eExtendedUsage)))
|
||||
{
|
||||
// NVIDIA case: we can't use the same image for shaders and encode
|
||||
if (not(picture_format.imageUsageFlags & vk::ImageUsageFlagBits::eTransferDst))
|
||||
throw std::runtime_error("Missing image flags for vulkan video encode");
|
||||
|
||||
// NVIDIA has this flag while AMD has mutable flag on images, we don't have to
|
||||
// care for transfer on main queue
|
||||
if (not(vk.physical_device.getQueueFamilyProperties().at(vk.encode_queue_family_index).queueFlags & vk::QueueFlagBits::eTransfer))
|
||||
throw std::runtime_error("Vulkan encode queue is missing transfer capability");
|
||||
|
||||
tmp_image = image_allocation(
|
||||
vk.device,
|
||||
vk::StructureChain{
|
||||
vk::ImageCreateInfo{
|
||||
.imageType = vk::ImageType::e2D,
|
||||
.format = picture_format.format,
|
||||
.extent = {
|
||||
.width = extent.width,
|
||||
.height = extent.height,
|
||||
.depth = 1,
|
||||
},
|
||||
.mipLevels = 1,
|
||||
.arrayLayers = num_slots,
|
||||
.usage = vk::ImageUsageFlagBits::eVideoEncodeSrcKHR | vk::ImageUsageFlagBits::eTransferDst,
|
||||
},
|
||||
vk::VideoProfileListInfoKHR{
|
||||
.profileCount = 1,
|
||||
.pProfiles = &video_profile,
|
||||
},
|
||||
}
|
||||
.get(),
|
||||
VmaAllocationCreateInfo{
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
},
|
||||
std::format("vulkan encoder {} temporary image", stream_idx));
|
||||
|
||||
for (auto [i, item]: std::ranges::enumerate_view(slot_data))
|
||||
{
|
||||
item.view = vk::raii::ImageView(
|
||||
vk.device,
|
||||
vk::ImageViewCreateInfo{
|
||||
.image = tmp_image,
|
||||
.viewType = vk::ImageViewType::e2D,
|
||||
.format = picture_format.format,
|
||||
.subresourceRange = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = uint32_t(i),
|
||||
.layerCount = 1},
|
||||
});
|
||||
vk.name(item.view, std::format("vulkan encoder {} view {}", stream_idx, i));
|
||||
}
|
||||
}
|
||||
|
||||
// Decode picture buffer (DPB) images
|
||||
vk::VideoFormatPropertiesKHR reference_picture_format = select_video_format(
|
||||
vk.physical_device,
|
||||
@@ -284,11 +348,11 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
|
||||
{
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
},
|
||||
"vulkan encoder DPB image");
|
||||
std::format("vulkan encoder {} DPB image", stream_idx));
|
||||
}
|
||||
|
||||
// Output buffer
|
||||
for (auto & item: slot_data)
|
||||
for (auto [i, item]: std::ranges::enumerate_view(slot_data))
|
||||
{
|
||||
// very conservative bound
|
||||
size_t output_buffer_size = extent.width * extent.height * 3;
|
||||
@@ -305,9 +369,9 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
},
|
||||
"vulkan encode output buffer");
|
||||
std::format("vulkan encode {} output buffer {}", stream_idx, i));
|
||||
|
||||
if (not(item.output_buffer.properties() & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT))
|
||||
if (not(item.output_buffer.properties() & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) or std::getenv("WIVRN_ASSUME_DGPU"))
|
||||
{
|
||||
U_LOG_D("Using staging buffer for vulkan encode output");
|
||||
item.host_buffer = buffer_allocation(
|
||||
@@ -321,7 +385,7 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST,
|
||||
},
|
||||
"vulkan encode host buffer");
|
||||
std::format("vulkan encode {} host buffer {}", stream_idx, i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,38 +465,6 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
|
||||
.layerCount = 1},
|
||||
};
|
||||
|
||||
if (not std::get<vk::PhysicalDeviceVideoMaintenance1FeaturesKHR>(vk.feat).videoMaintenance1)
|
||||
{
|
||||
image_view_template.subresourceRange.baseArrayLayer = 0;
|
||||
for (size_t i = 0; i < num_slots; ++i)
|
||||
{
|
||||
slot_data[i].tmp_image = image_allocation(
|
||||
vk.device, {
|
||||
.pNext = &video_profile_list,
|
||||
.imageType = vk::ImageType::e2D,
|
||||
.format = picture_format.format,
|
||||
.extent = {
|
||||
.width = extent.width,
|
||||
.height = extent.height,
|
||||
.depth = 1,
|
||||
},
|
||||
.mipLevels = 1,
|
||||
.arrayLayers = 1,
|
||||
.samples = vk::SampleCountFlagBits::e1,
|
||||
.tiling = vk::ImageTiling::eOptimal,
|
||||
.usage = vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eVideoEncodeSrcKHR,
|
||||
.sharingMode = vk::SharingMode::eExclusive,
|
||||
},
|
||||
{
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
},
|
||||
"vulkan encoder temporary image");
|
||||
image_view_template.image = vk::Image(slot_data[i].tmp_image);
|
||||
slot_data[i].view = vk.device.createImageView(image_view_template);
|
||||
vk.name(slot_data[i].view, "vulkan encoder temporary image view");
|
||||
}
|
||||
}
|
||||
|
||||
auto & dpb = (dpb_state &)*idr;
|
||||
|
||||
// DPB slot info
|
||||
@@ -466,7 +498,7 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
|
||||
img_view_create_info.subresourceRange.baseArrayLayer = i;
|
||||
vk::raii::ImageView v(vk.device, img_view_create_info);
|
||||
vk::ImageView v1(*v);
|
||||
vk.name(v, "vulkan encoder dpb view");
|
||||
vk.name(v, std::format("vulkan encoder {} dpb view {}", stream_idx, i));
|
||||
dpb.items.push_back({
|
||||
.image_view = std::move(v),
|
||||
.resource = {
|
||||
@@ -486,21 +518,20 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
|
||||
});
|
||||
}
|
||||
|
||||
// fence, semaphore
|
||||
for (auto [i, item]: std::ranges::enumerate_view(slot_data))
|
||||
// semaphore
|
||||
sem = vk.device.createSemaphore(vk::StructureChain{
|
||||
vk::SemaphoreCreateInfo{},
|
||||
vk::SemaphoreTypeCreateInfo{
|
||||
.semaphoreType = vk::SemaphoreType::eTimeline,
|
||||
}}
|
||||
.get());
|
||||
vk.name(sem, std::format("vulkan encoder {} semaphore", stream_idx));
|
||||
|
||||
// fences
|
||||
for (size_t i = 0; i < num_slots; ++i)
|
||||
{
|
||||
item.fence = vk.device.createFence({.flags = vk::FenceCreateFlagBits::eSignaled});
|
||||
item.wait_sem = vk.device.createSemaphore({});
|
||||
item.sem = vk.device.createSemaphore(vk::StructureChain{
|
||||
vk::SemaphoreCreateInfo{},
|
||||
vk::SemaphoreTypeCreateInfo{
|
||||
.semaphoreType = vk::SemaphoreType::eTimeline,
|
||||
},
|
||||
}
|
||||
.get());
|
||||
vk.name(item.fence, "vulkan encoder fence");
|
||||
vk.name(item.wait_sem, "vulkan encoder wait semaphore");
|
||||
vk.name(item.sem, "vulkan encoder complete semaphore");
|
||||
slot_data[i].fence = vk.device.createFence(vk::FenceCreateInfo{.flags = vk::FenceCreateFlagBits::eSignaled});
|
||||
vk.name(slot_data[i].fence, std::format("vulkan encoder {} fence {}", stream_idx, i));
|
||||
}
|
||||
|
||||
// query pool
|
||||
@@ -519,17 +550,17 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
|
||||
};
|
||||
|
||||
query_pool = vk.device.createQueryPool(query_pool_create.get());
|
||||
vk.name(query_pool, "vulkan encoder query pool");
|
||||
vk.name(query_pool, std::format("vulkan encoder {} query pool", stream_idx));
|
||||
}
|
||||
|
||||
// command pools
|
||||
{
|
||||
video_command_pool = vk.device.createCommandPool(
|
||||
vk::CommandPoolCreateInfo{
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer,
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer | vk::CommandPoolCreateFlagBits::eTransient,
|
||||
.queueFamilyIndex = vk.encode_queue_family_index,
|
||||
});
|
||||
vk.name(video_command_pool, "vulkan encoder video command pool");
|
||||
vk.name(video_command_pool, std::format("vulkan encoder {} video command pool", stream_idx));
|
||||
|
||||
auto command_buffers = vk.device.allocateCommandBuffers(
|
||||
{.commandPool = *video_command_pool,
|
||||
@@ -538,26 +569,34 @@ void wivrn::video_encoder_vulkan::init(const vk::VideoCapabilitiesKHR & video_ca
|
||||
for (size_t i = 0; i < num_slots; ++i)
|
||||
{
|
||||
slot_data[i].video_cmd_buf = std::move(command_buffers[i]);
|
||||
vk.name(slot_data[i].video_cmd_buf, "vulkan encoder video command buffer");
|
||||
vk.name(slot_data[i].video_cmd_buf, std::format("vulkan encoder {} video command buffer {}", stream_idx, i));
|
||||
}
|
||||
|
||||
auto properties = vk.physical_device.getQueueFamilyProperties().at(vk.encode_queue_family_index);
|
||||
if (not(properties.queueFlags & vk::QueueFlagBits::eTransfer))
|
||||
if (slot_data[0].host_buffer)
|
||||
{
|
||||
transfer_command_pool = vk.device.createCommandPool(
|
||||
vk::CommandPoolCreateInfo{
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer,
|
||||
.queueFamilyIndex = vk.queue_family_index,
|
||||
});
|
||||
vk.name(transfer_command_pool, "vulkan encoder transfer command pool");
|
||||
|
||||
auto command_buffers = vk.device.allocateCommandBuffers(
|
||||
{.commandPool = *transfer_command_pool,
|
||||
.commandBufferCount = num_slots});
|
||||
for (size_t i = 0; i < num_slots; ++i)
|
||||
if (*vk.transfer_queue)
|
||||
{
|
||||
slot_data[i].transfer_cmd_buf = std::move(command_buffers[i]);
|
||||
vk.name(slot_data[i].transfer_cmd_buf, "vulkan encoder transfer command buffer");
|
||||
transfer_command_pool = vk.device.createCommandPool(
|
||||
vk::CommandPoolCreateInfo{
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer | vk::CommandPoolCreateFlagBits::eTransient,
|
||||
.queueFamilyIndex = vk.transfer_queue_family_index,
|
||||
});
|
||||
vk.name(transfer_command_pool, std::format("vulkan encoder {} transfer command pool", stream_idx));
|
||||
|
||||
auto command_buffers = vk.device.allocateCommandBuffers(
|
||||
{.commandPool = *transfer_command_pool,
|
||||
.commandBufferCount = num_slots});
|
||||
for (size_t i = 0; i < num_slots; ++i)
|
||||
{
|
||||
slot_data[i].transfer_cmd_buf = std::move(command_buffers[i]);
|
||||
vk.name(slot_data[i].transfer_cmd_buf, std::format("vulkan encoder {} transfer command buffer {}", stream_idx, i));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auto properties = vk.physical_device.getQueueFamilyProperties().at(vk.encode_queue_family_index);
|
||||
if (not(properties.queueFlags & vk::QueueFlagBits::eTransfer))
|
||||
throw std::runtime_error("Incorrect vulkan queues for video encode support");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -576,150 +615,72 @@ std::vector<uint8_t> wivrn::video_encoder_vulkan::get_encoded_parameters(void *
|
||||
return encoded;
|
||||
}
|
||||
|
||||
std::optional<wivrn::video_encoder::data> wivrn::video_encoder_vulkan::encode(uint8_t encode_slot, uint64_t frame_index)
|
||||
void wivrn::video_encoder_vulkan::present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo compositor_sem, uint8_t encode_slot, uint64_t frame_index)
|
||||
{
|
||||
auto & slot_item = slot_data[encode_slot];
|
||||
if (slot_item.idr)
|
||||
send_idr_data();
|
||||
|
||||
if (auto res = vk.device.waitForFences(*slot_item.fence, true, 1'000'000'000);
|
||||
res != vk::Result::eSuccess)
|
||||
if (vk.device.waitForFences(*slot_item.fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
throw std::runtime_error("wait for fences: " + vk::to_string(res));
|
||||
U_LOG_E("Timeout on stream %d", stream_idx);
|
||||
return;
|
||||
}
|
||||
slot_item.busy.wait(true);
|
||||
|
||||
auto [res, size] = query_pool.getResult<uint32_t>(encode_slot, 1, 0, vk::QueryResultFlagBits::eWait);
|
||||
if (res != vk::Result::eSuccess)
|
||||
{
|
||||
std::cerr << "device.getQueryPoolResults: " << vk::to_string(res) << std::endl;
|
||||
}
|
||||
|
||||
// We don't copy the whole buffer, but an estimate of how much we'll need
|
||||
// If that wasn't enough, we have to issue a second copy command for the rest
|
||||
if (slot_item.host_buffer and size > slot_item.copy_size)
|
||||
{
|
||||
U_LOG_D("additional copy needed: %ld", size - slot_item.copy_size);
|
||||
const bool main_queue = *slot_item.transfer_cmd_buf;
|
||||
// The encoded image is larger than expected, we need to copy some more data
|
||||
vk::raii::CommandBuffer & cmd_buf = main_queue ? slot_item.transfer_cmd_buf : slot_item.video_cmd_buf;
|
||||
|
||||
cmd_buf.reset();
|
||||
cmd_buf.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
cmd_buf.copyBuffer(
|
||||
slot_item.output_buffer,
|
||||
slot_item.host_buffer,
|
||||
vk::BufferCopy{
|
||||
.srcOffset = slot_item.copy_size,
|
||||
.dstOffset = slot_item.copy_size,
|
||||
.size = size - slot_item.copy_size,
|
||||
});
|
||||
|
||||
cmd_buf.end();
|
||||
|
||||
vk.device.resetFences(*slot_item.fence);
|
||||
|
||||
{
|
||||
std::unique_lock lock(main_queue ? vk.queue_mutex : vk.encode_queue_mutex);
|
||||
auto & queue = main_queue ? vk.queue : vk.encode_queue;
|
||||
queue.submit(vk::SubmitInfo{
|
||||
.commandBufferCount = 1,
|
||||
.pCommandBuffers = &*cmd_buf,
|
||||
},
|
||||
*slot_item.fence);
|
||||
}
|
||||
if (auto res = vk.device.waitForFences(*slot_item.fence, true, 1'000'000'000);
|
||||
res != vk::Result::eSuccess)
|
||||
{
|
||||
throw std::runtime_error("wait for fences: " + vk::to_string(res));
|
||||
}
|
||||
}
|
||||
|
||||
void * mapped = slot_item.host_buffer ? slot_item.host_buffer.map() : slot_item.output_buffer.map();
|
||||
|
||||
return data{
|
||||
.encoder = this,
|
||||
.span = std::span(((uint8_t *)mapped), size),
|
||||
.mem = std::shared_ptr<void>(&slot_item.busy, [](std::atomic_bool * busy) {*busy = false; busy->notify_all(); }),
|
||||
.prefer_control = slot_item.idr,
|
||||
};
|
||||
}
|
||||
|
||||
std::pair<bool, vk::Semaphore> wivrn::video_encoder_vulkan::present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t encode_slot, uint64_t frame_index)
|
||||
{
|
||||
auto & slot_item = slot_data[encode_slot];
|
||||
auto & video_cmd_buf = slot_item.video_cmd_buf;
|
||||
video_cmd_buf.reset();
|
||||
video_cmd_buf.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
// If we encode from top left corner, encode from the source image directly
|
||||
bool encode_direct = not slot_item.tmp_image;
|
||||
|
||||
vk::ImageView image_view;
|
||||
|
||||
if (encode_direct)
|
||||
if (tmp_image)
|
||||
{
|
||||
if (not transferred)
|
||||
assert(slot_item.view);
|
||||
image_view = slot_item.view;
|
||||
compositor_sem.stageMask = vk::PipelineStageFlagBits2::eCopy;
|
||||
|
||||
beman::inplace_vector::inplace_vector<vk::ImageMemoryBarrier2, 2> im_barriers;
|
||||
vk::ImageLayout y_cbcr_layout{vk::ImageLayout::eGeneral};
|
||||
if (need_transfer)
|
||||
{
|
||||
vk::ImageMemoryBarrier2 video_barrier{
|
||||
.srcStageMask = vk::PipelineStageFlagBits2KHR::eTransfer,
|
||||
.dstStageMask = vk::PipelineStageFlagBits2KHR::eVideoEncodeKHR,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eVideoEncodeReadKHR,
|
||||
.newLayout = vk::ImageLayout::eVideoEncodeSrcKHR,
|
||||
im_barriers.push_back(vk::ImageMemoryBarrier2{
|
||||
.dstStageMask = vk::PipelineStageFlagBits2KHR::eCopy,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eTransferRead,
|
||||
.oldLayout = y_cbcr_layout,
|
||||
.newLayout = vk::ImageLayout::eTransferSrcOptimal,
|
||||
.srcQueueFamilyIndex = vk.queue_family_index,
|
||||
.dstQueueFamilyIndex = vk.encode_queue_family_index,
|
||||
.dstQueueFamilyIndex = target_queue,
|
||||
.image = y_cbcr,
|
||||
.subresourceRange = {.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = 0,
|
||||
.layerCount = vk::RemainingArrayLayers},
|
||||
};
|
||||
video_cmd_buf.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = 1,
|
||||
.pImageMemoryBarriers = &video_barrier,
|
||||
.baseArrayLayer = stream_idx,
|
||||
.layerCount = 1},
|
||||
});
|
||||
y_cbcr_layout = vk::ImageLayout::eTransferSrcOptimal;
|
||||
}
|
||||
|
||||
auto it = image_views.find(VkImage(y_cbcr));
|
||||
if (it != image_views.end())
|
||||
image_view = *it->second;
|
||||
else
|
||||
{
|
||||
image_view_template.image = y_cbcr;
|
||||
image_view = *image_views.emplace(y_cbcr, vk.device.createImageView(image_view_template)).first->second;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vk::ImageMemoryBarrier barrier{
|
||||
.srcAccessMask = vk::AccessFlagBits::eNone,
|
||||
.dstAccessMask = vk::AccessFlagBits::eTransferWrite,
|
||||
im_barriers.push_back(vk::ImageMemoryBarrier2{
|
||||
.dstStageMask = vk::PipelineStageFlagBits2KHR::eCopy,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eTransferWrite,
|
||||
.oldLayout = vk::ImageLayout::eUndefined,
|
||||
.newLayout = vk::ImageLayout::eTransferDstOptimal,
|
||||
.image = slot_item.tmp_image,
|
||||
.subresourceRange = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = 0,
|
||||
.layerCount = 1,
|
||||
},
|
||||
};
|
||||
.image = tmp_image,
|
||||
.subresourceRange = {.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = encode_slot,
|
||||
.layerCount = 1},
|
||||
});
|
||||
|
||||
cmd_buf.pipelineBarrier(
|
||||
vk::PipelineStageFlagBits::eNone,
|
||||
vk::PipelineStageFlagBits::eTransfer,
|
||||
vk::DependencyFlags{},
|
||||
{},
|
||||
{},
|
||||
barrier);
|
||||
video_cmd_buf.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = uint32_t(im_barriers.size()),
|
||||
.pImageMemoryBarriers = im_barriers.data(),
|
||||
});
|
||||
|
||||
cmd_buf.copyImage(
|
||||
video_cmd_buf.copyImage(
|
||||
y_cbcr,
|
||||
vk::ImageLayout::eTransferSrcOptimal,
|
||||
slot_item.tmp_image,
|
||||
y_cbcr_layout,
|
||||
tmp_image,
|
||||
vk::ImageLayout::eTransferDstOptimal,
|
||||
{
|
||||
std::array{
|
||||
vk::ImageCopy{
|
||||
.srcSubresource = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::ePlane0,
|
||||
@@ -728,7 +689,7 @@ std::pair<bool, vk::Semaphore> wivrn::video_encoder_vulkan::present_image(vk::Im
|
||||
},
|
||||
.dstSubresource = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::ePlane0,
|
||||
.baseArrayLayer = 0,
|
||||
.baseArrayLayer = encode_slot,
|
||||
.layerCount = 1,
|
||||
},
|
||||
.extent = {
|
||||
@@ -745,7 +706,7 @@ std::pair<bool, vk::Semaphore> wivrn::video_encoder_vulkan::present_image(vk::Im
|
||||
},
|
||||
.dstSubresource = {
|
||||
.aspectMask = vk::ImageAspectFlagBits::ePlane1,
|
||||
.baseArrayLayer = 0,
|
||||
.baseArrayLayer = encode_slot,
|
||||
.layerCount = 1,
|
||||
},
|
||||
.extent = {
|
||||
@@ -756,42 +717,58 @@ std::pair<bool, vk::Semaphore> wivrn::video_encoder_vulkan::present_image(vk::Im
|
||||
},
|
||||
});
|
||||
|
||||
barrier.srcAccessMask = barrier.dstAccessMask;
|
||||
barrier.dstAccessMask = vk::AccessFlagBits::eNone;
|
||||
barrier.srcQueueFamilyIndex = vk.queue_family_index;
|
||||
barrier.dstQueueFamilyIndex = vk.encode_queue_family_index;
|
||||
barrier.oldLayout = barrier.newLayout;
|
||||
barrier.newLayout = vk::ImageLayout::eVideoEncodeSrcKHR;
|
||||
|
||||
cmd_buf.pipelineBarrier(
|
||||
vk::PipelineStageFlagBits::eTransfer,
|
||||
vk::PipelineStageFlagBits::eNone,
|
||||
vk::DependencyFlags{},
|
||||
{},
|
||||
{},
|
||||
barrier);
|
||||
|
||||
vk::ImageMemoryBarrier2 video_barrier{
|
||||
vk::ImageMemoryBarrier2 tmp_image_barrier{
|
||||
.srcStageMask = vk::PipelineStageFlagBits2KHR::eTransfer,
|
||||
.srcAccessMask = vk::AccessFlagBits2::eMemoryWrite,
|
||||
.srcAccessMask = vk::AccessFlagBits2::eTransferWrite,
|
||||
.dstStageMask = vk::PipelineStageFlagBits2KHR::eVideoEncodeKHR,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eVideoEncodeReadKHR,
|
||||
.oldLayout = vk::ImageLayout::eTransferDstOptimal,
|
||||
.newLayout = vk::ImageLayout::eVideoEncodeSrcKHR,
|
||||
.srcQueueFamilyIndex = vk.queue_family_index,
|
||||
.dstQueueFamilyIndex = vk.encode_queue_family_index,
|
||||
.image = slot_item.tmp_image,
|
||||
.image = tmp_image,
|
||||
.subresourceRange = {.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = 0,
|
||||
.baseArrayLayer = encode_slot,
|
||||
.layerCount = 1},
|
||||
};
|
||||
video_cmd_buf.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = 1,
|
||||
.pImageMemoryBarriers = &video_barrier,
|
||||
.pImageMemoryBarriers = &tmp_image_barrier,
|
||||
});
|
||||
image_view = slot_item.view;
|
||||
}
|
||||
else
|
||||
{
|
||||
compositor_sem.stageMask = vk::PipelineStageFlagBits2::eVideoEncodeKHR;
|
||||
if (need_transfer)
|
||||
{
|
||||
vk::ImageMemoryBarrier2 video_barrier{
|
||||
.dstStageMask = vk::PipelineStageFlagBits2KHR::eVideoEncodeKHR,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eVideoEncodeReadKHR,
|
||||
.oldLayout = vk::ImageLayout::eGeneral,
|
||||
.newLayout = vk::ImageLayout::eVideoEncodeSrcKHR,
|
||||
.srcQueueFamilyIndex = vk.queue_family_index,
|
||||
.dstQueueFamilyIndex = target_queue,
|
||||
.image = y_cbcr,
|
||||
.subresourceRange = {.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = stream_idx,
|
||||
.layerCount = 1},
|
||||
};
|
||||
video_cmd_buf.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = 1,
|
||||
.pImageMemoryBarriers = &video_barrier,
|
||||
});
|
||||
}
|
||||
|
||||
auto it = image_views.find(VkImage(y_cbcr));
|
||||
if (it != image_views.end())
|
||||
image_view = *it->second;
|
||||
else
|
||||
{
|
||||
image_view_template.image = y_cbcr;
|
||||
image_view = *image_views.emplace(y_cbcr, vk.device.createImageView(image_view_template)).first->second;
|
||||
}
|
||||
}
|
||||
|
||||
video_cmd_buf.resetQueryPool(*query_pool, encode_slot, 1);
|
||||
@@ -888,7 +865,6 @@ std::pair<bool, vk::Semaphore> wivrn::video_encoder_vulkan::present_image(vk::Im
|
||||
.pNext = &rate_control.value(),
|
||||
.flags = vk::VideoCodingControlFlagBitsKHR::eEncodeRateControl,
|
||||
});
|
||||
|
||||
if (rate_control)
|
||||
slot_item.copy_size = (rate_control_layer.maxBitrate * rate_control_layer.frameRateDenominator) / rate_control_layer.frameRateNumerator;
|
||||
else
|
||||
@@ -928,112 +904,184 @@ std::pair<bool, vk::Semaphore> wivrn::video_encoder_vulkan::present_image(vk::Im
|
||||
// When output buffer is not visible, we have to issue a transfer operation
|
||||
if (slot_item.host_buffer)
|
||||
{
|
||||
vk::BufferMemoryBarrier2 barrier{
|
||||
.srcStageMask = vk::PipelineStageFlagBits2::eAllCommands,
|
||||
.srcAccessMask = vk::AccessFlagBits2::eMemoryWrite,
|
||||
.dstStageMask = vk::PipelineStageFlagBits2::eAllCommands,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eMemoryRead,
|
||||
.srcQueueFamilyIndex = vk.encode_queue_family_index,
|
||||
.dstQueueFamilyIndex = vk.encode_queue_family_index,
|
||||
.buffer = slot_item.output_buffer,
|
||||
.size = vk::WholeSize,
|
||||
};
|
||||
|
||||
vk::raii::CommandBuffer * transfer_cmd_buf;
|
||||
if (*slot_item.transfer_cmd_buf)
|
||||
{
|
||||
// We need to transfer the buffer on the main queue
|
||||
barrier.dstQueueFamilyIndex = vk.queue_family_index;
|
||||
transfer_cmd_buf = &slot_item.transfer_cmd_buf;
|
||||
auto & cmd = slot_item.transfer_cmd_buf;
|
||||
// transfer on a dedicated queue
|
||||
cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
transfer_cmd_buf->reset();
|
||||
transfer_cmd_buf->begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
transfer_cmd_buf->pipelineBarrier2({
|
||||
.bufferMemoryBarrierCount = 1,
|
||||
.pBufferMemoryBarriers = &barrier,
|
||||
});
|
||||
{
|
||||
vk::BufferMemoryBarrier2 buf_barrier{
|
||||
.srcStageMask = vk::PipelineStageFlagBits2::eVideoEncodeKHR,
|
||||
.srcAccessMask = vk::AccessFlagBits2::eMemoryWrite,
|
||||
.dstStageMask = vk::PipelineStageFlagBits2::eTransfer,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eMemoryRead,
|
||||
.srcQueueFamilyIndex = vk.encode_queue_family_index,
|
||||
.dstQueueFamilyIndex = vk.transfer_queue_family_index,
|
||||
.buffer = slot_item.output_buffer,
|
||||
.size = slot_item.copy_size,
|
||||
};
|
||||
vk::DependencyInfo dep_info{
|
||||
.bufferMemoryBarrierCount = 1,
|
||||
.pBufferMemoryBarriers = &buf_barrier,
|
||||
};
|
||||
video_cmd_buf.pipelineBarrier2(dep_info);
|
||||
cmd.pipelineBarrier2(dep_info);
|
||||
}
|
||||
|
||||
cmd.copyBuffer(
|
||||
slot_item.output_buffer,
|
||||
slot_item.host_buffer,
|
||||
vk::BufferCopy{
|
||||
.size = slot_item.copy_size,
|
||||
});
|
||||
cmd.end();
|
||||
}
|
||||
else
|
||||
transfer_cmd_buf = &video_cmd_buf;
|
||||
|
||||
video_cmd_buf.pipelineBarrier2({
|
||||
.bufferMemoryBarrierCount = 1,
|
||||
.pBufferMemoryBarriers = &barrier,
|
||||
});
|
||||
|
||||
transfer_cmd_buf->copyBuffer(
|
||||
slot_item.output_buffer,
|
||||
slot_item.host_buffer,
|
||||
vk::BufferCopy{
|
||||
.size = slot_item.copy_size,
|
||||
});
|
||||
|
||||
if (*slot_item.transfer_cmd_buf)
|
||||
transfer_cmd_buf->end();
|
||||
{
|
||||
// transfer on video queue
|
||||
vk::MemoryBarrier2 mem_barrier{
|
||||
.srcStageMask = vk::PipelineStageFlagBits2::eVideoEncodeKHR,
|
||||
.srcAccessMask = vk::AccessFlagBits2::eVideoEncodeWriteKHR,
|
||||
.dstStageMask = vk::PipelineStageFlagBits2::eTransfer,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eTransferRead,
|
||||
};
|
||||
video_cmd_buf.pipelineBarrier2({
|
||||
.memoryBarrierCount = 1,
|
||||
.pMemoryBarriers = &mem_barrier,
|
||||
});
|
||||
video_cmd_buf.copyBuffer(
|
||||
slot_item.output_buffer,
|
||||
slot_item.host_buffer,
|
||||
vk::BufferCopy{
|
||||
.size = slot_item.copy_size,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
video_cmd_buf.end();
|
||||
|
||||
++dpb.frame_num;
|
||||
|
||||
// If we encode directly from the source, request a transition to video queue
|
||||
return {encode_direct, slot_item.wait_sem};
|
||||
}
|
||||
|
||||
void wivrn::video_encoder_vulkan::post_submit(uint8_t slot)
|
||||
{
|
||||
auto & slot_item = slot_data[slot];
|
||||
const auto & prev_slot = slot_data[(slot + num_slots - 1) % num_slots];
|
||||
slot_item.busy.wait(true);
|
||||
slot_item.busy = true;
|
||||
const bool need_transfer = *slot_item.transfer_cmd_buf and slot_item.host_buffer;
|
||||
// Issue encode command, and if necessary transfer command
|
||||
vk.device.resetFences(*slot_item.fence);
|
||||
std::array wait_sem_info{
|
||||
vk::SemaphoreSubmitInfo{
|
||||
.semaphore = *prev_slot.sem,
|
||||
.value = prev_slot.sem_value,
|
||||
.stageMask = vk::PipelineStageFlagBits2::eAllCommands,
|
||||
},
|
||||
vk::SemaphoreSubmitInfo{
|
||||
.semaphore = *slot_item.wait_sem,
|
||||
.stageMask = vk::PipelineStageFlagBits2::eAllCommands,
|
||||
},
|
||||
};
|
||||
vk::SemaphoreSubmitInfo sem_info{
|
||||
.semaphore = slot_item.sem,
|
||||
.value = ++slot_item.sem_value,
|
||||
.stageMask = vk::PipelineStageFlagBits2::eAllCommands,
|
||||
};
|
||||
vk::CommandBufferSubmitInfo cmd_info{
|
||||
.commandBuffer = slot_item.video_cmd_buf,
|
||||
};
|
||||
|
||||
{
|
||||
vk::CommandBufferSubmitInfo cmd_info{
|
||||
.commandBuffer = slot_item.video_cmd_buf,
|
||||
};
|
||||
|
||||
vk::SemaphoreSubmitInfo signal_info{
|
||||
.semaphore = *sem,
|
||||
.value = ++sem_value,
|
||||
.stageMask = vk::PipelineStageFlagBits2::eVideoEncodeKHR,
|
||||
};
|
||||
|
||||
std::unique_lock lock(vk.encode_queue_mutex);
|
||||
vk.encode_queue.submit2(
|
||||
vk::SubmitInfo2{
|
||||
.waitSemaphoreInfoCount = wait_sem_info.size(),
|
||||
.pWaitSemaphoreInfos = wait_sem_info.data(),
|
||||
.waitSemaphoreInfoCount = 1,
|
||||
.pWaitSemaphoreInfos = &compositor_sem,
|
||||
.commandBufferInfoCount = 1,
|
||||
.pCommandBufferInfos = &cmd_info,
|
||||
.signalSemaphoreInfoCount = 1,
|
||||
.pSignalSemaphoreInfos = &sem_info,
|
||||
.pSignalSemaphoreInfos = &signal_info,
|
||||
},
|
||||
need_transfer ? nullptr : *slot_item.fence);
|
||||
*slot_item.transfer_cmd_buf ? nullptr : *slot_item.fence);
|
||||
}
|
||||
if (need_transfer)
|
||||
|
||||
if (*slot_item.transfer_cmd_buf)
|
||||
{
|
||||
// caller already holds the lock
|
||||
vk::CommandBufferSubmitInfo cmd_info{
|
||||
.commandBuffer = slot_item.transfer_cmd_buf,
|
||||
.commandBuffer = *slot_item.transfer_cmd_buf,
|
||||
};
|
||||
vk.queue.submit2(vk::SubmitInfo2{
|
||||
.waitSemaphoreInfoCount = 1,
|
||||
.pWaitSemaphoreInfos = &sem_info,
|
||||
.commandBufferInfoCount = 1,
|
||||
.pCommandBufferInfos = &cmd_info,
|
||||
},
|
||||
*slot_item.fence);
|
||||
|
||||
vk::SemaphoreSubmitInfo wait_info{
|
||||
.semaphore = *sem,
|
||||
.value = sem_value,
|
||||
.stageMask = vk::PipelineStageFlagBits2::eTransfer,
|
||||
};
|
||||
|
||||
std::unique_lock lock(vk.transfer_queue_mutex);
|
||||
vk.transfer_queue.submit2(vk::SubmitInfo2{
|
||||
.waitSemaphoreInfoCount = 1,
|
||||
.pWaitSemaphoreInfos = &wait_info,
|
||||
.commandBufferInfoCount = 1,
|
||||
.pCommandBufferInfos = &cmd_info,
|
||||
},
|
||||
*slot_item.fence);
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<wivrn::video_encoder::data> wivrn::video_encoder_vulkan::encode(uint8_t encode_slot, uint64_t frame_index)
|
||||
{
|
||||
auto & slot_item = slot_data[encode_slot];
|
||||
if (slot_item.idr)
|
||||
send_idr_data();
|
||||
|
||||
if (vk.device.waitForFences(*slot_item.fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_E("Timeout on stream %d", stream_idx);
|
||||
return {};
|
||||
}
|
||||
|
||||
auto [res, size] = query_pool.getResult<uint32_t>(encode_slot, 1, 0, vk::QueryResultFlagBits::eWait);
|
||||
if (res != vk::Result::eSuccess)
|
||||
{
|
||||
std::cerr << "device.getQueryPoolResults: " << vk::to_string(res) << std::endl;
|
||||
}
|
||||
|
||||
// We don't copy the whole buffer, but an estimate of how much we'll need
|
||||
// If that wasn't enough, we have to issue a second copy command for the rest
|
||||
if (slot_item.host_buffer and size > slot_item.copy_size)
|
||||
{
|
||||
U_LOG_D("additional copy needed: %ld", size - slot_item.copy_size);
|
||||
const bool transfer_queue = *slot_item.transfer_cmd_buf;
|
||||
// The encoded image is larger than expected, we need to copy some more data
|
||||
vk::raii::CommandBuffer & cmd = transfer_queue ? slot_item.transfer_cmd_buf : slot_item.video_cmd_buf;
|
||||
|
||||
cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
cmd.copyBuffer(
|
||||
slot_item.output_buffer,
|
||||
slot_item.host_buffer,
|
||||
vk::BufferCopy{
|
||||
.srcOffset = slot_item.copy_size,
|
||||
.dstOffset = slot_item.copy_size,
|
||||
.size = size - slot_item.copy_size,
|
||||
});
|
||||
|
||||
cmd.end();
|
||||
|
||||
{
|
||||
std::unique_lock lock(transfer_queue ? vk.transfer_queue_mutex : vk.encode_queue_mutex);
|
||||
auto & queue = transfer_queue ? vk.transfer_queue : vk.encode_queue;
|
||||
|
||||
vk::CommandBufferSubmitInfo cmd_info{
|
||||
.commandBuffer = *cmd,
|
||||
};
|
||||
|
||||
vk.device.resetFences(*slot_item.fence);
|
||||
queue.submit2(vk::SubmitInfo2{
|
||||
.commandBufferInfoCount = 1,
|
||||
.pCommandBufferInfos = &cmd_info,
|
||||
},
|
||||
*slot_item.fence);
|
||||
}
|
||||
|
||||
if (vk.device.waitForFences(*slot_item.fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_E("Timeout on stream %d", stream_idx);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
void * mapped = slot_item.host_buffer ? slot_item.host_buffer.map() : slot_item.output_buffer.map();
|
||||
|
||||
slot_item.busy = true;
|
||||
return data{
|
||||
.encoder = this,
|
||||
.span = std::span(((uint8_t *)mapped), size),
|
||||
.mem = std::shared_ptr<void>(&slot_item.busy,
|
||||
[](auto * b) {*b = false;b->notify_all(); }),
|
||||
.prefer_control = slot_item.idr,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,28 +38,28 @@ class video_encoder_vulkan : public video_encoder
|
||||
vk::raii::VideoSessionKHR video_session = nullptr;
|
||||
vk::raii::VideoSessionParametersKHR video_session_parameters = nullptr;
|
||||
|
||||
vk::raii::Semaphore sem = nullptr;
|
||||
uint64_t sem_value = 0;
|
||||
|
||||
vk::raii::QueryPool query_pool = nullptr;
|
||||
vk::raii::CommandPool transfer_command_pool = nullptr;
|
||||
vk::raii::CommandPool video_command_pool = nullptr;
|
||||
|
||||
image_allocation tmp_image;
|
||||
vk::ImageViewUsageCreateInfo image_view_template_next;
|
||||
vk::ImageViewCreateInfo image_view_template;
|
||||
std::unordered_map<VkImage, vk::raii::ImageView> image_views; // for input images
|
||||
struct slot_item
|
||||
{
|
||||
image_allocation tmp_image; // Used if we have an offset in the image to encode
|
||||
vk::raii::Fence fence = nullptr;
|
||||
vk::raii::CommandBuffer video_cmd_buf = nullptr;
|
||||
vk::raii::CommandBuffer transfer_cmd_buf = nullptr;
|
||||
vk::raii::Semaphore wait_sem = nullptr;
|
||||
vk::raii::Semaphore sem = nullptr;
|
||||
uint64_t sem_value = 0;
|
||||
vk::raii::Fence fence = nullptr;
|
||||
vk::raii::ImageView view = nullptr;
|
||||
buffer_allocation output_buffer;
|
||||
buffer_allocation host_buffer;
|
||||
vk::DeviceSize copy_size;
|
||||
bool idr = false;
|
||||
std::atomic_bool busy = false;
|
||||
std::atomic<bool> busy = false;
|
||||
};
|
||||
std::array<slot_item, num_slots> slot_data;
|
||||
|
||||
@@ -104,12 +104,7 @@ protected:
|
||||
virtual vk::ExtensionProperties std_header_version() = 0;
|
||||
|
||||
public:
|
||||
bool need_copy() const override
|
||||
{
|
||||
return slot_data[0].tmp_image;
|
||||
}
|
||||
void present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo, uint8_t slot, uint64_t frame_index) override;
|
||||
std::optional<data> encode(uint8_t slot, uint64_t frame_index) override;
|
||||
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index) override;
|
||||
void post_submit(uint8_t slot) override;
|
||||
};
|
||||
} // namespace wivrn
|
||||
|
||||
@@ -86,11 +86,32 @@ void video_encoder_x264::InsertInPendingNal(pending_nal && nal)
|
||||
pending_nals.push_back(std::move(nal));
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
vk::raii::CommandPool make_cmd_pool(wivrn::vk_bundle & vk, uint8_t stream_idx)
|
||||
{
|
||||
auto res = vk.device.createCommandPool(vk::CommandPoolCreateInfo{
|
||||
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer | vk::CommandPoolCreateFlagBits::eTransient,
|
||||
.queueFamilyIndex = *vk.transfer_queue ? vk.transfer_queue_family_index : vk.queue_family_index,
|
||||
});
|
||||
vk.name(res, std::format("x264 encoder {} command pool", stream_idx));
|
||||
return res;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
video_encoder_x264::video_encoder_x264(
|
||||
wivrn::vk_bundle & vk,
|
||||
const encoder_settings & settings,
|
||||
uint8_t stream_idx) :
|
||||
video_encoder(stream_idx, settings, std::make_unique<default_idr_handler>(), false)
|
||||
video_encoder(vk,
|
||||
stream_idx,
|
||||
*vk.transfer_queue ? vk.transfer_queue_family_index : vk.queue_family_index,
|
||||
settings,
|
||||
std::make_unique<default_idr_handler>(),
|
||||
false),
|
||||
vk{vk},
|
||||
cmd_pool{make_cmd_pool(vk, stream_idx)}
|
||||
{
|
||||
if (settings.bit_depth != 8)
|
||||
throw std::runtime_error("x264 encoder only supports 8-bit encoding");
|
||||
@@ -98,6 +119,17 @@ video_encoder_x264::video_encoder_x264(
|
||||
if (settings.codec != h264)
|
||||
U_LOG_W("requested x264 encoder with codec != h264");
|
||||
|
||||
auto command_buffers = vk.device.allocateCommandBuffers(
|
||||
{.commandPool = *cmd_pool,
|
||||
.commandBufferCount = num_slots});
|
||||
|
||||
for (size_t i = 0; i < num_slots; ++i)
|
||||
{
|
||||
in[i].cmd = std::move(command_buffers[i]);
|
||||
vk.name(in[i].cmd, std::format("x264 {} transfer command buffer {}", stream_idx, i));
|
||||
in[i].fence = vk::raii::Fence(vk.device, vk::FenceCreateInfo{.flags = vk::FenceCreateFlagBits::eSignaled});
|
||||
}
|
||||
|
||||
// encoder requires width and height to be even
|
||||
chroma_width = extent.width / 2;
|
||||
|
||||
@@ -149,7 +181,7 @@ video_encoder_x264::video_encoder_x264(
|
||||
},
|
||||
{
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST,
|
||||
},
|
||||
"x264 luma buffer");
|
||||
i.chroma = buffer_allocation(
|
||||
@@ -159,7 +191,7 @@ video_encoder_x264::video_encoder_x264(
|
||||
},
|
||||
{
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST,
|
||||
},
|
||||
"x264 chroma buffer");
|
||||
|
||||
@@ -176,11 +208,40 @@ video_encoder_x264::video_encoder_x264(
|
||||
}
|
||||
}
|
||||
|
||||
std::pair<bool, vk::Semaphore> video_encoder_x264::present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t)
|
||||
void video_encoder_x264::present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo compositor_sem, uint8_t slot, uint64_t)
|
||||
{
|
||||
cmd_buf.copyImageToBuffer(
|
||||
if (vk.device.waitForFences(*in[slot].fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_E("Timeout on stream %d", stream_idx);
|
||||
return;
|
||||
}
|
||||
|
||||
auto & cmd = in[slot].cmd;
|
||||
cmd.begin({.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit});
|
||||
|
||||
if (need_transfer)
|
||||
{
|
||||
vk::ImageMemoryBarrier2 barrier{
|
||||
.dstStageMask = vk::PipelineStageFlagBits2KHR::eTransfer,
|
||||
.dstAccessMask = vk::AccessFlagBits2::eTransferRead,
|
||||
.srcQueueFamilyIndex = vk.queue_family_index,
|
||||
.dstQueueFamilyIndex = target_queue,
|
||||
.image = y_cbcr,
|
||||
.subresourceRange = {.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = stream_idx,
|
||||
.layerCount = 1},
|
||||
};
|
||||
cmd.pipelineBarrier2({
|
||||
.imageMemoryBarrierCount = 1,
|
||||
.pImageMemoryBarriers = &barrier,
|
||||
});
|
||||
}
|
||||
|
||||
cmd.copyImageToBuffer(
|
||||
y_cbcr,
|
||||
vk::ImageLayout::eTransferSrcOptimal,
|
||||
vk::ImageLayout::eGeneral,
|
||||
in[slot].luma,
|
||||
vk::BufferImageCopy{
|
||||
.bufferRowLength = chroma_width * 2,
|
||||
@@ -194,9 +255,9 @@ std::pair<bool, vk::Semaphore> video_encoder_x264::present_image(vk::Image y_cbc
|
||||
.height = extent.height,
|
||||
.depth = 1,
|
||||
}});
|
||||
cmd_buf.copyImageToBuffer(
|
||||
cmd.copyImageToBuffer(
|
||||
y_cbcr,
|
||||
vk::ImageLayout::eTransferSrcOptimal,
|
||||
vk::ImageLayout::eGeneral,
|
||||
in[slot].chroma,
|
||||
vk::BufferImageCopy{
|
||||
.bufferRowLength = chroma_width,
|
||||
@@ -210,7 +271,24 @@ std::pair<bool, vk::Semaphore> video_encoder_x264::present_image(vk::Image y_cbc
|
||||
.height = extent.height / 2,
|
||||
.depth = 1,
|
||||
}});
|
||||
return {false, nullptr};
|
||||
|
||||
cmd.end();
|
||||
|
||||
std::unique_lock lock(*vk.transfer_queue ? vk.transfer_queue_mutex : vk.queue_mutex);
|
||||
vk::CommandBufferSubmitInfo cmd_info{
|
||||
.commandBuffer = *cmd,
|
||||
};
|
||||
compositor_sem.stageMask = vk::PipelineStageFlagBits2::eTransfer;
|
||||
|
||||
vk.device.resetFences(*in[slot].fence);
|
||||
(*vk.transfer_queue ? vk.transfer_queue : vk.queue)
|
||||
.submit2(vk::SubmitInfo2{
|
||||
.waitSemaphoreInfoCount = 1,
|
||||
.pWaitSemaphoreInfos = &compositor_sem,
|
||||
.commandBufferInfoCount = 1,
|
||||
.pCommandBufferInfos = &cmd_info,
|
||||
},
|
||||
*in[slot].fence);
|
||||
}
|
||||
|
||||
std::optional<video_encoder::data> video_encoder_x264::encode(uint8_t slot, uint64_t frame_index)
|
||||
@@ -253,6 +331,11 @@ std::optional<video_encoder::data> video_encoder_x264::encode(uint8_t slot, uint
|
||||
}
|
||||
next_mb = 0;
|
||||
assert(pending_nals.empty());
|
||||
if (vk.device.waitForFences(*in[slot].fence, true, 1'000'000'000) == vk::Result::eTimeout)
|
||||
{
|
||||
U_LOG_E("Timeout on stream %d", stream_idx);
|
||||
return {};
|
||||
}
|
||||
int size = x264_encoder_encode(enc, &nal, &num_nal, &pic, &pic_out);
|
||||
if (next_mb != num_mb)
|
||||
{
|
||||
|
||||
@@ -38,8 +38,14 @@ class video_encoder_x264 : public video_encoder
|
||||
|
||||
x264_picture_t pic_out = {};
|
||||
|
||||
wivrn::vk_bundle & vk;
|
||||
uint64_t sem_value = 0; // current value of the semaphore
|
||||
vk::raii::CommandPool cmd_pool;
|
||||
|
||||
struct in_t
|
||||
{
|
||||
vk::raii::Fence fence = nullptr;
|
||||
vk::raii::CommandBuffer cmd = nullptr;
|
||||
x264_picture_t pic;
|
||||
buffer_allocation luma;
|
||||
buffer_allocation chroma;
|
||||
@@ -62,7 +68,7 @@ class video_encoder_x264 : public video_encoder
|
||||
public:
|
||||
video_encoder_x264(wivrn::vk_bundle & vk, const encoder_settings & settings, uint8_t stream_idx);
|
||||
|
||||
std::pair<bool, vk::Semaphore> present_image(vk::Image y_cbcr, bool transferred, vk::raii::CommandBuffer & cmd_buf, uint8_t slot, uint64_t frame_index) override;
|
||||
void present_image(vk::Image y_cbcr, vk::SemaphoreSubmitInfo, uint8_t slot, uint64_t frame_index) override;
|
||||
|
||||
std::optional<data> encode(uint8_t slot, uint64_t frame_index) override;
|
||||
|
||||
|
||||
+11
-1
@@ -193,6 +193,9 @@ std::unique_ptr<children_manager> children;
|
||||
bool quitting_main_loop;
|
||||
bool do_fork;
|
||||
bool do_active_runtime;
|
||||
#if WIVRN_FEATURE_DEBUG_GUI
|
||||
bool show_debug_gui;
|
||||
#endif
|
||||
wivrn::service_publication publication;
|
||||
|
||||
guint listener_watch;
|
||||
@@ -248,7 +251,7 @@ void start_server(configuration config)
|
||||
.udgci = {
|
||||
.window_title = "WiVRn",
|
||||
#if WIVRN_FEATURE_DEBUG_GUI
|
||||
.open = config.debug_gui ? U_DEBUG_GUI_OPEN_ALWAYS : U_DEBUG_GUI_OPEN_AUTO,
|
||||
.open = (config.debug_gui or show_debug_gui) ? U_DEBUG_GUI_OPEN_ALWAYS : U_DEBUG_GUI_OPEN_AUTO,
|
||||
#else
|
||||
.open = U_DEBUG_GUI_OPEN_NEVER,
|
||||
#endif
|
||||
@@ -1025,6 +1028,9 @@ int main(int argc, char * argv[])
|
||||
auto no_fork = app.add_flag("--no-fork")->description("disable fork to serve connection")->group("Debug");
|
||||
auto no_publish = app.add_flag("--no-publish-service")->description("disable publishing the service through avahi");
|
||||
auto no_encrypt = app.add_flag("--no-encrypt")->description("disable encryption")->group("Debug");
|
||||
#if WIVRN_FEATURE_DEBUG_GUI
|
||||
auto debug_gui = app.add_flag("--debug-gui")->description("show the debug GUI")->group("Debug");
|
||||
#endif
|
||||
|
||||
CLI11_PARSE(app, argc, argv);
|
||||
|
||||
@@ -1054,6 +1060,10 @@ int main(int argc, char * argv[])
|
||||
else
|
||||
publication = configuration().publication;
|
||||
|
||||
#if WIVRN_FEATURE_DEBUG_GUI
|
||||
show_debug_gui = bool(*debug_gui);
|
||||
#endif
|
||||
|
||||
try
|
||||
{
|
||||
return inner_main(argc, argv, not *no_instructions);
|
||||
|
||||
@@ -155,7 +155,7 @@ void forked_children::start_application(const std::vector<std::string> & args, c
|
||||
if (path)
|
||||
tmp.push_back("--directory=" + *path);
|
||||
}
|
||||
else
|
||||
else if (path)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "xrt/xrt_instance.h"
|
||||
#include "xrt/xrt_system.h"
|
||||
|
||||
#include "util/u_system.h"
|
||||
#include "b_system.h"
|
||||
#include "util/u_trace_marker.h"
|
||||
|
||||
#include <assert.h>
|
||||
@@ -50,7 +50,7 @@ xrt_result_t instance::create_system(
|
||||
assert(*out_xsysd == NULL);
|
||||
assert(out_xsysc == NULL || *out_xsysc == NULL);
|
||||
assert(server);
|
||||
auto u_sys = u_system_create();
|
||||
auto u_sys = b_system_create();
|
||||
*out_xsys = &u_sys->base;
|
||||
|
||||
struct xrt_system_compositor * xsysc = NULL;
|
||||
@@ -61,10 +61,13 @@ xrt_result_t instance::create_system(
|
||||
out_xspovrs,
|
||||
out_xsysc);
|
||||
if (res != XRT_SUCCESS)
|
||||
{
|
||||
ipc_server_stop(server);
|
||||
return res;
|
||||
}
|
||||
session = (wivrn_session *)*out_xsysd;
|
||||
session->start(server);
|
||||
u_system_set_system_compositor(u_sys, *out_xsysc);
|
||||
b_system_set_system_compositor(u_sys, *out_xsysc);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -88,11 +91,8 @@ instance::instance() :
|
||||
void instance::set_ipc_server(ipc_server * server)
|
||||
{
|
||||
this->server = server;
|
||||
if (!server)
|
||||
{
|
||||
assert(session);
|
||||
if (session and not server)
|
||||
session->stop();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace wivrn
|
||||
|
||||
@@ -108,6 +108,32 @@ uint32_t select_queue(const std::vector<vk::QueueFamilyProperties> & queues, vk:
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int get_queue_index(const std::vector<vk::QueueFamilyProperties> & queues, std::vector<vk::DeviceQueueCreateInfo> & infos, uint32_t family_index)
|
||||
{
|
||||
if (family_index == vk::QueueFamilyIgnored)
|
||||
return -1;
|
||||
for (auto & info: infos)
|
||||
{
|
||||
if (info.queueFamilyIndex == family_index)
|
||||
{
|
||||
auto count = queues.at(family_index).queueCount;
|
||||
if (info.queueCount == count)
|
||||
{
|
||||
U_LOG_W("Insufficient vulkan queues for family %d", family_index);
|
||||
return -1;
|
||||
}
|
||||
return info.queueCount++;
|
||||
}
|
||||
}
|
||||
static std::array<float, 3> prios{1.0, 1.0, 1.0};
|
||||
infos.push_back(vk::DeviceQueueCreateInfo{
|
||||
.queueFamilyIndex = family_index,
|
||||
.queueCount = 1,
|
||||
.pQueuePriorities = prios.data(),
|
||||
});
|
||||
return 0;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
wivrn::vk_bundle::vk_bundle() :
|
||||
@@ -116,6 +142,8 @@ wivrn::vk_bundle::vk_bundle() :
|
||||
device(nullptr),
|
||||
queue(nullptr),
|
||||
queue_family_index(vk::QueueFamilyIgnored),
|
||||
transfer_queue(nullptr),
|
||||
transfer_queue_family_index(vk::QueueFamilyIgnored),
|
||||
encode_queue(nullptr),
|
||||
encode_queue_family_index(vk::QueueFamilyIgnored),
|
||||
debug(nullptr)
|
||||
@@ -189,9 +217,10 @@ wivrn::vk_bundle::vk_bundle() :
|
||||
}
|
||||
|
||||
// Select queue families
|
||||
auto queues = physical_device.getQueueFamilyProperties();
|
||||
{
|
||||
auto queues = physical_device.getQueueFamilyProperties();
|
||||
queue_family_index = select_queue(queues, vk::QueueFlagBits::eCompute);
|
||||
transfer_queue_family_index = select_queue(queues, vk::QueueFlagBits::eTransfer);
|
||||
#if WIVRN_USE_VULKAN_ENCODE
|
||||
encode_queue_family_index = select_queue(queues, vk::QueueFlagBits::eVideoEncodeKHR);
|
||||
#endif
|
||||
@@ -249,6 +278,9 @@ wivrn::vk_bundle::vk_bundle() :
|
||||
#endif
|
||||
#ifdef VK_KHR_video_encode_intra_refresh
|
||||
VK_KHR_VIDEO_ENCODE_INTRA_REFRESH_EXTENSION_NAME,
|
||||
#endif
|
||||
#ifdef VK_KHR_maintenance9
|
||||
VK_KHR_MAINTENANCE_9_EXTENSION_NAME,
|
||||
#endif
|
||||
};
|
||||
for (auto & ext: physical_device.enumerateDeviceExtensionProperties())
|
||||
@@ -259,28 +291,25 @@ wivrn::vk_bundle::vk_bundle() :
|
||||
|
||||
float prio = 1.0;
|
||||
|
||||
std::vector queues_info = {
|
||||
vk::DeviceQueueCreateInfo{
|
||||
.queueFamilyIndex = queue_family_index,
|
||||
.queueCount = 1,
|
||||
.pQueuePriorities = &prio,
|
||||
},
|
||||
};
|
||||
std::vector<vk::DeviceQueueCreateInfo> queues_info;
|
||||
int queue_index = get_queue_index(queues, queues_info, queue_family_index);
|
||||
U_LOG_D("queue index: %d", queue_index);
|
||||
int transfer_queue_index = get_queue_index(queues, queues_info, transfer_queue_family_index);
|
||||
U_LOG_D("transfer queue index: %d", transfer_queue_index);
|
||||
#if WIVRN_USE_VULKAN_ENCODE
|
||||
if (encode_queue_family_index != vk::QueueFamilyIgnored)
|
||||
{
|
||||
queues_info.push_back(
|
||||
vk::DeviceQueueCreateInfo{
|
||||
.queueFamilyIndex = encode_queue_family_index,
|
||||
.queueCount = 1,
|
||||
.pQueuePriorities = &prio,
|
||||
});
|
||||
|
||||
int encode_queue_index = get_queue_index(queues, queues_info, encode_queue_family_index);
|
||||
U_LOG_D("encode queue index: %d", encode_queue_index);
|
||||
#ifdef VK_KHR_video_maintenance1
|
||||
if (has_device_ext(VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME))
|
||||
std::get<vk::PhysicalDeviceVideoMaintenance1FeaturesKHR>(feat).videoMaintenance1 =
|
||||
std::get<vk::PhysicalDeviceVideoMaintenance1FeaturesKHR>(physical_device.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceVideoMaintenance1FeaturesKHR>()).videoMaintenance1;
|
||||
if (has_device_ext(VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME))
|
||||
std::get<vk::PhysicalDeviceVideoMaintenance1FeaturesKHR>(feat).videoMaintenance1 =
|
||||
std::get<vk::PhysicalDeviceVideoMaintenance1FeaturesKHR>(physical_device.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceVideoMaintenance1FeaturesKHR>()).videoMaintenance1;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef VK_KHR_maintenance9
|
||||
if (has_device_ext(VK_KHR_MAINTENANCE_9_EXTENSION_NAME))
|
||||
{
|
||||
std::get<vk::PhysicalDeviceMaintenance9FeaturesKHR>(feat).maintenance9 =
|
||||
std::get<vk::PhysicalDeviceMaintenance9FeaturesKHR>(physical_device.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceMaintenance9FeaturesKHR>()).maintenance9;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -291,6 +320,11 @@ wivrn::vk_bundle::vk_bundle() :
|
||||
std::get<vk::PhysicalDeviceVulkan12Features>(feat).timelineSemaphore = phys_feat12.timelineSemaphore;
|
||||
std::get<vk::PhysicalDeviceVulkan13Features>(feat).synchronization2 = phys_feat13.synchronization2;
|
||||
|
||||
if (not phys_feat13.synchronization2)
|
||||
throw std::runtime_error("GPU does not support Vulkan synchronization2 feature");
|
||||
if (not phys_feat12.timelineSemaphore)
|
||||
throw std::runtime_error("GPU does not support Vulkan timeline semaphores");
|
||||
|
||||
#ifdef VK_KHR_video_encode_intra_refresh
|
||||
if (has_device_ext(VK_KHR_VIDEO_ENCODE_INTRA_REFRESH_EXTENSION_NAME))
|
||||
std::get<vk::PhysicalDeviceVideoEncodeIntraRefreshFeaturesKHR>(feat).videoEncodeIntraRefresh = std::get<vk::PhysicalDeviceVideoEncodeIntraRefreshFeaturesKHR>(physical_device.getFeatures2<vk::PhysicalDeviceFeatures2, vk::PhysicalDeviceVideoEncodeIntraRefreshFeaturesKHR>()).videoEncodeIntraRefresh;
|
||||
@@ -306,10 +340,19 @@ wivrn::vk_bundle::vk_bundle() :
|
||||
.ppEnabledExtensionNames = device_extensions.data(),
|
||||
});
|
||||
|
||||
queue = device.getQueue(queue_family_index, 0);
|
||||
queue = device.getQueue(queue_family_index, queue_index);
|
||||
name(queue, "compute queue");
|
||||
if (transfer_queue_index >= 0)
|
||||
{
|
||||
transfer_queue = device.getQueue(transfer_queue_family_index, transfer_queue_index);
|
||||
name(transfer_queue, "transfer queue");
|
||||
}
|
||||
#if WIVRN_USE_VULKAN_ENCODE
|
||||
if (encode_queue_family_index != vk::QueueFamilyIgnored)
|
||||
encode_queue = device.getQueue(encode_queue_family_index, 0);
|
||||
if (encode_queue_index >= 0)
|
||||
{
|
||||
encode_queue = device.getQueue(encode_queue_family_index, encode_queue_index);
|
||||
name(encode_queue, "encode queue");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -320,6 +363,15 @@ wivrn::vk_bundle::vk_bundle() :
|
||||
.vulkanApiVersion = app_info.apiVersion,
|
||||
},
|
||||
*debug != VK_NULL_HANDLE);
|
||||
|
||||
auto prop = physical_device.getProperties();
|
||||
U_LOG_I("Vulkan instance created:\n"
|
||||
"\tGPU: %s\n"
|
||||
"\tqueue families: %d %d %d (main, encode, transfer)\n",
|
||||
prop.deviceName.data(),
|
||||
int32_t(queue_family_index),
|
||||
int32_t(encode_queue_family_index),
|
||||
int32_t(transfer_queue_family_index));
|
||||
}
|
||||
|
||||
uint32_t wivrn::vk_bundle::get_memory_type(uint32_t type_bits, vk::MemoryPropertyFlags memory_props)
|
||||
@@ -358,6 +410,22 @@ bool wivrn::vk_bundle::has_device_ext(const char * ext) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wivrn::vk_bundle::optimal_transfer(uint32_t from, uint32_t to) const
|
||||
{
|
||||
if (from == vk::QueueFamilyIgnored or to == vk::QueueFamilyIgnored or from == to)
|
||||
return false;
|
||||
#ifdef VK_KHR_maintenance9
|
||||
if (std::get<vk::PhysicalDeviceMaintenance9FeaturesKHR>(feat).maintenance9)
|
||||
{
|
||||
auto props = physical_device.getQueueFamilyProperties2<vk::StructureChain<vk::QueueFamilyProperties2, vk::QueueFamilyOwnershipTransferPropertiesKHR>>();
|
||||
|
||||
auto to = std::get<1>(props[from]).optimalImageTransferToQueueFamilies;
|
||||
return to & (1 << to);
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
vk::raii::ShaderModule wivrn::vk_bundle::load_shader(const char * name)
|
||||
{
|
||||
std::span spirv{::shaders.at(name)};
|
||||
|
||||
@@ -71,6 +71,10 @@ struct vk_bundle
|
||||
vk::raii::Queue queue;
|
||||
uint32_t queue_family_index;
|
||||
|
||||
std::mutex transfer_queue_mutex;
|
||||
vk::raii::Queue transfer_queue;
|
||||
uint32_t transfer_queue_family_index;
|
||||
|
||||
std::mutex encode_queue_mutex;
|
||||
vk::raii::Queue encode_queue;
|
||||
uint32_t encode_queue_family_index;
|
||||
@@ -82,6 +86,9 @@ struct vk_bundle
|
||||
#ifdef VK_KHR_video_maintenance1
|
||||
vk::PhysicalDeviceVideoMaintenance1FeaturesKHR,
|
||||
#endif
|
||||
#ifdef VK_KHR_maintenance9
|
||||
vk::PhysicalDeviceMaintenance9FeaturesKHR,
|
||||
#endif
|
||||
#ifdef VK_KHR_video_encode_intra_refresh
|
||||
vk::PhysicalDeviceVideoEncodeIntraRefreshFeaturesKHR,
|
||||
#endif
|
||||
@@ -96,18 +103,26 @@ struct vk_bundle
|
||||
|
||||
uint32_t get_memory_type(uint32_t type_bits, vk::MemoryPropertyFlags memory_props);
|
||||
|
||||
template <typename T>
|
||||
void name(const T & handle, const char * value)
|
||||
template <typename T, typename U>
|
||||
void name(const T & handle, U && value)
|
||||
{
|
||||
return name(T::objectType, vk_handle(handle), value);
|
||||
return name(T::objectType, vk_handle(handle), std::forward<U>(value));
|
||||
}
|
||||
|
||||
bool has_instance_ext(const char *) const;
|
||||
bool has_device_ext(const char *) const;
|
||||
|
||||
// return true if optimal images do NOT require a transfer operation
|
||||
// between those queues
|
||||
bool optimal_transfer(uint32_t from_queue_family_index, uint32_t to_queue_family_index) const;
|
||||
|
||||
vk::raii::ShaderModule load_shader(const char * name);
|
||||
|
||||
private:
|
||||
void name(vk::ObjectType, uint64_t handle, const char * value);
|
||||
void name(vk::ObjectType t, uint64_t handle, const std::string & value)
|
||||
{
|
||||
return name(t, handle, value.c_str());
|
||||
}
|
||||
};
|
||||
} // namespace wivrn
|
||||
|
||||
@@ -54,7 +54,9 @@ if __name__ == "__main__":
|
||||
"--c++", "--from-code=UTF-8",
|
||||
"--keyword=_:1,1t",
|
||||
"--keyword=_S:1,1t",
|
||||
"--keyword=_C:1c,2,2t",
|
||||
"--keyword=_cS:1c,2,2t",
|
||||
"--keyword=_cF:1c,2,2t",
|
||||
"--keyword=_F:1,1t",
|
||||
"--keyword=gettext_noop:1,1t",
|
||||
"--output", client_pot,
|
||||
|
||||
@@ -11,6 +11,7 @@ xgettext \
|
||||
--keyword=_S:1,1t \
|
||||
--keyword=_C:1c,2,2t \
|
||||
--keyword=_cS:1c,2,2t \
|
||||
--keyword=_cF:1c,2,2t \
|
||||
--keyword=_F:1,1t \
|
||||
--keyword=gettext_noop:1,1t \
|
||||
--output=$WIVRN_CLIENT_POT \
|
||||
|
||||
Reference in New Issue
Block a user