spirv: Improve the 'ID is the wrong kind of value' error messages
Include the expected and actual values in the errors -- since
very frequently we care about them to diagnose issues.
Since these helpers are meant to be inlined, also pull the
failure code out of the way into a separate function (not meant to
be inlined). This way, extra calls to to_string will not harm
the existing client code size. Verified this with GCC release build.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22977>