[Freedreno] [PATCH] freedreno/a3xx: use the same layer size for all slices

Ilia Mirkin imirkin at alum.mit.edu
Fri Mar 13 09:30:48 PDT 2015


On Fri, Mar 13, 2015 at 12:56 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> We only program in one layer size per texture, so that means that all
> levels must share one size. This makes the piglit test
>
> bin/texelFetch fs sampler2DArray
>
> have the same breakage as its non-array version instead of being
> completely off.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> Cc: "10.4 10.5" <mesa-stable at lists.freedesktop.org>
> ---
>
> Need to put this through a piglit run, but seems fairly obvious given what
> fd3_texture does. Also see results of the texelFetch piglit.
>
>  src/gallium/drivers/freedreno/freedreno_resource.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c
> index c412407..afb396e 100644
> --- a/src/gallium/drivers/freedreno/freedreno_resource.c
> +++ b/src/gallium/drivers/freedreno/freedreno_resource.c
> @@ -215,7 +215,10 @@ setup_slices(struct fd_resource *rsc, uint32_t alignment)
>
>                 slice->pitch = align(width, 32);
>                 slice->offset = size;
> -               slice->size0 = align(slice->pitch * height * rsc->cpp, alignment);
> +               if (level == 0 || layers_in_level == 1)
> +                       slice->size0 = align(slice->pitch * height * rsc->cpp, alignment);

Ended up having to change this slightly, since we *don't* want to do
this for cubemaps... this is what I have now and it seems to fix
ext_texture_array/gen-mipmap as well:

+               /* 1d array, 2d array, 3d textures (but not cube!)
must all have the
+                * same layer size for each miplevel on a3xx. These are also the
+                * targets that have non-1 alignment.
+                */
+               if (level == 0 || layers_in_level == 1 || alignment == 1)
+                       slice->size0 = align(slice->pitch * height *
rsc->cpp, alignment);
+               else
+                       slice->size0 = rsc->slices[0].size0;

We still have an issue with per-layer sizes > 0xf000, need to see what
the blob does there. And 3D is still broken. But it was broken before
too :)


More information about the Freedreno mailing list