MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / validate_compression_swz

Function validate_compression_swz

Source/astcenc_entry.cpp:332–348  ·  view source on GitHub ↗

* @brief Validate single channel compression swizzle. * * @param swizzle The swizzle to check. * * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure. */

Source from the content-addressed store, hash-verified

330 * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
331 */
332static astcenc_error validate_compression_swz(
333 astcenc_swz swizzle
334) {
335 // Not all enum values are handled; SWZ_Z is invalid for compression
336 switch (static_cast<int>(swizzle))
337 {
338 case ASTCENC_SWZ_R:
339 case ASTCENC_SWZ_G:
340 case ASTCENC_SWZ_B:
341 case ASTCENC_SWZ_A:
342 case ASTCENC_SWZ_0:
343 case ASTCENC_SWZ_1:
344 return ASTCENC_SUCCESS;
345 default:
346 return ASTCENC_ERR_BAD_SWIZZLE;
347 }
348}
349
350/**
351 * @brief Validate overall compression swizzle.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected