NVIDIAGameWorks / nvrhi

MIT License
832 stars 97 forks source link

Add BGRX8 format support #40

Open null77 opened 12 months ago

null77 commented 12 months ago

This format is useful for interop between NVRHI and some other APIs (in my case SDL). It would be useful to avoid custom code to translate pixel formats or having to "fake" the format via BGRA8.

BGRX8 is supported in Vulkan and D3D (DXGI), and doesn't exist in Metal. It seems straight-forward to add to D3D and Vulkan, using the existing format tables, and in Metal NVRHI can return no support via the mechanism to indicate there's no support for a particular format (Device::queryFormatSupport).

Would this be an acceptable new feature? If so I'm happy to put together a PR.

null77 commented 12 months ago

My bad, looks like the format doesn't exist in Vulkan. Probably isn't worth supporting it directly, but I'll leave it open in case it's something worth doing.