freedreno/a5xx: texture layout
authorRob Clark <robdclark@gmail.com>
Tue, 6 Dec 2016 18:32:31 +0000 (13:32 -0500)
committerRob Clark <robdclark@gmail.com>
Tue, 27 Dec 2016 21:54:01 +0000 (16:54 -0500)
Seems to be imilar to a4xx, and sampler state "array-pitch" needs
to be aligned to page size.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a5xx/fd5_texture.c
src/gallium/drivers/freedreno/freedreno_resource.c

index 588e914b0cc8faaa02477deecf43c71af7656676..47b07b8cd4ef08492c350be36cd3095acff079f9 100644 (file)
@@ -281,7 +281,7 @@ fd5_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
        case PIPE_TEXTURE_1D:
        case PIPE_TEXTURE_2D:
                so->texconst3 =
-                       A5XX_TEX_CONST_3_ARRAY_PITCH(rsc->slices[lvl].size0);
+                       A5XX_TEX_CONST_3_ARRAY_PITCH(rsc->layer_size);
                so->texconst5 =
                        A5XX_TEX_CONST_5_DEPTH(1);
                break;
index 174c1d48ce8ab4404f8badfc6c60ec9e1d3744d4..5a2bdfc6651159bc0a642e0cc79b58baa3350368 100644 (file)
@@ -819,7 +819,7 @@ fd_resource_create(struct pipe_screen *pscreen,
        assert(rsc->cpp);
 
        alignment = slice_alignment(pscreen, tmpl);
-       if (is_a4xx(fd_screen(pscreen))) {
+       if (is_a4xx(fd_screen(pscreen)) || is_a5xx(fd_screen(pscreen))) {
                switch (tmpl->target) {
                case PIPE_TEXTURE_3D:
                        rsc->layer_first = false;