summaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl.h
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-07-08 17:10:59 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-07-13 11:47:37 -0700
commit4b62c19c323f79e7cc4feff5845996e8dde8daaf (patch)
tree217f84a3c40e545e081e62386c2e686b8fa22961 /src/intel/isl/isl.h
parent7270bd0607090574d18d22840fc115ab0a082439 (diff)
downloadexternal_mesa3d-4b62c19c323f79e7cc4feff5845996e8dde8daaf.zip
external_mesa3d-4b62c19c323f79e7cc4feff5845996e8dde8daaf.tar.gz
external_mesa3d-4b62c19c323f79e7cc4feff5845996e8dde8daaf.tar.bz2
isl: Rework the way we define tile sizes.
This is based on a very long set of discussions between Chad and myself about how we should properly represent HiZ and CCS buffers. The end result of that discussion was that a tiling actually has two different sizes, a logical size in elements, and a physical size in bytes and rows. This commit reworks ISL's pitch and size calculations to work in terms of these two sizes. Reviewed-by: Chad Versace <chad.versace@intel.com>
Diffstat (limited to 'src/intel/isl/isl.h')
-rw-r--r--src/intel/isl/isl.h37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index 985b605..f169fef 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -660,9 +660,28 @@ struct isl_format_layout {
struct isl_tile_info {
enum isl_tiling tiling;
- uint32_t width; /**< in bytes */
- uint32_t height; /**< in rows of memory */
- uint32_t size; /**< in bytes */
+
+ /** The logical size of the tile in units of surface elements
+ *
+ * This field determines how a given surface is cut up into tiles. It is
+ * used to compute the size of a surface in tiles and can be used to
+ * determine the location of the tile containing any given surface element.
+ * The exact value of this field depends heavily on the bits-per-block of
+ * the format being used.
+ */
+ struct isl_extent2d logical_extent_el;
+
+ /** The physical size of the tile in bytes and rows of bytes
+ *
+ * This field determines how the tiles of a surface are physically layed
+ * out in memory. The logical and physical tile extent are frequently the
+ * same but this is not always the case. For instance, a W-tile (which is
+ * always used with ISL_FORMAT_R8) has a logical size of 64el x 64el but
+ * its physical size is 128B x 32rows, the same as a Y-tile.
+ *
+ * @see isl_surf::row_pitch
+ */
+ struct isl_extent2d phys_extent_B;
};
/**
@@ -743,7 +762,17 @@ struct isl_surf {
uint32_t alignment;
/**
- * Pitch between vertically adjacent surface elements, in bytes.
+ * The interpretation of this field depends on the value of
+ * isl_tile_info::physical_extent_B. In particular, the width of the
+ * surface in tiles is row_pitch / isl_tile_info::physical_extent_B.width
+ * and the distance in bytes between vertically adjacent tiles in the image
+ * is given by row_pitch * isl_tile_info::physical_extent_B.height.
+ *
+ * For linear images where isl_tile_info::physical_extent_B.height == 1,
+ * this cleanly reduces to being the distance, in bytes, between vertically
+ * adjacent surface elements.
+ *
+ * @see isl_tile_info::phys_extent_B;
*/
uint32_t row_pitch;