[Mesa-dev] [PATCH v3 3/7] i965: set ASTC5x5 workaround texture type tracking on texture validate
kevin.rogovin at intel.com
kevin.rogovin at intel.com
Tue Feb 27 09:30:04 UTC 2018
From: Kevin Rogovin <kevin.rogovin at intel.com>
Signed-off-by: Kevin Rogovin <kevin.rogovin at 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
More information about the mesa-dev
mailing list