Open syoyo opened 4 years ago
Thanks for reporting this. I'll take a look into this.
As with my Vulkan samples, I'll replace gli with libktx. This gives more control over how to handle texture loading failures.
What would be your favorite way of handling texture loading failures? Right now the ktx loading will also just assert, and I think showing some kind of message or gracefully exiting with a proper output would be sufficient.
I'll replace gli with libktx
Awesome!
What would be your favorite way of handling texture loading failures?
Less assertion as much as possible(so we may better to check if a texture file exists before libktx API call). Simply print an error when failed to load a texture(and/or file not found), then exit an app is appreciated.
https://github.com/SaschaWillems/Vulkan-glTF-PBR/blob/master/base/VulkanTexture.hpp#L89
Creating
gli::texture2d
orgli::texture_cube
directly fromgli::load
triggers assertion(debug build) or gives undefined behaviour(usually this results to a Vulkan error) in the constructor when failed to load a texture file. (It does not create empty gli texture)Here is an example when failed to load a texture.
Tthis is an issue of gli, so it should be fixed in gli library. For a while, we can use the following workaround:
Related to: https://github.com/g-truc/gli/issues/174