zink/spirv: do not use bitwise operations on booleans
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 3 Mar 2020 18:37:37 +0000 (19:37 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 20 Mar 2020 16:37:30 +0000 (16:37 +0000)
commitd4b0e28f62421d0fb5a5bcb19038b4f6fec622c5
tree5ef5422b6797d188d6ce232766d06c686f7ffd3e
parent130c0ba1cc1b800641ed09fe7842c7ef4bce2dfb
zink/spirv: do not use bitwise operations on booleans

According to the SPIR-V specification, these operations require
integer-types. When bit_size is 1, we use booleans, which makes us emit
illegal code.

So let's fix the emitting to check if the first source is one bit wide.

For inot we can take a short-cut, and check the destination instead.
This doesn't work for ieq and ine, so let's not bother to do this
BINOP_LOG.

Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4036>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4036>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c