Skip to content

mesa: Simplify UNORM16 to UNORM8 conversions in the ASTC decoder

Nanley Chery requested to merge nchery/mesa:perf/astc-top-8-bits into main

In many cases, the ASTC LDR decoder outputs to UNORM8 by doing the following conversions: UNORM16 -> FP16 -> UNORM8. This doesn't seem to be defined by any specification and is costly according to perf profiles. For better performance, we convert UNORM16 to UNORM8 by simply storing/keeping the top 8 bits.

In a texture upload test made by @tpalli and adapted for benchmarking by @kwg, this decreases the upload time by about 34% or 13% depending on the color space.

/cc @jljusten

Merge request reports