From 017cbab5b05d714e9c83474decce1946fa10e011 Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Sun, 8 Dec 2019 11:54:31 -0500 Subject: [PATCH] etnaviv: disable integer vertex formats on pre-HALTI2 hardware Signed-off-by: Jonathan Marek Reviewed-by: Christian Gmeiner --- src/gallium/drivers/etnaviv/etnaviv_screen.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 823042a1f25..cec94cc333d 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -434,6 +434,18 @@ gpu_supports_render_format(struct etna_screen *screen, enum pipe_format format, return true; } +static bool +gpu_supports_vertex_format(struct etna_screen *screen, enum pipe_format format) +{ + if (translate_vertex_format_type(format) == ETNA_NO_MATCH) + return false; + + if (util_format_is_pure_integer(format)) + return VIV_FEATURE(screen, chipMinorFeatures4, HALTI2); + + return true; +} + static bool etna_screen_is_format_supported(struct pipe_screen *pscreen, enum pipe_format format, @@ -472,7 +484,7 @@ etna_screen_is_format_supported(struct pipe_screen *pscreen, } if (usage & PIPE_BIND_VERTEX_BUFFER) { - if (translate_vertex_format_type(format) != ETNA_NO_MATCH) + if (gpu_supports_vertex_format(screen, format)) allowed |= PIPE_BIND_VERTEX_BUFFER; } -- 2.30.2