Archived
1
Fork 0

Fix two Vulkan validation errors for texture loading

* Now TransferSrc and TransferDst are defined for asset textures, specifically for loading image data into it and generating mipmaps from it.
This commit is contained in:
Joshua Goins 2022-02-07 09:57:54 -05:00
parent aa8968625b
commit 48348ac09f

View file

@ -223,7 +223,7 @@ std::unique_ptr<Texture> load_texture(const prism::path path) {
createInfo.width = width;
createInfo.height = height;
createInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
createInfo.usage = GFXTextureUsage::Sampled;
createInfo.usage = GFXTextureUsage::Sampled | GFXTextureUsage::TransferDst | GFXTextureUsage::TransferSrc; // src and dst are needed for copy tex data -> image and mipmap gen (from image data) respectively
if(should_generate_mipmaps)
createInfo.mip_count = std::floor(std::log2(std::max(width, height))) + 1;