[Mesa-dev] [PATCH 18/30] i965: Move texturing to the new resolve functions
Chad Versace
chad at kiwitree.net
Wed Jun 7 06:00:42 UTC 2017
On Fri 26 May 2017, Jason Ekstrand wrote:
> ---
> src/mesa/drivers/dri/i965/brw_context.c | 55 +++++----------------------
> src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 55 +++++++++++++++++++++++++++
> src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 6 +++
> 3 files changed, 71 insertions(+), 45 deletions(-)
> static void
> intel_update_state(struct gl_context * ctx, GLuint new_state)
> {
> @@ -259,16 +224,16 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)
> /* We need inte_texture_object::_Format to be valid */
> intel_finalize_mipmap_tree(brw, i);
>
> - if (intel_miptree_sample_with_hiz(brw, tex_obj->mt))
> - intel_miptree_all_slices_resolve_hiz(brw, tex_obj->mt);
> - else
> - intel_miptree_all_slices_resolve_depth(brw, tex_obj->mt);
> - /* Sampling engine understands lossless compression and resolving
> - * those surfaces should be skipped for performance reasons.
> - */
> - const int flags = intel_texture_view_requires_resolve(brw, tex_obj) ?
> - 0 : INTEL_MIPTREE_IGNORE_CCS_E;
> - intel_miptree_all_slices_resolve_color(brw, tex_obj->mt, flags);
> + bool aux_supported;
> + intel_miptree_prepare_texture(brw, tex_obj->mt, tex_obj->_Format,
> + &aux_supported);
> +
> + if (!aux_supported && brw->gen >= 9 &&
> + intel_disable_rb_aux_buffer(brw, tex_obj->mt->bo)) {
> + perf_debug("Sampling renderbuffer with non-compressible format - "
> + "turning off compression");
> + }
> +
I don't understand why intel_disable_rb_aux_buffer() is called here.
Specifically, I don't understand why the code disables aux for
a *framebuffer* attachment in response to the state of a *texture* view
in the *same* draw call. There is hidden subtlety here.
[time passes... tick tick tick]
In general, the GL spec claims undefined behavior when simultaneuosly
sampling and rendering to the same buffer. Self-blits are legal, though.
So, it seems to me that intel_disable_rb_aux_buffer() is applicable here
only during a glBlit* when src and dest are the same. Is that correct?
Do there exist other applicable scenarios that I'm failing to see?
Anyway, this is just a refactoring patch, so
Reviewed-by: Chad Versace <chadversary at chromium.org>
More information about the mesa-dev
mailing list