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: c99f2fe70e ("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>
This commit is contained in:
Mike Blumenkrantz 2020-12-11 19:00:23 -05:00 committed by Marge Bot
parent dfd0f042e0
commit 614c77772a
1 changed files with 1 additions and 1 deletions

View File

@ -202,7 +202,7 @@ st_pbo_draw(struct st_context *st, const struct st_pbo_addresses *addr,
return false;
}
if (addr->depth != 1 && st->pbo.use_gs && !st->pbo.gs) {
if (st->pbo.use_gs && !st->pbo.gs) {
st->pbo.gs = st_pbo_create_gs(st);
if (!st->pbo.gs)
return false;