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

Function astcProfile

lib/astc_codec.cpp:196–213  ·  view source on GitHub ↗

* @memberof ktxTexture * @internal * @ingroup reader writer * @~English * @brief Creates valid ASTC decoder profile from VkFormat * * @return Valid astc_profile from VkFormat */

Source from the content-addressed store, hash-verified

194 * @return Valid astc_profile from VkFormat
195 */
196static astcenc_profile
197astcProfile(bool sRGB, bool ldr) {
198
199 if (sRGB && ldr)
200 return ASTCENC_PRF_LDR_SRGB;
201 else if (!sRGB) {
202 if (ldr)
203 return ASTCENC_PRF_LDR;
204 else
205 return ASTCENC_PRF_HDR;
206 }
207 // TODO: Add support for the following
208 // KTX_PACK_ASTC_ENCODER_ACTION_COMP_HDR_RGB_LDR_ALPHA; currently not supported
209
210 assert(ldr && "HDR sRGB profile not supported");
211
212 return ASTCENC_PRF_LDR_SRGB;
213}
214
215//************************************************************************
216//* Decoder functions *

Callers 2

ktxTexture2_DecodeAstcFunction · 0.85

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected