From 45cb5eee5d52844b86e20309db260425b81a97d4 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Wed, 14 Aug 2019 11:32:50 +0200 Subject: [PATCH] etnaviv: put uniform limit determination into own function Signed-off-by: Christian Gmeiner Reviewed-by: Lucas Stach l.stach@pengutronix.de --- src/gallium/drivers/etnaviv/etnaviv_screen.c | 22 +++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 8c80c1e9556..28b577bc3a5 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -526,6 +526,19 @@ etna_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen, *count = num_modifiers; } +static void +etna_determine_uniform_limits(struct etna_screen *screen) +{ + /* from QueryShaderCaps in kernel driver */ + if (screen->model < chipModel_GC4000) { + screen->specs.max_vs_uniforms = 168; + screen->specs.max_ps_uniforms = 64; + } else { + screen->specs.max_vs_uniforms = 256; + screen->specs.max_ps_uniforms = 256; + } +} + static bool etna_get_specs(struct etna_screen *screen) { @@ -688,14 +701,7 @@ etna_get_specs(struct etna_screen *screen) if (screen->specs.max_varyings > ETNA_NUM_VARYINGS) screen->specs.max_varyings = ETNA_NUM_VARYINGS; - /* from QueryShaderCaps in kernel driver */ - if (screen->model < chipModel_GC4000) { - screen->specs.max_vs_uniforms = 168; - screen->specs.max_ps_uniforms = 64; - } else { - screen->specs.max_vs_uniforms = 256; - screen->specs.max_ps_uniforms = 256; - } + etna_determine_uniform_limits(screen); if (screen->specs.halti >= 5) { screen->specs.has_unified_uniforms = true; -- 2.30.2