override_view() should take hmd_traits as argument to ensure envvar overrides are read consistently
This commit is contained in:
+3
-4
@@ -356,15 +356,14 @@ static XrViewConfigurationView scale_view(XrViewConfigurationView view, uint32_t
|
|||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
XrViewConfigurationView override_view(XrViewConfigurationView view, model m)
|
XrViewConfigurationView override_view_for_hmd(const hmd_traits & traits, XrViewConfigurationView view)
|
||||||
{
|
{
|
||||||
// Standalone headsets tend to report a lower resolution
|
// Standalone headsets tend to report a lower resolution
|
||||||
// as the GPU can't handle full res.
|
// as the GPU can't handle full res.
|
||||||
// Return the panel resolution instead.
|
// Return the panel resolution instead.
|
||||||
spdlog::debug("Recommended image size: {}x{}", view.recommendedImageRectWidth, view.recommendedImageRectHeight);
|
spdlog::debug("Recommended image size: {}x{}", view.recommendedImageRectWidth, view.recommendedImageRectHeight);
|
||||||
const hmd_traits quirks = get_hmd_traits(m);
|
if (traits.panel_width_override > 0)
|
||||||
if (quirks.panel_width_override > 0)
|
return scale_view(view, traits.panel_width_override);
|
||||||
return scale_view(view, quirks.panel_width_override);
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -83,7 +83,6 @@ void initialize_runtime_hmd_traits();
|
|||||||
// constructs itself and complains in logs.
|
// constructs itself and complains in logs.
|
||||||
const hmd_traits & runtime_hmd_traits();
|
const hmd_traits & runtime_hmd_traits();
|
||||||
const char * permission_name_for_hmd(const hmd_traits & traits, const feature f);
|
const char * permission_name_for_hmd(const hmd_traits & traits, const feature f);
|
||||||
|
XrViewConfigurationView override_view_for_hmd(const hmd_traits & traits, XrViewConfigurationView);
|
||||||
XrViewConfigurationView override_view(XrViewConfigurationView, model = guess_model());
|
|
||||||
|
|
||||||
std::pair<glm::vec3, glm::quat> controller_offset(std::string_view profile, xr::spaces space);
|
std::pair<glm::vec3, glm::quat> controller_offset(std::string_view profile, xr::spaces space);
|
||||||
|
|||||||
@@ -1114,7 +1114,7 @@ void scenes::lobby::on_focused()
|
|||||||
|
|
||||||
auto views = system.view_configuration_views(viewconfig);
|
auto views = system.view_configuration_views(viewconfig);
|
||||||
assert(views.size() == 2); // FIXME
|
assert(views.size() == 2); // FIXME
|
||||||
stream_view = override_view(views[0], guess_model());
|
stream_view = override_view_for_hmd(runtime_hmd_traits(), views[0]);
|
||||||
width = views[0].recommendedImageRectWidth;
|
width = views[0].recommendedImageRectWidth;
|
||||||
height = views[0].recommendedImageRectHeight;
|
height = views[0].recommendedImageRectHeight;
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
|
|||||||
|
|
||||||
{
|
{
|
||||||
auto view = self->system.view_configuration_views(self->viewconfig)[0];
|
auto view = self->system.view_configuration_views(self->viewconfig)[0];
|
||||||
view = override_view(view, guess_model());
|
view = override_view_for_hmd(runtime_hmd_traits(), view);
|
||||||
|
|
||||||
info.render_eye_width = view.recommendedImageRectWidth * config.resolution_scale;
|
info.render_eye_width = view.recommendedImageRectWidth * config.resolution_scale;
|
||||||
info.render_eye_height = view.recommendedImageRectHeight * config.resolution_scale;
|
info.render_eye_height = view.recommendedImageRectHeight * config.resolution_scale;
|
||||||
|
|||||||
Reference in New Issue
Block a user