Reputation: 1171
I've recently tried using Block-Compressed image formats in Vulkan and found that when I switch up my code to use a compressed image format, I get a complete garbage image on render.
Using NVIDIA Nsight also shows the same image I see as well.
I uploading the data by copying the raw SRGB pixels to a staging buffer and initiate a vkCmdCopyBufferImage to the target image. I get this output if the VkImage
and VkImageView
are of the format: VK_FORMAT_R8G8B8A8_SRGB
But when I changed the format to VK_FORMAT_BC7_SRGB_BLOCK
. I get this image:
I was wondering if I need to do any conversions before copying the data to the image or am I just handling compressed textures wrong
Pastebin for upload code: https://pastebin.com/yrmRrQGp
Upvotes: 1
Views: 184
Reputation: 474116
If you want to use a compressed image format, you must provide image data that has been compressed in accord with that format. You cannot just change the image format and expect everything to work.
Upvotes: 3