VulkanImage: fix VkImageSubresourceRange initialization

* Fixes segmentation fault due to unitialised struct

Signed-off-by: Lucchetto <lucchetto.tie@live.com>
This commit is contained in:
Lucchetto 2023-12-18 20:38:23 +01:00
parent 1a5609b861
commit 4858513a3b
No known key found for this signature in database
GPG Key ID: 85D0B724C86A61FF
1 changed files with 2 additions and 0 deletions

View File

@ -70,6 +70,7 @@ VulkanImage::~VulkanImage() {
}
void VulkanImage::barrierWrite(VkCommandBuffer buffer) const {
VkImageSubresourceRange subrange;
::memset(&subrange, 0, sizeof(VkImageSubresourceRange));
subrange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
subrange.layerCount = 1;
subrange.levelCount = 1;
@ -82,6 +83,7 @@ void VulkanImage::barrierRead(VkCommandBuffer buffer) const {
return;
}
VkImageSubresourceRange subrange;
::memset(&subrange, 0, sizeof(VkImageSubresourceRange));
subrange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
subrange.layerCount = 1;
subrange.levelCount = 1;