zink: lower b2b to b2i
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 5 May 2020 15:04:46 +0000 (17:04 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 09:20:27 +0000 (09:20 +0000)
commit7f6a491eec02d6c141e2b4849a3ba924926a482a
treeb79dea5c4b8765a9ec757cb18d1a0fb991a3ee1b
parentf457e1b6d5814e51cb9e0ae47e8fd5936139f42f
zink: lower b2b to b2i

Zink requires 1-bit booleans, but this requirement was missed before
b2b1s started getting automatically inserted. Let's lower these away, to
avoid piglit regressions.

Fixes the following piglits:
- shaders@glsl-vs-if-bool
- spec@!opengl 2.0@vertex-program-two-side

Fixes: c217ee8d35f ("nir: Insert b2b1s around booleans in nir_lower_to")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2902
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4903>
src/gallium/drivers/zink/meson.build
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.h
src/gallium/drivers/zink/nir_to_spirv/zink_nir_algebraic.py [new file with mode: 0644]
src/gallium/drivers/zink/zink_compiler.c