[Mesa-stable] [Mesa-dev] [PATCH] gm107/ir: fix texturing with indirect samplers

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Oct 18 08:50:49 UTC 2016



On 10/18/2016 05:53 AM, Ilia Mirkin wrote:
> The indirect handle has to come right after the coordinates, so if there
> was a sample/bias/depth compare/offset, everything would end up being
> shifted by one argument position.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> Cc: mesa-stable at lists.freedesktop.org
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 10 ++++++++++
>  1 file changed, 10 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 dab3e2d..83154c1 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> @@ -751,6 +751,16 @@ NVC0LoweringPass::handleTEX(TexInstruction *i)
>           i->tex.rIndirectSrc = 0;
>           i->tex.sIndirectSrc = -1;
>        }
> +      // Move the indirect reference to right after the coords
> +      else if (i->tex.rIndirectSrc >= 0 && chipset >= NVISA_GM107_CHIPSET) {
> +         Value *hnd = i->getIndirectR();
> +
> +         i->setIndirectR(NULL);
> +         i->moveSources(arg, 1);
> +         i->setSrc(arg, hnd);
> +         i->tex.rIndirectSrc = 0;
> +         i->tex.sIndirectSrc = -1;
> +      }

This looks (a bit) redundant with the loop above, but texture arguments 
are insane, so... :)

I'm going to run piglit.

>     } else
>     // (nvc0) generate and move the tsc/tic/array source to the front
>     if (i->tex.target.isArray() || i->tex.rIndirectSrc >= 0 || i->tex.sIndirectSrc >= 0) {
>

-- 
-Samuel


More information about the mesa-stable mailing list