[Mesa-dev] [PATCH 2/2] ac: split 16-bit ssbo loads that may not be dword aligned

Juan A. Suarez Romero jasuarez at igalia.com
Mon Dec 17 12:05:40 UTC 2018


On Thu, 2018-12-13 at 17:06 +0000, Rhys Perry wrote:
> Fixes: 7e7ee826982 ('ac: add support for 16bit buffer loads')
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108114
> Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>

This patch is a candidate for 18.2 stable, as 7e7ee826982 ('ac: add support for
16bit buffer loads') is part of the queue too.

Unfortunately, I need to reject it as it depends on other commits to be applied
cleanly, mainly 12dc7cb202a ("ac: refactor visit_load_buffer"); which, by the
way, does not apply neither in 18.2.

	J.A.

> ---
>  src/amd/common/ac_nir_to_llvm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index c05b45e084..4a4c09cf5f 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -1642,6 +1642,8 @@ static LLVMValueRef visit_load_buffer(struct ac_nir_context *ctx,
>  	LLVMValueRef results[4];
>  	for (int i = 0; i < num_components;) {
>  		int num_elems = num_components - i;
> +		if (elem_size_bytes < 4 && nir_intrinsic_align(instr) % 4 != 0)
> +			num_elems = 1;
>  		if (num_elems * elem_size_bytes > 16)
>  			num_elems = 16 / elem_size_bytes;
>  		int load_bytes = num_elems * elem_size_bytes;



More information about the mesa-dev mailing list