From eed8421bbac0ba814a5634550fd4ea02baec57a9 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Mon, 6 Dec 2021 17:37:35 +0800 Subject: [PATCH] gallium: add screen get_sparse_texture_virtual_page_size callback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For ARB_sparse_texture extension to query driver supported page size for each texture format. Reviewed-by: Marek Olšák Signed-off-by: Qiang Yu Part-of: --- src/gallium/include/pipe/p_screen.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 904c7ba03a0..54eea130c96 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -653,6 +653,22 @@ struct pipe_screen { uint64_t modifier, enum pipe_format format); + /** + * Get supported page sizes for sparse texture. + * + * \p size is the array size of \p x, \p y and \p z. + * + * \p offset sets an offset into the possible format page size array, + * used to pick a specific xyz size combination. + * + * \return Number of supported page sizes, 0 means not support. + */ + int (*get_sparse_texture_virtual_page_size)(struct pipe_screen *screen, + enum pipe_texture_target target, + enum pipe_format format, + unsigned offset, unsigned size, + int *x, int *y, int *z); + /** * Vertex state CSO functions for precomputing vertex and index buffer * states for display lists.