From b65f13a0f497b0663789f1979a323241a68ba65f Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Mon, 22 Apr 2024 16:49:18 +0800 Subject: [PATCH] intel/compiler/elk: Replace the usage of ELK_VARYING_SLOT_PNTC with VARYING_SLOT_PNTC When ELK_VARYING_SLOT_PNTC is introduce with name BRW_VERT_RESULT_PNTC at commit https://gitlab.freedesktop.org/mesa/mesa/-/commit/43af02ac731dac7d80f7e47feb0c80e4da156769 there is no VARYING_SLOT_PNTC, now we have VARYING_SLOT_PNTC, so take use of it. Signed-off-by: Yonggang Luo --- src/intel/compiler/elk/elk_compile_sf.c | 8 ++++---- src/intel/compiler/elk/elk_compiler.h | 7 ------- src/intel/compiler/elk/elk_vue_map.c | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/intel/compiler/elk/elk_compile_sf.c b/src/intel/compiler/elk/elk_compile_sf.c index a41e2720465..1835581f5d1 100644 --- a/src/intel/compiler/elk/elk_compile_sf.c +++ b/src/intel/compiler/elk/elk_compile_sf.c @@ -408,7 +408,7 @@ calculate_point_sprite_mask(struct elk_sf_compile *c, GLuint reg) if (c->key.point_sprite_coord_replace & (1 << (varying1 - VARYING_SLOT_TEX0))) pc |= 0x0f; } - if (varying1 == ELK_VARYING_SLOT_PNTC) + if (varying1 == VARYING_SLOT_PNTC) pc |= 0x0f; varying2 = vert_reg_to_varying(c, reg, 1); @@ -417,7 +417,7 @@ calculate_point_sprite_mask(struct elk_sf_compile *c, GLuint reg) VARYING_SLOT_TEX0))) pc |= 0xf0; } - if (varying2 == ELK_VARYING_SLOT_PNTC) + if (varying2 == VARYING_SLOT_PNTC) pc |= 0xf0; return pc; @@ -825,8 +825,8 @@ elk_compile_sf(const struct elk_compiler *compiler, * it manually to let SF shader generate the needed interpolation * coefficient for FS shader. */ - c.vue_map.varying_to_slot[ELK_VARYING_SLOT_PNTC] = c.vue_map.num_slots; - c.vue_map.slot_to_varying[c.vue_map.num_slots++] = ELK_VARYING_SLOT_PNTC; + c.vue_map.varying_to_slot[VARYING_SLOT_PNTC] = c.vue_map.num_slots; + c.vue_map.slot_to_varying[c.vue_map.num_slots++] = VARYING_SLOT_PNTC; } c.urb_entry_read_offset = ELK_SF_URB_ENTRY_READ_OFFSET; c.nr_attr_regs = (c.vue_map.num_slots + 1)/2 - c.urb_entry_read_offset; diff --git a/src/intel/compiler/elk/elk_compiler.h b/src/intel/compiler/elk/elk_compiler.h index 978264a4f3f..e737e3296f6 100644 --- a/src/intel/compiler/elk/elk_compiler.h +++ b/src/intel/compiler/elk/elk_compiler.h @@ -1161,13 +1161,6 @@ typedef enum { ELK_VARYING_SLOT_NDC = VARYING_SLOT_MAX, ELK_VARYING_SLOT_PAD, - /** - * Technically this is not a varying but just a placeholder that - * compile_sf_prog() inserts into its VUE map to cause the gl_PointCoord - * builtin variable to be compiled correctly. see compile_sf_prog() for - * more info. - */ - ELK_VARYING_SLOT_PNTC, ELK_VARYING_SLOT_COUNT } elk_varying_slot; diff --git a/src/intel/compiler/elk/elk_vue_map.c b/src/intel/compiler/elk/elk_vue_map.c index bb8f751ce83..6f1fb03bc01 100644 --- a/src/intel/compiler/elk/elk_vue_map.c +++ b/src/intel/compiler/elk/elk_vue_map.c @@ -291,7 +291,6 @@ varying_name(elk_varying_slot slot, gl_shader_stage stage) static const char *elk_names[] = { [ELK_VARYING_SLOT_NDC - VARYING_SLOT_MAX] = "ELK_VARYING_SLOT_NDC", [ELK_VARYING_SLOT_PAD - VARYING_SLOT_MAX] = "ELK_VARYING_SLOT_PAD", - [ELK_VARYING_SLOT_PNTC - VARYING_SLOT_MAX] = "ELK_VARYING_SLOT_PNTC", }; return elk_names[slot - VARYING_SLOT_MAX];