diff --git a/common/vk/allocation.cpp b/common/vk/allocation.cpp index 8048374b..08395780 100644 --- a/common/vk/allocation.cpp +++ b/common/vk/allocation.cpp @@ -25,7 +25,7 @@ #include #include -std::pair basic_allocation_traits::create( +std::pair basic_allocation_traits::create( vk::raii::Device & device, const CreateInfo & buffer_info, const VmaAllocationCreateInfo & alloc_info) @@ -40,7 +40,7 @@ std::pair basic_allocation_traits::cr return std::pair{vk::raii::Buffer{device, tmp}, allocation}; } -void basic_allocation_traits::destroy( +void basic_allocation_traits::destroy( vk::raii::Buffer & buffer, VmaAllocation allocation, void * mapped) @@ -50,7 +50,7 @@ void basic_allocation_traits::destroy( if (mapped) vmaUnmapMemory(allocator, allocation); - vmaDestroyBuffer(allocator, buffer.release(), allocation); + vmaDestroyBuffer(allocator, VkBuffer(buffer.release()), allocation); } void * basic_allocation_traits_base::map(VmaAllocation allocation) @@ -69,7 +69,7 @@ void basic_allocation_traits_base::unmap(VmaAllocation allocation) vmaUnmapMemory(allocator, allocation); } -std::pair basic_allocation_traits::create( +std::pair basic_allocation_traits::create( vk::raii::Device & device, const CreateInfo & image_info, const VmaAllocationCreateInfo & alloc_info) @@ -84,7 +84,7 @@ std::pair basic_allocation_traits::crea return std::pair{vk::raii::Image{device, tmp}, allocation}; } -void basic_allocation_traits::destroy( +void basic_allocation_traits::destroy( vk::raii::Image & image, VmaAllocation allocation, void * mapped) @@ -94,5 +94,5 @@ void basic_allocation_traits::destroy( if (mapped) vmaUnmapMemory(allocator, allocation); - vmaDestroyImage(allocator, image.release(), allocation); + vmaDestroyImage(allocator, VkImage(image.release()), allocation); } diff --git a/common/vk/allocation.h b/common/vk/allocation.h index 58bd9f19..e47242be 100644 --- a/common/vk/allocation.h +++ b/common/vk/allocation.h @@ -36,7 +36,7 @@ struct basic_allocation_traits_base }; template <> -struct basic_allocation_traits : basic_allocation_traits_base +struct basic_allocation_traits : basic_allocation_traits_base { using CreateInfo = vk::BufferCreateInfo; using NativeCreateInfo = CreateInfo::NativeType; @@ -54,7 +54,7 @@ struct basic_allocation_traits : basic_allocation_traits_base }; template <> -struct basic_allocation_traits : basic_allocation_traits_base +struct basic_allocation_traits : basic_allocation_traits_base { using CreateInfo = vk::ImageCreateInfo; using NativeCreateInfo = CreateInfo::NativeType; @@ -76,7 +76,7 @@ class basic_allocation { public: using CType = T::CType; - using traits = basic_allocation_traits; + using traits = basic_allocation_traits; using CreateInfo = traits::CreateInfo; using NativeCreateInfo = CreateInfo::NativeType; using RaiiType = traits::RaiiType; @@ -95,7 +95,7 @@ public: operator CType() { - return *resource; + return CType(*resource); } operator bool() const diff --git a/server/driver/wivrn_comp_target.cpp b/server/driver/wivrn_comp_target.cpp index dbeba657..409e5006 100644 --- a/server/driver/wivrn_comp_target.cpp +++ b/server/driver/wivrn_comp_target.cpp @@ -250,8 +250,8 @@ static VkResult create_images(struct wivrn_comp_target * cn, vk::ImageUsageFlags .layerCount = 2, }, }); - cn->images[i].view = *item.image_view_y; - cn->images[i].view_cbcr = *item.image_view_cbcr; + cn->images[i].view = VkImageView(*item.image_view_y); + cn->images[i].view_cbcr = VkImageView(*item.image_view_cbcr); } cn->psc.fence = vk::raii::Fence(device, vk::FenceCreateInfo{.flags = vk::FenceCreateFlagBits::eSignaled}); @@ -505,7 +505,7 @@ static VkResult comp_wivrn_present(struct comp_target * ct, struct vk_bundle * vk = get_vk(cn); auto res = cn->wivrn_bundle->device.waitForFences(*cn->psc.fence, true, UINT64_MAX); - vk::Semaphore wait_semaphore = cn->semaphores.render_complete; + vk::Semaphore wait_semaphore(cn->semaphores.render_complete); vk::PipelineStageFlags wait_stage = vk::PipelineStageFlagBits::eTransfer; vk::SubmitInfo submit_info{ .waitSemaphoreCount = 1, diff --git a/server/driver/wivrn_foveation.cpp b/server/driver/wivrn_foveation.cpp index 38e61dab..68fc4d49 100644 --- a/server/driver/wivrn_foveation.cpp +++ b/server/driver/wivrn_foveation.cpp @@ -163,7 +163,7 @@ void wivrn_foveation_renderer::render_distortion_images(std::array wivrn::video_encoder_vulkan::present_image(vk::Im .pImageMemoryBarriers = &video_barrier, }); - auto it = image_views.find(src_yuv); + auto it = image_views.find(VkImage(src_yuv)); if (it != image_views.end()) image_view = *it->second; else