mesa: remove FEATURE_NV_(fragment|vertex)_program defines.
authorOliver McFadden <oliver.mcfadden@linux.intel.com>
Tue, 11 Sep 2012 07:41:46 +0000 (10:41 +0300)
committerOliver McFadden <oliver.mcfadden@linux.intel.com>
Sat, 15 Sep 2012 09:57:36 +0000 (12:57 +0300)
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/api_exec.c
src/mesa/main/dlist.c
src/mesa/main/enable.c
src/mesa/main/extensions.c
src/mesa/main/getstring.c
src/mesa/main/mfeatures.h
src/mesa/main/varray.c
src/mesa/program/program.c

index 8038a8f4edaf9338b485c7d3c66a915a4dd94142..3c73cc7f2a984b29759d6ca13e802cd74dfcf260 100644 (file)
@@ -91,9 +91,7 @@
 #include "mtypes.h"
 #include "varray.h"
 #include "viewport.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
 #include "nvprogram.h"
-#endif
 #include "shaderapi.h"
 #include "uniforms.h"
 #include "syncobj.h"
@@ -474,7 +472,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
 #endif
 
    /* 233. GL_NV_vertex_program */
-#if FEATURE_NV_vertex_program
    if (ctx->API == API_OPENGL) {
       SET_BindProgramNV(exec, _mesa_BindProgram);
       SET_DeleteProgramsNV(exec, _mesa_DeletePrograms);
@@ -502,7 +499,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
       SET_VertexAttribPointerNV(exec, _mesa_VertexAttribPointerNV);
       /* glVertexAttrib*NV functions handled in api_loopback.c */
    }
-#endif
    SET_GetVertexAttribPointervNV(exec, _mesa_GetVertexAttribPointervNV);
 
    /* 273. GL_APPLE_vertex_array_object */
@@ -515,7 +511,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
    SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE);
 
    /* 282. GL_NV_fragment_program */
-#if FEATURE_NV_fragment_program
    if (ctx->API == API_OPENGL) {
       SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV);
       SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV);
@@ -530,7 +525,6 @@ _mesa_create_exec_table(struct gl_context *ctx)
       SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB);
       SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB);
    }
-#endif
 
    /* 262. GL_NV_point_sprite */
 #if _HAVE_FULL_GL
index 3df4f6cc1f8884e0eb20b9cea6629b7aea23cb05..8508d95e889ae0f909f16115d4ecb096b29ac1c1 100644 (file)
@@ -67,9 +67,7 @@
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
 #include "arbprogram.h"
 #endif
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
 #include "nvprogram.h"
-#endif
 #if FEATURE_EXT_transform_feedback
 #include "transformfeedback.h"
 #endif
@@ -736,7 +734,6 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
             free(n[11].data);
             n += InstSize[n[0].opcode];
             break;
-#if FEATURE_NV_vertex_program
          case OPCODE_LOAD_PROGRAM_NV:
             free(n[4].data);      /* program string */
             n += InstSize[n[0].opcode];
@@ -745,13 +742,10 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
             free(n[2].data);      /* array of program ids */
             n += InstSize[n[0].opcode];
             break;
-#endif
-#if FEATURE_NV_fragment_program
          case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
             free(n[3].data);      /* parameter name */
             n += InstSize[n[0].opcode];
             break;
-#endif
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
          case OPCODE_PROGRAM_STRING_ARB:
             free(n[4].data);      /* program string */
@@ -4856,7 +4850,6 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert)
 /*
  * GL_NV_vertex_program
  */
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
 static void GLAPIENTRY
 save_BindProgramNV(GLenum target, GLuint id)
 {
@@ -4956,9 +4949,7 @@ save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
                                  (GLfloat) params[2], (GLfloat) params[3]);
 }
 
-#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
 
-#if FEATURE_NV_vertex_program
 static void GLAPIENTRY
 save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
 {
@@ -5073,13 +5064,11 @@ save_TrackMatrixNV(GLenum target, GLuint address,
       CALL_TrackMatrixNV(ctx->Exec, (target, address, matrix, transform));
    }
 }
-#endif /* FEATURE_NV_vertex_program */
 
 
 /*
  * GL_NV_fragment_program
  */
