vc4: Don't forget to set up the offset for render targets.
authorEric Anholt <eric@anholt.net>
Mon, 18 Aug 2014 17:24:29 +0000 (10:24 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 18 Aug 2014 22:27:43 +0000 (15:27 -0700)
This almost fixes fbo-generatemipmap rendering, except that the 1x1 level
isn't getting rendered.

src/gallium/drivers/vc4/vc4_resource.c

index e0c0c7bdd42583aec4796f4594d8ae4d6496839c..349837e9824004e9bbb1576d1cfc0a3e5d002e43 100644 (file)
@@ -239,6 +239,7 @@ vc4_create_surface(struct pipe_context *pctx,
                    const struct pipe_surface *surf_tmpl)
 {
         struct vc4_surface *surface = CALLOC_STRUCT(vc4_surface);
+        struct vc4_resource *rsc = vc4_resource(ptex);
 
         if (!surface)
                 return NULL;
@@ -258,6 +259,7 @@ 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;
 
         return &surface->base;
 }