<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Dec 1, 2017 at 2:44 PM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Gen10 doesn't automatically decode the clear color of sRGB buffers. To<br>
get correct rendering, avoid fast-clearing such buffers for now.<br>
<br>
The driver now passes the following piglit tests:<br>
* spec@arb_framebuffer_srgb@<wbr>msaa-fast-clear<br>
* spec@ext_texture_srgb@<wbr>multisample-fast-clear gl_ext_texture_srgb<br>
<br>
Suggested-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
Suggested-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
---<br>
<br>
This patch is currently going through the jenkins pipeline.<br>
<br>
src/mesa/drivers/dri/i965/brw_<wbr>meta_util.c | 14 ++++++++++++--<br>
1 file changed, 12 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_meta_util.c b/src/mesa/drivers/dri/i965/<wbr>brw_meta_util.c<br>
index ba92168934..54dc6a5ff9 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_meta_util.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_meta_util.c<br>
@@ -298,13 +298,23 @@ brw_is_color_fast_clear_<wbr>compatible(struct brw_context *brw,<br>
* resolved in intel_update_state. In that case it's pointless to do a<br>
* fast clear because it's very likely to be immediately resolved.<br>
*/<br>
+ const bool srgb_rb = _mesa_get_srgb_format_linear(<wbr>mt->format) != mt->format;<br>
if (devinfo->gen >= 9 &&<br>
mt->surf.samples == 1 &&<br>
- ctx->Color.sRGBEnabled &&<br>
- _mesa_get_srgb_format_linear(<wbr>mt->format) != mt->format)<br>
+ ctx->Color.sRGBEnabled && srgb_rb)<br>
return false;<br>
<br>
+ /* Gen10 doesn't automatically decode the clear color of sRGB buffers. Since<br>
+ * we currently don't perform this decode in software, avoid a fast-clear<br>
+ * altogether. TODO: Do this in software.<br>
+ */<br>
const mesa_format format = _mesa_get_render_format(ctx, mt->format);<br>
+ if (devinfo->gen >= 10 && srgb_rb) {<br></blockquote><div><br></div><div>We could be a bit more precise and only disable it for non-0/1. Either way,</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ perf_debug("sRGB fast clear not enabled for (%s)",<br>
+ _mesa_get_format_name(format))<wbr>;<br></blockquote><div><br></div><div>Thanks for leaving a perf_debug!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ return false;<br>
+ }<br>
+<br>
if (_mesa_is_format_integer_<wbr>color(format)) {<br>
if (devinfo->gen >= 8) {<br>
perf_debug("Integer fast clear not enabled for (%s)",<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.15.1<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>