I don't really like this being in texture validation. It has nothing to do with texture validation. Instead, we should put it in brw_predraw_resolve_inputs and do it as a pre-pass. This would let us store astc5x5_present as a local variable. Also, I don't think we need texture_with_auxiliary_present for anything since our solution is to resolve those.
On Tue, Feb 27, 2018 at 1:30 AM, <kevin.rogo...@intel.com> wrote: > From: Kevin Rogovin <kevin.rogo...@intel.com> > > Signed-off-by: Kevin Rogovin <kevin.rogo...@intel.com> > --- > src/mesa/drivers/dri/i965/intel_tex_validate.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/src/mesa/drivers/dri/i965/intel_tex_validate.c > b/src/mesa/drivers/dri/i965/intel_tex_validate.c > index eaa60ba..2bf6c65 100644 > --- a/src/mesa/drivers/dri/i965/intel_tex_validate.c > +++ b/src/mesa/drivers/dri/i965/intel_tex_validate.c > @@ -179,6 +179,8 @@ brw_validate_textures(struct brw_context *brw) > struct gl_context *ctx = &brw->ctx; > const int max_enabled_unit = ctx->Texture._MaxEnabledTexImageUnit; > > + brw->astc5x5_wa.texture_astc5x5_present = false; > + brw->astc5x5_wa.texture_with_auxilary_present = false; > for (int unit = 0; unit <= max_enabled_unit; unit++) { > struct gl_texture_object *tex_obj = ctx->Texture.Unit[unit]._ > Current; > > @@ -194,5 +196,18 @@ brw_validate_textures(struct brw_context *brw) > > intel_update_max_level(tex_obj, sampler); > intel_finalize_mipmap_tree(brw, tex_obj); > + > + /* ASTC5x5 workaround needs to know if textures in use have > + * auxilary in buffers and/or a texture in use is ASTC5x5 > + */ > + struct intel_texture_object *tex = intel_texture_object(tex_obj); > + struct intel_mipmap_tree *mt = tex->mt; > + if (mt && mt->aux_usage != ISL_AUX_USAGE_NONE) { > + brw->astc5x5_wa.texture_with_auxilary_present = true; > + } > + if (tex->_Format == MESA_FORMAT_RGBA_ASTC_5x5 || > + tex->_Format == MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5) { > + brw->astc5x5_wa.texture_astc5x5_present = true; > + } > } > } > -- > 2.7.4 > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev