ir3: Support variants with different constlen's
[mesa.git] / src / freedreno / ir3 / ir3_cp.c
index e739f792cf80ac3e3872157e72b199d77c16b94d..56f6b2b215d90e6b61dda8a885179b9559f223c2 100644 (file)
@@ -220,12 +220,11 @@ lower_immed(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr, unsigned n,
        }
 
        if (i == const_state->immediate_idx) {
-               struct ir3_compiler *compiler = instr->block->shader->compiler;
                /* Add on a new immediate to be pushed, if we have space left in the
                 * constbuf.
                 */
                if (const_state->offsets.immediate + const_state->immediate_idx / 4 >=
-                               compiler->max_const)
+                               ir3_max_const(ctx->so))
                        return false;
 
                swiz = i % 4;