[Mesa-dev] [PATCH 2/2] anv/image: fix offset's alignment to the surface alignment

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Feb 18 15:02:32 UTC 2019


On 15/02/2019 14:43, Samuel Iglesias Gonsálvez wrote:
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>


Hey Samuel,


Thanks for this change. Would you mind changing the align_u32 in the 
if() branch too?

It won't fix anything but that's just to be consistent.


With that :

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>


> ---
>   src/intel/vulkan/anv_image.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
> index 3999c7399d0..f4a65044a3b 100644
> --- a/src/intel/vulkan/anv_image.c
> +++ b/src/intel/vulkan/anv_image.c
> @@ -142,7 +142,7 @@ add_surface(struct anv_image *image, struct anv_surface *surf, uint32_t plane)
>                                  surf->isl.alignment_B);
>         /* Plane offset is always 0 when it's disjoint. */
>      } else {
> -      surf->offset = align_u32(image->size, surf->isl.alignment_B);
> +      surf->offset = util_align_npot(image->size, surf->isl.alignment_B);
>         /* Determine plane's offset only once when the first surface is added. */
>         if (image->planes[plane].size == 0)
>            image->planes[plane].offset = image->size;




More information about the mesa-dev mailing list