etnaviv: validate number of VS outputs against GPU limit

All user defined varyings, the position output and possibly the
point size output need to fit into the GPU specific maximum
number of VS outputs. Check this limitation.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31032>
This commit is contained in:
Lucas Stach 2024-09-04 15:59:45 +02:00 committed by Marge Bot
parent 21a5370f9c
commit dcb61d3da5

View file

@ -1063,6 +1063,18 @@ etna_compile_check_limits(struct etna_shader_variant *v)
return false;
}
if (v->stage == MESA_SHADER_VERTEX) {
int num_outputs = v->vs_pointsize_out_reg >= 0 ? 2 : 1;
num_outputs += v->outfile.num_reg;
if (num_outputs > specs->max_vs_outputs) {
DBG("Number of VS outputs (%zu) exceeds maximum %d",
v->outfile.num_reg, specs->max_vs_outputs);
return false;
}
}
return true;
}