<p dir="ltr"></p>
<p dir="ltr">On Sep 2, 2016 8:55 AM, "Pohjolainen, Topi" <<a href="mailto:topi.pohjolainen@gmail.com">topi.pohjolainen@gmail.com</a>> wrote:<br>
><br>
> On Fri, Sep 02, 2016 at 07:59:15AM -0700, Jason Ekstrand wrote:<br>
> > On Sep 2, 2016 3:07 AM, "Pohjolainen, Topi"<br>
> > <[1]<a href="mailto:topi.pohjolainen@gmail.com">topi.pohjolainen@gmail.com</a>> wrote:<br>
> > ><br>
> > > On Fri, Sep 02, 2016 at 08:34:27AM +0300, Pohjolainen, Topi wrote:<br>
> > > > On Thu, Sep 01, 2016 at 02:33:48PM -0700, Jason Ekstrand wrote:<br>
> > > > > On Wed, Aug 31, 2016 at 8:17 AM, Topi Pohjolainen<br>
> > > > > <[1][2]<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>> wrote:<br>
> > > > ><br>
> > > > > From: Topi Pohjolainen <[2][3]<a href="mailto:topi.pohjolainen@gmail.com">topi.pohjolainen@gmail.com</a>><br>
> > > > > Blorp consults brw_is_color_fast_clear_compatible() to see<br>
> > if any<br>
> > > > > restrictions apply for fast clear in addition to the<br>
> > capablities<br>
> > > > > advertised in isl_format.c::format_info[]. On Gen8+ integer<br>
> > formats<br>
> > > > > are backlisted for plain old fast clear but there is no<br>
> > reason why<br>
> > > > > lossless compression shouldn't be supported. In fact,<br>
> > lossless<br>
> > > > > compression of integer formats is already supported for<br>
> > normal<br>
> > > > > render paths.<br>
> > > > > This patch prepares for dropping the delayed allocating of<br>
> > the mcs<br>
> > > > > buffer for lossless compression. Until now the skip of fast<br>
> > clear<br>
> > > > > also prevented the mcs being allocated and hence the<br>
> > lossless<br>
> > > > > compression being effectively turned off for integer<br>
> > formats.<br>
> > > > > Once the mcs buffer is allocated beforehand, the assertion<br>
> > addressed<br>
> > > > > here would start triggering.<br>
> > > > > Signed-off-by: Topi Pohjolainen<br>
> > <[3][4]<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
> > > > > ---<br>
> > > > > src/mesa/drivers/dri/i965/brw_blorp.c | 6 +++++-<br>
> > > > > 1 file changed, 5 insertions(+), 1 deletion(-)<br>
> > > > > diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c<br>
> > > > > b/src/mesa/drivers/dri/i965/brw_blorp.c<br>
> > > > > index c902f2e..7e257e9 100644<br>
> > > > > --- a/src/mesa/drivers/dri/i965/brw_blorp.c<br>
> > > > > +++ b/src/mesa/drivers/dri/i965/brw_blorp.c<br>
> > > > > @@ -761,8 +761,12 @@ do_single_blorp_clear(struct<br>
> > brw_context *brw,<br>
> > > > > struct gl_framebuffer *fb,<br>
> > > > > /* Compressed buffers can be cleared also using<br>
> > normal<br>
> > > > > rep-clear. In<br>
> > > > > * such case they bahave such as if they were<br>
> > drawn using<br>
> > > > > normal 3D<br>
> > > > > * render pipeline, and we simply mark the mcs as<br>
> > dirty.<br>
> > > > > + *<br>
> > > > > + * Fast clear of integer formats is not supported<br>
> > on<br>
> > > > > Gen8+. See<br>
> > > > > + * brw_is_color_fast_clear_compatible(). This,<br>
> > however,<br>
> > > > > doesn't<br>
> > > > > + * prevent lossless compression on Gen9+.<br>
> > > > > */<br>
> > > > > - assert(partial_clear);<br>
> > > > > + assert(partial_clear ||<br>
> > _mesa_is_format_integer_color(<br>
> > > > > format));<br>
> > > > ><br>
> > > > > How about assert(isl_format_supports_lossless_compression())?<br>
> > > ><br>
> > > > Instead of _mesa_is_format_integer_color()? Sounds good to me.<br>
> > ><br>
> > > Well, I suppose we could just drop the assert? This is in a<br>
> > conditional<br>
> > > block:<br>
> ><br>
> > Yeah, really the code that's protected by the assert has nothing to do<br>
> > with fast clears. Instead, it's just "you rendered into a compressed<br>
> > render target with compression, flag it as unresolved". We probably<br>
> > need similar code in brw_blorp_blit_miptrees of we don't have it<br>
> > already.<br>
><br>
> Just in the end of brw_blorp_blit_miptrees() we have:<br>
><br>
> if (intel_miptree_is_lossless_compressed(brw, dst_mt))<br>
> dst_mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_UNRESOLVED;</p>
<p dir="ltr">Awesome! I didn't bother to look. :-/</p>