nvc0/ir: TXF array index already is an integer

This commit is contained in:
Christoph Bumiller 2012-01-08 16:26:23 +01:00
parent 7fd802b96c
commit e4210a42bc
1 changed files with 6 additions and 3 deletions

View File

@ -322,10 +322,13 @@ NVC0LoweringPass::handleTEX(TexInstruction *i)
Value *ticRel = i->getIndirectR();
Value *tscRel = i->getIndirectS();
if (arrayIndex)
bld.mkCvt(OP_CVT, TYPE_U16, src, TYPE_F32, arrayIndex);
else
if (arrayIndex) {
int sat = (i->op == OP_TXF) ? 1 : 0;
DataType sTy = (i->op == OP_TXF) ? TYPE_U32 : TYPE_F32;
bld.mkCvt(OP_CVT, TYPE_U16, src, sTy, arrayIndex)->saturate = sat;
} else {
bld.loadImm(src, 0);
}
if (ticRel) {
i->setSrc(i->tex.rIndirectSrc, NULL);