spirv: Improve the 'ID is the wrong kind of value' error messages
authorCaio Oliveira <caio.oliveira@intel.com>
Fri, 12 May 2023 00:05:26 +0000 (17:05 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 17 May 2023 22:58:10 +0000 (22:58 +0000)
commit7adf6c75efa215d59d466800ddd7a90065157d8b
treeb9550f79dd03aee0762afe1d57d9b2cb83a465ed
parent1a89b1a3012d98586fa6e9fbd85516e2f67f6817
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>
src/compiler/spirv/spirv_to_nir.c
src/compiler/spirv/vtn_private.h