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:
parent
aa8968625b
commit
48348ac09f
1 changed files with 1 additions and 1 deletions
|
@ -223,7 +223,7 @@ std::unique_ptr<Texture> load_texture(const prism::path path) {
|
||||||
createInfo.width = width;
|
createInfo.width = width;
|
||||||
createInfo.height = height;
|
createInfo.height = height;
|
||||||
createInfo.format = GFXPixelFormat::R8G8B8A8_UNORM;
|
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)
|
if(should_generate_mipmaps)
|
||||||
createInfo.mip_count = std::floor(std::log2(std::max(width, height))) + 1;
|
createInfo.mip_count = std::floor(std::log2(std::max(width, height))) + 1;
|
||||||
|
|
Reference in a new issue