[Mesa-dev] [PATCH 6/7] radeonsi/nir: add initial bindless image support

Marek Olšák maraeo at gmail.com
Tue Feb 20 22:41:51 UTC 2018


On Tue, Feb 20, 2018 at 4:42 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> ---
>  src/gallium/drivers/radeonsi/si_shader_nir.c | 41 +++++++++++++++++++++++-----
>  1 file changed, 34 insertions(+), 7 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
> index c2036a1509..e3e71c6eb6 100644
> --- a/src/gallium/drivers/radeonsi/si_shader_nir.c
> +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
> @@ -771,6 +771,21 @@ si_nir_lookup_interp_param(struct ac_shader_abi *abi,
>                 LLVMGetParam(ctx->main_fn, interp_param_idx) : NULL;
>  }
>
> +static LLVMValueRef
> +get_bindless_index(struct ac_shader_abi *abi,
> +                   struct si_shader_context *ctx, LLVMValueRef index)
> +{
> +       LLVMValueRef offset =
> +               LLVMBuildMul(ctx->ac.builder, index, LLVMConstInt(ctx->i32, 16, 0), "");
> +
> +       index = abi->load_ubo(abi, ctx->ac.i32_0);
> +
> +       LLVMValueRef ret = ac_build_buffer_load(&ctx->ac, index, 1, NULL, offset,
> +                                               NULL, 0, false, false, true, true);

I don't understand this. At least I think it shouldn't use load_ubo
and ac_build_buffer_load. A bindless variable (index) is a 64-bit
integer, i.e. the same size as vec2.

Marek


More information about the mesa-dev mailing list