-#if FEATURE_NV_fragment_program
 static void GLAPIENTRY
 save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
                                 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
@@ -5257,9 +5246,6 @@ save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name,
                                   (GLfloat) v[3]);
 }
 
-#endif /* FEATURE_NV_fragment_program */
-
-
 
 /* GL_EXT_stencil_two_side */
 static void GLAPIENTRY
@@ -8403,12 +8389,9 @@ execute_list(struct gl_context *ctx, GLuint list)
          case OPCODE_WINDOW_POS_ARB:   /* GL_ARB_window_pos */
             CALL_WindowPos3fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f));
             break;
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
          case OPCODE_BIND_PROGRAM_NV:  /* GL_NV_vertex_program */
             CALL_BindProgramNV(ctx->Exec, (n[1].e, n[2].ui));
             break;
-#endif
-#if FEATURE_NV_vertex_program
          case OPCODE_EXECUTE_PROGRAM_NV:
             {
                GLfloat v[4];
@@ -8430,9 +8413,6 @@ execute_list(struct gl_context *ctx, GLuint list)
          case OPCODE_TRACK_MATRIX_NV:
             CALL_TrackMatrixNV(ctx->Exec, (n[1].e, n[2].ui, n[3].e, n[4].e));
             break;
-#endif
-
-#if FEATURE_NV_fragment_program
          case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB:
             CALL_ProgramLocalParameter4fARB(ctx->Exec,
                                             (n[1].e, n[2].ui, n[3].f, n[4].f,
@@ -8444,8 +8424,6 @@ execute_list(struct gl_context *ctx, GLuint list)
                                                        data, n[4].f, n[5].f,
                                                        n[6].f, n[7].f));
             break;
-#endif
-
          case OPCODE_ACTIVE_STENCIL_FACE_EXT:
             CALL_ActiveStencilFaceEXT(ctx->Exec, (n[1].e));
             break;
@@ -8458,13 +8436,11 @@ execute_list(struct gl_context *ctx, GLuint list)
                                   (n[1].e, n[2].e, n[3].i, n[4].data));
             break;
 #endif
-#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
          case OPCODE_PROGRAM_ENV_PARAMETER_ARB:
             CALL_ProgramEnvParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
                                                       n[4].f, n[5].f,
                                                       n[6].f));
             break;
-#endif
          case OPCODE_BEGIN_QUERY_ARB:
             CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui));
             break;
@@ -10278,7 +10254,6 @@ _mesa_create_save_table(void)
    SET_MultiModeDrawArraysIBM(table, exec_MultiModeDrawArraysIBM);
    SET_MultiModeDrawElementsIBM(table, exec_MultiModeDrawElementsIBM);
 
-#if FEATURE_NV_vertex_program
    /* 233. GL_NV_vertex_program */
    /* The following commands DO NOT go into display lists:
     * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
@@ -10309,7 +10284,6 @@ _mesa_create_save_table(void)
    SET_ProgramParameters4fvNV(table, save_ProgramParameters4fvNV);
    SET_TrackMatrixNV(table, save_TrackMatrixNV);
    SET_VertexAttribPointerNV(table, _mesa_VertexAttribPointerNV);
-#endif
 
    /* 244. GL_ATI_envmap_bumpmap */
    SET_TexBumpParameterivATI(table, save_TexBumpParameterivATI);
@@ -10322,7 +10296,6 @@ _mesa_create_save_table(void)
 #endif
 
    /* 282. GL_NV_fragment_program */
-#if FEATURE_NV_fragment_program
    SET_ProgramNamedParameter4fNV(table, save_ProgramNamedParameter4fNV);
    SET_ProgramNamedParameter4dNV(table, save_ProgramNamedParameter4dNV);
    SET_ProgramNamedParameter4fvNV(table, save_ProgramNamedParameter4fvNV);
@@ -10339,7 +10312,6 @@ _mesa_create_save_table(void)
                                      _mesa_GetProgramLocalParameterdvARB);
    SET_GetProgramLocalParameterfvARB(table,
                                      _mesa_GetProgramLocalParameterfvARB);
-#endif
 
    /* 262. GL_NV_point_sprite */
    SET_PointParameteriNV(table, save_PointParameteriNV);
