radeonsi: fix ps_uses_fbfetch value
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 29 Oct 2021 13:12:50 +0000 (15:12 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 4 Nov 2021 08:38:42 +0000 (09:38 +0100)
commitbc6d22b92002dc43a8c742ab234717147d63ad87
treee8142c956c08a80ae82b9a1b03fefbe2c5053f3f
parentd86d602ed0c75c30840ca6bac98556ffa99304ea
radeonsi: fix ps_uses_fbfetch value

si_update_ps_colorbuf0_slot used blitter_running as a way to detect
recursive calls.
Unfortunately this catch too many cases; for instance a backtrace
like:
  #0 si_update_ps_colorbuf0_slot
  #1 si_set_framebuffer_state
  #2 do_blits
  [...]
  #5 si_blit
  #6 si_copy_region_with_blit

Would end-up not updating ps_uses_fbfetch; so if the new fb_state is
something like:
  cbufs = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, zsbuf = 0x55b8987545e0}

We can have ps_uses_fbfetch=true but cbufs[0] = NULL, which causes a
crash later in si_ps_key_update_framebuffer.

This commit fixes intermittent crashes in KHR-GL46.stencil_texturing.functional.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13550>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_pipe.h