nv50/ir/tgsi: only export x-component of PSIZE
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 5 Apr 2012 21:14:33 +0000 (23:14 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 14 Apr 2012 19:54:03 +0000 (21:54 +0200)
src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp

index 81d5d55f780455d64a79561033c5643d7c01cf3f..c419a7dca6e5a03d684c84ceb658feb2e6c37bf9 100644 (file)
@@ -946,6 +946,9 @@ bool Source::scanInstruction(const struct tgsi_full_instruction *inst)
          else
             info->out[dst.getIndex(0)].mask |= dst.getMask();
 
+         if (info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_PSIZE)
+            info->out[dst.getIndex(0)].mask &= 1;
+
          if (isEdgeFlagPassthrough(insn))
             info->io.edgeFlagIn = insn.getSrc(0).getIndex(0);
       } else
@@ -1393,7 +1396,8 @@ Converter::storeDst(const tgsi::Instruction::DstRegister dst, int c,
       mkOp2(OP_WRSV, TYPE_U32, NULL, dstToSym(dst, c), val);
    } else
    if (f == TGSI_FILE_OUTPUT && prog->getType() != Program::TYPE_FRAGMENT) {
-      mkStore(OP_EXPORT, TYPE_U32, dstToSym(dst, c), ptr, val);
+      if (ptr || (info->out[idx].mask & (1 << c)))
+         mkStore(OP_EXPORT, TYPE_U32, dstToSym(dst, c), ptr, val);
    } else
    if (f == TGSI_FILE_TEMPORARY ||
        f == TGSI_FILE_TEMPORARY_ARRAY ||