From fa7f5de54626bb6daec8909a2abcb92fb4acf04c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 5 Jun 2018 10:37:41 +1000 Subject: [PATCH] shader: refactor txq emit out of translate_tex Reviewed-by: Gurchetan Singh --- src/vrend_shader.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index fce03a7..6afcd98 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -1469,10 +1469,6 @@ static int translate_tex(struct dump_ctx *ctx, if (inst->Instruction.Opcode == TGSI_OPCODE_LODQ) ctx->shader_req_bits |= SHADER_REQ_LODQ; - if (inst->Instruction.Opcode == TGSI_OPCODE_TXQ) { - return emit_txq(ctx, inst, sreg_index, srcs, dsts, writemask); - } - switch (inst->Texture.Texture) { case TGSI_TEXTURE_1D: case TGSI_TEXTURE_BUFFER: @@ -2475,12 +2471,16 @@ iter_instruction(struct tgsi_iterate_context *iter, case TGSI_OPCODE_TXF: case TGSI_OPCODE_TG4: case TGSI_OPCODE_TXP: - case TGSI_OPCODE_TXQ: case TGSI_OPCODE_LODQ: ret = translate_tex(ctx, inst, sreg_index, srcs, dsts, writemask, get_string(dstconv), dst_override_no_wm[0], tg4_has_component); if (ret) return FALSE; break; + case TGSI_OPCODE_TXQ: + ret = emit_txq(ctx, inst, sreg_index, srcs, dsts, writemask); + if (ret) + return FALSE; + break; case TGSI_OPCODE_I2F: snprintf(buf, 255, "%s = %s(ivec4(%s)%s);\n", dsts[0], get_string(dstconv), srcs[0], writemask); EMIT_BUF_WITH_RET(ctx, buf);