<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 21, 2018 at 1:45 PM, Rafael Antognolli <span dir="ltr"><<a href="mailto:rafael.antognolli@intel.com" target="_blank">rafael.antognolli@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Similarly to vulkan where we store the clear value in the aux surface,<br>
we can do the same in GL.<br>
<br>
v2: Remove unneeded extra function.<br>
v3: Use clear_value_state_size instead of clear_value_size.<br>
<br>
Signed-off-by: Rafael Antognolli <<a href="mailto:rafael.antognolli@intel.com">rafael.antognolli@intel.com</a>><br>
---<br>
 src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 10 ++++++++++<br>
 1 file changed, 10 insertions(+)<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 6d35c9d3928..7bdd4d89ccc 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>
@@ -1676,6 +1676,16 @@ intel_alloc_aux_buffer(struct brw_context *brw,<br>
       return false;<br>
<br>
    buf->size = aux_surf->size;<br>
+<br>
+   const struct gen_device_info *devinfo = &brw->screen->devinfo;<br>
+   if (devinfo->gen >= 10) {<br>
+      /* On CNL, instead of setting the clear color in the SURFACE_STATE, we<br>
+       * will set a pointer to a dword somewhere that contains the color. So,<br>
+       * allocate the space for the clear color value here on the aux buffer.<br>
+       */<br>
+      buf->size += brw->isl_dev.ss.clear_value_<wbr>state_size;<br></blockquote><div><br></div><div>So, this is a bit sticky...  There are two places that we get CCS buffers.  One is here and the other is when the image gets created through the window system and has the I915_FORMAT_MOD_Y_TILED_CCS modifier.  In the second (modifier) case, we need to put the clear color in its own BO.  Yeah, that's a bit silly but there's not much more we can do.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+   }<br>
+<br>
    buf->pitch = aux_surf->row_pitch;<br>
    buf->qpitch = isl_surf_get_array_pitch_sa_<wbr>rows(aux_surf);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.14.3<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>