[Mesa-dev] [PATCH 6/6] radeonsi/nir: tidy up si_nir_load_sampler_desc()

Marek Olšák maraeo at gmail.com
Mon Apr 9 20:39:58 UTC 2018


If you add break statements into patch 5, the series is:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Thu, Apr 5, 2018 at 1:34 AM, Timothy Arceri <tarceri at itsqueeze.com>
wrote:

> This makes it easier to follow the code, and also initialises
> dynamic_index which will be useful for adding bindless textures
> support.
> ---
>  src/gallium/drivers/radeonsi/si_shader_nir.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c
> b/src/gallium/drivers/radeonsi/si_shader_nir.c
> index 362b7445cc5..f916575a1a1 100644
> --- a/src/gallium/drivers/radeonsi/si_shader_nir.c
> +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
> @@ -880,14 +880,12 @@ si_nir_load_sampler_desc(struct ac_shader_abi *abi,
>         struct si_shader_context *ctx = si_shader_context_from_abi(abi);
>         LLVMBuilderRef builder = ctx->ac.builder;
>         LLVMValueRef list = LLVMGetParam(ctx->main_fn,
> ctx->param_samplers_and_images);
> -       LLVMValueRef index = dynamic_index;
> +       LLVMValueRef index;
>
>         assert(!descriptor_set);
>
> -       if (!index)
> -               index = ctx->ac.i32_0;
> -
> -       index = LLVMBuildAdd(builder, index,
> +       dynamic_index = dynamic_index ? dynamic_index : ctx->ac.i32_0;
> +       index = LLVMBuildAdd(builder, dynamic_index,
>                              LLVMConstInt(ctx->ac.i32, base_index +
> constant_index, false),
>                              "");
>
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180409/e2fe33f8/attachment-0001.html>


More information about the mesa-dev mailing list