Skip to content
  • Kenneth Graunke's avatar
    iris: Disable aux for sampling/images when disabling it for rendering · 54b95fa8
    Kenneth Graunke authored
    When disable_rb_aux_buffer detects that an image is bound for rendering
    at the same time that it's bound as a sampler or image view, it flags
    that we should disable aux for the render target.  Prior to Tigerlake,
    this is all that we need, because the two don't share a common cache
    hierarchy.  Sampling can use CCS_E, but rendering uses AUX_NONE.
    
    Tigerlake adds an extra unified L3 cache, which both the sampler and
    render caches pull from and add to.  Having the sampler access a surface
    with CCS_E while the render cache accesses it with AUX_NONE means that
    we introduce cachelines in both modes into the common, shared cache,
    which seems to result in rendering corruptions.
    
    To fix this issue, we disable CCS_E for both sampling -and- rendering
    on Gfx12+ when a surface is used by both simultaneously.  This means
    that sampling loses out on compression in this corner case.
    
    I am unsure if image reads/render writes have the same conflict, since
    image access has DC-tagged L3 lines rather than C/Z-tagged L3 lines.
    For now, we assume that they do and disable aux out of caution.
    
    Closes: mesa/mesa#7272
    54b95fa8