From eac681debd43903979b8938dabff66cc48555cfe Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 23 Apr 2018 22:38:14 +0100 Subject: [PATCH] r600: pass offset into vtx fetch instead of adding it separately This might fix trine, this might break lots of other things --- src/gallium/drivers/r600/r600_shader.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index bd511c76ac2..34631b60833 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -1733,34 +1733,12 @@ static int tgsi_fetch_rel_const(struct r600_shader_ctx *ctx, unsigned int ar_reg; int r; - if (offset) { - struct r600_bytecode_alu alu; - - memset(&alu, 0, sizeof(alu)); - - alu.op = ALU_OP2_ADD_INT; - alu.src[0].sel = ctx->bc->ar_reg; - alu.src[0].chan = ar_chan; - - alu.src[1].sel = V_SQ_ALU_SRC_LITERAL; - alu.src[1].value = offset; - - alu.dst.sel = dst_reg; - alu.dst.chan = ar_chan; - alu.dst.write = 1; - alu.last = 1; - - if ((r = r600_bytecode_add_alu(ctx->bc, &alu))) - return r; - - ar_reg = dst_reg; - } else { - ar_reg = ctx->bc->ar_reg; - } + ar_reg = ctx->bc->ar_reg; memset(&vtx, 0, sizeof(vtx)); vtx.buffer_id = cb_idx; vtx.fetch_type = SQ_VTX_FETCH_NO_INDEX_OFFSET; + vtx.offset = offset; vtx.src_gpr = ar_reg; vtx.src_sel_x = ar_chan; vtx.mega_fetch_count = 16; -- 2.14.3