[Mesa-dev] [PATCH 11/23] anv/copy: Use the linear format from the image for the buffer block size

Nanley Chery nanleychery at gmail.com
Tue May 17 00:48:52 UTC 2016


On Mon, May 16, 2016 at 12:08:16PM -0700, Jason Ekstrand wrote:
> Because the buffer is exposed to the user, the block size is defined to
> always exactly be the size of the actual vulkan format.  This is the same
> size (it had better be) as the linaer image format.

s/linaer/linear/

> ---
>  src/intel/vulkan/anv_meta_copy.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/intel/vulkan/anv_meta_copy.c b/src/intel/vulkan/anv_meta_copy.c
> index df2cc2f..dbec4f7 100644
> --- a/src/intel/vulkan/anv_meta_copy.c
> +++ b/src/intel/vulkan/anv_meta_copy.c
> @@ -161,11 +161,14 @@ meta_copy_buffer_to_image(struct anv_cmd_buffer *cmd_buffer,
>           &anv_image_get_surface_for_aspect_mask(image, aspect)->isl;
>        struct anv_meta_blit2d_surf img_bsurf =
>           blit_surf_for_image(image, img_isl_surf);
> +      enum isl_format buf_format = anv_get_isl_format(image->vk_format, aspect,
> +                                                      VK_IMAGE_TILING_LINEAR,
> +                                                      NULL);
>        struct anv_meta_blit2d_surf buf_bsurf = {
>           .bo = buffer->bo,
>           .tiling = ISL_TILING_LINEAR,
>           .base_offset = buffer->offset + pRegions[r].bufferOffset,
> -         .bs = forward ? image->format->isl_layout->bs : img_bsurf.bs,
> +         .bs = isl_format_get_layout(buf_format)->bs,

IIRC, the ternary enabled the RGB CTS tests to pass, but I can't see 
why the logic behind it would've been correct. This seems like the right
thing to do.

Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>


>           .pitch = buf_extent_el.width * buf_bsurf.bs,
>        };
>  
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list