[Mesa-dev] [PATCH 0/5] i965: ASTC5x5 workaround

Pohjolainen, Topi topi.pohjolainen at gmail.com
Sat Dec 2 10:42:24 UTC 2017


On Fri, Dec 01, 2017 at 07:19:17PM +0200, kevin.rogovin at intel.com wrote:
> From: Kevin Rogovin <kevin.rogovin at intel.com>
> 
> This patch series implements a needed workaround for Gen9 for ASTC5x5
> sampler reads. The crux of the work around is to make sure that the
> sampler does not read an ASTC5x5 texture and a surface with an auxilary
> buffer without having a texture cache invalidate between such accesses.

The solution here is to store the types of read access (aux, astc5x5) into
context. This information is then used for two purposes: 

   1) do extra tex cache flush when needed and specifically only when needed
   2) resolve surfaces when undesired combination is about to be sampled

Latter case could be addressed also with on-the-fly check in
brw_predraw_resolve_inputs(). There one goes thru all the active textures for
the next draw call and resolves when necessary. One could check for the
undesired combination of textures there. I understand we would need to walk
the textures twice, first to check for any occurences of one type and
then for the other. This, however, would fit to the way we resolve other
texture types and prevent from adding more things to check into the context.

In the first case, if one didn't optimize, i.e., do the extra flush only when
needed, one could instead check if ASTC5x5 texture is going to be sampled and
flush before and after the draw call to be safe. This is not optimal but also
code-wise that simple that I'd be curious to know how much the optimized
flushing helps.

I think the non-optimized cases should be doable also in Vulkan. Jason, what
do you think?

> 
> 
> Kevin Rogovin (5):
>   i965: define astc5x5 workaround infrastructure
>   i965: ASTC5x5 workaround logic for blorp
>   i965: set ASTC5x5 workaround texture type tracking on texture validate
>   i965: use ASTC5x5 workaround in brw_draw
>   i965: use ASTC5x5 workaround in brw_compute
> 
>  src/mesa/drivers/dri/i965/brw_compute.c          |  6 +++
>  src/mesa/drivers/dri/i965/brw_context.c          | 63 ++++++++++++++++++++++++
>  src/mesa/drivers/dri/i965/brw_context.h          | 23 +++++++++
>  src/mesa/drivers/dri/i965/brw_draw.c             |  6 +++
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c |  5 ++
>  src/mesa/drivers/dri/i965/genX_blorp_exec.c      |  5 ++
>  src/mesa/drivers/dri/i965/intel_batchbuffer.c    |  1 +
>  src/mesa/drivers/dri/i965/intel_tex_image.c      | 16 ++++--
>  src/mesa/drivers/dri/i965/intel_tex_validate.c   | 13 +++++
>  9 files changed, 134 insertions(+), 4 deletions(-)
> 
> -- 
> 2.14.2
> 
> _______________________________________________
> 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