This is now handled in SFN.
v2: remove obsolte comments (Vitaliy Kuzmin)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25475>
}
#endif
-int egcm_load_index_reg(struct r600_bytecode *bc, unsigned id, bool inside_alu_clause)
-{
- struct r600_bytecode_alu alu;
- int r;
- unsigned type;
-
- assert(id < 2);
- assert(bc->gfx_level >= EVERGREEN);
-
- if (bc->index_loaded[id])
- return 0;
-
- /* Hack to put MOVA and SET_CF_IDX in the same clause as AR only persists for one clause */
- if (bc->gfx_level == EVERGREEN && (bc->cf_last == NULL || (bc->cf_last->ndw >> 1) >= 110)) {
- bc->force_add_cf = 1;
- }
-
- memset(&alu, 0, sizeof(alu));
- alu.op = ALU_OP1_MOVA_INT;
- alu.src[0].sel = bc->index_reg[id];
- alu.src[0].chan = bc->index_reg_chan[id];
- if (bc->gfx_level == CAYMAN)
- alu.dst.sel = id == 0 ? CM_V_SQ_MOVA_DST_CF_IDX0 : CM_V_SQ_MOVA_DST_CF_IDX1;
-
- alu.last = 1;
- r = r600_bytecode_add_alu(bc, &alu);
- if (r)
- return r;
-
- bc->ar_loaded = 0; /* clobbered */
-
- if (bc->gfx_level == EVERGREEN) {
- memset(&alu, 0, sizeof(alu));
- alu.op = id == 0 ? ALU_OP0_SET_CF_IDX0 : ALU_OP0_SET_CF_IDX1;
- alu.last = 1;
- r = r600_bytecode_add_alu(bc, &alu);
- if (r)
- return r;
- }
-
- /* Must split ALU group as index only applies to following group */
- if (inside_alu_clause) {
- type = bc->cf_last->op;
- if ((r = r600_bytecode_add_cf(bc))) {
- return r;
- }
- bc->cf_last->op = type;
- }
-
- bc->index_loaded[id] = 1;
-
- return 0;
-}
-
int eg_bytecode_gds_build(struct r600_bytecode *bc, struct r600_bytecode_gds *gds, unsigned id)
{
unsigned gds_op = (r600_isa_fetch_opcode(bc->isa->hw_class, gds->op) >> 8) & 0x3f;
}
bc->cf_last->op = type;
- /* Load index register if required */
if (bc->gfx_level >= EVERGREEN) {
for (i = 0; i < 3; i++)
if (nalu->src[i].kc_bank && nalu->src[i].kc_rel)
- egcm_load_index_reg(bc, nalu->src[i].kc_rel - 1, true);
+ assert(bc->index_loaded[nalu->src[i].kc_rel - 1]);
}
/* Check AR usage and load it if required */
return -ENOMEM;
memcpy(nvtx, vtx, sizeof(struct r600_bytecode_vtx));
- /* Load index register if required */
if (bc->gfx_level >= EVERGREEN) {
- if (vtx->buffer_index_mode)
- egcm_load_index_reg(bc, vtx->buffer_index_mode - 1, false);
+ assert(!vtx->buffer_index_mode ||
+ bc->index_loaded[vtx->buffer_index_mode - 1]);
}
return -ENOMEM;
memcpy(ntex, tex, sizeof(struct r600_bytecode_tex));
- /* Load index register if required */
if (bc->gfx_level >= EVERGREEN) {
- if (tex->sampler_index_mode || tex->resource_index_mode)
- egcm_load_index_reg(bc, tex->resource_index_mode - 1, false);
+ assert(!tex->sampler_index_mode ||
+ bc->index_loaded[tex->sampler_index_mode - 1]);
+ assert(!tex->resource_index_mode ||
+ bc->index_loaded[tex->resource_index_mode - 1]);
}
/* we can't fetch data und use it as texture lookup address in the same TEX clause */
memcpy(ngds, gds, sizeof(struct r600_bytecode_gds));
if (bc->gfx_level >= EVERGREEN) {
- if (gds->uav_index_mode)
- egcm_load_index_reg(bc, gds->uav_index_mode - 1, false);
+ assert(!gds->uav_index_mode ||
+ bc->index_loaded[gds->uav_index_mode - 1]);
}
if (bc->cf_last == NULL ||
/* eg_asm.c */
int eg_bytecode_cf_build(struct r600_bytecode *bc, struct r600_bytecode_cf *cf);
-int egcm_load_index_reg(struct r600_bytecode *bc, unsigned id, bool inside_alu_clause);
int eg_bytecode_gds_build(struct r600_bytecode *bc, struct r600_bytecode_gds *gds, unsigned id);
int eg_bytecode_alu_build(struct r600_bytecode *bc,
struct r600_bytecode_alu *alu, unsigned id);