MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / getUncompressedFormat

Function getUncompressedFormat

lib/astc_codec.cpp:244–255  ·  view source on GitHub ↗

* @memberof ktxTexture * @internal * @ingroup reader * @~English * @brief Should be used to get uncompressed version of ASTC VkFormat * * The decompressed format is calculated from corresponding ASTC format. There are * only 3 possible options currently supported. RGBA8, SRGBA8 and RGBA32. * * @return Uncompressed version of VKFormat for a specific ASTC VkFormat */

Source from the content-addressed store, hash-verified

242 * @return Uncompressed version of VKFormat for a specific ASTC VkFormat
243 */
244inline VkFormat getUncompressedFormat(ktxTexture2* This) noexcept {
245 uint32_t* BDB = This->pDfd + 1;
246
247 if (KHR_DFDSVAL(BDB, 0, QUALIFIERS) & KHR_DF_SAMPLE_DATATYPE_FLOAT) {
248 return VK_FORMAT_R32G32B32A32_SFLOAT;
249 } else {
250 if (khr_df_transfer_e(KHR_DFDVAL(BDB, TRANSFER) == KHR_DF_TRANSFER_SRGB))
251 return VK_FORMAT_R8G8B8A8_SRGB;
252 else
253 return VK_FORMAT_R8G8B8A8_UNORM;
254 }
255}
256
257struct decompression_workload
258{

Callers 1

ktxTexture2_DecodeAstcFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected