Fix 32bits build

This commit is contained in:
Patrick Nicolas
2024-11-30 13:02:24 +01:00
parent bab3a23953
commit 9eacb3b881
5 changed files with 17 additions and 17 deletions
+6 -6
View File
@@ -25,7 +25,7 @@
#include <utility>
#include <vk_mem_alloc.h>
std::pair<vk::raii::Buffer, VmaAllocation> basic_allocation_traits<VkBuffer>::create(
std::pair<vk::raii::Buffer, VmaAllocation> basic_allocation_traits<vk::Buffer>::create(
vk::raii::Device & device,
const CreateInfo & buffer_info,
const VmaAllocationCreateInfo & alloc_info)
@@ -40,7 +40,7 @@ std::pair<vk::raii::Buffer, VmaAllocation> basic_allocation_traits<VkBuffer>::cr
return std::pair<vk::raii::Buffer, VmaAllocation>{vk::raii::Buffer{device, tmp}, allocation};
}
void basic_allocation_traits<VkBuffer>::destroy(
void basic_allocation_traits<vk::Buffer>::destroy(
vk::raii::Buffer & buffer,
VmaAllocation allocation,
void * mapped)
@@ -50,7 +50,7 @@ void basic_allocation_traits<VkBuffer>::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<vk::raii::Image, VmaAllocation> basic_allocation_traits<VkImage>::create(
std::pair<vk::raii::Image, VmaAllocation> basic_allocation_traits<vk::Image>::create(
vk::raii::Device & device,
const CreateInfo & image_info,
const VmaAllocationCreateInfo & alloc_info)
@@ -84,7 +84,7 @@ std::pair<vk::raii::Image, VmaAllocation> basic_allocation_traits<VkImage>::crea
return std::pair<vk::raii::Image, VmaAllocation>{vk::raii::Image{device, tmp}, allocation};
}
void basic_allocation_traits<VkImage>::destroy(
void basic_allocation_traits<vk::Image>::destroy(
vk::raii::Image & image,
VmaAllocation allocation,
void * mapped)
@@ -94,5 +94,5 @@ void basic_allocation_traits<VkImage>::destroy(
if (mapped)
vmaUnmapMemory(allocator, allocation);
vmaDestroyImage(allocator, image.release(), allocation);
vmaDestroyImage(allocator, VkImage(image.release()), allocation);
}
+4 -4
View File
@@ -36,7 +36,7 @@ struct basic_allocation_traits_base
};
template <>
struct basic_allocation_traits<VkBuffer> : basic_allocation_traits_base
struct basic_allocation_traits<vk::Buffer> : basic_allocation_traits_base
{
using CreateInfo = vk::BufferCreateInfo;
using NativeCreateInfo = CreateInfo::NativeType;
@@ -54,7 +54,7 @@ struct basic_allocation_traits<VkBuffer> : basic_allocation_traits_base
};
template <>
struct basic_allocation_traits<VkImage> : basic_allocation_traits_base
struct basic_allocation_traits<vk::Image> : 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<CType>;
using traits = basic_allocation_traits<T>;
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
+3 -3
View File
@@ -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,
+3 -3
View File
@@ -163,7 +163,7 @@ void wivrn_foveation_renderer::render_distortion_images(std::array<to_headset::f
.layerCount = 1},
});
for (size_t i = 0; i < im_barriers.size(); ++i)
im_barriers[i].image = images[i];
im_barriers[i].image = vk::Image(images[i]);
cmd_buf.pipelineBarrier(
vk::PipelineStageFlagBits::eTopOfPipe,
@@ -180,11 +180,11 @@ void wivrn_foveation_renderer::render_distortion_images(std::array<to_headset::f
std::array image_info{
vk::DescriptorImageInfo{
.imageView = image_views[eye],
.imageView = vk::ImageView(image_views[eye]),
.imageLayout = vk::ImageLayout::eGeneral,
},
vk::DescriptorImageInfo{
.imageView = image_views[eye + 2],
.imageView = vk::ImageView(image_views[eye + 2]),
.imageLayout = vk::ImageLayout::eGeneral,
},
};
+1 -1
View File
@@ -476,7 +476,7 @@ std::pair<bool, vk::Semaphore> 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