<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 21, 2017 at 1:50 PM, 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"><span class="">On Wed, Jul 19, 2017 at 02:01:50PM -0700, Jason Ekstrand wrote:<br>
> This will be a bit more convenient momentarily. It's also more correct<br>
> because it makes prepare_texture take sRGB into account.<br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_<wbr>draw.c | 7 ++++++-<br>
> src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 15 +++++++--------<br>
> src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h | 2 +-<br>
> 3 files changed, 14 insertions(+), 10 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_draw.c b/src/mesa/drivers/dri/i965/<wbr>brw_draw.c<br>
> index b77b44e..01b618c 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_draw.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_draw.c<br>
> @@ -383,8 +383,13 @@ brw_predraw_resolve_inputs(<wbr>struct brw_context *brw)<br>
> if (!tex_obj || !tex_obj->mt)<br>
> continue;<br>
><br>
> +<br>
<br>
</span>Extra?<br></blockquote><div> </div><div>Yup. Fixed.<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">
> + struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, i);<br>
> + enum isl_format view_format =<br>
> + translate_tex_format(brw, tex_obj->_Format, sampler->sRGBDecode);<br>
> +<br>
> bool aux_supported;<br>
> - intel_miptree_prepare_texture(<wbr>brw, tex_obj->mt, tex_obj->_Format,<br>
> + intel_miptree_prepare_texture(<wbr>brw, tex_obj->mt, view_format,<br>
> &aux_supported);<br>
><br>
> if (!aux_supported && brw->gen >= 9 &&<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 5696886..801d830 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>
> @@ -2716,18 +2716,16 @@ intel_miptree_set_aux_state(<wbr>struct brw_context *brw,<br>
> static bool<br>
> can_texture_with_ccs(struct brw_context *brw,<br>
> struct intel_mipmap_tree *mt,<br>
> - mesa_format view_format)<br>
> + enum isl_format view_format)<br>
> {<br>
> if (mt->aux_usage != ISL_AUX_USAGE_CCS_E)<br>
> return false;<br>
><br>
> enum isl_format isl_mt_format = brw_isl_format_for_mesa_<wbr>format(mt->format);<br>
> - enum isl_format isl_view_format = brw_isl_format_for_mesa_<wbr>format(view_format);<br>
> -<br>
> if (!isl_formats_are_ccs_e_<wbr>compatible(&brw->screen-><wbr>devinfo,<br>
> - isl_mt_format, isl_view_format)) {<br>
> + isl_mt_format, view_format)) {<br>
> perf_debug("Incompatible sampling format (%s) for rbc (%s)\n",<br>
> - _mesa_get_format_name(view_<wbr>format),<br>
> + isl_format_get_layout(view_<wbr>format)->name,<br>
> _mesa_get_format_name(mt-><wbr>format));<br>
> return false;<br>
> }<br>
> @@ -2765,7 +2763,7 @@ intel_miptree_texture_aux_<wbr>usage(struct brw_context *brw,<br>
> static void<br>
> intel_miptree_prepare_texture_<wbr>slices(struct brw_context *brw,<br>
> struct intel_mipmap_tree *mt,<br>
> - mesa_format view_format,<br>
> + enum isl_format view_format,<br>
> uint32_t start_level, uint32_t num_levels,<br>
> uint32_t start_layer, uint32_t num_layers,<br>
> bool *aux_supported_out)<br>
> @@ -2791,7 +2789,7 @@ intel_miptree_prepare_texture_<wbr>slices(struct brw_context *brw,<br>
<br>
</div></div>It gets passed to intel_miptree_prepare_texture_<wbr>slices() but it doesn't do<br>
anything with it yet?<br>
<br>
Above can_texture_with_ccs() really takes it into account.<br><div><div class="h5"></div></div></blockquote><div><br></div><div>I can't tell if the above is a statement or a question. :-) It's taken into account in can_texture_with_ccs as well as in the comparison to determine whether or not we can handle clear colors. And I just realized that's broken because it's comparing mt->format to view_format. :-( I'll fix that too.<br><br></div><div>--Jason<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">
> void<br>
> intel_miptree_prepare_texture(<wbr>struct brw_context *brw,<br>
> struct intel_mipmap_tree *mt,<br>
> - mesa_format view_format,<br>
> + enum isl_format view_format,<br>
> bool *aux_supported_out)<br>
> {<br>
> intel_miptree_prepare_texture_<wbr>slices(brw, mt, view_format,<br>
> @@ -2815,7 +2813,8 @@ intel_miptree_prepare_fb_<wbr>fetch(struct brw_context *brw,<br>
> struct intel_mipmap_tree *mt, uint32_t level,<br>
> uint32_t start_layer, uint32_t num_layers)<br>
> {<br>
> - intel_miptree_prepare_texture_<wbr>slices(brw, mt, mt->format, level, 1,<br>
> + enum isl_format format = translate_tex_format(brw, mt->format, false);<br>
> + intel_miptree_prepare_texture_<wbr>slices(brw, mt, format, level, 1,<br>
> start_layer, num_layers, NULL);<br>
> }<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
> index 239791f..df413b1 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
> @@ -931,7 +931,7 @@ intel_miptree_texture_aux_<wbr>usage(struct brw_context *brw,<br>
> void<br>
> intel_miptree_prepare_texture(<wbr>struct brw_context *brw,<br>
> struct intel_mipmap_tree *mt,<br>
> - mesa_format view_format,<br>
> + enum isl_format view_format,<br>
> bool *aux_supported_out);<br>
> void<br>
> intel_miptree_prepare_image(<wbr>struct brw_context *brw,<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>