[Mesa-dev] [PATCH 2/3] nvc0/ir: Handle TGSI_OPCODE_CLOCK

Boyan Ding boyan.j.ding at gmail.com
Fri Mar 31 02:33:06 UTC 2017


Signed-off-by: Boyan Ding <boyan.j.ding at gmail.com>
---
 src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index 7aaeedf8dd..9fbd3c0d30 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -3410,6 +3410,11 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
          mkCvt(OP_CVT, TYPE_U32, dst0[c], TYPE_U8, val0);
       }
       break;
+   case TGSI_OPCODE_CLOCK:
+      // The shifting is weird, but that's how they made it
+      mkOp1(OP_RDSV, TYPE_U32, dst0[1], mkSysVal(SV_CLOCK, 0))->fixed = 1;
+      mkOp1(OP_RDSV, TYPE_U32, dst0[0], mkSysVal(SV_CLOCK, 1))->fixed = 1;
+      break;
    case TGSI_OPCODE_KILL_IF:
       val0 = new_LValue(func, FILE_PREDICATE);
       mask = 0;
-- 
2.12.0



More information about the mesa-dev mailing list