v3d: rebind sampler view if resource changed the BO
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 3 Mar 2022 11:09:32 +0000 (12:09 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 4 Mar 2022 17:20:28 +0000 (17:20 +0000)
commit7ffee7f1ab3c7f7f652f73d0c33f4504ffba5e89
tree83aa14b833ff2bbcef26301ba1c9d1a4ead9dbff
parent7bda838c56111bde0d27d208a725abf215ed85bb
v3d: rebind sampler view if resource changed the BO

When discarding the whole resource to create a new one, if this resource
is used by a sampler view, a rebind must be done to use the new
resource.

But this must be done when setting the sampler views, because we don't
have access to those samplers before.

v2:
 - Pack shader state on setting sampler views (Iago)
 - Use a serial ID to know when to rebind sampler views (Juan)

v3:
 - Move check to caller (Iago)
 - Keep rebind sampler view on BO change (Iago)

v4:
 - Rename "serial_bo" to "serial_id" (Iago)
 - Add comments (Iago)

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6027
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15171>
src/gallium/drivers/v3d/v3d_context.h
src/gallium/drivers/v3d/v3d_resource.c
src/gallium/drivers/v3d/v3d_resource.h
src/gallium/drivers/v3d/v3dx_state.c