Right, so arg+1, -1 is the right thing. However, this patch is bogus. It relies on getImmediate which in turn relies on getUniqueInsn, which in turn doesn't work pre-ssa (except in very contrived scenarios). So I'm going to try to put together a series that resolves many of these things, like making getImmediate safe pre-ssa, and making it more likely to succeed pre-ssa as well (by doing a semi-kinda-sorta SSA pass as we're going from TGSI -> nv50 ir - effectively undoing the stupid renumbering thing st/mesa does).
On Fri, Oct 21, 2016 at 9:59 AM, Ilia Mirkin <imir...@alum.mit.edu> wrote: > Yeah, it might actually need to be arg+1, -1. I didn't test this patch > too thoroughly... > > On Fri, Oct 21, 2016 at 9:53 AM, Samuel Pitoiset > <samuel.pitoi...@gmail.com> wrote: >> This patch breaks a bunch of piglit tests, see a short list below: >> >> bin/arb_texture_barrier-blending-in-shader 512 42 1 128 7 -auto -fbo >> bin/arb_texture_buffer_object-formats vs core -auto -fbo >> bin/texelFetch 140 vs sampler2DRect -auto -fbo >> bin/mesa_pack_invert-readpixels -auto -fbo >> ... >> >> Around 150 regressions. >> >> I suspect the moveSources() to be wrong just because texture arguments are >> crazy. :-) >> >> On 10/21/2016 08:30 AM, Ilia Mirkin wrote: >>> >>> Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu> >>> --- >>> src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 9 >>> +++++++++ >>> 1 file changed, 9 insertions(+) >>> >>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp >>> b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp >>> index 68f2b15..4181422 100644 >>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp >>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp >>> @@ -662,6 +662,15 @@ NVC0LoweringPass::handleTEX(TexInstruction *i) >>> } >>> } >>> >>> + ImmediateValue lod; >>> + if (!i->tex.target.isMS() && (i->op == OP_TXL || i->op == OP_TXF) && >>> + i->src(arg).getImmediate(lod) && lod.isInteger(0)) { >>> + if (i->op == OP_TXL) >>> + i->op = OP_TEX; >>> + i->tex.levelZero = true; >>> + i->moveSources(arg, -1); >>> + } >>> + >>> // Arguments to the TEX instruction are a little insane. Even though >>> the >>> // encoding is identical between SM20 and SM30, the arguments mean >>> // different things between Fermi and Kepler+. A lot of arguments are >>> >> >> -- >> -Samuel _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev