texture error checking

This commit is contained in:
Greg Wells
2025-07-01 16:53:12 -04:00
parent 918d854062
commit 9c154c1eeb

View File

@@ -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);