lavapipe: more accurately check for caps
This MR fixes a few details, some benign (but useful because it introduce a utility we can reuse), and two that actually matters:
-
We accidentally subtract 8 from the enum-value we're checking. That makes us check an unrelated cap, and we're exposing a way too large value.
-
Lavapipe doesn't yet actually correctly support int16, because the NIR-path of Gallivm is missing an important detail.
This affects Zink when trying to add int16 support, because we can't really trust this feature from Lavapipe. So let's fix that.