nir: fix lower_memcpy
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 16 Feb 2022 21:14:15 +0000 (23:14 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 17 Feb 2022 15:12:45 +0000 (15:12 +0000)
commit768930a73a43e48172df00b6c934de582bd9422b
tree32517df20d979fd76fb001b0be5b0ee31b76f815
parentbc6380259641e6f23e4daefb0268c5f2533be24d
nir: fix lower_memcpy

memcpy is divided into chunks that are vec4 sized max. The problem
here happens with a structure of 24 bytes :

  struct {
    float3 a;
    float3 b;
  }

If you memcpy that struct, the lowering will emit 2 load/store, one of
sized 8, next one sized 16. But both end up located at offset 0, so we
effectively drop 2 floats.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a3177cca996145 ("nir: Add a lowering pass to lower memcpy")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15049>
src/compiler/nir/nir_lower_memcpy.c