From bf447c1d1d7dcbdef7ec0a807074791cd33ee64b Mon Sep 17 00:00:00 2001 From: Brandon Mak Date: Sun, 11 Sep 2022 20:03:11 +0800 Subject: [PATCH] Auto stash before merge of "SP3-4-editor" and "origin/SP3-4-editor" --- SHADE_Engine/src/Graphics/Images/SHVkImage.cpp | 10 +++++++++- SHADE_Engine/src/Graphics/Images/SHVkImage.h | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/SHADE_Engine/src/Graphics/Images/SHVkImage.cpp b/SHADE_Engine/src/Graphics/Images/SHVkImage.cpp index 11fbe5dd..003e36ec 100644 --- a/SHADE_Engine/src/Graphics/Images/SHVkImage.cpp +++ b/SHADE_Engine/src/Graphics/Images/SHVkImage.cpp @@ -11,6 +11,8 @@ namespace SHADE SHVkImage::SHVkImage( VmaAllocator const& vmaAllocator, SHImageCreateParams const& imageDetails, + unsigned char* data, + uint32_t dataSize, VmaMemoryUsage memUsage, VmaAllocationCreateFlags allocFlags ) noexcept @@ -64,7 +66,13 @@ namespace SHADE VmaAllocationInfo allocInfo{}; VkImage tempImage; - vmaCreateImage(vmaAllocator, &imageCreateInfo.operator VkImageCreateInfo&(), &allocCreateInfo, &tempImage, &alloc, &allocInfo); + auto result = vmaCreateImage(vmaAllocator, &imageCreateInfo.operator VkImageCreateInfo&(), &allocCreateInfo, &tempImage, &alloc, &allocInfo); + + if (result != VK_SUCCESS) + SHVulkanDebugUtil::ReportVkError(vk::Result(result), "Failed to create vulkan image. "); + else + SHVulkanDebugUtil::ReportVkSuccess("Successfully created image. "); + vkImage = tempImage; //if (allocFlags & ) diff --git a/SHADE_Engine/src/Graphics/Images/SHVkImage.h b/SHADE_Engine/src/Graphics/Images/SHVkImage.h index 53066075..48ad1b75 100644 --- a/SHADE_Engine/src/Graphics/Images/SHVkImage.h +++ b/SHADE_Engine/src/Graphics/Images/SHVkImage.h @@ -86,10 +86,11 @@ namespace SHADE /*-----------------------------------------------------------------------*/ SHVkImage(void) noexcept = default; - // TODO: Might need to add flags to parameters SHVkImage( VmaAllocator const& vmaAllocator, SHImageCreateParams const& imageDetails, + unsigned char* data, + uint32_t dataSize, VmaMemoryUsage memUsage, VmaAllocationCreateFlags allocFlags ) noexcept;