mesa: remove MAX_WIDTH from prog_execute.h
authorBrian Paul <brianp@vmware.com>
Mon, 20 Feb 2012 18:07:01 +0000 (11:07 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 24 Feb 2012 15:03:12 +0000 (08:03 -0700)
define a PROG_MAX_WIDTH var instead.  It has to match MAX_WIDTH in
swrast.  More elaborate refactoring could fix that (someday).

src/mesa/program/prog_execute.h
src/mesa/swrast/s_context.c

index cdf3708..1ae302c 100644 (file)
@@ -39,6 +39,10 @@ typedef void (*FetchTexelDerivFunc)(struct gl_context *ctx, const GLfloat texcoo
                                     GLuint unit, GLfloat color[4]);
 
 
+/** NOTE: This must match SWRAST_MAX_WIDTH */
+#define PROG_MAX_WIDTH 16384
+
+
 /**
  * Virtual machine state used during execution of vertex/fragment programs.
  */
@@ -47,7 +51,7 @@ struct gl_program_machine
    const struct gl_program *CurProgram;
 
    /** Fragment Input attributes */
-   GLfloat (*Attribs)[MAX_WIDTH][4];
+   GLfloat (*Attribs)[PROG_MAX_WIDTH][4];
    GLfloat (*DerivX)[4];
    GLfloat (*DerivY)[4];
    GLuint NumDeriv; /**< Max index into DerivX/Y arrays */
index 32f95de..63350b2 100644 (file)
@@ -736,6 +736,8 @@ _swrast_CreateContext( struct gl_context *ctx )
    assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
    assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
 
+   assert(PROG_MAX_WIDTH == SWRAST_MAX_WIDTH);
+
    if (SWRAST_DEBUG) {
       _mesa_debug(ctx, "_swrast_CreateContext\n");
    }