From 9c154c1eebfd0982e6792e4322cfaf96291395a1 Mon Sep 17 00:00:00 2001 From: Greg Wells Date: Tue, 1 Jul 2025 16:53:12 -0400 Subject: [PATCH] texture error checking --- projects/apis/vulkan/src/textures/vulkan_texture.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/apis/vulkan/src/textures/vulkan_texture.c b/projects/apis/vulkan/src/textures/vulkan_texture.c index 4c48a71..ac98ef2 100644 --- a/projects/apis/vulkan/src/textures/vulkan_texture.c +++ b/projects/apis/vulkan/src/textures/vulkan_texture.c @@ -163,8 +163,9 @@ gnReturnCode createTexture(gnTexture texture, gnDevice device, const gnTextureIn else imageInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT; - if (vkCreateImage(device->outputDevice->device, &imageInfo, NULL, &texture->texture->image.image) != VK_SUCCESS) - return GN_FAILED_TO_CREATE_IMAGE; + VkResult res = vkCreateImage(device->outputDevice->device, &imageInfo, NULL, &texture->texture->image.image); + if (res == VK_ERROR_FORMAT_NOT_SUPPORTED) return GN_UNSUPPORTED_IMAGE_FORMAT; + else if (res != VK_SUCCESS) return GN_FAILED_TO_CREATE_IMAGE; VkMemoryRequirements memRequirements; vkGetImageMemoryRequirements(device->outputDevice->device, texture->texture->image.image, &memRequirements);