Use semantic wrapping where appropriate for class initialiser lists

This commit is contained in:
Billy Laws
2021-10-30 20:30:34 +01:00
committed by PixelyIon
parent 6b33268d85
commit ef10d3d394
27 changed files with 155 additions and 37 deletions

View File

@ -16,11 +16,18 @@ namespace skyline::gpu::memory {
VmaAllocation vmaAllocation;
vk::Buffer vkBuffer;
constexpr StagingBuffer(u8 *pointer, size_t size, VmaAllocator vmaAllocator, vk::Buffer vkBuffer, VmaAllocation vmaAllocation) : vmaAllocator(vmaAllocator), vkBuffer(vkBuffer), vmaAllocation(vmaAllocation), span(pointer, size) {}
constexpr StagingBuffer(u8 *pointer, size_t size, VmaAllocator vmaAllocator, vk::Buffer vkBuffer, VmaAllocation vmaAllocation)
: vmaAllocator(vmaAllocator),
vkBuffer(vkBuffer),
vmaAllocation(vmaAllocation),
span(pointer, size) {}
StagingBuffer(const StagingBuffer &) = delete;
constexpr StagingBuffer(StagingBuffer &&other) : vmaAllocator(std::exchange(other.vmaAllocator, nullptr)), vmaAllocation(std::exchange(other.vmaAllocation, nullptr)), vkBuffer(std::exchange(other.vkBuffer, {})) {}
constexpr StagingBuffer(StagingBuffer &&other)
: vmaAllocator(std::exchange(other.vmaAllocator, nullptr)),
vmaAllocation(std::exchange(other.vmaAllocation, nullptr)),
vkBuffer(std::exchange(other.vkBuffer, {})) {}
StagingBuffer &operator=(const StagingBuffer &) = delete;
@ -42,13 +49,24 @@ namespace skyline::gpu::memory {
VmaAllocation vmaAllocation;
vk::Image vkImage;
constexpr Image(VmaAllocator vmaAllocator, vk::Image vkImage, VmaAllocation vmaAllocation) : vmaAllocator(vmaAllocator), vkImage(vkImage), vmaAllocation(vmaAllocation) {}
constexpr Image(VmaAllocator vmaAllocator, vk::Image vkImage, VmaAllocation vmaAllocation)
: vmaAllocator(vmaAllocator),
vkImage(vkImage),
vmaAllocation(vmaAllocation) {}
constexpr Image(u8 *pointer, VmaAllocator vmaAllocator, vk::Image vkImage, VmaAllocation vmaAllocation) : pointer(pointer), vmaAllocator(vmaAllocator), vkImage(vkImage), vmaAllocation(vmaAllocation) {}
constexpr Image(u8 *pointer, VmaAllocator vmaAllocator, vk::Image vkImage, VmaAllocation vmaAllocation)
: pointer(pointer),
vmaAllocator(vmaAllocator),
vkImage(vkImage),
vmaAllocation(vmaAllocation) {}
Image(const Image &) = delete;
constexpr Image(Image &&other) : pointer(std::exchange(other.pointer, nullptr)), vmaAllocator(std::exchange(other.vmaAllocator, nullptr)), vmaAllocation(std::exchange(other.vmaAllocation, nullptr)), vkImage(std::exchange(other.vkImage, {})) {}
constexpr Image(Image &&other)
: pointer(std::exchange(other.pointer, nullptr)),
vmaAllocator(std::exchange(other.vmaAllocator, nullptr)),
vmaAllocation(std::exchange(other.vmaAllocation, nullptr)),
vkImage(std::exchange(other.vkImage, {})) {}
Image &operator=(const Image &) = delete;