Ilia Mirkin
2014-Jan-09 07:16 UTC
[Nouveau] Handling UMAD with a negative modifier, or why glsl-fs-atan-3 was failing
So I figured out what was going on. The shader has a UMAD TEMP[0].x, TEMP[0].xxxx, -TEMP[5].xxxx, TEMP[0].xxxx instruction, in which the -TEMP[5].xxxx got emitted as cvt neg u32 $r1 u32 $r1 If instead I fudge mkOp() to force a s32 dtype on OP_NEG, everything starts to work. Similarly, if I fudge emitCVT to basically do the same thing, it also works. (Of note -- changing both stype and dtype to s32 does _not_ work, which makes sense.) I'm not sure which approach is the right one -- advice? It's a very short patch either way. Perhaps someone with a NVC0+ card could check that piglit test and see if my patch breaks things... Thanks, -ilia --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_build_util.cpp @@ -70,6 +70,9 @@ insn->setDef(0, dst); insn->setSrc(0, src); + if (op == OP_NEG && ty == TYPE_U32) + insn->dType = TYPE_S32; + insert(insn); return insn; }
Reasonably Related Threads
- [PATCH] nv50/ir: change the way float face is returned
- [PATCH v3 1/2] nv50/ir: Add support for the double Type to BuildUtil
- [PATCH 1/2] nvc0/ir: detect AND/SHR pairs and convert into EXTBF
- [PATCH] gm107/ir: fix loading z offset for layered 3d image bindings
- [PATCH 01/11] nvc0/ir: add emission of dadd/dmul/dmad opcodes, fix minmax