[Mesa-dev] [PATCH] anv/blorp: Handle zero width/height copying in copy_buffer_to_image

Nanley Chery nanleychery at gmail.com
Wed Sep 21 21:38:58 UTC 2016


Is this to avoid needless computation?
If an app copies such an image, that's likely an app bug right?

On Wed, Sep 21, 2016 at 11:17:08AM -0700, Anuj Phogat wrote:
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/intel/vulkan/anv_blorp.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
> index cb61070..de33dce 100644
> --- a/src/intel/vulkan/anv_blorp.c
> +++ b/src/intel/vulkan/anv_blorp.c
> @@ -273,6 +273,10 @@ copy_buffer_to_image(struct anv_cmd_buffer *cmd_buffer,
>  
>        VkExtent3D extent =
>           anv_sanitize_image_extent(anv_image->type, pRegions[r].imageExtent);
> +
> +      if (extent.width == 0 || extent.height == 0)
> +         return;
> +

This seems like something we'd want put in blorp_copy(). That way we'd
also handle CopyImage.

>        if (anv_image->type != VK_IMAGE_TYPE_3D) {
>           image.offset.z = pRegions[r].imageSubresource.baseArrayLayer;
>           extent.depth = pRegions[r].imageSubresource.layerCount;
> -- 
> 2.5.5
> 
> _______________________________________________
> 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