shader: refactor txq emit out of translate_tex

Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Dave Airlie 6 years ago
parent 055fd69374
commit fa7f5de546
  1. 10
      src/vrend_shader.c

@ -1469,10 +1469,6 @@ static int translate_tex(struct dump_ctx *ctx,
if (inst->Instruction.Opcode == TGSI_OPCODE_LODQ) if (inst->Instruction.Opcode == TGSI_OPCODE_LODQ)
ctx->shader_req_bits |= SHADER_REQ_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) { switch (inst->Texture.Texture) {
case TGSI_TEXTURE_1D: case TGSI_TEXTURE_1D:
case TGSI_TEXTURE_BUFFER: case TGSI_TEXTURE_BUFFER:
@ -2475,12 +2471,16 @@ iter_instruction(struct tgsi_iterate_context *iter,
case TGSI_OPCODE_TXF: case TGSI_OPCODE_TXF:
case TGSI_OPCODE_TG4: case TGSI_OPCODE_TG4:
case TGSI_OPCODE_TXP: case TGSI_OPCODE_TXP:
case TGSI_OPCODE_TXQ:
case TGSI_OPCODE_LODQ: 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); ret = translate_tex(ctx, inst, sreg_index, srcs, dsts, writemask, get_string(dstconv), dst_override_no_wm[0], tg4_has_component);
if (ret) if (ret)
return FALSE; return FALSE;
break; break;
case TGSI_OPCODE_TXQ:
ret = emit_txq(ctx, inst, sreg_index, srcs, dsts, writemask);
if (ret)
return FALSE;
break;
case TGSI_OPCODE_I2F: case TGSI_OPCODE_I2F:
snprintf(buf, 255, "%s = %s(ivec4(%s)%s);\n", dsts[0], get_string(dstconv), srcs[0], writemask); snprintf(buf, 255, "%s = %s(ivec4(%s)%s);\n", dsts[0], get_string(dstconv), srcs[0], writemask);
EMIT_BUF_WITH_RET(ctx, buf); EMIT_BUF_WITH_RET(ctx, buf);

Loading…
Cancel
Save