[Mesa-dev] [PATCH 24/32] i965/miptree: Take an isl_format in prepare_texture
Pohjolainen, Topi
topi.pohjolainen at gmail.com
Fri Jul 21 20:50:54 UTC 2017
On Wed, Jul 19, 2017 at 02:01:50PM -0700, Jason Ekstrand wrote:
> This will be a bit more convenient momentarily. It's also more correct
> because it makes prepare_texture take sRGB into account.
> ---
> src/mesa/drivers/dri/i965/brw_draw.c | 7 ++++++-
> src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 15 +++++++--------
> src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 2 +-
> 3 files changed, 14 insertions(+), 10 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
> index b77b44e..01b618c 100644
> --- a/src/mesa/drivers/dri/i965/brw_draw.c
> +++ b/src/mesa/drivers/dri/i965/brw_draw.c
> @@ -383,8 +383,13 @@ brw_predraw_resolve_inputs(struct brw_context *brw)
> if (!tex_obj || !tex_obj->mt)
> continue;
>
> +
Extra?
> + struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, i);
> + enum isl_format view_format =
> + translate_tex_format(brw, tex_obj->_Format, sampler->sRGBDecode);
> +
> bool aux_supported;
> - intel_miptree_prepare_texture(brw, tex_obj->mt, tex_obj->_Format,
> + intel_miptree_prepare_texture(brw, tex_obj->mt, view_format,
> &aux_supported);
>
> if (!aux_supported && brw->gen >= 9 &&
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 5696886..801d830 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -2716,18 +2716,16 @@ intel_miptree_set_aux_state(struct brw_context *brw,
> static bool
> can_texture_with_ccs(struct brw_context *brw,
> struct intel_mipmap_tree *mt,
> - mesa_format view_format)
> + enum isl_format view_format)
> {
> if (mt->aux_usage != ISL_AUX_USAGE_CCS_E)
> return false;
>
> enum isl_format isl_mt_format = brw_isl_format_for_mesa_format(mt->format);
> - enum isl_format isl_view_format = brw_isl_format_for_mesa_format(view_format);
> -
> if (!isl_formats_are_ccs_e_compatible(&brw->screen->devinfo,
> - isl_mt_format, isl_view_format)) {
> + isl_mt_format, view_format)) {
> perf_debug("Incompatible sampling format (%s) for rbc (%s)\n",
> - _mesa_get_format_name(view_format),
> + isl_format_get_layout(view_format)->name,
> _mesa_get_format_name(mt->format));
> return false;
> }
> @@ -2765,7 +2763,7 @@ intel_miptree_texture_aux_usage(struct brw_context *brw,
> static void
> intel_miptree_prepare_texture_slices(struct brw_context *brw,
> struct intel_mipmap_tree *mt,
> - mesa_format view_format,
> + enum isl_format view_format,
> uint32_t start_level, uint32_t num_levels,
> uint32_t start_layer, uint32_t num_layers,
> bool *aux_supported_out)
> @@ -2791,7 +2789,7 @@ intel_miptree_prepare_texture_slices(struct brw_context *brw,
It gets passed to intel_miptree_prepare_texture_slices() but it doesn't do
anything with it yet?
Above can_texture_with_ccs() really takes it into account.
> void
> intel_miptree_prepare_texture(struct brw_context *brw,
> struct intel_mipmap_tree *mt,
> - mesa_format view_format,
> + enum isl_format view_format,
> bool *aux_supported_out)
> {
> intel_miptree_prepare_texture_slices(brw, mt, view_format,
> @@ -2815,7 +2813,8 @@ intel_miptree_prepare_fb_fetch(struct brw_context *brw,
> struct intel_mipmap_tree *mt, uint32_t level,
> uint32_t start_layer, uint32_t num_layers)
> {
> - intel_miptree_prepare_texture_slices(brw, mt, mt->format, level, 1,
> + enum isl_format format = translate_tex_format(brw, mt->format, false);
> + intel_miptree_prepare_texture_slices(brw, mt, format, level, 1,
> start_layer, num_layers, NULL);
> }
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> index 239791f..df413b1 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> @@ -931,7 +931,7 @@ intel_miptree_texture_aux_usage(struct brw_context *brw,
> void
> intel_miptree_prepare_texture(struct brw_context *brw,
> struct intel_mipmap_tree *mt,
> - mesa_format view_format,
> + enum isl_format view_format,
> bool *aux_supported_out);
> void
> intel_miptree_prepare_image(struct brw_context *brw,
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list