diff options
Diffstat (limited to 'src/gallium/drivers/nvc0')
-rw-r--r-- | src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp index 51537972644..6faef9b68ca 100644 --- a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp @@ -509,11 +509,17 @@ NVC0LoweringPass::handleRDSV(Instruction *i) switch (i->getSrc(0)->reg.data.sv.sv) { case SV_POSITION: assert(prog->getType() == Program::TYPE_FRAGMENT); - ld = new_Instruction(func, OP_LINTERP, TYPE_F32); - ld->setDef(0, i->getDef(0)); - ld->setSrc(0, bld.mkSymbol(FILE_SHADER_INPUT, 0, TYPE_F32, addr)); - ld->setInterpolate(NV50_IR_INTERP_LINEAR); - bld.getBB()->insertAfter(i, ld); + bld.mkInterp(NV50_IR_INTERP_LINEAR, i->getDef(0), addr, NULL); + break; + case SV_FACE: + { + Value *face = i->getDef(0); + bld.mkInterp(NV50_IR_INTERP_FLAT, face, addr, NULL); + if (i->dType == TYPE_F32) { + bld.mkOp2(OP_AND, TYPE_U32, face, face, bld.mkImm(0x80000000)); + bld.mkOp2(OP_XOR, TYPE_U32, face, face, bld.mkImm(0xbf800000)); + } + } break; case SV_TESS_COORD: assert(prog->getType() == Program::TYPE_TESSELLATION_EVAL); @@ -705,14 +711,6 @@ NVC0LoweringPass::visit(Instruction *i) i->getSrc(0)->reg.data.offset < 0x2c0) i->setInterpolate(i->getSampleMode() | NV50_IR_INTERP_SC); break; - case OP_LINTERP: - if (i->getSrc(0)->reg.data.offset == 0x3fc) { - Value *face = i->getDef(0); - bld.setPosition(i, true); - bld.mkOp2(OP_SHL, TYPE_U32, face, face, bld.mkImm(31)); - bld.mkOp2(OP_XOR, TYPE_U32, face, face, bld.mkImm(0xbf800000)); - } - break; default: break; } |