[Mesa-dev] [PATCH 1/2] st/mesa: add color varyings to MaxVarying

Marek Olšák maraeo at gmail.com
Tue Nov 22 06:05:29 PST 2011


The linker now adds color varyings to the number of used varyings and checks
against that limit.
---
 src/mesa/state_tracker/st_extensions.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 3563e1d..240497a 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -205,12 +205,10 @@ void st_init_limits(struct st_context *st)
          options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536);
    }
 
-   /* 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_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_INPUTS) - 2;
+   /* PIPE_SHADER_CAP_MAX_INPUTS for the FS specifies the maximum number
+    * of inputs. It's always 2 colors + N generic inputs. */
+   c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
+                                            PIPE_SHADER_CAP_MAX_INPUTS);
    c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING);
 
    /* XXX we'll need a better query here someday */
-- 
1.7.5.4



More information about the mesa-dev mailing list