panfrost: Fix linear depth textures
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 10 Jan 2020 18:12:35 +0000 (13:12 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 14 Jan 2020 19:42:20 +0000 (19:42 +0000)
commit6bd9c4dc570c062e9160807fdd5ed888af22fced
treef01d5b2bc1a5d755653ec2c7c563c1e01445715d
parent7c16a1ae4e629ccbae3979ec9be105e6b44e0acf
panfrost: Fix linear depth textures

As pointed out by Boris, what we were calling PAN_LINEAR depth textures
was in fact u-interleaved tiled (!), but we never noticed since we
flipped the flag used for sampling, leading to all sorts of fun bugs
when attempting to directly acess depth textures from the CPU. Which
begs the question -- if what we called LINEAR was tiled, how do we
actually render linear depth textures? It turns out the flags for AFBC
form a mali_block_format 2-bit code just like their render-target
counterparts, so we can render to any of the above.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3393>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3393>
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_mfbd.c
src/gallium/drivers/panfrost/pan_resource.c
src/gallium/drivers/panfrost/pan_sfbd.c
src/panfrost/include/panfrost-job.h
src/panfrost/pandecode/decode.c