vc4: Add support for rendering to cube map surfaces.
authorEric Anholt <eric@anholt.net>
Fri, 15 Apr 2016 22:07:49 +0000 (15:07 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 18 Apr 2016 17:10:44 +0000 (10:10 -0700)
We need to fix up the offset to point at the face of the cube.  Fixes
piglit fbo-cubemap, copyteximage CUBE, and glean's fbo test.

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/vc4/vc4_resource.c

index 050941c3e6f1a1b184ebb99b34d3fc400793b91c..a360e192b3f40bcaad4b0ccbeb0a2dace2bcab54 100644 (file)
@@ -607,7 +607,8 @@ vc4_create_surface(struct pipe_context *pctx,
         psurf->u.tex.level = level;
         psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
         psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
-        surface->offset = rsc->slices[level].offset;
+        surface->offset = (rsc->slices[level].offset +
+                           psurf->u.tex.first_layer * rsc->cube_map_stride);
         surface->tiling = rsc->slices[level].tiling;
 
         return &surface->base;