freedreno/ir3: Use regid() helper when setting up precolor regs
authorKristian H. Kristensen <hoegsberg@google.com>
Fri, 8 Nov 2019 00:44:33 +0000 (16:44 -0800)
committerKristian H. Kristensen <hoegsberg@google.com>
Fri, 8 Nov 2019 00:46:21 +0000 (16:46 -0800)
Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/freedreno/ir3/ir3_compiler_nir.c

index 3b0dc5a0c8c5464bb473ffdf5ae3bb7259c40666..b827a4bef6e3cac7323ebb38e5b70aa5bfd5df83 100644 (file)
@@ -3440,8 +3440,8 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
                 * since the VS chains to TCS and doesn't get the sysvals redelivered.
                 */
 
-               ctx->tcs_header->regs[0]->num = 0;
-               ctx->primitive_id->regs[0]->num = 1;
+               ctx->tcs_header->regs[0]->num = regid(0, 0);
+               ctx->primitive_id->regs[0]->num = regid(0, 1);
                struct ir3_instruction *precolor[] = { ctx->tcs_header, ctx->primitive_id };
                ret = ir3_ra(so, precolor, ARRAY_SIZE(precolor));
        } else if (ctx->gs_header) {
@@ -3450,8 +3450,8 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
                 * the sysvals redelivered.
                 */
 
-               ctx->gs_header->regs[0]->num = 0;
-               ctx->primitive_id->regs[0]->num = 1;
+               ctx->gs_header->regs[0]->num = regid(0, 0);
+               ctx->primitive_id->regs[0]->num = regid(0, 1);
                struct ir3_instruction *precolor[] = { ctx->gs_header, ctx->primitive_id };
                ret = ir3_ra(so, precolor, ARRAY_SIZE(precolor));
        } else if (so->num_sampler_prefetch) {