diff options
author | Christoph Bumiller <[email protected]> | 2011-10-17 23:04:11 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-10-21 23:00:39 +0200 |
commit | 52c8c52b222e1fdb4c1f4ca3dedde9cd7b9c321f (patch) | |
tree | 98a568e38751f6a2f669ee89b948edc7c965a965 /src/gallium/drivers/nvc0 | |
parent | 9c930639d9f6d713ccfd16b390a41a9f584f348c (diff) |
nv50/ir: use RDSV to fetch FrontFacing before lowering
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; } |