<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 27, 2017 at 11:32 AM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
---<br>
src/intel/isl/isl.c | 9 +++++++--<br>
1 file changed, 7 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c<br>
index f89f351c15..ce5b35c47c 100644<br>
--- a/src/intel/isl/isl.c<br>
+++ b/src/intel/isl/isl.c<br>
@@ -1610,14 +1610,19 @@ isl_surf_get_ccs_surf(const struct isl_device *dev,<br>
return false;<br>
}<br>
<br>
+ /* Multi-LOD and multi-layer CCS isn't supported on gen7. */<br>
+ const uint8_t levels = ISL_DEV_GEN(dev) == 7 ? 1 : surf->levels;<br>
+ const uint32_t array_len = ISL_DEV_GEN(dev) == 7 ?<br>
+ 1 : surf->logical_level0_px.array_<wbr>len;<br>
+<br></blockquote><div><br></div><div>The GL driver does<br><br> if (brw->gen < 8 && (mip_mapped || arrayed))<br> return false;<br><br></div><div>Which is a bit stronger condition. I think this is probably ok though so long as we're careful.<br><br></div><div>It might be worth adding the following asserts to blorp_fast_clear and blorp_ccs_resolve:<br></div><div><br></div><div>assert(level < surf->aux_surf->levels);<br></div><div>if (surf->surf->dim == ISL_SURF_DIM_3D) {<br> assert(start_layer < surf->aux_surf->logical_level0_px.depth);<br> assert(start_layer + num_layers < surf->aux_surf->logical_level0_px.depth);</div><div>} else {<br></div><div> assert(start_layer < surf->aux_surf->logical_level0_px.array_len);<br><div> assert(start_layer + num_layers < surf->aux_surf->logical_level0_px.array_len);<br>}<br><br></div><div>That way we'll catch it if anyone ever tries to resolve/fast-clear a miplevel or array slice that isn't there.<br></div></div><div><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
return isl_surf_init(dev, ccs_surf,<br>
.dim = surf->dim,<br>
.format = ccs_format,<br>
.width = surf->logical_level0_px.width,<br>
.height = surf->logical_level0_px.<wbr>height,<br>
.depth = surf->logical_level0_px.depth,<br>
- .levels = surf->levels,<br>
- .array_len = surf->logical_level0_px.array_<wbr>len,<br>
+ .levels = levels,<br>
+ .array_len = array_len,<br>
.samples = 1,<br>
.usage = ISL_SURF_USAGE_CCS_BIT,<br>
.tiling_flags = ISL_TILING_CCS_BIT);<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
2.12.2<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>