diff options
author | Jordan Justen <[email protected]> | 2014-06-29 11:55:26 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2015-03-09 23:56:50 -0700 |
commit | aedcd466bb9d899e892f9d47f96fbca5e5647133 (patch) | |
tree | 5435bcf7bfb5210e3d5be975ab828e6e193774ea /src/mesa/drivers/dri/i965/intel_mipmap_tree.h | |
parent | 4d318b61fc14c7ed550007cb568ff27dbeab1662 (diff) |
i965/hiz: Start to separate miptree out from hiz buffers
Today we allocate a miptree's for the hiz buffer. We needed this in
the past because we would point the hardware at offsets of the hiz
buffer. Since the hiz format is not documented, this is not a good
idea.
Since moving to support layered rendering on Gen7+, we no longer point
at an offset into the buffer on Gen7+.
Therefore, to support hiz on Gen7+, we don't need a full miptree
structure allocated.
This patch starts to create a new auxiliary buffer structure
(intel_miptree_aux_buffer) that can be a more simplistic miptree
side-band buffer associated with a miptree. (For example, to serve the
needs of the hiz buffer.)
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_mipmap_tree.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h index ee9cf1ea4a9..41b60363f6c 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h @@ -307,6 +307,29 @@ enum miptree_array_layout { ALL_SLICES_AT_EACH_LOD, }; +/** + * Miptree aux buffer. These buffers are associated with a miptree, but the + * format is managed by the hardware. + * + * For Gen7+, we always give the hardware the start of the buffer, and let it + * handle all accesses to the buffer. Therefore we don't need the full miptree + * layout structure for this buffer. + * + * For Gen6, we need a hiz miptree structure for this buffer so we can program + * offsets to slices & miplevels. + */ +struct intel_miptree_aux_buffer +{ + /** Buffer object containing the pixel data. */ + drm_intel_bo *bo; + + uint32_t pitch; /**< pitch in bytes. */ + + uint32_t qpitch; /**< The distance in rows between array slices. */ + + struct intel_mipmap_tree *mt; /**< hiz miptree used with Gen6 */ +}; + struct intel_mipmap_tree { /** Buffer object containing the pixel data. */ @@ -411,15 +434,15 @@ struct intel_mipmap_tree uint32_t offset; /** - * \brief HiZ miptree + * \brief HiZ aux buffer * * The hiz miptree contains the miptree's hiz buffer. To allocate the hiz - * miptree, use intel_miptree_alloc_hiz(). + * buffer, use intel_miptree_alloc_hiz(). * * To determine if hiz is enabled, do not check this pointer. Instead, use * intel_miptree_slice_has_hiz(). */ - struct intel_mipmap_tree *hiz_mt; + struct intel_miptree_aux_buffer *hiz_buf; /** * \brief Map of miptree slices to needed resolves. |