zink: use actual const for const offset
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 27 May 2021 09:17:01 +0000 (11:17 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 27 May 2021 11:16:38 +0000 (11:16 +0000)
commit761383720617b46617bd278ec6015c9520f43f5c
tree65299496e3614baa1f6fdc28567f56c0c4783c69
parent3179daf61393ee8a0fac943b94335b114e34873b
zink: use actual const for const offset

When we emit constants, we don't know what type they'll be used as, so
we just emit them as uint, and then bitcast them to whatever we need.

But this isn't a good idea for ConstOffset, which needs to actually be a
const value, and not a const value bitcasted. So we sadly have to
open-code the const emitting here to avoid the problem.

Fixes: e963d35efe1 ("zink: use ConstOffset for nir_tex_src_offset")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4831
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11032>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c