asahi: unbind samplers and fix sampler_count if state is NULL
authorIago López Galeiras <iaguis@gmail.com>
Tue, 13 Dec 2022 17:51:25 +0000 (18:51 +0100)
committerMarge Bot <emma+marge@anholt.net>
Wed, 14 Dec 2022 00:13:44 +0000 (00:13 +0000)
commit5f2171625b17d66fd568e3813c9dff11fe0f307e
tree55afcba11323914666e84f2f98292199804f7524
parent687a82d2d3debc3391d0ac66e8b3b6d099b7f3d5
asahi: unbind samplers and fix sampler_count if state is NULL

When states is NULL, unbind samplers (to avoid dangling pointers) and
set sampler_count to the highest non-null samplers[] entry instead of
setting it to 0.

This is ported from a similar fix in panfrost:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20285

Signed-off-by: Iago López Galeiras <iaguis@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20306>
src/gallium/drivers/asahi/agx_state.c
src/gallium/drivers/asahi/agx_state.h