aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2014-10-15 17:15:06 -0400
committerRob Clark <[email protected]>2014-10-20 21:42:44 -0400
commit74069e324e559a9361ebe631d1b819ff6e675c8f (patch)
tree73d1efe04efecccf827e071d307d5970e49c9f85 /src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
parentaafbd89c5e6c643e9c80edabda1fac2437bea927 (diff)
freedreno/a3xx: more layer/level fixes
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a3xx/fd3_gmem.c')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_gmem.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
index 219c9e06a2d..2eefa9119dc 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
@@ -609,8 +609,11 @@ fd3_emit_sysmem_prep(struct fd_context *ctx)
struct fd_ringbuffer *ring = ctx->ring;
uint32_t pitch = 0;
- if (pfb->cbufs[0])
- pitch = fd_resource(pfb->cbufs[0]->texture)->slices[0].pitch;
+ if (pfb->cbufs[0]) {
+ struct pipe_surface *psurf = pfb->cbufs[0];
+ unsigned lvl = psurf->u.tex.level;
+ pitch = fd_resource(psurf->texture)->slices[lvl].pitch;
+ }
fd3_emit_restore(ctx);