panfrost: Rewrite texture descriptor creation logic

Graphics / Mesa 3D Graphics Library / Mesa - Alyssa Rosenzweig [collabora.com] - 21 February 2020 12:27 EST

Rather than creating partially within the Gallium create function and monkeypatching on draw time with code split across N different files with tight Gallium dependencies, let's streamline everything into a series of maintainable routines in mesa/src/panfrost with no Gallium dependencies, doing the entire texture creation in one-shot and thus adding absolutely zero draw-time overhead (since we can allocate a BO for the descriptor and upload ahead-of-time, so switching textures is as cheap as switching pointers).

Was this worth it? You know, I'm not sure :|

b929565ea8d panfrost: Rewrite texture descriptor creation logic
src/gallium/drivers/panfrost/pan_context.c | 188 +++++------------------
src/gallium/drivers/panfrost/pan_context.h | 4 +-
src/gallium/drivers/panfrost/pan_resource.c | 21 +--
src/panfrost/encoder/pan_texture.c | 230 ++++++++++++++++++++++++++++
src/panfrost/encoder/pan_texture.h | 31 ++++
5 files changed, 306 insertions(+), 168 deletions(-)

Upstream: cgit.freedesktop.org


  • Share