Module: Mesa Branch: 17.3 Commit: a399c7fa1d5b88b25b798319db7b3ce71805d5b6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a399c7fa1d5b88b25b798319db7b3ce71805d5b6
Author: Jason Ekstrand <jason.ekstr...@intel.com> Date: Wed Jan 24 11:51:08 2018 -0800 i965: Stop disabling aux during texture preparation Previously, we were handling self-dependencies by marking the render buffer and then passing disable_aux=true to prepare_texture so that it would do a resolve. This works but ends us up doing to much resolving in some cases. Specifically, if we're doing something such as mipmap generation, this would cause us to resolve all levels of the texture if even one of them is overlapping. Instead, this commit makes us wait until we process the framebuffer to do these resolves and we only resolve the slices needed for rendering. Doing this resolve puts them into the pass-through state so, even if we do texture using CCS_E, the CCS data will effectively be ignored and the real surface contents read. Reviewed-by: Kenneth Graunke <kenn...@whitecape.org> (cherry picked from commit df13588d2176dcf4800a882d926f389667772b46) --- src/mesa/drivers/dri/i965/brw_draw.c | 12 +++++------- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 5 ++--- src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 3 +-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index a22c3c6ae6..edc8269bd7 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -443,15 +443,15 @@ brw_predraw_resolve_inputs(struct brw_context *brw, bool rendering, num_layers = INTEL_REMAINING_LAYERS; } - const bool disable_aux = rendering && + if (rendering) { intel_disable_rb_aux_buffer(brw, draw_aux_buffer_disabled, tex_obj->mt, min_level, num_levels, "for sampling"); + } intel_miptree_prepare_texture(brw, tex_obj->mt, view_format, min_level, num_levels, - min_layer, num_layers, - disable_aux); + min_layer, num_layers); /* If any programs are using it with texelFetch, we may need to also do * a prepare with an sRGB format to ensure texelFetch works "properly". @@ -462,8 +462,7 @@ brw_predraw_resolve_inputs(struct brw_context *brw, bool rendering, if (txf_format != view_format) { intel_miptree_prepare_texture(brw, tex_obj->mt, txf_format, min_level, num_levels, - min_layer, num_layers, - disable_aux); + min_layer, num_layers); } } @@ -535,8 +534,7 @@ brw_predraw_resolve_framebuffer(struct brw_context *brw, if (irb) { intel_miptree_prepare_texture(brw, irb->mt, irb->mt->surf.format, irb->mt_level, 1, - irb->mt_layer, irb->layer_count, - false); + irb->mt_layer, irb->layer_count); } } } diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index bed6dd7ce1..a28e4ac01e 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -2650,10 +2650,9 @@ intel_miptree_prepare_texture(struct brw_context *brw, struct intel_mipmap_tree *mt, enum isl_format view_format, uint32_t start_level, uint32_t num_levels, - uint32_t start_layer, uint32_t num_layers, - bool disable_aux) + uint32_t start_layer, uint32_t num_layers) { - enum isl_aux_usage aux_usage = disable_aux ? ISL_AUX_USAGE_NONE : + enum isl_aux_usage aux_usage = intel_miptree_texture_aux_usage(brw, mt, view_format); bool clear_supported = aux_usage != ISL_AUX_USAGE_NONE; diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h index 6135af1452..7fcf09f118 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h @@ -642,8 +642,7 @@ intel_miptree_prepare_texture(struct brw_context *brw, struct intel_mipmap_tree *mt, enum isl_format view_format, uint32_t start_level, uint32_t num_levels, - uint32_t start_layer, uint32_t num_layers, - bool disable_aux); + uint32_t start_layer, uint32_t num_layers); void intel_miptree_prepare_image(struct brw_context *brw, struct intel_mipmap_tree *mt); _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit