Re: [Mesa-dev] [PATCH] anv: fix number of planes for depth & stencil

2018-04-12 Thread Jason Ekstrand
Right.  It's just a very generically named function for a fairly specific
task. :-)  Maybe we should just inline in at it's one use.

On Thu, Apr 12, 2018 at 2:17 PM, Lionel Landwerlin <
lionel.g.landwer...@intel.com> wrote:

> It's supposed to depend on how many aspects you've selected for creating
> the image view (not always correlate to the image).
>
>
> On 12/04/18 14:15, Jason Ekstrand wrote:
>
> I don't really get what this patch is doing.  Why not just use
> image->n_planes?
>
> On Thu, Apr 12, 2018 at 11:37 AM, Lionel Landwerlin <
> lionel.g.landwer...@intel.com> wrote:
>
>> We're not counting correctly with depth & stencil images.
>>
>> Signed-off-by: Lionel Landwerlin 
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105994
>> ---
>>  src/intel/vulkan/anv_private.h | 4 
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/src/intel/vulkan/anv_private.h
>> b/src/intel/vulkan/anv_private.h
>> index 53115ae470f..a4297511bbb 100644
>> --- a/src/intel/vulkan/anv_private.h
>> +++ b/src/intel/vulkan/anv_private.h
>> @@ -2356,6 +2356,10 @@ anv_image_aspect_get_planes(VkImageAspectFlags
>> aspect_mask)
>> if (aspect_mask & VK_IMAGE_ASPECT_PLANE_2_BIT)
>>planes++;
>>
>> +   if (aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT &&
>> +   aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT)
>> +  planes++;
>> +
>> return planes;
>>  }
>>
>> --
>> 2.17.0
>>
>> ___
>> 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: fix number of planes for depth & stencil

2018-04-12 Thread Lionel Landwerlin
It's supposed to depend on how many aspects you've selected for creating 
the image view (not always correlate to the image).


On 12/04/18 14:15, Jason Ekstrand wrote:
I don't really get what this patch is doing.  Why not just use 
image->n_planes?


On Thu, Apr 12, 2018 at 11:37 AM, Lionel Landwerlin 
mailto:lionel.g.landwer...@intel.com>> 
wrote:


We're not counting correctly with depth & stencil images.

Signed-off-by: Lionel Landwerlin mailto:lionel.g.landwer...@intel.com>>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105994

---
 src/intel/vulkan/anv_private.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/intel/vulkan/anv_private.h
b/src/intel/vulkan/anv_private.h
index 53115ae470f..a4297511bbb 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -2356,6 +2356,10 @@
anv_image_aspect_get_planes(VkImageAspectFlags aspect_mask)
    if (aspect_mask & VK_IMAGE_ASPECT_PLANE_2_BIT)
       planes++;

+   if (aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT &&
+       aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT)
+      planes++;
+
    return planes;
 }

--
2.17.0

___
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: fix number of planes for depth & stencil

2018-04-12 Thread Jason Ekstrand
I don't really get what this patch is doing.  Why not just use
image->n_planes?

On Thu, Apr 12, 2018 at 11:37 AM, Lionel Landwerlin <
lionel.g.landwer...@intel.com> wrote:

> We're not counting correctly with depth & stencil images.
>
> Signed-off-by: Lionel Landwerlin 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105994
> ---
>  src/intel/vulkan/anv_private.h | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_
> private.h
> index 53115ae470f..a4297511bbb 100644
> --- a/src/intel/vulkan/anv_private.h
> +++ b/src/intel/vulkan/anv_private.h
> @@ -2356,6 +2356,10 @@ anv_image_aspect_get_planes(VkImageAspectFlags
> aspect_mask)
> if (aspect_mask & VK_IMAGE_ASPECT_PLANE_2_BIT)
>planes++;
>
> +   if (aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT &&
> +   aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT)
> +  planes++;
> +
> return planes;
>  }
>
> --
> 2.17.0
>
> ___
> 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: fix number of planes for depth & stencil

2018-04-12 Thread Nanley Chery
On Thu, Apr 12, 2018 at 11:37:57AM -0700, Lionel Landwerlin wrote:
> We're not counting correctly with depth & stencil images.
> 
> Signed-off-by: Lionel Landwerlin 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105994
> ---
>  src/intel/vulkan/anv_private.h | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
> index 53115ae470f..a4297511bbb 100644
> --- a/src/intel/vulkan/anv_private.h
> +++ b/src/intel/vulkan/anv_private.h
> @@ -2356,6 +2356,10 @@ anv_image_aspect_get_planes(VkImageAspectFlags 
> aspect_mask)
> if (aspect_mask & VK_IMAGE_ASPECT_PLANE_2_BIT)
>planes++;
>  
> +   if (aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT &&
> +   aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT)
> +  planes++;
> +

I think we usually use curly braces for multi-line if-statements. I
can't find that written down anywhere though.

With or without that change, this patch is
Reviewed-by: Nanley Chery 

> return planes;
>  }
>  
> -- 
> 2.17.0
> 
> ___
> 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