summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-05-02 03:44:35 +0200
committerMarek Olšák <[email protected]>2013-05-11 23:45:01 +0200
commit286d06ddc4968c06848faf2b375a8d20f3e74595 (patch)
tree2e6ad7508cdb46dbc36167574b87c0b352b081df
parent5e78433eec94fcaa87bdcb2526ec0910a69ed347 (diff)
mesa: unify MaxVertexVaryingComponents and MaxGeometryVaryingComponents
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 <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/mesa/main/config.h2
-rw-r--r--src/mesa/main/context.c2
-rw-r--r--src/mesa/main/get_hash_params.py4
-rw-r--r--src/mesa/main/mtypes.h5
-rw-r--r--src/mesa/state_tracker/st_extensions.c1
5 files changed, 5 insertions, 9 deletions
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 76863bf75b4..c48ffdc4778 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -245,8 +245,6 @@
/** 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
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index e94509ad773..3041ec24aec 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -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;
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 596c86dc073..2450759ece3 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -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" ],
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 6cd8b96b54f..1d24c9926aa 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -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
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 9111d1fc594..6c84a269fce 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -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);