Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -293,9 +293,6 @@ std::optional<std::chrono::system_clock::time_point> from_iso8601(const std::str
|
||||
if (strptime(timestamp.c_str(), "%FT%H:%M:%S%z", &t) == nullptr)
|
||||
return std::nullopt;
|
||||
|
||||
// Convert from local time to UTC
|
||||
t.tm_sec += t.tm_gmtoff;
|
||||
|
||||
return std::chrono::system_clock::from_time_t(mktime(&t));
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ static bool comp_wivrn_init_post_vulkan(struct comp_target * ct, uint32_t prefer
|
||||
cn->wivrn_bundle->device,
|
||||
{
|
||||
.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer,
|
||||
.queueFamilyIndex = vk->queue_family_index,
|
||||
.queueFamilyIndex = vk->main_queue.family_index,
|
||||
});
|
||||
cn->wivrn_bundle->name(cn->command_pool, "comp target command pool");
|
||||
}
|
||||
@@ -584,8 +584,8 @@ static VkResult comp_wivrn_present(struct comp_target * ct,
|
||||
.dstAccessMask = vk::AccessFlagBits::eMemoryWrite,
|
||||
.oldLayout = vk::ImageLayout::eTransferSrcOptimal,
|
||||
.newLayout = vk::ImageLayout::eVideoEncodeSrcKHR,
|
||||
.srcQueueFamilyIndex = vk->queue_family_index,
|
||||
.dstQueueFamilyIndex = vk->encode_queue_family_index,
|
||||
.srcQueueFamilyIndex = vk->main_queue.family_index,
|
||||
.dstQueueFamilyIndex = vk->encode_queue.family_index,
|
||||
.image = psc_image.image,
|
||||
.subresourceRange = {.aspectMask = vk::ImageAspectFlagBits::eColor,
|
||||
.baseMipLevel = 0,
|
||||
|
||||
@@ -64,6 +64,11 @@ public:
|
||||
wivrn_connection(const wivrn_connection &) = delete;
|
||||
wivrn_connection & operator=(const wivrn_connection &) = delete;
|
||||
|
||||
bool has_stream() const
|
||||
{
|
||||
return stream;
|
||||
}
|
||||
|
||||
bool is_active()
|
||||
{
|
||||
return active;
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "xrt/xrt_defines.h"
|
||||
|
||||
#include <array>
|
||||
#include <charconv>
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
#include <ranges>
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "xrt/xrt_defines.h"
|
||||
#include "xrt/xrt_device.h"
|
||||
|
||||
#include "utils/singleton.h"
|
||||
#include <mutex>
|
||||
#include <vulkan/vulkan_raii.hpp>
|
||||
|
||||
struct render_resources;
|
||||
@@ -34,7 +36,7 @@ namespace wivrn
|
||||
struct clock_offset;
|
||||
struct wivrn_vk_bundle;
|
||||
|
||||
class wivrn_foveation
|
||||
class wivrn_foveation : public singleton<wivrn_foveation>
|
||||
{
|
||||
std::mutex mutex;
|
||||
|
||||
@@ -53,8 +55,8 @@ class wivrn_foveation
|
||||
|
||||
vk::raii::CommandPool command_pool;
|
||||
vk::raii::CommandBuffer cmd;
|
||||
buffer_allocation gpu_buffer;
|
||||
buffer_allocation host_buffer;
|
||||
vk::Buffer gpu_buffer = nullptr;
|
||||
|
||||
// parameters used for last computation
|
||||
struct P
|
||||
@@ -81,6 +83,8 @@ public:
|
||||
void update_foveation_center_override(const from_headset::override_foveation_center &);
|
||||
std::array<to_headset::foveation_parameter, 2> get_parameters();
|
||||
|
||||
vk::Buffer get_gpu_buffer();
|
||||
|
||||
vk::CommandBuffer update_foveation_buffer(
|
||||
vk::Buffer target,
|
||||
bool flip_y,
|
||||
|
||||
@@ -41,14 +41,13 @@ xrt_result_t wivrn_hmd::get_visibility_mask(xrt_visibility_mask_type type, uint3
|
||||
{
|
||||
static_assert(sizeof(uint32_t) == sizeof(decltype(from_headset::visibility_mask_changed::mask::indices)::value_type));
|
||||
static_assert(sizeof(xrt_vec2) == sizeof(decltype(from_headset::visibility_mask_changed::mask::vertices)::value_type));
|
||||
type = xrt_visibility_mask_type((unsigned int)type - 1); // enum values start at 1
|
||||
const auto visibility_mask = this->visibility_mask.lock();
|
||||
if (type >= from_headset::visibility_mask_changed::num_types or view_index >= 2 or not(*visibility_mask)[view_index])
|
||||
if (type > from_headset::visibility_mask_changed::num_types or view_index >= 2 or not(*visibility_mask)[view_index])
|
||||
{
|
||||
*mask = (xrt_visibility_mask *)calloc(1, sizeof(xrt_visibility_mask));
|
||||
return XRT_SUCCESS;
|
||||
}
|
||||
const auto & in_mask = (*(*visibility_mask)[view_index])[int(type)];
|
||||
const auto & in_mask = (*(*visibility_mask)[view_index])[int(type - 1)];
|
||||
size_t index_size = in_mask.indices.size() * sizeof(uint32_t);
|
||||
size_t vertex_size = in_mask.vertices.size() * sizeof(xrt_vec2);
|
||||
*mask = (xrt_visibility_mask *)calloc(1, sizeof(xrt_visibility_mask) + index_size + vertex_size);
|
||||
|
||||
@@ -338,7 +338,7 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
|
||||
self->feedback_csv.open(dump_file);
|
||||
}
|
||||
|
||||
self->thread = std::jthread(&wivrn_session::run, self.get());
|
||||
self->thread = std::jthread([s = self.get()](auto stop_token) { return s->run(stop_token); });
|
||||
*out_xsysd = self.release();
|
||||
return XRT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -197,6 +197,10 @@ public:
|
||||
void operator()(to_monado::disconnect &&);
|
||||
void operator()(to_monado::set_bitrate &&);
|
||||
|
||||
bool has_stream()
|
||||
{
|
||||
return connection->has_stream();
|
||||
}
|
||||
template <typename T>
|
||||
void send_stream(T && packet)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user