If PBO require to use a GS, this is created with TGSI.
For drivers preferring NIR shaders, they need to translate it from TGSI
to NIR. But unfortunately TGSI to NIR for GS is not implemented, which
makes it crash.
So let's use a GS only for drivers preferring TGSI.
v3:
- Add comment (Iago and Alejandro)
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13409>
if (screen->get_param(screen, PIPE_CAP_TGSI_INSTANCEID)) {
if (screen->get_param(screen, PIPE_CAP_TGSI_VS_LAYER_VIEWPORT)) {
st->pbo.layers = true;
- } else if (screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES) >= 3) {
+ } else if (screen->get_param(screen, PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES) >= 3 &&
+ screen->get_shader_param(screen, PIPE_SHADER_GEOMETRY,
+ PIPE_SHADER_CAP_PREFERRED_IR) != PIPE_SHADER_IR_NIR) {
+ /* As the download GS is created in TGSI, and TGSI to NIR translation
+ * is not implemented for GS, avoid using GS for drivers preferring
+ * NIR shaders.
+ */
st->pbo.layers = true;
st->pbo.use_gs = true;
}