vc4: Decide the HW's format before laying out the miptree.
authorEric Anholt <eric@anholt.net>
Mon, 23 Mar 2015 23:21:25 +0000 (16:21 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 24 Mar 2015 17:39:12 +0000 (10:39 -0700)
I'm experimenting with a workaround for raster texture misrendering on
hardware, and this lets me look at the format chosen when computing
strides.

src/gallium/drivers/vc4/vc4_resource.c

index 0dda0d86a69e493ecbcfd5c075a5a97dcdea71ad..c640cf6ad5b86b833f076babd90d22b5bdc63c1d 100644 (file)
@@ -373,14 +373,14 @@ vc4_resource_create(struct pipe_screen *pscreen,
                 rsc->tiled = true;
         }
 
+        if (tmpl->target != PIPE_BUFFER)
+                rsc->vc4_format = get_resource_texture_format(prsc);
+
         vc4_setup_slices(rsc);
         vc4_resource_bo_alloc(rsc);
         if (!rsc->bo)
                 goto fail;
 
-        if (tmpl->target != PIPE_BUFFER)
-                rsc->vc4_format = get_resource_texture_format(prsc);
-
         return prsc;
 fail:
         vc4_resource_destroy(pscreen, prsc);