asahi, agx: Implement dummy samplers
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 3 Mar 2023 04:02:05 +0000 (23:02 -0500)
committerMarge Bot <emma+marge@anholt.net>
Sat, 11 Mar 2023 02:26:31 +0000 (02:26 +0000)
commit826649ba1959e56d527feccc31a8a466337a4a03
tree34487148cf3aebc840ea898189af153ef1a36313
parentbc178c044eca6175b9b9a4d01938a6de147599f7
asahi, agx: Implement dummy samplers

In NIR, texelFetch (txf) does not use a sampler, but in AGX, it does -- even
though the contents of the sampler are semantically irrelevant. Rather than
requiring the state tracker to bind a sampler anyway (indicated for texture
buffers with PIPE_CAP_TEXTURE_BUFFER_SAMPLER), just add a dummy sampler
ourselves if txf is used and there are otherwise no samplers. This is helpful
because PIPE_CAP_TEXTURE_BUFFER_SAMPLER isn't honoured by Rusticl or seemingly
mesa/st's PBO code, and after implementing this dummy sampler workaround in
Panfrost for Rusticl, I realized this CAP is silly and shouldn't exist in the
first place. (And I regret pushing for its reinclusion.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21672>
src/asahi/compiler/agx_compile.c
src/asahi/compiler/agx_compile.h
src/gallium/drivers/asahi/agx_pipe.c
src/gallium/drivers/asahi/agx_state.c