zink: track/check submit info on resource batch usage
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 12 May 2023 16:26:52 +0000 (12:26 -0400)
committerMarge Bot <emma+marge@anholt.net>
Mon, 22 May 2023 23:26:45 +0000 (23:26 +0000)
commitdb12b881c7fdbbe534b21b9d169db0a905c2c704
tree99d419d16627e0b5fb2ddf25c9957ba5a975f22e
parent5e1943db7f75ad1f5de9066a41649787385f9b7b
zink: track/check submit info on resource batch usage

resources use a private refcount to avoid overhead from atomics on
descriptor binds, but this has the side effect of evading batch usage,
meaning that the usage may not be properly removed once the batch state
is reset, which will cause issues with detecting whether usage exists
for a given resource

to fix this, the mechanism for tc fence disambiguation can be reused,
namely adding the batch state's submit count to the usage info and
then using that to add a second set of comparisons such that it becomes
possible to check both whether the batch usage for a resource matches
a given batch AND whether the batch usage is the current state of the
batch

affects:
KHR-GLES3.copy_tex_image_conversions.required.cubemap_posy_cubemap_negz

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23035>
src/gallium/drivers/zink/zink_bo.h
src/gallium/drivers/zink/zink_types.h