From: Marek Olšák Date: Mon, 12 Sep 2011 10:46:45 +0000 (+0200) Subject: st/mesa: clamp Max program param limits X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f37a5081b229b020553c45e32e9888af77cfd3d6;p=mesa.git st/mesa: clamp Max program param limits 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 --- diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 0ad9e1286ea..722db8d774f 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -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;