From dad69c7ccd246cd069649ee0106d5c1d798869eb Mon Sep 17 00:00:00 2001 From: Jose Maria Casanova Crespo Date: Tue, 31 Aug 2021 18:40:23 +0200 Subject: [PATCH] vc4: export supported prim types by vc4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is now handled by gallium. v2: Fix incorrect indentation (Alejandro Piñeiro) Reference: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5277 Suggested-by: Mike Blumenkrantz Acked-By: Mike Blumenkrantz Reviewed-by: Alejandro Piñeiro Part-of: --- src/gallium/drivers/vc4/vc4_screen.c | 13 +++++++++++++ src/gallium/drivers/vc4/vc4_screen.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index 5cfce4d..40d49cc 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -204,6 +204,9 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_TEXRECT: return 0; + case PIPE_CAP_SUPPORTED_PRIM_MODES: + return screen->prim_types; + default: return u_pipe_screen_get_param_defaults(pscreen, param); } @@ -606,6 +609,16 @@ vc4_screen_create(int fd, struct renderonly *ro) pscreen->get_driver_query_info = vc4_get_driver_query_info; } + /* Generate the bitmask of supported draw primitives. */ + screen->prim_types = BITFIELD_BIT(PIPE_PRIM_POINTS) | + BITFIELD_BIT(PIPE_PRIM_LINES) | + BITFIELD_BIT(PIPE_PRIM_LINE_LOOP) | + BITFIELD_BIT(PIPE_PRIM_LINE_STRIP) | + BITFIELD_BIT(PIPE_PRIM_TRIANGLES) | + BITFIELD_BIT(PIPE_PRIM_TRIANGLE_STRIP) | + BITFIELD_BIT(PIPE_PRIM_TRIANGLE_FAN); + + return pscreen; fail: diff --git a/src/gallium/drivers/vc4/vc4_screen.h b/src/gallium/drivers/vc4/vc4_screen.h index 2a5a160..06342f7 100644 --- a/src/gallium/drivers/vc4/vc4_screen.h +++ b/src/gallium/drivers/vc4/vc4_screen.h @@ -92,6 +92,7 @@ struct vc4_screen { uint32_t bo_size; uint32_t bo_count; + uint32_t prim_types; bool has_control_flow; bool has_etc1; bool has_threaded_fs; -- 2.7.4