* @brief Convert integer color value into a float value for the decoder. * * @param data The integer color value post-interpolation. * @param lns_mask If set treat lane as HDR (LNS) else LDR (unorm16). * * @return The float color value. */
| 64 | * @return The float color value. |
| 65 | */ |
| 66 | static inline vfloat4 decode_texel( |
| 67 | vint4 data, |
| 68 | vmask4 lns_mask |
| 69 | ) { |
| 70 | vint4 color_lns = vint4::zero(); |
| 71 | vint4 color_unorm = vint4::zero(); |
| 72 | |
| 73 | if (any(lns_mask)) |
| 74 | { |
| 75 | color_lns = lns_to_sf16(data); |
| 76 | } |
| 77 | |
| 78 | if (!all(lns_mask)) |
| 79 | { |
| 80 | color_unorm = unorm16_to_sf16(data); |
| 81 | } |
| 82 | |
| 83 | // Pick components and then convert to FP16 |
| 84 | vint4 datai = select(color_unorm, color_lns, lns_mask); |
| 85 | return float16_to_float(datai); |
| 86 | } |
| 87 | |
| 88 | /* See header for documentation. */ |
| 89 | void unpack_weights( |
no test coverage detected