<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 6, 2018 at 12:15 AM, Pohjolainen, Topi <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"><div class="HOEnZb"><div class="h5">On Fri, Jan 26, 2018 at 05:59:46PM -0800, Jason Ekstrand wrote:<br>
> Previously, blorp could only blit into something that was renderable.<br>
> Thanks to recent additions to blorp, it can now blit into basically<br>
> anything so long as it isn't compressed.<br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_<wbr>blorp.c | 67 +++++++++++++++++-------------<wbr>-----<br>
> 1 file changed, 33 insertions(+), 34 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 82d9de1..b3b007f 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_blorp.c<br>
> @@ -199,6 +199,26 @@ blorp_surf_for_miptree(struct brw_context *brw,<br>
> *level -= mt->first_level;<br>
> }<br>
> <br>
> +static bool<br>
> +brw_blorp_supports_dst_<wbr>format(struct brw_context *brw, mesa_format format)<br>
> +{<br>
> + /* If it's renderable, it's definitely supported. */<br>
> + if (brw->mesa_format_supports_<wbr>render[format])<br>
> + return true;<br>
> +<br>
> + /* BLORP can't compress anything */<br>
> + if (_mesa_is_format_compressed(<wbr>format))<br>
> + return false;<br>
> +<br>
> + /* No exotic formats such as GL_LUMINANCE_ALPHA */<br>
> + if (_mesa_get_format_bits(format, GL_RED_BITS) == 0 &&<br>
> + _mesa_get_format_bits(format, GL_DEPTH_BITS) == 0 &&<br>
> + _mesa_get_format_bits(format, GL_STENCIL_BITS) == 0)<br>
> + return false;<br>
> +<br>
> + return true;<br>
> +}<br>
> +<br>
> static enum isl_format<br>
> brw_blorp_to_isl_format(struct brw_context *brw, mesa_format format,<br>
> bool is_render_target)<br>
> @@ -216,15 +236,20 @@ brw_blorp_to_isl_format(struct brw_context *brw, mesa_format format,<br>
> return ISL_FORMAT_R32_FLOAT;<br>
> case MESA_FORMAT_Z_UNORM16:<br>
> return ISL_FORMAT_R16_UNORM;<br>
> - default: {<br>
> + default:<br>
> if (is_render_target) {<br>
> - assert(brw->mesa_format_<wbr>supports_render[format]);<br>
> - return brw->mesa_to_isl_render_<wbr>format[format];<br>
> + assert(brw_blorp_supports_dst_<wbr>format(brw, format));<br>
> + if (brw->mesa_format_supports_<wbr>render[format]) {<br>
> + return brw->mesa_to_isl_render_<wbr>format[format];<br>
> + } else {<br></div></div></blockquote><div><br>Maybe I should move the comment below up to here where it actually means something. :-)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
> + return brw_isl_format_for_mesa_<wbr>format(format);<br>
> + }<br>
> } else {<br>
> + /* Some destinations (is_render_target == true) are supported by<br>
<br>
</div></div>I didn't really understand this comment, this is inside block where<br>
"is_render_target == false".<br><div><div> </div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
> + * blorp even though we technically can't render to them.<br>
> + */<br>
> return brw_isl_format_for_mesa_<wbr>format(format);<br>
> }<br>
> - break;<br>
> - }<br>
> }<br>
> }<br>
> <br>
> @@ -553,14 +578,6 @@ try_blorp_blit(struct brw_context *brw,<br>
> src_mt = find_miptree(buffer_bit, src_irb);<br>
> dst_mt = find_miptree(buffer_bit, dst_irb);<br>
> <br>
> - /* We can't handle format conversions between Z24 and other formats<br>
> - * since we have to lie about the surface format. See the comments in<br>
> - * brw_blorp_surface_info::set().<br>
> - */<br>
> - if ((src_mt->format == MESA_FORMAT_Z24_UNORM_X8_UINT) !=<br>
> - (dst_mt->format == MESA_FORMAT_Z24_UNORM_X8_UINT)<wbr>)<br>
> - return false;<br>
> -<br>
> /* We also can't handle any combined depth-stencil formats because we<br>
> * have to reinterpret as a color format.<br>
> */<br>
> @@ -629,32 +646,14 @@ brw_blorp_copytexsubimage(<wbr>struct brw_context *brw,<br>
> struct intel_mipmap_tree *src_mt = src_irb->mt;<br>
> struct intel_mipmap_tree *dst_mt = intel_image->mt;<br>
> <br>
> - /* There is support for only up to eight samples. */<br>
> - if (src_mt->surf.samples > 8 || dst_mt->surf.samples > 8)<br>
> - return false;<br>
<br>
</div></div>Previous patches only dealt with formats and I fail to see how they enable<br>
samples > 8. We probably can, to me it just seems that this is because of<br>
something else than changes in this series. Or did I miss something?<br><div><div class="h5"></div></div></blockquote><div><br></div><div>We've been able to support 16x MSAA for a long time. This series really has nothing to do with it. I'm happy to make that it's own patch if you'd like.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
> -<br>
> - if (_mesa_get_format_base_format(<wbr>src_rb->Format) !=<br>
> - _mesa_get_format_base_format(<wbr>dst_image->TexFormat)) {<br>
> - return false;<br>
> - }<br>
> -<br>
> - /* We can't handle format conversions between Z24 and other formats since<br>
> - * we have to lie about the surface format. See the comments in<br>
> - * brw_blorp_surface_info::set().<br>
> - */<br>
> - if ((src_mt->format == MESA_FORMAT_Z24_UNORM_X8_UINT) !=<br>
> - (dst_mt->format == MESA_FORMAT_Z24_UNORM_X8_UINT)<wbr>) {<br>
> - return false;<br>
> - }<br>
> -<br>
> - /* We also can't handle any combined depth-stencil formats because we<br>
> - * have to reinterpret as a color format.<br>
> + /* We can't handle any combined depth-stencil formats because we have to<br>
> + * reinterpret as a color format.<br>
> */<br>
> if (_mesa_get_format_base_format(<wbr>src_mt->format) == GL_DEPTH_STENCIL ||<br>
> _mesa_get_format_base_format(<wbr>dst_mt->format) == GL_DEPTH_STENCIL)<br>
> return false;<br>
> <br>
> - if (!brw->mesa_format_supports_<wbr>render[dst_image->TexFormat])<br>
> + if (!brw_blorp_supports_dst_<wbr>format(brw, dst_image->TexFormat))<br>
> return false;<br>
> <br>
> /* Source clipping shouldn't be necessary, since copytexsubimage (in<br>
> -- <br>
> 2.5.0.400.gff86faf<br>
> <br>
</div></div>> ______________________________<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>
</blockquote></div><br></div></div>