[virglrenderer-devel] [PATCH 5/9] shader: refactor txq emit out of translate_tex

Dave Airlie airlied at gmail.com
Tue Jun 5 02:30:16 UTC 2018


From: Dave Airlie <airlied at redhat.com>

---
 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);
-- 
2.14.3



More information about the virglrenderer-devel mailing list