zink: Fix spirv stream 0 vertex emit for multistream shaders
authorSoroushIMG <soroush.kashani@imgtec.com>
Wed, 13 Jul 2022 10:59:05 +0000 (11:59 +0100)
committerMarge Bot <emma+marge@anholt.net>
Wed, 20 Jul 2022 00:19:38 +0000 (00:19 +0000)
commit3dfd8e4d7dde2dfb749c4d115e7f37e5965d460c
tree0e2dbd3902b1c6bd755aff69ff805c47f926e4e4
parent9ecc26ff276099ed2eb3fe22d417c84f49700d20
zink: Fix spirv stream 0 vertex emit for multistream shaders

Spirv spec does not allow the use of OpEmitVertex or OpEndPrimitive when there are multiple streams.
Instead emit the multi-stream version of these with stream set to 0.
This issue was seen when testing cts case KHR-GL46.transform_feedback.draw_xfb_stream_test

Fixes: 35e346f4280 ("zink: handle vertex streams")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17513>
src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
src/gallium/drivers/zink/nir_to_spirv/spirv_builder.c
src/gallium/drivers/zink/nir_to_spirv/spirv_builder.h