st/mesa: raise shader MaxParameters if driver supports more
authorBrian Paul <brianp@vmware.com>
Wed, 27 Apr 2011 15:31:30 +0000 (09:31 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 27 Apr 2011 17:58:42 +0000 (11:58 -0600)
The default value is 64 but drivers usually advertise more, like 4096.
Allows ARB vp/fp programs to use more parameters.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/mesa/state_tracker/st_extensions.c

index 2f2bc5cc560fabfec55ec934cd3ef383d1397cb7..339e00d309ccfae340d5e9e986229b81e74ebaf3 100644 (file)
@@ -167,6 +167,8 @@ void st_init_limits(struct st_context *st)
       pc->MaxNativeAddressRegs     = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ADDRS);
       pc->MaxNativeParameters      = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONSTS);
       pc->MaxUniformComponents     = 4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS);
+      /* raise MaxParameters if native support is higher */
+      pc->MaxParameters            = MAX2(pc->MaxParameters, pc->MaxNativeParameters);
 
       options->EmitNoNoise = TRUE;