aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-08-25 05:25:41 +0200
committerMarek Olšák <[email protected]>2010-08-30 13:27:36 +0200
commit007bac83312b29061753e625edfd45ccab9ecc9c (patch)
tree094103016af69c1528f2c852d388c0237f2444a4 /src
parent77dac1945f0f8122dc933b45e407f6137c757f1d (diff)
st/mesa: set the MaxVarying GLSL constant
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_extensions.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 90e78679e47..6cd74db897b 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -161,6 +161,13 @@ void st_init_limits(struct st_context *st)
pc->MaxNativeTemps = screen->get_param(screen, PIPE_CAP_MAX_VS_TEMPS);
pc->MaxNativeAddressRegs = screen->get_param(screen, PIPE_CAP_MAX_VS_ADDRS);
pc->MaxNativeParameters = screen->get_param(screen, PIPE_CAP_MAX_VS_CONSTS);
+
+ /* PIPE_CAP_MAX_FS_INPUTS specifies the number of COLORn + GENERICn inputs
+ * and is set in MaxNativeAttribs. It's always 2 colors + N generic
+ * attributes. The GLSL compiler never uses COLORn for varyings, so we
+ * subtract the 2 colors to get the maximum number of varyings (generic
+ * attributes) supported by a driver. */
+ c->MaxVarying = screen->get_param(screen, PIPE_CAP_MAX_FS_INPUTS) - 2;
}