Re: [Mesa-dev] [PATCH 08/12] panfrost: Support linear depth textures

2019-03-11 Thread Tomeu Vizoso
Reviewed-by: Tomeu Vizoso 

On Sun, 10 Mar 2019 at 07:50, Alyssa Rosenzweig  wrote:
>
> This combination has not yet been seen "in the wild" in traces, but to
> support linear depth FBOs, ~bruteforce reveals this bit pattern is
> necessary. It's not yet clear why the meanings of 0x1 and 0x2 are
> essentially flipped (tiled vs linear for colour, linear vs some sort of
> tiled for depth).
>
> Signed-off-by: Alyssa Rosenzweig 
> ---
>  src/gallium/drivers/panfrost/pan_context.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/panfrost/pan_context.c 
> b/src/gallium/drivers/panfrost/pan_context.c
> index 9db667d8287..099d6d0389b 100644
> --- a/src/gallium/drivers/panfrost/pan_context.c
> +++ b/src/gallium/drivers/panfrost/pan_context.c
> @@ -2289,17 +2289,19 @@ panfrost_create_sampler_view(
>
>  enum mali_format format = panfrost_find_format(desc);
>
> +bool is_depth = desc->format == PIPE_FORMAT_Z32_UNORM;
> +
>  unsigned usage2_layout = 0x10;
>
>  switch (prsrc->bo->layout) {
>  case PAN_AFBC:
> -usage2_layout |= 0xc;
> +usage2_layout |= 0x8 | 0x4;
>  break;
>  case PAN_TILED:
>  usage2_layout |= 0x1;
>  break;
>  case PAN_LINEAR:
> -usage2_layout |= 0x2;
> +usage2_layout |= is_depth ? 0x1 : 0x2;
>  break;
>  default:
>  assert(0);
> --
> 2.20.1
>
> ___
> 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

[Mesa-dev] [PATCH 08/12] panfrost: Support linear depth textures

2019-03-09 Thread Alyssa Rosenzweig
This combination has not yet been seen "in the wild" in traces, but to
support linear depth FBOs, ~bruteforce reveals this bit pattern is
necessary. It's not yet clear why the meanings of 0x1 and 0x2 are
essentially flipped (tiled vs linear for colour, linear vs some sort of
tiled for depth).

Signed-off-by: Alyssa Rosenzweig 
---
 src/gallium/drivers/panfrost/pan_context.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c 
b/src/gallium/drivers/panfrost/pan_context.c
index 9db667d8287..099d6d0389b 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2289,17 +2289,19 @@ panfrost_create_sampler_view(
 
 enum mali_format format = panfrost_find_format(desc);
 
+bool is_depth = desc->format == PIPE_FORMAT_Z32_UNORM;
+
 unsigned usage2_layout = 0x10;
 
 switch (prsrc->bo->layout) {
 case PAN_AFBC:
-usage2_layout |= 0xc;
+usage2_layout |= 0x8 | 0x4;
 break;
 case PAN_TILED:
 usage2_layout |= 0x1;
 break;
 case PAN_LINEAR:
-usage2_layout |= 0x2;
+usage2_layout |= is_depth ? 0x1 : 0x2;
 break;
 default:
 assert(0);
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev