Mesa (master): st/mesa: raise shader MaxParameters if driver supports more

Brian Paul brianp at kemper.freedesktop.org
Wed Apr 27 10:59:05 PDT 2011


Module: Mesa
Branch: master
Commit: f9cc6acbfa6f6f91b29a0601436d91a330fdce79
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9cc6acbfa6f6f91b29a0601436d91a330fdce79

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Apr 27 09:31:30 2011 -0600

st/mesa: raise shader MaxParameters if driver supports more

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 at vmware.com>

---

 src/mesa/state_tracker/st_extensions.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 2f2bc5c..339e00d 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -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;
 



More information about the mesa-commit mailing list