index bc23cc0abd111a2bc894bef980a5d41510a436ac..d5c40cc487fd08b39ab55f1830baee487de60984 100644 (file)
@@ -97,7 +97,6 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
          flag = VERT_BIT_POINT_SIZE;
          break;
 
-#if FEATURE_NV_vertex_program
       case GL_VERTEX_ATTRIB_ARRAY0_NV:
       case GL_VERTEX_ATTRIB_ARRAY1_NV:
       case GL_VERTEX_ATTRIB_ARRAY2_NV:
@@ -122,7 +121,6 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
             flag = VERT_BIT_GENERIC(n);
          }
          break;
-#endif /* FEATURE_NV_vertex_program */
 
       /* GL_NV_primitive_restart */
       case GL_PRIMITIVE_RESTART_NV:
@@ -833,7 +831,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          ctx->Point.PointSprite = state;
          break;
 
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
       case GL_VERTEX_PROGRAM_ARB:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
@@ -864,8 +861,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          FLUSH_VERTICES(ctx, _NEW_PROGRAM); 
          ctx->VertexProgram.TwoSideEnabled = state;
          break;
-#endif
-#if FEATURE_NV_vertex_program
+
       case GL_MAP1_VERTEX_ATTRIB0_4_NV:
       case GL_MAP1_VERTEX_ATTRIB1_4_NV:
       case GL_MAP1_VERTEX_ATTRIB2_4_NV:
@@ -916,9 +912,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
             ctx->Eval.Map2Attrib[map] = state;
          }
          break;
-#endif /* FEATURE_NV_vertex_program */
 
-#if FEATURE_NV_fragment_program
       case GL_FRAGMENT_PROGRAM_NV:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
@@ -928,7 +922,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          FLUSH_VERTICES(ctx, _NEW_PROGRAM);
          ctx->FragmentProgram.Enabled = state;
          break;
-#endif /* FEATURE_NV_fragment_program */
 
       /* GL_NV_texture_rectangle */
       case GL_TEXTURE_RECTANGLE_NV:
@@ -1549,7 +1542,6 @@ _mesa_IsEnabled( GLenum cap )
          CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite)
          return ctx->Point.PointSprite;
 
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
       case GL_VERTEX_PROGRAM_ARB:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
@@ -1568,8 +1560,7 @@ _mesa_IsEnabled( GLenum cap )
             goto invalid_enum_error;
          CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
          return ctx->VertexProgram.TwoSideEnabled;
-#endif
-#if FEATURE_NV_vertex_program
+
       case GL_VERTEX_ATTRIB_ARRAY0_NV:
       case GL_VERTEX_ATTRIB_ARRAY1_NV:
       case GL_VERTEX_ATTRIB_ARRAY2_NV:
@@ -1640,15 +1631,12 @@ _mesa_IsEnabled( GLenum cap )
             const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV);
             return ctx->Eval.Map2Attrib[map];
          }
-#endif /* FEATURE_NV_vertex_program */
 
-#if FEATURE_NV_fragment_program
       case GL_FRAGMENT_PROGRAM_NV:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
          CHECK_EXTENSION(NV_fragment_program);
          return ctx->FragmentProgram.Enabled;
-#endif /* FEATURE_NV_fragment_program */
 
       /* GL_NV_texture_rectangle */
       case GL_TEXTURE_RECTANGLE_NV:
index c83ed8f21cf24b024ce59650153b201590469272..fe95a51a231195ebfa1b1c334b4992a272fe8946 100644 (file)
@@ -493,16 +493,10 @@ _mesa_enable_sw_extensions(struct gl_context *ctx)
    ctx->Extensions.NV_texture_env_combine4 = GL_TRUE;
    ctx->Extensions.NV_texture_rectangle = GL_TRUE;
    /*ctx->Extensions.NV_texgen_reflection = GL_TRUE;*/
-#if FEATURE_NV_vertex_program
    ctx->Extensions.NV_vertex_program = GL_TRUE;
    ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
-#endif
-#if FEATURE_NV_fragment_program
    ctx->Extensions.NV_fragment_program = GL_TRUE;
-#endif
-#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program
    ctx->Extensions.NV_fragment_program_option = GL_TRUE;
