[Mesa-dev] [PATCH] nv50/ir: fix use of getUniqueInsn() in loadProjTexCoords

Karol Herbst kherbst at redhat.com
Tue Jul 17 11:17:33 UTC 2018


the big problem with all that is, that the code was correct and turned
out to do the right thing. Last time I was looking into that, the
projection value was overwritten with the newest projection and this
turned out to be returned into insn and just ended up doing the right
thing.

I would expect that affected shaders start to render incorrectly with
this patch applied.

On Sun, Jul 8, 2018 at 6:32 PM, Rhys Perry <pendingchaos02 at gmail.com> wrote:
> Fixes "value not uniquely defined" messages during shader-db runs.
>
> Fixes: 57594065c30feec9376b "nv50/ir: import new shader backend code"
>
> Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
> index 2f9bcc1f34..2fe49909d5 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
> @@ -2337,10 +2337,10 @@ void
>  Converter::loadProjTexCoords(Value *dst[4], Value *src[4], unsigned int mask)
>  {
>     Value *proj = fetchSrc(0, 3);
> -   Instruction *insn = proj->getUniqueInsn();
> +   Instruction *insn = proj->defs.size() > 1 ? NULL : proj->getUniqueInsn();
>     int c;
>
> -   if (insn->op == OP_PINTERP) {
> +   if (insn && insn->op == OP_PINTERP) {
>        bb->insertTail(insn = cloneForward(func, insn));
>        insn->op = OP_LINTERP;
>        insn->setInterpolate(NV50_IR_INTERP_LINEAR | insn->getSampleMode());
> @@ -2352,6 +2352,8 @@ Converter::loadProjTexCoords(Value *dst[4], Value *src[4], unsigned int mask)
>     for (c = 0; c < 4; ++c) {
>        if (!(mask & (1 << c)))
>           continue;
> +      if (src[c]->defs.size() > 1)
> +         continue;
>        if ((insn = src[c]->getUniqueInsn())->op != OP_PINTERP)
>           continue;
>        mask &= ~(1 << c);
> --
> 2.14.4
>


More information about the mesa-dev mailing list