* @brief Swizzle a texel into a new arrangement. * * @param data The source RGBA vector to swizzle. * @param swz The swizzle to use. */
| 106 | * @param swz The swizzle to use. |
| 107 | */ |
| 108 | static vfloat4 swz_texel( |
| 109 | vfloat4 data, |
| 110 | const astcenc_swizzle& swz |
| 111 | ) { |
| 112 | ASTCENC_ALIGNAS float datas[6]; |
| 113 | |
| 114 | storea(data, datas); |
| 115 | datas[ASTCENC_SWZ_0] = 0.0f; |
| 116 | datas[ASTCENC_SWZ_1] = 1.0f; |
| 117 | |
| 118 | return vfloat4(datas[swz.r], datas[swz.g], datas[swz.b], datas[swz.a]); |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * @brief Encode a texel that is entirely LDR linear. |