-#endif
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
    ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
 #endif
index 24210c34bd80b2ff5592fcc9454948769eeaf3a2..54e518d2b497735575c85360f125db7344e78743 100644 (file)
@@ -135,8 +135,6 @@ _mesa_GetString( GLenum name )
          if (ctx->API == API_OPENGLES)
             break;
         return shading_language_version(ctx);
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program || \
-    FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
       case GL_PROGRAM_ERROR_STRING_NV:
          if (ctx->API == API_OPENGL &&
              (ctx->Extensions.NV_fragment_program ||
@@ -146,7 +144,6 @@ _mesa_GetString( GLenum name )
             return (const GLubyte *) ctx->Program.ErrorString;
          }
          break;
-#endif
       default:
          break;
    }
index d46906d3e2aadf88ec526bec5865bf9dd01c8f7e..3f6e2929238611bbdd4c9b190afa01048d6ecfda 100644 (file)
@@ -99,7 +99,5 @@
 
 #define FEATURE_APPLE_object_purgeable    FEATURE_GL
 #define FEATURE_ATI_fragment_shader       FEATURE_GL
-#define FEATURE_NV_fragment_program       FEATURE_GL
-#define FEATURE_NV_vertex_program         FEATURE_GL
 
 #endif /* FEATURES_H */
index 91452b75fa628960076116218d2f364b49ffdf20..ab446e29d5a597f61454e1306eaef7be4a47165c 100644 (file)
@@ -431,7 +431,6 @@ _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr)
 }
 
 
-#if FEATURE_NV_vertex_program
 /**
  * Set a vertex attribute array.
  * Note that these arrays DO alias the conventional GL vertex arrays
@@ -462,7 +461,6 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type,
                 legalTypes, 1, BGRA_OR_4,
                 size, type, stride, normalized, GL_FALSE, ptr);
 }
-#endif
 
 
 #if FEATURE_ARB_vertex_program
index 939f3f89aafc59e25359fcf4b8c96274ee6bf758..531a93264eb8badc726be9c700d215ed92a7afe2 100644 (file)
@@ -83,7 +83,6 @@ _mesa_init_program(struct gl_context *ctx)
    ctx->Program.ErrorPos = -1;
    ctx->Program.ErrorString = _mesa_strdup("");
 
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
    ctx->VertexProgram.Enabled = GL_FALSE;
    ctx->VertexProgram.PointSizeEnabled =
       (ctx->API == API_OPENGLES2) ? GL_TRUE : GL_FALSE;
@@ -96,15 +95,12 @@ _mesa_init_program(struct gl_context *ctx)
       ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
    }
    ctx->VertexProgram.Cache = _mesa_new_program_cache();
-#endif
 
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
    ctx->FragmentProgram.Enabled = GL_FALSE;
    _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
                             ctx->Shared->DefaultFragmentProgram);
    assert(ctx->FragmentProgram.Current);
    ctx->FragmentProgram.Cache = _mesa_new_program_cache();
-#endif
 
    ctx->GeometryProgram.Enabled = GL_FALSE;
    /* right now by default we don't have a geometry program */
@@ -128,14 +124,10 @@ _mesa_init_program(struct gl_context *ctx)
 void
 _mesa_free_program_data(struct gl_context *ctx)
 {
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
    _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current, NULL);
    _mesa_delete_program_cache(ctx, ctx->VertexProgram.Cache);
-#endif
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
    _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
    _mesa_delete_shader_cache(ctx, ctx->FragmentProgram.Cache);
-#endif
    _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL);
    _mesa_delete_program_cache(ctx, ctx->GeometryProgram.Cache);
    /* XXX probably move this stuff */
@@ -159,17 +151,13 @@ _mesa_free_program_data(struct gl_context *ctx)
 void
 _mesa_update_default_objects_program(struct gl_context *ctx)
 {
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
    _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
                             ctx->Shared->DefaultVertexProgram);
    assert(ctx->VertexProgram.Current);
-#endif
 
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
    _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
                             ctx->Shared->DefaultFragmentProgram);
    assert(ctx->FragmentProgram.Current);
-#endif
 
    _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current,
                       ctx->Shared->DefaultGeometryProgram);