st/mesa: clamp Max program param limits
authorMarek Olšák <maraeo@gmail.com>
Mon, 12 Sep 2011 10:46:45 +0000 (12:46 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 12 Sep 2011 14:55:21 +0000 (16:55 +0200)
Setting just MAX_PROGRAM_ENV_PARAMS to 4096 breaks everything,
so let's do this instead.

This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=40767

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_extensions.c

index 0ad9e1286ea0337a614e7058177b0f5acca3f5ab..722db8d774f004de62c49f96f383c10b70029114 100644 (file)
@@ -176,8 +176,8 @@ void st_init_limits(struct st_context *st)
       /* Gallium doesn't really care about local vs. env parameters so use the
        * same limits.
        */
-      pc->MaxLocalParams = pc->MaxParameters;
-      pc->MaxEnvParams = pc->MaxParameters;
+      pc->MaxLocalParams = MIN2(pc->MaxParameters, MAX_PROGRAM_LOCAL_PARAMS);
+      pc->MaxEnvParams = MIN2(pc->MaxParameters, MAX_PROGRAM_ENV_PARAMS);
 
       options->EmitNoNoise = TRUE;