iris: Drop the RT flush for PIPE_BARRIER_TEXTURE
authorNanley Chery <nanley.g.chery@intel.com>
Thu, 15 Sep 2022 22:41:59 +0000 (15:41 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 15 Jun 2023 14:57:18 +0000 (14:57 +0000)
commite3b794c184c6eba584030f277a263aedbd6e8127
treee7d84a41f6247e76432a69caeedadb4fbe1e4042
parentbb6d300b3a3878109bd07fbee241547ec0009ef7
iris: Drop the RT flush for PIPE_BARRIER_TEXTURE

The render target flush would have been needed if it was possible to:

1) pollute the render cache and write to the data port in one draw
   call.

2) perform a subsequent operation that assumed the render cache was
   up-to-date.

However, this is not possible for the two glMemoryBarrier barrier bits
that get translated to this pipe barrier:

* GL_TEXTURE_FETCH_BARRIER_BIT is only used for sampling operations.
  It's possible to pollute the render cache and data cache with writes
  to a texture in one draw call (1). However, the GL spec states that
  apps cannot assume that any existing render caches are up-to-date for
  sampling the written locations immediately afterwards. Apps are
  required to use glTextureBarrier before the sampling operation, so
  requirement #2 is not satisfied.

* GL_PIXEL_BUFFER_BARRIER_BIT could be used for a PBO upload (2), but
  it's not possible to pollute the render cache and data cache with a
  PBO access in one draw call. PBOs cannot be bound to framebuffers
  for rendering, so requirement #1 is not satisfied.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18725>
src/gallium/drivers/iris/iris_pipe_control.c