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

2016-09-22 Thread Anuj Phogat
On Wed, Sep 21, 2016 at 2:38 PM, Nanley Chery  wrote:
> Is this to avoid needless computation?
Yes it is.
> If an app copies such an image, that's likely an app bug right?
Yes it is. But I think keeping such simple checks in the driver
saves a lot of app debugging time sometime later.

>
> On Wed, Sep 21, 2016 at 11:17:08AM -0700, Anuj Phogat wrote:
>> Signed-off-by: Anuj Phogat 
>> ---
>>  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.
Yes, blorp_copy() looks like a better place.
>
>>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@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2016-09-22 Thread Nanley Chery
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 
> ---
>  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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev