[Mesa-dev] [PATCH] nvc0/ir: fix ubo max clamp, reset file index

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Feb 9 20:43:07 UTC 2017


Nice catch.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 02/09/2017 09:37 PM, Ilia Mirkin wrote:
> We just increased the max UBO, so we should also increase the clamp that
> we do for robustness. Similarly, as we're including the fileIndex in the
> new indirect value, we should reset fileIndex to 0 so that it is not
> added in a second time.
>
> 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 | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> 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 0633767..ba22740 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> @@ -2407,10 +2407,12 @@ NVC0LoweringPass::handleLDST(Instruction *i)
>           if (ind) {
>              // Clamp the UBO index when an indirect access is used to avoid
>              // loading information from the wrong place in the driver cb.
> +            // TODO - synchronize the max with the driver.
>              ind = bld.mkOp2v(OP_MIN, TYPE_U32, ind,
>                               bld.mkOp2v(OP_ADD, TYPE_U32, bld.getSSA(),
>                                          ind, bld.loadImm(NULL, fileIndex)),
> -                             bld.loadImm(NULL, 12));
> +                             bld.loadImm(NULL, 13));
> +            fileIndex = 0;
>           }
>
>           Value *offset = bld.loadImm(NULL, i->getSrc(0)->reg.data.offset + typeSizeof(i->sType));
>


More information about the mesa-dev mailing list