[Mesa-dev] [PATCH 33/45] mesa: replace FEATURE_NV_(fragment|vertex)_program with FEATURE_GL define.

Oliver McFadden oliver.mcfadden at linux.intel.com
Tue Sep 11 02:56:46 PDT 2012


Signed-off-by: Oliver McFadden <oliver.mcfadden at linux.intel.com>
---
 src/mesa/main/api_exec.c                  |    6 ++--
 src/mesa/main/dlist.c                     |   30 ++++++++++++++--------------
 src/mesa/main/enable.c                    |   24 +++++++++++-----------
 src/mesa/main/extensions.c                |    6 ++--
 src/mesa/main/getstring.c                 |    4 +-
 src/mesa/main/mfeatures.h                 |    2 -
 src/mesa/main/varray.c                    |    2 +-
 src/mesa/program/program.c                |   12 +++++-----
 src/mesa/state_tracker/st_draw.c          |    4 +-
 src/mesa/state_tracker/st_draw_feedback.c |    4 +-
 src/mesa/state_tracker/st_program.c       |    2 +-
 11 files changed, 47 insertions(+), 49 deletions(-)

diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
index 3758887..c6bf6dc 100644
--- a/src/mesa/main/api_exec.c
+++ b/src/mesa/main/api_exec.c
@@ -93,7 +93,7 @@
 #include "mtypes.h"
 #include "varray.h"
 #include "viewport.h"
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
+#if FEATURE_GL
 #include "nvprogram.h"
 #endif
 #include "shaderapi.h"
@@ -479,7 +479,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
 #endif
 
    /* 233. GL_NV_vertex_program */
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
    if (ctx->API == API_OPENGL) {
       SET_BindProgramNV(exec, _mesa_BindProgram);
       SET_DeleteProgramsNV(exec, _mesa_DeletePrograms);
@@ -520,7 +520,7 @@ _mesa_create_exec_table(struct gl_context *ctx)
    SET_IsVertexArrayAPPLE(exec, _mesa_IsVertexArrayAPPLE);
 
    /* 282. GL_NV_fragment_program */
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
    if (ctx->API == API_OPENGL) {
       SET_ProgramNamedParameter4fNV(exec, _mesa_ProgramNamedParameter4fNV);
       SET_ProgramNamedParameter4dNV(exec, _mesa_ProgramNamedParameter4dNV);
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index b162f9b..33ff08c 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -67,7 +67,7 @@
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
 #include "arbprogram.h"
 #endif
-#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
+#if FEATURE_GL
 #include "nvprogram.h"
 #endif
 #if FEATURE_EXT_transform_feedback
@@ -739,7 +739,7 @@ _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
+#if FEATURE_GL
          case OPCODE_LOAD_PROGRAM_NV:
             free(n[4].data);      /* program string */
             n += InstSize[n[0].opcode];
@@ -749,7 +749,7 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
             n += InstSize[n[0].opcode];
             break;
 #endif
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
          case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
             free(n[3].data);      /* parameter name */
             n += InstSize[n[0].opcode];
@@ -4859,7 +4859,7 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert)
 /*
  * GL_NV_vertex_program
  */
-#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
+#if FEATURE_GL || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
 static void GLAPIENTRY
 save_BindProgramNV(GLenum target, GLuint id)
 {
@@ -4959,9 +4959,9 @@ 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 */
+#endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_GL */
 
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
 static void GLAPIENTRY
 save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
 {
@@ -5076,13 +5076,13 @@ save_TrackMatrixNV(GLenum target, GLuint address,
       CALL_TrackMatrixNV(ctx->Exec, (target, address, matrix, transform));
    }
 }
-#endif /* FEATURE_NV_vertex_program */
+#endif /* FEATURE_GL */
 
 
 /*
  * GL_NV_fragment_program
  */
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
 static void GLAPIENTRY
 save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
                                 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
@@ -5260,7 +5260,7 @@ save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name,
                                   (GLfloat) v[3]);
 }
 
-#endif /* FEATURE_NV_fragment_program */
+#endif /* FEATURE_GL */
 
 
 
