Skip to content

iris: Don't disable CCS for simultaneous rendering/texturing on Gfx12+

Kenneth Graunke requested to merge kwg/mesa:no-feedback-loop into main

On older hardware, we disabled compression for render targets when we detected a rendering feedback loop, where the same resource was being simultaneously sampled from and rendered to. This caused a resolve to occur for any areas bound for rendering, updating the aux data to be in the ISL_AUX_STATE_PASS_THROUGH state. So even though sampling still had CCS_E enabled, it would go fetch from the main surface memory.

Tigerlake and later have a shared L3 cache (tile cache) for both the sampler and pixel pipes. This can lead to WaR, RaW, and even RaR hazards if cachelines are accessed via both methods. One may be using compression while the other isn't. Worse, the compressed data may be stored in two different forms depending which unit populated the cache.

Fortunately, according to HSD #1604384245 (which updates the older HSD #1209978140), the hardware handles these hazards for us. We can leave compression enabled on both sides, and not worry about it in the driver. We can simply bypass the disable_rb_aux_buffer path on Gfx12+ and retain CCS_E on both sides, and let the hardware sort it out.

Gfx12.0 specifically seems to have an unknown issue with accessing surfaces in the passthrough state, leading to green noise. This avoids provoking that bug by removing the resolves, so we don't see the pass- through aux state.

Icelake also has a shared L3 cache, but different compression formats. It has fewer complications than Tigerlake, but we aren't sure that it handles the hazards correctly. Pass-through also seems to work fine there, so we leave it using the old approach for now as it's working.

Closes: #7625 (closed)

+@nchery

Merge request reports