[Mesa-dev] [PATCH 19/19] mesa: Remove defines for NV_vertex_program limits.

Eric Anholt eric at anholt.net
Tue Oct 9 18:06:51 PDT 2012


Note that _mesa_GetVertexAttribPointervNV() is actually
glGetVertexAttribPointerv(), which operates on the generic attributes.  The
geometry shader initialization looks like arbitrary cruft to me.
---
 src/mesa/main/config.h    |    9 ---------
 src/mesa/main/context.c   |   11 +++--------
 src/mesa/main/nvprogram.c |    2 +-
 3 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index ead1d32..1b72b54 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -204,15 +204,6 @@
 #define MAX_FRAGMENT_PROGRAM_ADDRESS_REGS 0
 /*@}*/
 
-/** For GL_NV_vertex_program */
-/*@{*/
-#define MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS 128
-#define MAX_NV_VERTEX_PROGRAM_TEMPS         12
-#define MAX_NV_VERTEX_PROGRAM_PARAMS        96
-#define MAX_NV_VERTEX_PROGRAM_INPUTS        16
-#define MAX_NV_VERTEX_PROGRAM_OUTPUTS       15
-/*@}*/
-
 /** For GL_NV_fragment_program */
 /*@{*/
 #define MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS 1024 /* 72 for GL_ARB_f_p */
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index d3fced9..4f97901 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -491,7 +491,7 @@ init_program_limits(struct gl_context *ctx, GLenum type,
    switch (type) {
    case GL_VERTEX_PROGRAM_ARB:
       prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS;
-      prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
+      prog->MaxAttribs = MAX_VERTEX_GENERIC_ATTRIBS;
       prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
       prog->MaxUniformComponents = 4 * MAX_UNIFORMS;
       break;
@@ -502,8 +502,8 @@ init_program_limits(struct gl_context *ctx, GLenum type,
       prog->MaxUniformComponents = 4 * MAX_UNIFORMS;
       break;
    case MESA_GEOMETRY_PROGRAM:
-      prog->MaxParameters = MAX_NV_VERTEX_PROGRAM_PARAMS;
-      prog->MaxAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
+      prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS;
+      prog->MaxAttribs = MAX_VERTEX_GENERIC_ATTRIBS;
       prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS;
       prog->MaxUniformComponents = MAX_GEOMETRY_UNIFORM_COMPONENTS;
       break;
@@ -688,11 +688,6 @@ check_context_limits(struct gl_context *ctx)
    assert(ctx->Const.FragmentProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
    assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
 
-   assert(MAX_NV_FRAGMENT_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
-   assert(MAX_NV_VERTEX_PROGRAM_TEMPS <= MAX_PROGRAM_TEMPS);
-   assert(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX);
-   assert(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX);
-
    /* Texture unit checks */
    assert(ctx->Const.MaxTextureImageUnits > 0);
    assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c
index 4b24dde..6565190 100644
--- a/src/mesa/main/nvprogram.c
+++ b/src/mesa/main/nvprogram.c
@@ -218,7 +218,7 @@ _mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer)
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
-   if (index >= MAX_NV_VERTEX_PROGRAM_INPUTS) {
+   if (index >= MAX_VERTEX_GENERIC_ATTRIBS) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glGetVertexAttribPointerNV(index)");
       return;
    }
-- 
1.7.10.4



More information about the mesa-dev mailing list