aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/vulkan_common/vulkan_wrapper.h
diff options
context:
space:
mode:
authordarktux <darktux@y2nlvhmmk5jnsvechppxnbyzmmv3vbl7dvzn6ltwcdbpgxixp3clkgqd.onion>2024-04-05 01:58:30 +0200
committerBriar <205427297+icybriarr@users.noreply.github.com>2025-04-04 03:40:48 +0200
commit492d3856e8e20d7c939d404fda6eab890757d8eb (patch)
tree7e191b9b800c802573dca3aca87f9b68964b2e16 /src/video_core/vulkan_common/vulkan_wrapper.h
parent5af02a5cea7b64ede1ad1be1ea614e134c3d0db7 (diff)
Vulkan validation error fix.
Different image usage flags between image creation and image view creation.
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_wrapper.h')
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.h b/src/video_core/vulkan_common/vulkan_wrapper.h
index 757f3c8afb..1bb8a47bdf 100644
--- a/src/video_core/vulkan_common/vulkan_wrapper.h
+++ b/src/video_core/vulkan_common/vulkan_wrapper.h
@@ -623,9 +623,10 @@ public:
class Image {
public:
- explicit Image(VkImage handle_, VkDevice owner_, VmaAllocator allocator_,
- VmaAllocation allocation_, const DeviceDispatch& dld_) noexcept
- : handle{handle_}, owner{owner_}, allocator{allocator_},
+ explicit Image(VkImage handle_, VkImageUsageFlags usage_, VkDevice owner_,
+ VmaAllocator allocator_, VmaAllocation allocation_,
+ const DeviceDispatch& dld_) noexcept
+ : handle{handle_}, usage{usage_}, owner{owner_}, allocator{allocator_},
allocation{allocation_}, dld{&dld_} {}
Image() = default;
@@ -633,12 +634,13 @@ public:
Image& operator=(const Image&) = delete;
Image(Image&& rhs) noexcept
- : handle{std::exchange(rhs.handle, nullptr)}, owner{rhs.owner}, allocator{rhs.allocator},
- allocation{rhs.allocation}, dld{rhs.dld} {}
+ : handle{std::exchange(rhs.handle, nullptr)}, usage{rhs.usage}, owner{rhs.owner},
+ allocator{rhs.allocator}, allocation{rhs.allocation}, dld{rhs.dld} {}
Image& operator=(Image&& rhs) noexcept {
Release();
handle = std::exchange(rhs.handle, nullptr);
+ usage = rhs.usage;
owner = rhs.owner;
allocator = rhs.allocator;
allocation = rhs.allocation;
@@ -665,10 +667,15 @@ public:
void SetObjectNameEXT(const char* name) const;
+ [[nodiscard]] VkImageUsageFlags UsageFlags() const noexcept {
+ return usage;
+ }
+
private:
void Release() const noexcept;
VkImage handle = nullptr;
+ VkImageUsageFlags usage{};
VkDevice owner = nullptr;
VmaAllocator allocator = nullptr;
VmaAllocation allocation = nullptr;