etnaviv: limit number of varyings to fit into VS outputs

One of the VS output slots is always occupied by the position
output. Limit the number of user visible varyings to fit into
the remaining slots.

This reduces GL_MAX_VARYING_COMPONENTS to 60 on <halti5 GPUs,
which is still enough to meet the GLES3 minimum requirements.

Fixes piglit shaders@glsl-max-varyings.

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 16:20:55 +02:00 committed by Marge Bot
parent dcb61d3da5
commit 5f6ab7dcdf

View file

@ -853,7 +853,6 @@ etna_get_specs(struct etna_screen *screen)
if (info->type == ETNA_CORE_GPU) {
instruction_count = info->gpu.max_instructions;
screen->specs.pixel_pipes = info->gpu.pixel_pipes;
screen->specs.max_varyings = MIN2(info->gpu.max_varyings, ETNA_NUM_VARYINGS);
if (screen->npu)
info = etna_gpu_get_core_info(screen->npu);
@ -966,6 +965,11 @@ etna_get_specs(struct etna_screen *screen)
screen->specs.max_vs_outputs = screen->info->halti >= 5 ? 32 : 16;
screen->specs.max_varyings = MIN3(ETNA_NUM_VARYINGS,
info->gpu.max_varyings,
/* one output slot used for position */
screen->specs.max_vs_outputs - 1);
screen->specs.max_texture_size =
VIV_FEATURE(screen, ETNA_FEATURE_TEXTURE_8K) ? 8192 : 2048;
screen->specs.max_rendertarget_size =