From 2e84a1b4d892d141b08cc16a5b6b473d33e076c5 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 27 Nov 2020 10:41:47 -0500 Subject: [PATCH] pan/bi: Use canonical varying names Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_print.c | 6 +++--- src/panfrost/bifrost/bi_schedule.c | 2 +- src/panfrost/bifrost/bifrost.h | 8 ++++---- src/panfrost/bifrost/bifrost_compile.c | 6 +++--- src/panfrost/bifrost/compiler.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/panfrost/bifrost/bi_print.c b/src/panfrost/bifrost/bi_print.c index f9fa637215c..ab01e376f8e 100644 --- a/src/panfrost/bifrost/bi_print.c +++ b/src/panfrost/bifrost/bi_print.c @@ -242,9 +242,9 @@ bi_print_load_vary(struct bi_load_vary *load, FILE *fp) if (load->special) { switch (load->var_id) { - case BIFROST_SPECIAL_VAR_POINT: fprintf(fp, ".point"); break; - case BIFROST_SPECIAL_VAR_FRAGZ: fprintf(fp, ".fragz"); break; - case BIFROST_SPECIAL_VAR_FRAGW: fprintf(fp, ".fragw"); break; + case BI_VARYING_NAME_POINT: fprintf(fp, ".point"); break; + case BI_VARYING_NAME_FRAG_Z: fprintf(fp, ".fragz"); break; + case BI_VARYING_NAME_FRAG_W: fprintf(fp, ".fragw"); break; default: unreachable("Invalid varying ID"); } } diff --git a/src/panfrost/bifrost/bi_schedule.c b/src/panfrost/bifrost/bi_schedule.c index c2315555b5d..e0d539af210 100644 --- a/src/panfrost/bifrost/bi_schedule.c +++ b/src/panfrost/bifrost/bi_schedule.c @@ -32,7 +32,7 @@ static bool bi_is_fragz(bi_instruction *ins) { return ins->load_vary.special && - ins->load_vary.var_id == BIFROST_SPECIAL_VAR_FRAGZ; + ins->load_vary.var_id == BI_VARYING_NAME_FRAG_Z; } static enum bifrost_message_type diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h index 48410bc43b9..aad9eef6103 100644 --- a/src/panfrost/bifrost/bifrost.h +++ b/src/panfrost/bifrost/bifrost.h @@ -238,10 +238,10 @@ enum bifrost_update_mode { }; /* Fixed location for gl_FragCoord.zw */ -enum bifrost_special_var_id { - BIFROST_SPECIAL_VAR_POINT = 0, - BIFROST_SPECIAL_VAR_FRAGW = 2, - BIFROST_SPECIAL_VAR_FRAGZ = 3, +enum bi_varying_name { + BI_VARYING_NAME_POINT = 0, + BI_VARYING_NAME_FRAG_W = 2, + BI_VARYING_NAME_FRAG_Z = 3, }; enum branch_bit_size { diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index a7295a5687f..1b9bd6ebb15 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -611,8 +611,8 @@ bi_emit_ld_frag_coord(bi_context *ctx, nir_intrinsic_instr *instr) .interp_mode = BIFROST_INTERP_CENTER, .update_mode = BIFROST_UPDATE_CLOBBER, .var_id = (i == 0) ? - BIFROST_SPECIAL_VAR_FRAGZ : - BIFROST_SPECIAL_VAR_FRAGW, + BI_VARYING_NAME_FRAG_Z : + BI_VARYING_NAME_FRAG_W, .special = true, .reuse = false, .flat = true @@ -767,7 +767,7 @@ bi_emit_point_coord(bi_context *ctx, nir_intrinsic_instr *instr) .type = BI_LOAD_VAR, .load_vary = { .update_mode = BIFROST_UPDATE_CLOBBER, - .var_id = BIFROST_SPECIAL_VAR_POINT, + .var_id = BI_VARYING_NAME_POINT, .special = true, }, .vector_channels = 2, diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 21e968e3ce8..437adb9adee 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -135,7 +135,7 @@ extern unsigned bi_class_props[BI_NUM_CLASSES]; struct bi_load_vary { enum bifrost_interp_mode interp_mode; enum bifrost_update_mode update_mode; - enum bifrost_special_var_id var_id; + enum bi_varying_name var_id; unsigned index; bool immediate; bool special;