panfrost: Fix linear depth textures

Graphics / Mesa 3D Graphics Library / Mesa - Alyssa Rosenzweig [collabora.com] - 14 January 2020 19:42 EST

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.

6bd9c4dc570 panfrost: Fix linear depth textures
src/gallium/drivers/panfrost/pan_context.c | 6 +-----
src/gallium/drivers/panfrost/pan_mfbd.c | 32 +++++++++++++++++------------
src/gallium/drivers/panfrost/pan_resource.c | 6 +++++-
src/gallium/drivers/panfrost/pan_sfbd.c | 2 +-
src/panfrost/include/panfrost-job.h | 11 +++++-----
src/panfrost/pandecode/decode.c | 27 ++++++++++++++++++------
6 files changed, 53 insertions(+), 31 deletions(-)

Upstream: cgit.freedesktop.org


  • Share