`raw` and `generate-mipmap` conflict, but no documentation on it
Hi,
I'm using ktx create to make mipmaps at runtime in development builds. As a result, in-game, we already have the image decoded from their source files (PNGs in this case), so we just want to send them to ktx with the --raw option.
However, doing so logs the following error:
ktx create fatal: Conflicting options: --generate-mipmap cannot be used with --raw. See 'ktx create --help'.
ktx create --help doesn't saw explicitly that raw and generate-mipmap can't be used together. To be totally clear, I am also providing width and height as you'd expect.
here is a minimal invocation which creates the warning:
ktx create --stdin --stdout --format R8G8B8A8_SRGB --raw --width 1 --height 1 --generate-mipmap
My questions are:
- Why not? It seems with width+height, this should be sufficient for ktx create.
- If there's a reason why not, can it be more clearly documented?
Thank you so much for the help and for making the excellent tool! For now, I've just kept the original data in-memory in debug builds and use that without issue, so my concern isn't pressing
I apologize for the failure to document that you cannot use --generate-mipmap with --raw-. I will fix it soon. As for the reason, it is due to lack of implementation. --generate-mipmap is handled by the templated Image class. What is missing is a plug-in for the companion ImageInput class that creates an instance of Image from a raw file. Such an plug-in would need the VkFormat of the raw file as well as the size in order to successfully create an Image.
I'd be delighted to accept a PR to add such an input plug-in.
Don't apologize -- I'd love to help with that work. I'm mostly a Rust developer, but I'll see if I can contribute
Don't apologize -- I'd love to help with that work. I'm mostly a Rust developer, but I'll see if I can contribute
I'll be grateful for a contribution. One thing to note is that an ImageInput plug-in for raw must be explicitly called by the application when the --raw option is specified as there is no format information in the file. All the existing plug-ins are in a list that is cycled through on an image file open request. They can recognize the format they support from information in the file.