agx: Handle vertex shaders that use <= 8 halfregs

r5 and r6 are always getting lowered. Will prevent a regression with VBO
lowering on a shader which has stride=0 and hence gets the vertex ID read
optimized out with NIR:

   dEQP-GLES2.functional.draw.random.50

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19971>
This commit is contained in:
Alyssa Rosenzweig
2022-11-19 17:37:25 -05:00
committed by Marge Bot
parent 94124925ca
commit d608ca0363
@@ -423,6 +423,12 @@ agx_ra(agx_context *ctx)
ctx->max_reg = MAX2(ctx->max_reg, ssa_to_reg[i] + ncomps[i] - 1);
}
/* Vertex shaders preload the vertex/instance IDs (r5, r6) even if the shader
* don't use them. Account for that so the preload doesn't clobber GPRs.
*/
if (ctx->nir->info.stage == MESA_SHADER_VERTEX)
ctx->max_reg = MAX2(ctx->max_reg, 6 * 2);
agx_foreach_instr_global(ctx, ins) {
agx_foreach_ssa_src(ins, s) {
unsigned v = ssa_to_reg[ins->src[s].value];