etnaviv: put uniform limit determination into own function
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 14 Aug 2019 09:32:50 +0000 (11:32 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 14 Aug 2019 10:29:56 +0000 (12:29 +0200)
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach l.stach@pengutronix.de
src/gallium/drivers/etnaviv/etnaviv_screen.c

index 8c80c1e95565284b5b1f22c94c7df9bd13add169..28b577bc3a545ee025812247495c75c046d59377 100644 (file)
@@ -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;