glsl: Set gl_MaxVertexOutputs from VertexProgram.MaxOutputComponents etc
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 10 Sep 2013 17:13:04 +0000 (12:13 -0500)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 7 Oct 2013 16:59:23 +0000 (09:59 -0700)
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@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> [v2]
Reviewed-by: Marek Olšák <marek.olsak@amd.com> [v2]
Reviewed-by: Paul Berry <stereotype441@gmail.com> [v2]
src/glsl/builtin_variables.cpp

index 6a808c072a26acb3dc5cff963180738c862e0537..a75bb6ddab45e0ae206e67fcec6f3c61a89d1b80 100644 (file)
@@ -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);
       }