[Mesa-dev] [PATCH 2/3] glsl: Set gl_MaxVertexOutputs from VertexProgram.MaxOutputComponents etc

Ian Romanick idr at freedesktop.org
Fri Sep 27 11:55:52 PDT 2013


From: Ian Romanick <ian.d.romanick at intel.com>

gl_MaxVertexOutputVectors => ctx->Const.VertexProgram.MaxOutputComponents
gl_MaxFragmentInputVectors => ctx->Const.FragmentProgram.MaxInputComponents

v2: Add types so that the code compiles.  Pointed out by Brian.

v3: Leave gl_MaxVaryingFloats et al. as-is.  Suggested by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com> [v2]
Reviewed-by: Marek Olšák <marek.olsak at amd.com> [v2]
Reviewed-by: Paul Berry <stereotype441 at gmail.com> [v2]
---
 src/glsl/builtin_variables.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index 6a808c0..a75bb6d 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -497,9 +497,9 @@ builtin_variable_generator::generate_constants()
        */
       if (state->is_version(0, 300)) {
          add_const("gl_MaxVertexOutputVectors",
-                   state->Const.MaxVaryingFloats / 4);
+                   state->ctx->Const.VertexProgram.MaxOutputComponents / 4);
          add_const("gl_MaxFragmentInputVectors",
-                   state->Const.MaxVaryingFloats / 4);
+                   state->ctx->Const.FragmentProgram.MaxInputComponents / 4);
       } else {
          add_const("gl_MaxVaryingVectors", state->Const.MaxVaryingFloats / 4);
       }
-- 
1.8.1.4



More information about the mesa-dev mailing list