I have a number of textures which don't require an alpha channel. Currently, I'm loading these using the MTLPixelFormat
rgba8Unorm
option, but this seems somewhat wasteful. Is there an option I'm missing, or some other rationale behind omitting a format with 3 8-bit components for texture data?
I'm not sure if this is answerable because it would require knowing the intent of people at Apple, and we can't know that for sure. We can only guess.
One such guess is that they only support pixel formats that have direct hardware support on common GPUs. Note that a) part of Metal's design philosophy is to eliminate implicit work by the API and driver, which would include format conversions. Such work is left for the application code itself to do. And b) not all formats that they do support somewhere are supported everywhere. For example, why isn't BGR5A1Unorm
supported on macOS? It's surely convertible to BGRA8Unorm
but they don't.