vc4: Rename the slice's size0.
authorEric Anholt <eric@anholt.net>
Sun, 28 Sep 2014 02:10:34 +0000 (19:10 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 29 Sep 2014 18:26:43 +0000 (11:26 -0700)
In the other related fields, "0" refers to the size of the first miplevel,
while this is a field in a slice.  The other implicit slices we have
(cubemap layers) don't vary in size compared to the first one.

src/gallium/drivers/vc4/vc4_resource.c
src/gallium/drivers/vc4/vc4_resource.h

index a71ae5bab136d1559f8092d1c47547eb2b28c31f..3fb0b99b7d5d96e54ab2df96d3af68ce1741a3ca 100644 (file)
@@ -152,7 +152,7 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
                 return buf + slice->offset +
                         box->y / util_format_get_blockheight(format) * ptrans->stride +
                         box->x / util_format_get_blockwidth(format) * rsc->cpp +
-                        box->z * slice->size0;
+                        box->z * slice->size;
         }
 
 
@@ -226,12 +226,12 @@ vc4_setup_slices(struct vc4_resource *rsc)
 
                 slice->offset = offset;
                 slice->stride = level_width * rsc->cpp;
-                slice->size0 = level_height * slice->stride;
+                slice->size = level_height * slice->stride;
 
                 /* Note, since we have cubes but no 3D, depth is invariant
                  * with miplevel.
                  */
-                offset += slice->size0 * depth;
+                offset += slice->size * depth;
         }
 
         /* The texture base pointer that has to point to level 0 doesn't have
@@ -306,7 +306,7 @@ vc4_resource_create(struct pipe_screen *pscreen,
 
         rsc->bo = vc4_bo_alloc(vc4_screen(pscreen),
                                rsc->slices[0].offset +
-                               rsc->slices[0].size0 * prsc->depth0,
+                               rsc->slices[0].size * prsc->depth0,
                                "resource");
         if (!rsc->bo)
                 goto fail;
index caefbd057c0cac0575308619f494c0aed0cd2a4d..78869295774f71abd6f15f1b4f7ef751fa2411cf 100644 (file)
@@ -37,7 +37,7 @@ struct vc4_transfer {
 struct vc4_resource_slice {
         uint32_t offset;
         uint32_t stride;
-        uint32_t size0;
+        uint32_t size;
         /** One of VC4_TILING_FORMAT_* */
         uint8_t tiling;
 };