Skip to content

Commit

Permalink
VulkanImage: fix VkImageSubresourceRange initialization
Browse files Browse the repository at this point in the history
    * Fixes segmentation fault due to unitialised struct

Signed-off-by: Lucchetto <lucchetto.tie@live.com>
  • Loading branch information
Lucchetto committed Dec 18, 2023
1 parent 1a5609b commit 4858513
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/backend/vulkan/component/VulkanImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 4858513

Please sign in to comment.