mesa: unify MaxVertexVaryingComponents and MaxGeometryVaryingComponents
authorMarek Olšák <maraeo@gmail.com>
Thu, 2 May 2013 01:44:35 +0000 (03:44 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sat, 11 May 2013 21:45:01 +0000 (23:45 +0200)
The limits should not be different and OpenGL requires both to be at least 32,
which is also the maximum limit on radeon.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/config.h
src/mesa/main/context.c
src/mesa/main/get_hash_params.py
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_extensions.c

index 76863bf75b4b1655907dca7e9829a7a7c26ee630..c48ffdc4778f17e714ae247865f652c253693970 100644 (file)
 
 /** For GL_ARB_geometry_shader4 */
 /*@{*/
-#define MAX_GEOMETRY_VARYING_COMPONENTS              32
-#define MAX_VERTEX_VARYING_COMPONENTS                32
 #define MAX_GEOMETRY_UNIFORM_COMPONENTS              512
 #define MAX_GEOMETRY_OUTPUT_VERTICES                 256
 #define MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS         1024
index e94509ad773b872d8bbb2be82e8647e9ba396b0e..3041ec24aec368cbf1f6d1d27e630548a077be8e 100644 (file)
@@ -605,8 +605,6 @@ _mesa_init_constants(struct gl_context *ctx)
    ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
    ctx->Const.MaxVarying = 16; /* old limit not to break tnl and swrast */
    ctx->Const.GeometryProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
-   ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS;
-   ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS;
    ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES;
    ctx->Const.MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS;
 
index 596c86dc07396b37a5d1dc343d7b58944fd76244..2450759ece30f2a91ccbda81d3681b94279d1491 100644 (file)
@@ -641,8 +641,8 @@ descriptor=[
   [ "MAX_GEOMETRY_OUTPUT_VERTICES_ARB", "CONTEXT_INT(Const.MaxGeometryOutputVertices), extra_ARB_geometry_shader4" ],
   [ "MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxGeometryTotalOutputComponents), extra_ARB_geometry_shader4" ],
   [ "MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxUniformComponents), extra_ARB_geometry_shader4" ],
-  [ "MAX_GEOMETRY_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxGeometryVaryingComponents), extra_ARB_geometry_shader4" ],
-  [ "MAX_VERTEX_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxVertexVaryingComponents), extra_ARB_geometry_shader4" ],
+  [ "MAX_GEOMETRY_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxVaryingComponents), extra_ARB_geometry_shader4" ],
+  [ "MAX_VERTEX_VARYING_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxVaryingComponents), extra_ARB_geometry_shader4" ],
 
 # GL_ARB_color_buffer_float
   [ "RGBA_FLOAT_MODE_ARB", "BUFFER_FIELD(Visual.floatMode, TYPE_BOOLEAN), extra_core_ARB_color_buffer_float_and_new_buffers" ],
index 6cd8b96b54fefb173078217c4384dafab9bd37d9..1d24c9926aacc7de0507605c31b1643cd82ba72e 100644 (file)
@@ -2803,10 +2803,9 @@ struct gl_constants
    GLuint MaxRenderbufferSize;   /**< GL_EXT_framebuffer_object */
    GLuint MaxSamples;            /**< GL_ARB_framebuffer_object */
 
-   /** Number of varying vectors between vertex and fragment shaders */
+   /** Number of varying vectors between any two shader stages. */
    GLuint MaxVarying;
-   GLuint MaxVertexVaryingComponents;   /**< Between vert and geom shader */
-   GLuint MaxGeometryVaryingComponents; /**< Between geom and frag shader */
+   GLuint MaxVaryingComponents;
 
    /** @{
     * GL_ARB_uniform_buffer_object
index 9111d1fc5945bf186905029ed0bc7092482000da..6c84a269fce17d07e7dd5010c1098810b37ec813 100644 (file)
@@ -242,6 +242,7 @@ void st_init_limits(struct st_context *st)
    c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
                                             PIPE_SHADER_CAP_MAX_INPUTS);
    c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING);
+   c->MaxVaryingComponents = c->MaxVarying * 4;
 
    c->MinProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXEL_OFFSET);
    c->MaxProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXEL_OFFSET);