<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 21, 2017 at 5:35 AM, Pohjolainen, Topi <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, Jun 16, 2017 at 03:41:27PM -0700, Jason Ekstrand wrote:<br>
> This commit replaces the complex and confusing set of disable flags with<br>
> two fairly straightforward fields which describe the intended auxiliary<br>
> surface usage and whether or not the miptree supports fast clears.<br>
> Right now, supports_fast_clear can be entirely derived from aux_usage<br>
> but that will not always be the case.<br>
><br>
> This commit makes functional changes. One of these changes is that it<br>
> re-enables multisampled fast-clears which were accidentally disabled in<br>
> cec30a666930ddb8476a9452a89364<wbr>a24979ff62 around a year ago. It should<br>
> also enable CCS_E for window-system buffers which are Y-tiled. They<br>
> will still get a full resolve like CCS_D but we will at least get some<br>
> of the advantage of compression.<br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_<wbr>blorp.c | 4 +-<br>
> src/mesa/drivers/dri/i965/<wbr>intel_fbo.c | 2 +-<br>
> src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 190 +++++++++++++-------------<br>
> src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h | 43 +++---<br>
> 4 files changed, 120 insertions(+), 119 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
> index 00092ee..9bd25f0 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
> @@ -762,7 +762,7 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,<br>
> if (set_write_disables(irb, ctx->Color.ColorMask[buf], color_write_disable))<br>
> can_fast_clear = false;<br>
><br>
> - if (irb->mt->aux_disable & INTEL_AUX_DISABLE_CCS ||<br>
> + if (!irb->mt->supports_fast_clear ||<br>
> !brw_is_color_fast_clear_<wbr>compatible(brw, irb->mt, &ctx->Color.ClearColor))<br>
> can_fast_clear = false;<br>
><br>
> @@ -785,7 +785,7 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,<br>
> */<br>
> if (!irb->mt->mcs_buf) {<br>
> assert(!intel_miptree_is_<wbr>lossless_compressed(brw, irb->mt));<br>
> - if (!intel_miptree_alloc_ccs(brw, irb->mt, false)) {<br>
> + if (!intel_miptree_alloc_ccs(brw, irb->mt)) {<br>
> /* MCS allocation failed--probably this will only happen in<br>
> * out-of-memory conditions. But in any case, try to recover<br>
> * by falling back to a non-blorp clear technique.<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c b/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c<br>
> index ee4aba9..6a64bcb 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c<br>
> @@ -555,7 +555,7 @@ intel_renderbuffer_update_<wbr>wrapper(struct brw_context *brw,<br>
><br>
> intel_renderbuffer_set_draw_<wbr>offset(irb);<br>
><br>
> - if (intel_miptree_wants_hiz_<wbr>buffer(brw, mt)) {<br>
> + if (mt->aux_usage == ISL_AUX_USAGE_HIZ && !mt->hiz_buf) {<br>
> intel_miptree_alloc_hiz(brw, mt);<br>
> if (!mt->hiz_buf)<br>
> return false;<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
> index 0f6d542..101317f 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
> @@ -64,7 +64,7 @@ intel_miptree_alloc_mcs(struct brw_context *brw,<br>
> */<br>
> static enum intel_msaa_layout<br>
> compute_msaa_layout(struct brw_context *brw, mesa_format format,<br>
> - enum intel_aux_disable aux_disable)<br>
> + uint32_t layout_flags)<br>
> {<br>
> /* Prior to Gen7, all MSAA surfaces used IMS layout. */<br>
> if (brw->gen < 7)<br>
> @@ -90,7 +90,7 @@ compute_msaa_layout(struct brw_context *brw, mesa_format format,<br>
> */<br>
> if (brw->gen == 7 && _mesa_get_format_datatype(<wbr>format) == GL_INT) {<br>
> return INTEL_MSAA_LAYOUT_UMS;<br>
> - } else if (aux_disable & INTEL_AUX_DISABLE_MCS) {<br>
> + } else if (layout_flags & MIPTREE_LAYOUT_DISABLE_AUX) {<br>
> /* We can't use the CMS layout because it uses an aux buffer, the MCS<br>
> * buffer. So fallback to UMS, which is identical to CMS without the<br>
> * MCS. */<br>
> @@ -148,9 +148,6 @@ intel_miptree_supports_ccs(<wbr>struct brw_context *brw,<br>
> if (brw->gen < 7)<br>
> return false;<br>
><br>
> - if (mt->aux_disable & INTEL_AUX_DISABLE_MCS)<br>
> - return false;<br>
> -<br>
> /* This function applies only to non-multisampled render targets. */<br>
> if (mt->num_samples > 1)<br>
> return false;<br>
> @@ -215,6 +212,26 @@ intel_miptree_supports_ccs(<wbr>struct brw_context *brw,<br>
> return true;<br>
> }<br>
><br>
> +static bool<br>
> +intel_miptree_supports_hiz(<wbr>struct brw_context *brw,<br>
> + struct intel_mipmap_tree *mt)<br>
> +{<br>
> + if (!brw->has_hiz)<br>
> + return false;<br>
> +<br>
> + switch (mt->format) {<br>
> + case MESA_FORMAT_Z_FLOAT32:<br>
> + case MESA_FORMAT_Z32_FLOAT_S8X24_<wbr>UINT:<br>
> + case MESA_FORMAT_Z24_UNORM_X8_UINT:<br>
> + case MESA_FORMAT_Z24_UNORM_S8_UINT:<br>
> + case MESA_FORMAT_Z_UNORM16:<br>
> + return true;<br>
> + default:<br>
> + return false;<br>
> + }<br>
> +}<br>
> +<br>
> +<br>
> /* On Gen9 support for color buffer compression was extended to single<br>
> * sampled surfaces. This is a helper considering both auxiliary buffer<br>
> * type and number of samples telling if the given miptree represents<br>
> @@ -320,10 +337,9 @@ intel_miptree_create_layout(<wbr>struct brw_context *brw,<br>
> mt->logical_width0 = width0;<br>
> mt->logical_height0 = height0;<br>
> mt->logical_depth0 = depth0;<br>
> - mt->aux_disable = (layout_flags & MIPTREE_LAYOUT_DISABLE_AUX) != 0 ?<br>
> - INTEL_AUX_DISABLE_ALL : INTEL_AUX_DISABLE_NONE;<br>
> - mt->aux_disable |= INTEL_AUX_DISABLE_CCS;<br>
> mt->is_scanout = (layout_flags & MIPTREE_LAYOUT_FOR_SCANOUT) != 0;<br>
> + mt->aux_usage = ISL_AUX_USAGE_NONE;<br>
> + mt->supports_fast_clear = false;<br>
> mt->aux_state = NULL;<br>
> mt->cpp = _mesa_get_format_bytes(format)<wbr>;<br>
> mt->num_samples = num_samples;<br>
> @@ -337,7 +353,7 @@ intel_miptree_create_layout(<wbr>struct brw_context *brw,<br>
> int depth_multiply = 1;<br>
> if (num_samples > 1) {<br>
> /* Adjust width/height/depth for MSAA */<br>
> - mt->msaa_layout = compute_msaa_layout(brw, format, mt->aux_disable);<br>
> + mt->msaa_layout = compute_msaa_layout(brw, format, layout_flags);<br>
> if (mt->msaa_layout == INTEL_MSAA_LAYOUT_IMS) {<br>
> /* From the Ivybridge PRM, Volume 1, Part 1, page 108:<br>
> * "If the surface is multisampled and it is a depth or stencil<br>
> @@ -460,8 +476,7 @@ intel_miptree_create_layout(<wbr>struct brw_context *brw,<br>
> if (!(layout_flags & MIPTREE_LAYOUT_FOR_BO) &&<br>
> _mesa_get_format_base_format(<wbr>format) == GL_DEPTH_STENCIL &&<br>
> (brw->must_use_separate_<wbr>stencil ||<br>
> - (brw->has_separate_stencil &&<br>
> - intel_miptree_wants_hiz_<wbr>buffer(brw, mt)))) {<br>
> + (brw->has_separate_stencil && intel_miptree_supports_hiz(<wbr>brw, mt)))) {<br>
> uint32_t stencil_flags = MIPTREE_LAYOUT_ACCELERATED_<wbr>UPLOAD;<br>
> if (brw->gen == 6) {<br>
> stencil_flags |= MIPTREE_LAYOUT_TILING_ANY;<br>
> @@ -530,14 +545,44 @@ intel_miptree_create_layout(<wbr>struct brw_context *brw,<br>
> return NULL;<br>
> }<br>
><br>
> - if (mt->aux_disable & INTEL_AUX_DISABLE_MCS)<br>
> - assert(mt->msaa_layout != INTEL_MSAA_LAYOUT_CMS);<br>
> -<br>
> return mt;<br>
> }<br>
><br>
><br>
> /**<br>
> + * Choose the aux usage for this miptree. This function must be called fairly<br>
> + * late in the miptree create process after we have a tiling.<br>
> + */<br>
> +static void<br>
> +intel_miptree_choose_aux_<wbr>usage(struct brw_context *brw,<br>
> + struct intel_mipmap_tree *mt)<br>
> +{<br>
> + assert(mt->aux_usage == ISL_AUX_USAGE_NONE);<br>
> +<br>
> + if (mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {<br>
> + mt->aux_usage = ISL_AUX_USAGE_MCS;<br>
> + } else if (intel_tiling_supports_ccs(<wbr>brw, mt->tiling) &&<br>
> + intel_miptree_supports_ccs(<wbr>brw, mt)) {<br>
> + if (!unlikely(INTEL_DEBUG & DEBUG_NO_RBC) &&<br>
> + brw->gen >= 9 && !mt->is_scanout &&<br>
<br>
</div></div>In the commit message you said that this patch enables CCS_E for winsys<br>
buffers. I don't see how that happens as we check for is_scanout here (which<br>
gets set by intel_miptree_create_layout() by<br>
intel_update_winsys_<wbr>renderbuffer_miptree() passing MIPTREE_LAYOUT_FOR_SCANOUT).<br></blockquote><div><br></div><div>Well... It gets us closer at any rate. More work to do there. I'll update the commit message to not claim to actually fix the issue.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Other than that this looks good:<br>
<br>
Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
<div><div class="h5"><br>
> + intel_miptree_supports_ccs_e(<wbr>brw, mt)) {<br>
> + mt->aux_usage = ISL_AUX_USAGE_CCS_E;<br>
> + } else {<br>
> + mt->aux_usage = ISL_AUX_USAGE_CCS_D;<br>
> + }<br>
> + } else if (intel_miptree_supports_hiz(<wbr>brw, mt)) {<br>
> + mt->aux_usage = ISL_AUX_USAGE_HIZ;<br>
> + }<br>
> +<br>
> + /* We can do fast-clear on all auxiliary surface types that are<br>
> + * allocated through the normal texture creation paths.<br>
> + */<br>
> + if (mt->aux_usage != ISL_AUX_USAGE_NONE)<br>
> + mt->supports_fast_clear = true;<br>
> +}<br>
> +<br>
> +<br>
> +/**<br>
> * Choose an appropriate uncompressed format for a requested<br>
> * compressed format, if unsupported.<br>
> */<br>
> @@ -670,6 +715,9 @@ miptree_create(struct brw_context *brw,<br>
> if (layout_flags & MIPTREE_LAYOUT_FOR_SCANOUT)<br>
> mt->bo->cache_coherent = false;<br>
><br>
> + if (!(layout_flags & MIPTREE_LAYOUT_DISABLE_AUX))<br>
> + intel_miptree_choose_aux_<wbr>usage(brw, mt);<br>
> +<br>
> return mt;<br>
> }<br>
><br>
> @@ -726,29 +774,14 @@ intel_miptree_create(struct brw_context *brw,<br>
> }<br>
> }<br>
><br>
> - /* If this miptree is capable of supporting fast color clears, set<br>
> - * fast_clear_state appropriately to ensure that fast clears will occur.<br>
> - * Allocation of the MCS miptree will be deferred until the first fast<br>
> - * clear actually occurs or when compressed single sampled buffer is<br>
> - * written by the GPU for the first time.<br>
> + /* Since CCS_E can compress more than just clear color, we create the CCS<br>
> + * for it up-front. For CCS_D which only compresses clears, we create the<br>
> + * CCS on-demand when a clear occurs that wants one.<br>
> */<br>
> - if (intel_tiling_supports_ccs(<wbr>brw, mt->tiling) &&<br>
> - intel_miptree_supports_ccs(<wbr>brw, mt)) {<br>
> - mt->aux_disable &= ~INTEL_AUX_DISABLE_CCS;<br>
> - assert(brw->gen < 8 || mt->halign == 16 || num_samples <= 1);<br>
> -<br>
> - /* On Gen9+ clients are not currently capable of consuming compressed<br>
> - * single-sampled buffers. Disabling compression allows us to skip<br>
> - * resolves.<br>
> - */<br>
> - const bool lossless_compression_disabled = INTEL_DEBUG & DEBUG_NO_RBC;<br>
> - const bool is_lossless_compressed =<br>
> - unlikely(!lossless_<wbr>compression_disabled) &&<br>
> - brw->gen >= 9 && !mt->is_scanout &&<br>
> - intel_miptree_supports_ccs_e(<wbr>brw, mt);<br>
> -<br>
> - if (is_lossless_compressed) {<br>
> - intel_miptree_alloc_ccs(brw, mt, is_lossless_compressed);<br>
> + if (mt->aux_usage == ISL_AUX_USAGE_CCS_E) {<br>
> + if (!intel_miptree_alloc_ccs(brw, mt)) {<br>
> + intel_miptree_release(&mt);<br>
> + return NULL;<br>
> }<br>
> }<br>
><br>
> @@ -805,6 +838,21 @@ intel_miptree_create_for_bo(<wbr>struct brw_context *brw,<br>
> mt->offset = offset;<br>
> mt->tiling = tiling;<br>
><br>
> + if (!(layout_flags & MIPTREE_LAYOUT_DISABLE_AUX)) {<br>
> + intel_miptree_choose_aux_<wbr>usage(brw, mt);<br>
> +<br>
> + /* Since CCS_E can compress more than just clear color, we create the<br>
> + * CCS for it up-front. For CCS_D which only compresses clears, we<br>
> + * create the CCS on-demand when a clear occurs that wants one.<br>
> + */<br>
> + if (mt->aux_usage == ISL_AUX_USAGE_CCS_E) {<br>
> + if (!intel_miptree_alloc_ccs(brw, mt)) {<br>
> + intel_miptree_release(&mt);<br>
> + return NULL;<br>
> + }<br>
> + }<br>
> + }<br>
> +<br>
> return mt;<br>
> }<br>
><br>
> @@ -849,16 +897,6 @@ intel_update_winsys_<wbr>renderbuffer_miptree(struct brw_context *intel,<br>
> if (!singlesample_mt)<br>
> goto fail;<br>
><br>
> - /* If this miptree is capable of supporting fast color clears, set<br>
> - * mcs_state appropriately to ensure that fast clears will occur.<br>
> - * Allocation of the MCS miptree will be deferred until the first fast<br>
> - * clear actually occurs.<br>
> - */<br>
> - if (intel_tiling_supports_ccs(<wbr>intel, singlesample_mt->tiling) &&<br>
> - intel_miptree_supports_ccs(<wbr>intel, singlesample_mt)) {<br>
> - singlesample_mt->aux_disable &= ~INTEL_AUX_DISABLE_CCS;<br>
> - }<br>
> -<br>
> if (num_samples == 0) {<br>
> intel_miptree_release(&irb-><wbr>mt);<br>
> irb->mt = singlesample_mt;<br>
> @@ -913,7 +951,7 @@ intel_miptree_create_for_<wbr>renderbuffer(struct brw_context *brw,<br>
> if (!mt)<br>
> goto fail;<br>
><br>
> - if (intel_miptree_wants_hiz_<wbr>buffer(brw, mt)) {<br>
> + if (mt->aux_usage == ISL_AUX_USAGE_HIZ) {<br>
> ok = intel_miptree_alloc_hiz(brw, mt);<br>
> if (!ok)<br>
> goto fail;<br>
> @@ -1492,7 +1530,7 @@ intel_miptree_alloc_mcs(struct brw_context *brw,<br>
> {<br>
> assert(brw->gen >= 7); /* MCS only used on Gen7+ */<br>
> assert(mt->mcs_buf == NULL);<br>
> - assert((mt->aux_disable & INTEL_AUX_DISABLE_MCS) == 0);<br>
> + assert(mt->aux_usage == ISL_AUX_USAGE_MCS);<br>
><br>
> /* Choose the correct format for the MCS buffer. All that really matters<br>
> * is that we allocate the right buffer size, since we'll always be<br>
> @@ -1551,11 +1589,11 @@ intel_miptree_alloc_mcs(struct brw_context *brw,<br>
><br>
> bool<br>
> intel_miptree_alloc_ccs(struct brw_context *brw,<br>
> - struct intel_mipmap_tree *mt,<br>
> - bool is_ccs_e)<br>
> + struct intel_mipmap_tree *mt)<br>
> {<br>
> assert(mt->mcs_buf == NULL);<br>
> - assert(!(mt->aux_disable & (INTEL_AUX_DISABLE_MCS | INTEL_AUX_DISABLE_CCS)));<br>
> + assert(mt->aux_usage == ISL_AUX_USAGE_CCS_E ||<br>
> + mt->aux_usage == ISL_AUX_USAGE_CCS_D);<br>
><br>
> struct isl_surf temp_main_surf;<br>
> struct isl_surf temp_ccs_surf;<br>
> @@ -1590,7 +1628,8 @@ intel_miptree_alloc_ccs(struct brw_context *brw,<br>
> * not use the gpu access flag which can cause an unnecessary delay if the<br>
> * backing pages happened to be just used by the GPU.<br>
> */<br>
> - const uint32_t alloc_flags = is_ccs_e ? 0 : BO_ALLOC_FOR_RENDER;<br>
> + const uint32_t alloc_flags =<br>
> + mt->aux_usage == ISL_AUX_USAGE_CCS_E ? 0 : BO_ALLOC_FOR_RENDER;<br>
><br>
> buf->bo = brw_bo_alloc_tiled(brw-><wbr>bufmgr, "ccs-miptree", buf->size,<br>
> I915_TILING_Y, buf->pitch, alloc_flags);<br>
> @@ -1607,7 +1646,7 @@ intel_miptree_alloc_ccs(struct brw_context *brw,<br>
> * used for lossless compression which requires similar initialisation<br>
> * as multi-sample compression.<br>
> */<br>
> - if (is_ccs_e) {<br>
> + if (mt->aux_usage == ISL_AUX_USAGE_CCS_E) {<br>
> /* Hardware sets the auxiliary buffer to all zeroes when it does full<br>
> * resolve. Initialize it accordingly in case the first renderer is<br>
> * cpu (or other none compression aware party).<br>
> @@ -1868,36 +1907,11 @@ intel_hiz_miptree_buf_create(<wbr>struct brw_context *brw,<br>
> }<br>
><br>
> bool<br>
> -intel_miptree_wants_hiz_<wbr>buffer(struct brw_context *brw,<br>
> - struct intel_mipmap_tree *mt)<br>
> -{<br>
> - if (!brw->has_hiz)<br>
> - return false;<br>
> -<br>
> - if (mt->hiz_buf != NULL)<br>
> - return false;<br>
> -<br>
> - if (mt->aux_disable & INTEL_AUX_DISABLE_HIZ)<br>
> - return false;<br>
> -<br>
> - switch (mt->format) {<br>
> - case MESA_FORMAT_Z_FLOAT32:<br>
> - case MESA_FORMAT_Z32_FLOAT_S8X24_<wbr>UINT:<br>
> - case MESA_FORMAT_Z24_UNORM_X8_UINT:<br>
> - case MESA_FORMAT_Z24_UNORM_S8_UINT:<br>
> - case MESA_FORMAT_Z_UNORM16:<br>
> - return true;<br>
> - default:<br>
> - return false;<br>
> - }<br>
> -}<br>
> -<br>
> -bool<br>
> intel_miptree_alloc_hiz(struct brw_context *brw,<br>
> struct intel_mipmap_tree *mt)<br>
> {<br>
> assert(mt->hiz_buf == NULL);<br>
> - assert((mt->aux_disable & INTEL_AUX_DISABLE_HIZ) == 0);<br>
> + assert(mt->aux_usage == ISL_AUX_USAGE_HIZ);<br>
><br>
> enum isl_aux_state **aux_state =<br>
> create_aux_state_map(mt, ISL_AUX_STATE_AUX_INVALID);<br>
> @@ -2016,7 +2030,7 @@ intel_miptree_check_color_<wbr>resolve(const struct brw_context *brw,<br>
> unsigned level, unsigned layer)<br>
> {<br>
><br>
> - if ((mt->aux_disable & INTEL_AUX_DISABLE_CCS) || !mt->mcs_buf)<br>
> + if (!mt->mcs_buf)<br>
> return;<br>
><br>
> /* Fast color clear is supported for mipmapped surfaces only on Gen8+. */<br>
> @@ -2645,7 +2659,6 @@ intel_miptree_make_shareable(<wbr>struct brw_context *brw,<br>
> 0, INTEL_REMAINING_LAYERS, false, false);<br>
><br>
> if (mt->mcs_buf) {<br>
> - mt->aux_disable |= (INTEL_AUX_DISABLE_CCS | INTEL_AUX_DISABLE_MCS);<br>
> brw_bo_unreference(mt->mcs_<wbr>buf->bo);<br>
> free(mt->mcs_buf);<br>
> mt->mcs_buf = NULL;<br>
> @@ -2659,7 +2672,6 @@ intel_miptree_make_shareable(<wbr>struct brw_context *brw,<br>
> }<br>
><br>
> if (mt->hiz_buf) {<br>
> - mt->aux_disable |= INTEL_AUX_DISABLE_HIZ;<br>
> intel_miptree_hiz_buffer_free(<wbr>mt->hiz_buf);<br>
> mt->hiz_buf = NULL;<br>
><br>
> @@ -2674,6 +2686,8 @@ intel_miptree_make_shareable(<wbr>struct brw_context *brw,<br>
> free(mt->aux_state);<br>
> mt->aux_state = NULL;<br>
> }<br>
> +<br>
> + mt->aux_usage = ISL_AUX_USAGE_NONE;<br>
> }<br>
><br>
><br>
> @@ -3716,17 +3730,7 @@ intel_miptree_get_aux_isl_<wbr>surf(struct brw_context *brw,<br>
> aux_pitch = mt->mcs_buf->pitch;<br>
> aux_qpitch = mt->mcs_buf->qpitch;<br>
><br>
> - if (mt->num_samples > 1) {<br>
> - assert(mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS);<br>
> - *usage = ISL_AUX_USAGE_MCS;<br>
> - } else if (intel_miptree_is_lossless_<wbr>compressed(brw, mt)) {<br>
> - assert(brw->gen >= 9);<br>
> - *usage = ISL_AUX_USAGE_CCS_E;<br>
> - } else if ((mt->aux_disable & INTEL_AUX_DISABLE_CCS) == 0) {<br>
> - *usage = ISL_AUX_USAGE_CCS_D;<br>
> - } else {<br>
> - unreachable("Invalid MCS miptree");<br>
> - }<br>
> + *usage = mt->aux_usage;<br>
> } else if (mt->hiz_buf) {<br>
> aux_pitch = mt->hiz_buf->aux_base.pitch;<br>
> aux_qpitch = mt->hiz_buf->aux_base.qpitch;<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
> index aa33967..f34be9a 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
> @@ -287,16 +287,6 @@ enum miptree_array_layout {<br>
> GEN6_HIZ_STENCIL,<br>
> };<br>
><br>
> -enum intel_aux_disable {<br>
> - INTEL_AUX_DISABLE_NONE = 0,<br>
> - INTEL_AUX_DISABLE_HIZ = 1 << 1,<br>
> - INTEL_AUX_DISABLE_MCS = 1 << 2,<br>
> - INTEL_AUX_DISABLE_CCS = 1 << 3,<br>
> - INTEL_AUX_DISABLE_ALL = INTEL_AUX_DISABLE_HIZ |<br>
> - INTEL_AUX_DISABLE_MCS |<br>
> - INTEL_AUX_DISABLE_CCS<br>
> -};<br>
> -<br>
> /**<br>
> * Miptree aux buffer. These buffers are associated with a miptree, but the<br>
> * format is managed by the hardware.<br>
> @@ -576,6 +566,25 @@ struct intel_mipmap_tree<br>
> struct intel_miptree_hiz_buffer *hiz_buf;<br>
><br>
> /**<br>
> + * \brief The type of auxiliary compression used by this miptree.<br>
> + *<br>
> + * This describes the type of auxiliary compression that is intended to be<br>
> + * used by this miptree. An aux usage of ISL_AUX_USAGE_NONE means that<br>
> + * auxiliary compression is permanently disabled. An aux usage other than<br>
> + * ISL_AUX_USAGE_NONE does not imply that the auxiliary buffer has actually<br>
> + * been allocated nor does it imply that auxiliary compression will always<br>
> + * be enabled for this surface. For instance, with CCS_D, we may allocate<br>
> + * the CCS on-the-fly and it may not be used for texturing if the miptree<br>
> + * is fully resolved.<br>
> + */<br>
> + enum isl_aux_usage aux_usage;<br>
> +<br>
> + /**<br>
> + * \brief Whether or not this miptree supports fast clears.<br>
> + */<br>
> + bool supports_fast_clear;<br>
> +<br>
> + /**<br>
> * \brief Maps miptree slices to their current aux state<br>
> *<br>
> * This two-dimensional array is indexed as [level][layer] and stores an<br>
> @@ -631,13 +640,6 @@ struct intel_mipmap_tree<br>
> union isl_color_value fast_clear_color;<br>
><br>
> /**<br>
> - * Disable allocation of auxiliary buffers, such as the HiZ buffer and MCS<br>
> - * buffer. This is useful for sharing the miptree bo with an external client<br>
> - * that doesn't understand auxiliary buffers.<br>
> - */<br>
> - enum intel_aux_disable aux_disable;<br>
> -<br>
> - /**<br>
> * Tells if the underlying buffer is to be also consumed by entities other<br>
> * than the driver. This allows logic to turn off features such as lossless<br>
> * compression which is not currently understood by client applications.<br>
> @@ -655,8 +657,7 @@ intel_miptree_is_lossless_<wbr>compressed(const struct brw_context *brw,<br>
><br>
> bool<br>
> intel_miptree_alloc_ccs(struct brw_context *brw,<br>
> - struct intel_mipmap_tree *mt,<br>
> - bool is_ccs_e);<br>
> + struct intel_mipmap_tree *mt);<br>
><br>
> enum {<br>
> MIPTREE_LAYOUT_ACCELERATED_<wbr>UPLOAD = 1 << 0,<br>
> @@ -814,10 +815,6 @@ intel_miptree_copy_teximage(<wbr>struct brw_context *brw,<br>
> * functions on a miptree without HiZ. In that case, each function is a no-op.<br>
> */<br>
><br>
> -bool<br>
> -intel_miptree_wants_hiz_<wbr>buffer(struct brw_context *brw,<br>
> - struct intel_mipmap_tree *mt);<br>
> -<br>
> /**<br>
> * \brief Allocate the miptree's embedded HiZ miptree.<br>
> * \see intel_mipmap_tree:hiz_mt<br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>