@@ -8410,12 +8410,12 @@ 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
+#if FEATURE_GL || 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
+#if FEATURE_GL
          case OPCODE_EXECUTE_PROGRAM_NV:
             {
                GLfloat v[4];
@@ -8439,7 +8439,7 @@ execute_list(struct gl_context *ctx, GLuint list)
             break;
 #endif
 
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
          case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB:
             CALL_ProgramLocalParameter4fARB(ctx->Exec,
                                             (n[1].e, n[2].ui, n[3].f, n[4].f,
@@ -8465,7 +8465,7 @@ 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
+#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_GL
          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,
@@ -10287,7 +10287,7 @@ _mesa_create_save_table(void)
    SET_MultiModeDrawArraysIBM(table, exec_MultiModeDrawArraysIBM);
    SET_MultiModeDrawElementsIBM(table, exec_MultiModeDrawElementsIBM);
 
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
    /* 233. GL_NV_vertex_program */
    /* The following commands DO NOT go into display lists:
     * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
@@ -10331,7 +10331,7 @@ _mesa_create_save_table(void)
 #endif
 
    /* 282. GL_NV_fragment_program */
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
    SET_ProgramNamedParameter4fNV(table, save_ProgramNamedParameter4fNV);
    SET_ProgramNamedParameter4dNV(table, save_ProgramNamedParameter4dNV);
    SET_ProgramNamedParameter4fvNV(table, save_ProgramNamedParameter4fvNV);
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 098ef2c..3e7e728 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -99,7 +99,7 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
          break;
 #endif
 
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
       case GL_VERTEX_ATTRIB_ARRAY0_NV:
       case GL_VERTEX_ATTRIB_ARRAY1_NV:
       case GL_VERTEX_ATTRIB_ARRAY2_NV:
@@ -124,7 +124,7 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
             flag = VERT_BIT_GENERIC(n);
          }
          break;
-#endif /* FEATURE_NV_vertex_program */
+#endif /* FEATURE_GL */
 
       /* GL_NV_primitive_restart */
       case GL_PRIMITIVE_RESTART_NV:
@@ -821,7 +821,7 @@ _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
+#if FEATURE_GL || FEATURE_ARB_vertex_program
       case GL_VERTEX_PROGRAM_ARB:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
@@ -853,7 +853,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          ctx->VertexProgram.TwoSideEnabled = state;
          break;
 #endif
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
       case GL_MAP1_VERTEX_ATTRIB0_4_NV:
       case GL_MAP1_VERTEX_ATTRIB1_4_NV:
       case GL_MAP1_VERTEX_ATTRIB2_4_NV:
@@ -904,9 +904,9 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
             ctx->Eval.Map2Attrib[map] = state;
          }
          break;
-#endif /* FEATURE_NV_vertex_program */
+#endif /* FEATURE_GL */
 
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
       case GL_FRAGMENT_PROGRAM_NV:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
@@ -916,7 +916,7 @@ _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 */
+#endif /* FEATURE_GL */
 
       /* GL_NV_texture_rectangle */
       case GL_TEXTURE_RECTANGLE_NV:
@@ -1537,7 +1537,7 @@ _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
+#if FEATURE_GL || FEATURE_ARB_vertex_program
       case GL_VERTEX_PROGRAM_ARB:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
@@ -1557,7 +1557,7 @@ _mesa_IsEnabled( GLenum cap )
          CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
          return ctx->VertexProgram.TwoSideEnabled;
 #endif
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
       case GL_VERTEX_ATTRIB_ARRAY0_NV:
       case GL_VERTEX_ATTRIB_ARRAY1_NV:
       case GL_VERTEX_ATTRIB_ARRAY2_NV:
@@ -1628,15 +1628,15 @@ _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 */
+#endif /* FEATURE_GL */
 
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
       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 */
+#endif /* FEATURE_GL */
 
       /* GL_NV_texture_rectangle */
       case GL_TEXTURE_RECTANGLE_NV:
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 50cf004..e62deee 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -497,14 +497,14 @@ _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
+#if FEATURE_GL
    ctx->Extensions.NV_vertex_program = GL_TRUE;
    ctx->Extensions.NV_vertex_program1_1 = GL_TRUE;
 #endif
-#if FEATURE_NV_fragment_program
+#if FEATURE_GL
    ctx->Extensions.NV_fragment_program = GL_TRUE;
 #endif
-#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program
+#if FEATURE_GL && FEATURE_ARB_fragment_program
    ctx->Extensions.NV_fragment_program_option = GL_TRUE;
 #endif
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index 97a2d3f..33ca2e5 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -135,8 +135,8 @@ _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
+#if FEATURE_GL || FEATURE_ARB_fragment_program || \
+    FEATURE_GL || FEATURE_ARB_vertex_program
       case GL_PROGRAM_ERROR_STRING_NV:
          if (ctx->API == API_OPENGL &&
              (ctx->Extensions.NV_fragment_program ||
diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h
index d46906d..3f6e292 100644
--- a/src/mesa/main/mfeatures.h
+++ b/src/mesa/main/mfeatures.h
@@ -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 */
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 91452b7..99e3b2c 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -431,7 +431,7 @@ _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid *ptr)
 }
 
 
-#if FEATURE_NV_vertex_program
+#if FEATURE_GL
 /**
  * Set a vertex attribute array.
  * Note that these arrays DO alias the conventional GL vertex arrays
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 3be8343..438a68c 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -83,7 +83,7 @@ _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
+#if FEATURE_GL || FEATURE_ARB_vertex_program
    ctx->VertexProgram.Enabled = GL_FALSE;
 #if FEATURE_ES2
    ctx->VertexProgram.PointSizeEnabled =
@@ -102,7 +102,7 @@ _mesa_init_program(struct gl_context *ctx)
    ctx->VertexProgram.Cache = _mesa_new_program_cache();
 #endif
 
-#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
+#if FEATURE_GL || FEATURE_ARB_fragment_program
    ctx->FragmentProgram.Enabled = GL_FALSE;
    _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
                             ctx->Shared->DefaultFragmentProgram);
@@ -132,11 +132,11 @@ _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
+#if FEATURE_GL || 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
+#if FEATURE_GL || FEATURE_ARB_fragment_program
    _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
    _mesa_delete_shader_cache(ctx, ctx->FragmentProgram.Cache);
 #endif
@@ -163,13 +163,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
+#if FEATURE_GL || 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
+#if FEATURE_GL || FEATURE_ARB_fragment_program
    _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
                             ctx->Shared->DefaultFragmentProgram);
    assert(ctx->FragmentProgram.Current);
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index a886b31..fac8e25 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -278,7 +278,7 @@ st_init_draw(struct st_context *st)
 
    vbo_set_draw_func(ctx, st_draw_vbo);
 
-#if FEATURE_GL || FEATURE_GL
+#if FEATURE_GL
    st->draw = draw_create(st->pipe); /* for selection/feedback */
 
    /* Disable draw options that might convert points/lines to tris, etc.
@@ -295,7 +295,7 @@ st_init_draw(struct st_context *st)
 void
 st_destroy_draw(struct st_context *st)
 {
-#if FEATURE_GL || FEATURE_GL
+#if FEATURE_GL
    draw_destroy(st->draw);
 #endif
 }
diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c
index 74c1e84..e1740f9 100644
--- a/src/mesa/state_tracker/st_draw_feedback.c
+++ b/src/mesa/state_tracker/st_draw_feedback.c
@@ -46,7 +46,7 @@
 #include "draw/draw_context.h"
 
 
-#if FEATURE_GL || FEATURE_GL
+#if FEATURE_GL
 
 /**
  * Set the (private) draw module's post-transformed vertex format when in
@@ -269,5 +269,5 @@ st_feedback_draw_vbo(struct gl_context *ctx,
    draw_set_vertex_buffers(draw, 0, NULL);
 }
 
-#endif /* FEATURE_GL || FEATURE_GL */
+#endif /* FEATURE_GL */
 
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index adc795b..7c5d99e 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -66,7 +66,7 @@ delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv)
    if (vpv->driver_shader) 
       cso_delete_vertex_shader(st->cso_context, vpv->driver_shader);
       
-#if FEATURE_GL || FEATURE_GL
+#if FEATURE_GL
    if (vpv->draw_shader)
       draw_delete_vertex_shader( st->draw, vpv->draw_shader );
 #endif
-- 
1.7.8.6



More information about the mesa-dev mailing list