zink: clean up const-value handling for get_ssbo_size
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 26 Aug 2021 09:12:23 +0000 (11:12 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 27 Aug 2021 18:43:31 +0000 (18:43 +0000)
commit2b82f2b78b151b90e1e713b29693e845325493ae
tree7525cdcd0936cade6493f0c075c56c20400c1b02
parent3e22fc27af95e80e13b06c389bf843d7315b6996
zink: clean up const-value handling for get_ssbo_size

nir_src_as_const_value can return null pointers, and in other places we
at least assert for this. So let's do that here as well, which makes
Coverity a bit less paranoid.

While we're at it, avoid duplicating the nir_src_as_const_value call to
the same source.

CID: 1444291

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12594>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c