nvc0/ir: patch vertex count is stored in the upper bits
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 21 Feb 2015 08:12:54 +0000 (03:12 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 23 Jul 2015 07:33:09 +0000 (03:33 -0400)
src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp

index 56dbb5134d10557c2347a463a1e49b9acf9e9bfb..85dd05d5267f4b4bd8f434d4cce0ae0d6a6be7b2 100644 (file)
@@ -1525,6 +1525,10 @@ NVC0LoweringPass::handleRDSV(Instruction *i)
          i->op = OP_MOV;
          i->setSrc(0, bld.mkImm((sv == SV_NTID || sv == SV_NCTAID) ? 1 : 0));
       }
+      if (sv == SV_VERTEX_COUNT) {
+         bld.setPosition(i, true);
+         bld.mkOp2(OP_EXTBF, TYPE_U32, i->getDef(0), i->getDef(0), bld.mkImm(0x808));
+      }
       return true;
    }