st/pbo: fix pbo uploads without PIPE_CAP_TGSI_VS_LAYER_VIEWPORT
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Sat, 12 Dec 2020 00:00:23 +0000 (19:00 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 14 Dec 2020 14:42:55 +0000 (14:42 +0000)
commit614c77772ac2f48955537efcfefaf0609d6c03e5
tree1c90da86d640df3cfaa8fda2861fc405a91a89df
parentdfd0f042e0d8faa374629ea0a67422edff6d48c3
st/pbo: fix pbo uploads without PIPE_CAP_TGSI_VS_LAYER_VIEWPORT

the code here tries to be too smart and only use a geometry shader if there's
actually multiple layers being uploaded, but the fragment shader also unconditionally
reads gl_Layer as long as the pipe cap for gs is set, which means that
in the case when the gs is dynamically disabled due to uploading a
single-layer surface, the fs has no input to read for gl_Layer and everything breaks

always using a gs isn't ideal, but it's considerably more work to manage multiple
fs variants based on layer usage

Fixes: c99f2fe70ec ("st/mesa: implement PBO upload for multiple layers")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8067>
src/mesa/state_tracker/st_pbo.c