[Mesa-stable] [Mesa-dev] [PATCH] nvc0/ir: reset the base offset for indirect images accesses

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Jul 4 23:03:06 UTC 2016



On 07/05/2016 12:57 AM, Ilia Mirkin wrote:
> This makes the code identical to the new code I added in suq handling?
> If so, r-b. As a separate patch, I'd encourage a refactor of the logic.

Sure, this was my plan too.

>
>
> On Jul 4, 2016 6:08 PM, "Samuel Pitoiset" <samuel.pitoiset at gmail.com
> <mailto:samuel.pitoiset at gmail.com>> wrote:
>
>     In presence of an indirect image access, the base offset should be
>     zeroed because the stride will be computed twice. This is a pretty
>     rare situation but it can happen when tex.r > 0.
>
>     Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com
>     <mailto:samuel.pitoiset at gmail.com>>
>     Cc: "11.2 12.0" <mesa-stable at lists.freedesktop.org
>     <mailto:mesa-stable at lists.freedesktop.org>>
>     ---
>      src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 6
>     ++++--
>      1 file changed, 4 insertions(+), 2 deletions(-)
>
>     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 ce0f99c..ec349ec 100644
>     --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
>     +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
>     @@ -1685,7 +1685,7 @@
>     NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su)
>         const int idx = su->tex.r;
>         const int dim = su->tex.target.getDim();
>         const int arg = dim + (su->tex.target.isArray() ||
>     su->tex.target.isCube());
>     -   const uint16_t base = idx * NVE4_SU_INFO__STRIDE;
>     +   uint16_t base = idx * NVE4_SU_INFO__STRIDE;
>         int c;
>         Value *zero = bld.mkImm(0);
>         Value *p1 = NULL;
>     @@ -1712,6 +1712,7 @@
>     NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su)
>            }
>            ind = bld.mkOp2v(OP_AND, TYPE_U32, bld.getSSA(), ind,
>     bld.mkImm(7));
>            ind = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(), ind,
>     bld.mkImm(6));
>     +      base = 0;
>         }
>
>         // calculate clamped coordinates
>     @@ -2049,7 +2050,7 @@
>     NVC0LoweringPass::processSurfaceCoordsNVC0(TexInstruction *su)
>         const int idx = su->tex.r;
>         const int dim = su->tex.target.getDim();
>         const int arg = dim + (su->tex.target.isArray() ||
>     su->tex.target.isCube());
>     -   const uint16_t base = idx * NVE4_SU_INFO__STRIDE;
>     +   uint16_t base = idx * NVE4_SU_INFO__STRIDE;
>         int c;
>         Value *zero = bld.mkImm(0);
>         Value *src[3];
>     @@ -2068,6 +2069,7 @@
>     NVC0LoweringPass::processSurfaceCoordsNVC0(TexInstruction *su)
>            }
>            ind = bld.mkOp2v(OP_AND, TYPE_U32, bld.getSSA(), ind,
>     bld.mkImm(7));
>            ind = bld.mkOp2v(OP_SHL, TYPE_U32, bld.getSSA(), ind,
>     bld.mkImm(6));
>     +      base = 0;
>         }
>
>         // get surface coordinates
>     --
>     2.9.0
>
>     _______________________________________________
>     mesa-dev mailing list
>     mesa-dev at lists.freedesktop.org <mailto:mesa-dev at lists.freedesktop.org>
>     https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>


More information about the mesa-stable mailing list