gallivm: fix crash in emit_get_buffer_size
authorRoland Scheidegger <sroland@vmware.com>
Wed, 19 Feb 2020 23:56:18 +0000 (00:56 +0100)
committerRoland Scheidegger <rscheidegger_lists@hispeed.ch>
Thu, 20 Feb 2020 17:32:54 +0000 (17:32 +0000)
commit7a73446c513e2218a08ae9425a1bea49c63080a7
tree9d7c7b0c3b6f2d64d942295cdd3072175b8a067f
parent1b610aab583211210f189b46904b66c483f8e38b
gallivm: fix crash in emit_get_buffer_size

Seems a bit odd we extract a value from a vector in the first place
(as we always extract the first element), but llvm asserts if using
a zero-vector instead of zero as the index element.
Fixes piglit crashes for example in arb_shader_storage_buffer_object-layout-std140-write-shader.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3886>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3886>
src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c