From e16c46c6a89ba01afe8d8527868224193a57f79b Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 1 Jul 2022 14:29:00 -0700 Subject: [PATCH] freedreno/a6xx: assert valid vertex_flags reg If this somehow gets optimized out, the GS will run forever. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_program.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c index 351d5dc..9901f59 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c @@ -991,6 +991,9 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd_context *ctx, uint32_t flags_regid = ir3_find_output_regid(gs, VARYING_SLOT_GS_VERTEX_FLAGS_IR3); + /* if vertex_flags somehow gets optimized out, your gonna have a bad time: */ + assert(flags_regid != INVALID_REG); + OUT_PKT4(ring, REG_A6XX_SP_GS_PRIMITIVE_CNTL, 1); OUT_RING(ring, A6XX_SP_GS_PRIMITIVE_CNTL_OUT(l.cnt) | A6XX_SP_GS_PRIMITIVE_CNTL_FLAGS_REGID(flags_regid)); -- 2.7.4