[Mesa-dev] [PATCH] r600g: Make unaligned 3D textures work on +evergreen

Alex Deucher alexdeucher at gmail.com
Tue Aug 30 09:50:18 PDT 2011


2011/8/29  <deathsimple at vodafone.de>:
> From: Christian König <deathsimple at vodafone.de>
>
> The layersize calculation is slightly different on +evergreen.
> This makes mpeg2 video decoding and piglits texture-packed-formats
> test work correctly on this hardware.

Does this patch work as well?  I think it's somewhat cleaner and
covers other cases that may be affected as well.  In theory we should
switch all the code to use linear aligned rather than linear general
for linear formats.

Alex

> ---
>  src/gallium/drivers/r600/r600_texture.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
> index 7c1bd9d..e5783b9 100644
> --- a/src/gallium/drivers/r600/r600_texture.c
> +++ b/src/gallium/drivers/r600/r600_texture.c
> @@ -262,7 +262,11 @@ static void r600_setup_miptree(struct pipe_screen *screen,
>                nblocksx = r600_texture_get_nblocksx(screen, rtex, i);
>                nblocksy = r600_texture_get_nblocksy(screen, rtex, i);
>
> -               layer_size = nblocksx * nblocksy * blocksize;
> +               if (chipc >= EVERGREEN && array_mode == V_038000_ARRAY_LINEAR_GENERAL)
> +                       layer_size = align(nblocksx, 64) * nblocksy * blocksize;
> +               else
> +                       layer_size = nblocksx * nblocksy * blocksize;
> +
>                if (ptex->target == PIPE_TEXTURE_CUBE) {
>                        if (chipc >= R700)
>                                size = layer_size * 8;
> --
> 1.7.4.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-r600g-use-linear-aligned-alignment-requirements-for-.patch
Type: text/x-patch
Size: 1855 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110830/42ba4235/attachment-0001.bin>


More information about the mesa-dev mailing list