Fix incorrect resolution show in stream settings
This commit is contained in:
@@ -267,8 +267,9 @@ void settings_video(const settings_context & ctx)
|
||||
}
|
||||
|
||||
{
|
||||
const auto width = ctx.recommended_width;
|
||||
const auto height = ctx.recommended_height;
|
||||
const auto & view = ctx.system.stereo_view();
|
||||
const auto width = view.recommendedImageRectWidth;
|
||||
const auto height = view.recommendedImageRectHeight;
|
||||
list.push_back({
|
||||
.id = "##resolution",
|
||||
.label = _("Render resolution"),
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
|
||||
@@ -46,10 +45,6 @@ struct settings_context
|
||||
xr::system & system;
|
||||
imgui_context & imgui_ctx;
|
||||
|
||||
// recommended per-eye render resolution, for the resolution description
|
||||
uint32_t recommended_width = 0;
|
||||
uint32_t recommended_height = 0;
|
||||
|
||||
// streaming: connection-time settings are disabled, in-stream controls appear
|
||||
bool in_game = false;
|
||||
|
||||
|
||||
@@ -144,6 +144,10 @@ void scenes::lobby::move_gui(glm::vec3 head_position, glm::vec3 new_gui_position
|
||||
scenes::lobby::lobby() :
|
||||
scene_impl<lobby>(supported_color_formats, supported_depth_formats)
|
||||
{
|
||||
const auto & view = system.stereo_view();
|
||||
width = view.recommendedImageRectWidth;
|
||||
height = view.recommendedImageRectHeight;
|
||||
|
||||
spdlog::info("Using formats {} and {}", vk::to_string(swapchain_format), vk::to_string(depth_format));
|
||||
|
||||
if (composition_layer_depth_test_supported)
|
||||
@@ -1140,15 +1144,6 @@ void scenes::lobby::on_focused()
|
||||
{
|
||||
recenter_gui = true;
|
||||
|
||||
auto views = system.view_configuration_views(viewconfig);
|
||||
assert(views.size() == 2); // FIXME
|
||||
stream_view = application::get_hmd_traits().override_view(views[0]);
|
||||
width = views[0].recommendedImageRectWidth;
|
||||
height = views[0].recommendedImageRectHeight;
|
||||
|
||||
// assert(std::ranges::all_of(views, [width](const XrViewConfigurationView & view) { return view.recommendedImageRectWidth == width; }));
|
||||
// assert(std::ranges::all_of(views, [height](const XrViewConfigurationView & view) { return view.recommendedImageRectHeight == height; }));
|
||||
|
||||
auto & config = application::get_config();
|
||||
|
||||
try
|
||||
|
||||
@@ -95,7 +95,6 @@ class lobby : public scene_impl<lobby>
|
||||
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
XrViewConfigurationView stream_view;
|
||||
|
||||
#if WIVRN_CLIENT_DEBUG_MENU
|
||||
// GUI debug
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
wivrn::gui::settings_context lobby_settings_context(xr::instance & instance, xr::session & session, xr::system & system, imgui_context & imgui_ctx, const XrViewConfigurationView & stream_view, std::optional<bool> server_hid_forwarding)
|
||||
wivrn::gui::settings_context lobby_settings_context(xr::instance & instance, xr::session & session, xr::system & system, imgui_context & imgui_ctx, std::optional<bool> server_hid_forwarding)
|
||||
{
|
||||
return {
|
||||
.config = application::get_config(),
|
||||
@@ -35,8 +35,6 @@ wivrn::gui::settings_context lobby_settings_context(xr::instance & instance, xr:
|
||||
.session = session,
|
||||
.system = system,
|
||||
.imgui_ctx = imgui_ctx,
|
||||
.recommended_width = stream_view.recommendedImageRectWidth,
|
||||
.recommended_height = stream_view.recommendedImageRectHeight,
|
||||
.in_game = false,
|
||||
.server_hid_forwarding = server_hid_forwarding,
|
||||
};
|
||||
@@ -45,40 +43,40 @@ wivrn::gui::settings_context lobby_settings_context(xr::instance & instance, xr:
|
||||
|
||||
void scenes::lobby::gui_video()
|
||||
{
|
||||
wivrn::gui::settings_video(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
|
||||
wivrn::gui::settings_video(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
|
||||
}
|
||||
|
||||
void scenes::lobby::gui_streaming()
|
||||
{
|
||||
wivrn::gui::settings_streaming(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
|
||||
wivrn::gui::settings_streaming(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
|
||||
}
|
||||
|
||||
void scenes::lobby::gui_post_processing()
|
||||
{
|
||||
wivrn::gui::settings_post_processing(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
|
||||
wivrn::gui::settings_post_processing(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
|
||||
}
|
||||
|
||||
void scenes::lobby::gui_audio()
|
||||
{
|
||||
wivrn::gui::settings_audio(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
|
||||
wivrn::gui::settings_audio(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
|
||||
}
|
||||
|
||||
void scenes::lobby::gui_devices()
|
||||
{
|
||||
wivrn::gui::settings_devices(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
|
||||
wivrn::gui::settings_devices(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
|
||||
}
|
||||
|
||||
void scenes::lobby::gui_tracking()
|
||||
{
|
||||
wivrn::gui::settings_tracking(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
|
||||
wivrn::gui::settings_tracking(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
|
||||
}
|
||||
|
||||
void scenes::lobby::gui_system()
|
||||
{
|
||||
wivrn::gui::settings_system(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
|
||||
wivrn::gui::settings_system(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
|
||||
}
|
||||
|
||||
void scenes::lobby::gui_theme()
|
||||
{
|
||||
wivrn::gui::settings_theme(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
|
||||
wivrn::gui::settings_theme(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
|
||||
}
|
||||
|
||||
@@ -205,9 +205,9 @@ scenes::stream::stream(std::string server_name, scene & parent_scene) :
|
||||
apps{*this, std::move(server_name)},
|
||||
foveation_center{instance, system, session, device, commandpool, queue, swapchain_format}
|
||||
{
|
||||
auto views = system.view_configuration_views(viewconfig);
|
||||
width = views[0].recommendedImageRectWidth;
|
||||
height = views[0].recommendedImageRectHeight;
|
||||
const auto & view = system.stereo_view();
|
||||
width = view.recommendedImageRectWidth;
|
||||
height = view.recommendedImageRectHeight;
|
||||
}
|
||||
|
||||
static from_headset::visibility_mask_changed::masks get_visibility_mask(xr::instance & inst, xr::session & session, int view)
|
||||
@@ -253,7 +253,7 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
|
||||
const auto & config = application::get_config();
|
||||
|
||||
{
|
||||
auto view = self->system.view_configuration_views(self->viewconfig)[0];
|
||||
auto view = self->system.stereo_view();
|
||||
view = application::get_hmd_traits().override_view(view);
|
||||
|
||||
info.render_eye_width = view.recommendedImageRectWidth * config.resolution_scale;
|
||||
|
||||
@@ -407,8 +407,6 @@ void scenes::stream::gui_settings(float)
|
||||
.session = session,
|
||||
.system = system,
|
||||
.imgui_ctx = *imgui_ctx,
|
||||
.recommended_width = width,
|
||||
.recommended_height = height,
|
||||
.in_game = true,
|
||||
.server_hid_forwarding = hid_forwarding_enabled(),
|
||||
.on_streaming_changed = [this] { send_settings_changed_packet(session, network_session.get(), application::get_config()); },
|
||||
|
||||
@@ -53,6 +53,10 @@ xr::system::system(xr::instance & inst, XrFormFactor formfactor)
|
||||
|
||||
body_tracker = xr::body_tracker_supported(inst, *this);
|
||||
face_tracker = xr::face_tracker_supported(inst, *this);
|
||||
|
||||
auto views = view_configuration_views(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO);
|
||||
assert(views.size() == 2);
|
||||
stereo_view_ = views[0];
|
||||
}
|
||||
|
||||
XrGraphicsRequirementsVulkan2KHR xr::system::graphics_requirements() const
|
||||
|
||||
@@ -66,6 +66,7 @@ class system
|
||||
passthrough_type passthrough;
|
||||
body_tracker_type body_tracker;
|
||||
face_tracker_type face_tracker;
|
||||
XrViewConfigurationView stereo_view_;
|
||||
|
||||
public:
|
||||
system() = default;
|
||||
@@ -106,6 +107,10 @@ public:
|
||||
vk::raii::Device create_device(vk::raii::PhysicalDevice & pdev, vk::DeviceCreateInfo & create_info) const;
|
||||
|
||||
std::vector<XrViewConfigurationType> view_configurations() const;
|
||||
const XrViewConfigurationView & stereo_view() const
|
||||
{
|
||||
return stereo_view_;
|
||||
}
|
||||
XrViewConfigurationProperties view_configuration_properties(XrViewConfigurationType) const;
|
||||
std::vector<XrViewConfigurationView> view_configuration_views(XrViewConfigurationType) const;
|
||||
std::vector<XrEnvironmentBlendMode> environment_blend_modes(XrViewConfigurationType) const;
|
||||
|
||||
Reference in New Issue
Block a user