vc4: Add support for rendering to cube map surfaces.

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>
(cherry picked from commit 48fe53bbb9)
This commit is contained in:
Eric Anholt 2016-04-15 15:07:49 -07:00 committed by Emil Velikov
parent 68ecc39aba
commit 08c747374c

View file

@ -588,7 +588,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;