mesa: Remove defines for NV_vertex_program limits.
authorEric Anholt <eric@anholt.net>
Wed, 10 Oct 2012 00:52:34 +0000 (17:52 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 15 Oct 2012 18:53:24 +0000 (11:53 -0700)
Note that _mesa_GetVertexAttribPointervNV() is actually
glGetVertexAttribPointerv(), which operates on the generic attributes.  The
geometry shader initialization looks like arbitrary cruft to me.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/config.h
src/mesa/main/context.c
src/mesa/main/nvprogram.c

index ead1d323c5e95ee0bd98e39bb1ee9f133937e0d0..1b72b5449fd212d7621b582c30d5ee4d37309f45 100644 (file)
 #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 */
index 29f28bd1887ec94a4ab020c0dab2d725214e2d52..1975ae0fe6e7df0b229c650cffc068c072654cda 100644 (file)
@@ -490,7 +490,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;
@@ -501,8 +501,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;
@@ -687,11 +687,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);
index 4b24dde39c6a4a6dba91a3501f565a21c55d8972..6565190552f4cdab61e00c0e3de2fd7f0bc6d2ac 100644 (file)
@@ -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;
    }