Skip to content

util/format,nir: Fix some bugs and add a format conversion helper

Faith Ekstrand requested to merge gfxstrand/mesa:nir/format-pack into main

This MR adds a NIR version of util_format_[un]pack_rgba(). We've already got a bunch of format conversion helpers in NIR but this adds a pair of helpers that take data and a pipe_format() and do it all. I also added unit tests for the new helper that take advantage of NIR's constant folding to compare the NIR helper with the helpers in util/.

Unfortunately, as happens with these things, I found about a half dozen bugs in the core format conversion code. 🤦🏻 So let's fix those while we're at it.

Tagging @idr as a likely suspect to review.

Merge request reports