<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 11, 2016 at 12:26 PM, Topi Pohjolainen <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">Currently the status bits for fast clear include the flag telling<br>
if non-multisampled mcs buffer should be used at all. Once the<br>
state tracking is changed to follow individual levels/layers one<br>
still needs to have the mcs enabling information in the miptree.<br>
Therefore simply split it out to its own boolean.<br></blockquote><div><br></div><div>Thank you! The fast clear state bits have been somewhat confused for some time. Between disable_aux_buffers, intel_fast_clear_state, intel_msaa_layout, and the hiz resolve tracking, we have a bunch of different fields that track memory layout, what aux is available, and the current state of affairs and some of them are trying to track two things at once. I hope to fix that some day but this is definitely a step in the right direction.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Possible follow-up work is to combine disable_aux_buffers and<br>
no_msrt_mcs into single enum.<br></blockquote><div><br></div><div>Yeah, I think that's a good direction. I did something similar in my Vulkan CCS series where I had an "aux usage" field in the image that provided a sort of "global" picture of the usage.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Signed-off-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/brw_<wbr>blorp.c | 2 +-<br>
src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 14 +++++++++-----<br>
src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h | 12 ++++++------<br>
3 files changed, 16 insertions(+), 12 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 c55bbc8..6332788 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
@@ -780,7 +780,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->fast_clear_state == INTEL_FAST_CLEAR_STATE_NO_MCS ||<br>
+ if (irb->mt->no_msrt_mcs ||<br>
!brw_is_color_fast_clear_<wbr>compatible(brw, irb->mt, &ctx->Color.ClearColor))<br>
can_fast_clear = false;<br>
<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 ce72e2c..4fb07e9 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>
@@ -374,8 +374,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->fast_clear_state = INTEL_FAST_CLEAR_STATE_NO_MCS;<br>
+ mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_<wbr>RESOLVED;<br>
mt->disable_aux_buffers = (layout_flags & MIPTREE_LAYOUT_DISABLE_AUX) != 0;<br>
+ mt->no_msrt_mcs = true;<br>
mt->is_scanout = (layout_flags & MIPTREE_LAYOUT_FOR_SCANOUT) != 0;<br>
exec_list_make_empty(&mt->hiz_<wbr>map);<br>
mt->cpp = _mesa_get_format_bytes(format)<wbr>;<br>
@@ -787,7 +788,7 @@ intel_miptree_create(struct brw_context *brw,<br>
*/<br>
if (intel_tiling_supports_non_<wbr>msrt_mcs(brw, mt->tiling) &&<br>
intel_miptree_supports_non_<wbr>msrt_fast_clear(brw, mt)) {<br>
- mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_<wbr>RESOLVED;<br>
+ mt->no_msrt_mcs = false;<br>
assert(brw->gen < 8 || mt->halign == 16 || num_samples <= 1);<br>
<br>
/* On Gen9+ clients are not currently capable of consuming compressed<br>
@@ -1582,6 +1583,7 @@ intel_miptree_alloc_non_msrt_<wbr>mcs(struct brw_context *brw,<br>
{<br>
assert(mt->mcs_mt == NULL);<br>
assert(!mt->disable_aux_<wbr>buffers);<br>
+ assert(!mt->no_msrt_mcs);<br>
<br>
/* The format of the MCS buffer is opaque to the driver; all that matters<br>
* is that we get its size and pitch right. We'll pretend that the format<br>
@@ -2126,6 +2128,9 @@ intel_miptree_resolve_color(<wbr>struct brw_context *brw,<br>
unsigned level, unsigned layer,<br>
int flags)<br>
{<br>
+ if (mt->no_msrt_mcs)<br>
+ return false;<br>
+<br>
intel_miptree_check_color_<wbr>resolve(mt, level, layer);<br>
<br>
/* From gen9 onwards there is new compression scheme for single sampled<br>
@@ -2137,7 +2142,6 @@ intel_miptree_resolve_color(<wbr>struct brw_context *brw,<br>
return false;<br>
<br>
switch (mt->fast_clear_state) {<br>
- case INTEL_FAST_CLEAR_STATE_NO_MCS:<br>
case INTEL_FAST_CLEAR_STATE_<wbr>RESOLVED:<br>
/* No resolve needed */<br>
return false;<br>
@@ -2187,7 +2191,7 @@ intel_miptree_make_shareable(<wbr>struct brw_context *brw,<br>
if (mt->mcs_mt) {<br>
intel_miptree_all_slices_<wbr>resolve_color(brw, mt, 0);<br>
intel_miptree_release(&mt-><wbr>mcs_mt);<br>
- mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_NO_MCS;<br>
+ mt->no_msrt_mcs = true;<br>
}<br>
}<br>
<br>
@@ -3268,7 +3272,7 @@ intel_miptree_get_aux_isl_<wbr>surf(struct brw_context *brw,<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->fast_clear_state != INTEL_FAST_CLEAR_STATE_NO_MCS) {<br>
+ } else if (!mt->no_msrt_mcs) {<br>
*usage = ISL_AUX_USAGE_CCS_D;<br>
} else {<br>
unreachable("Invalid MCS miptree");<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 bfb8ad5..57d7b80 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>
@@ -220,12 +220,6 @@ enum intel_msaa_layout<br>
enum intel_fast_clear_state<br>
{<br>
/**<br>
- * There is no MCS buffer for this miptree, and one should never be<br>
- * allocated.<br>
- */<br>
- INTEL_FAST_CLEAR_STATE_NO_MCS,<br>
-<br>
- /**<br>
* No deferred clears are pending for this miptree, and the contents of the<br>
* color buffer are entirely correct. An MCS buffer may or may not exist<br>
* for this miptree. If it does exist, it is entirely in the "no deferred<br>
@@ -676,6 +670,12 @@ struct intel_mipmap_tree<br>
bool disable_aux_buffers;<br>
<br>
/**<br>
+ * Fast clear and lossless compression are always disabled for this<br>
+ * miptree.<br>
+ */<br>
+ bool no_msrt_mcs;<br></blockquote><div><br></div><div>Please choose a different name for this boolean. What you have right now unabreviates to "no multisampled render target MCS" but it's for single-sampled. The single-sampled color compression surface is referred to in the gen8 docs and prior as a non-multisampled MCS which we abbreviate various places in the driver as non_msrt_mcs which is 1 character off the name of this field. When I read this I can't tell if you're saying "no non-msrt MCS" or "no-msrt MCS enabled".<br><br></div><div>One option would be "no_ccs". I know that the docs overload CCS to also include multisampled surfaces. However, in ISL, we chose the convention of CCS means single-sampled and MCS means multisampled. I'm also open to other names.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<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>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.5<br>
<br>
______________________________<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>
</font></span></blockquote></div><br></div></div>