mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-10 23:27:53 +00:00
a251600c8a
* engine: common: imagelib: add KTX2 support Adds basic KTX2 support for a few compressed formats. KTX2 essentially is a Vulkan-centric texture format that supports literally hundreds of pixel formats. For now only support for these is added: - `VK_FORMAT_BC4_UNORM_BLOCK` - `VK_FORMAT_BC4_SNORM_BLOCK` - `VK_FORMAT_BC5_UNORM_BLOCK` - `VK_FORMAT_BC5_SNORM_BLOCK` - `VK_FORMAT_BC6H_UFLOAT_BLOCK` - `VK_FORMAT_BC6H_SFLOAT_BLOCK` - `VK_FORMAT_BC7_UNORM_BLOCK` - `VK_FORMAT_BC7_SRGB_BLOCK` Adding more formats is relatively straightforward: - Copy format definition from `VkFormat` enum in `vulkan_core.h` - Add a new definition into `pixformat_t` enum. - Add format size calculation into `Image_ComputeSize()` While we're at it, also adds a few new formats to DDS: - BC4_UNORM -- PF_BC4_UNSIGNED - BC4_SNORM -- PF_BC4_SIGNED - BC5_UNORM -- PF_BC5_UNSIGNED - BC5_SNORM -- PF_BC5_SIGNED - BC7 is expanded into BC7_UNORM and BC7_SRGB ref_gl and ref_soft code is updated where it made sense. But not tested really. Support for these formats has been tested with ref_vk. * address spaces-vs-parentheses formatting where noticed * parenthesize sizeofs * move ktx2.h to imagelib as img_ktx2.h; massage it a bit * use SetBits() instead of |= * remove stale TODO comments |
||
---|---|---|
.. | ||
imagelib.h | ||
img_bmp.c | ||
img_bmp.h | ||
img_dds.c | ||
img_dds.h | ||
img_ktx2.c | ||
img_ktx2.h | ||
img_main.c | ||
img_png.c | ||
img_png.h | ||
img_quant.c | ||
img_tga.c | ||
img_tga.h | ||
img_utils.c | ||
img_wad.c |