Merge branch 'WiVRn:master' into sneed
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "wivrn_connection.h"
|
||||
#include "configuration.h"
|
||||
#include "protocol_version.h"
|
||||
#include "secrets.h"
|
||||
#include "smp.h"
|
||||
#include "wivrn_ipc.h"
|
||||
@@ -169,6 +170,14 @@ void wivrn::wivrn_connection::init(std::stop_token stop_token, std::function<voi
|
||||
// Wait for client to send handshake packet
|
||||
auto crypto_handshake = std::get<from_headset::crypto_handshake>(receive(10s).first);
|
||||
|
||||
if (crypto_handshake.protocol_version != wivrn::protocol_version)
|
||||
{
|
||||
control.send(to_headset::crypto_handshake{
|
||||
.state = to_headset::crypto_handshake::crypto_state::incompatible_version,
|
||||
});
|
||||
throw std::runtime_error("Incompatible protocol version");
|
||||
}
|
||||
|
||||
crypto::key headset_key = crypto::key::from_public_key(crypto_handshake.public_key);
|
||||
bool is_public_key_known = std::ranges::any_of(
|
||||
wivrn::known_keys(),
|
||||
|
||||
@@ -236,6 +236,11 @@ void wivrn_foveation::compute_params(
|
||||
tan_center[i].y = angles_to_center(-view.y - e.y, views[i].fov.angleUp, views[i].fov.angleDown);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < 2; ++i)
|
||||
tan_center[i].x = angles_to_center(0, fovs[i].angle_left, fovs[i].angle_right);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -386,7 +391,7 @@ vk::CommandBuffer wivrn_foveation::update_foveation_buffer(
|
||||
}
|
||||
|
||||
// Check if the last value is still valid
|
||||
if (last.flip_y == flip_y and last.src[0] == source[0] and last.src[1] == source[1] and last.fovs[0] == fovs[0])
|
||||
if (last.flip_y == flip_y and last.src[0] == source[0] and last.src[1] == source[1] and last.fovs[0] == fovs[0] and last.fovs[1] == fovs[1])
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
if (last.gaze == gaze)
|
||||
|
||||
@@ -230,6 +230,12 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
|
||||
{
|
||||
U_LOG_I("Creating %d generic trackers", num_generic_trackers);
|
||||
|
||||
if (num_generic_trackers > generic_trackers.size())
|
||||
throw std::out_of_range(
|
||||
std::format("{} generic trackers is larger than maximum {}",
|
||||
num_generic_trackers,
|
||||
generic_trackers.size()));
|
||||
|
||||
for (int i = 0; i < num_generic_trackers; ++i)
|
||||
{
|
||||
auto dev = std::make_unique<wivrn_generic_tracker>(i, &hmd, *this);
|
||||
|
||||
Reference in New Issue
Block a user