[Mesa-dev] [PATCH 16/19] mesa: Remove miscellaneous remains of NV_vertex_program.

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


---
 src/mesa/main/enable.c      |   12 ++++++------
 src/mesa/main/extensions.c  |    2 --
 src/mesa/main/get.c         |   39 ++++++++-------------------------------
 src/mesa/main/mtypes.h      |    3 ---
 src/mesa/main/nvprogram.c   |    3 +--
 src/mesa/program/program.c  |    1 -
 src/mesa/tnl/t_vb_program.c |   32 --------------------------------
 7 files changed, 15 insertions(+), 77 deletions(-)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index e771cba..297b495 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -826,7 +826,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
       case GL_VERTEX_PROGRAM_ARB:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
-         CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
+         CHECK_EXTENSION(ARB_vertex_program, cap);
          if (ctx->VertexProgram.Enabled == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_PROGRAM); 
@@ -838,7 +838,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
           */
          if (!_mesa_is_desktop_gl(ctx))
             goto invalid_enum_error;
-         CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
+         CHECK_EXTENSION(ARB_vertex_program, cap);
          if (ctx->VertexProgram.PointSizeEnabled == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_PROGRAM);
@@ -847,7 +847,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
       case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
-         CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap);
+         CHECK_EXTENSION(ARB_vertex_program, cap);
          if (ctx->VertexProgram.TwoSideEnabled == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_PROGRAM); 
@@ -1479,7 +1479,7 @@ _mesa_IsEnabled( GLenum cap )
       case GL_VERTEX_PROGRAM_ARB:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
-         CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
+         CHECK_EXTENSION(ARB_vertex_program);
          return ctx->VertexProgram.Enabled;
       case GL_VERTEX_PROGRAM_POINT_SIZE_ARB:
          /* This was added with ARB_vertex_program, but it is also used with
@@ -1487,12 +1487,12 @@ _mesa_IsEnabled( GLenum cap )
           */
          if (!_mesa_is_desktop_gl(ctx))
             goto invalid_enum_error;
-         CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
+         CHECK_EXTENSION(ARB_vertex_program);
          return ctx->VertexProgram.PointSizeEnabled;
       case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
          if (ctx->API != API_OPENGL)
             goto invalid_enum_error;
-         CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program);
+         CHECK_EXTENSION(ARB_vertex_program);
          return ctx->VertexProgram.TwoSideEnabled;
 
       case GL_FRAGMENT_PROGRAM_NV:
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 1bdd1b1..8681c4c 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -312,8 +312,6 @@ static const struct extension extension_table[] = {
    { "GL_NV_texture_barrier",                      o(NV_texture_barrier),                      GL,             2009 },
    { "GL_NV_texture_env_combine4",                 o(NV_texture_env_combine4),                 GLL,            1999 },
    { "GL_NV_texture_rectangle",                    o(NV_texture_rectangle),                    GLL,            2000 },
-   { "GL_NV_vertex_program1_1",                    o(NV_vertex_program1_1),                    GLL,            2001 },
-   { "GL_NV_vertex_program",                       o(NV_vertex_program),                       GLL,            2000 },
    { "GL_S3_s3tc",                                 o(S3_s3tc),                                 GL,             1999 },
    { "GL_SGIS_generate_mipmap",                    o(dummy_true),                              GLL,            1997 },
    { "GL_SGIS_texture_border_clamp",               o(ARB_texture_border_clamp),                GLL,            1997 },
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index a30323b..369cdee 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -305,7 +305,6 @@ EXTRA_EXT(NV_fog_distance);
 EXTRA_EXT(EXT_texture_filter_anisotropic);
 EXTRA_EXT(IBM_rasterpos_clip);
 EXTRA_EXT(NV_point_sprite);
-EXTRA_EXT(NV_vertex_program);
 EXTRA_EXT(NV_fragment_program);
 EXTRA_EXT(NV_texture_rectangle);
 EXTRA_EXT(EXT_stencil_two_side);
@@ -331,7 +330,6 @@ EXTRA_EXT(EXT_pixel_buffer_object);
 EXTRA_EXT(ARB_vertex_program);
 EXTRA_EXT2(NV_point_sprite, ARB_point_sprite);
 EXTRA_EXT2(ARB_fragment_program, NV_fragment_program);
-EXTRA_EXT2(ARB_vertex_program, NV_vertex_program);
 EXTRA_EXT2(ARB_vertex_program, ARB_fragment_program);
 EXTRA_EXT(ARB_geometry_shader4);
 EXTRA_EXT(ARB_color_buffer_float);
@@ -344,23 +342,6 @@ EXTRA_EXT(ARB_uniform_buffer_object);
 EXTRA_EXT(ARB_timer_query);
 
 static const int
-extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
-   EXT(ARB_vertex_program),
-   EXT(ARB_fragment_program),
-   EXT(NV_vertex_program),
-   EXTRA_END
-};
-
-static const int
-extra_NV_vertex_program_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
-   EXT(NV_vertex_program),
-   EXT(ARB_vertex_program),
-   EXT(ARB_fragment_program),
-   EXT(NV_vertex_program),
-   EXTRA_END
-};
-
-static const int
 extra_NV_primitive_restart[] = {
    EXT(NV_primitive_restart),
    EXTRA_END
@@ -1026,10 +1007,6 @@ static const struct value_desc values[] = {
    { GL_POINT_SPRITE_COORD_ORIGIN, CONTEXT_ENUM(Point.SpriteOrigin),
      extra_NV_point_sprite_ARB_point_sprite },
 
-   /* GL_NV_vertex_program */
-   { GL_VERTEX_PROGRAM_BINDING_NV, LOC_CUSTOM, TYPE_INT, 0,
-     extra_NV_vertex_program },
-
    /* GL_NV_fragment_program */
    { GL_FRAGMENT_PROGRAM_NV, CONTEXT_BOOL(FragmentProgram.Enabled),
      extra_NV_fragment_program },
@@ -1083,33 +1060,33 @@ static const struct value_desc values[] = {
    /* GL_ARB_vertex_program */
    { GL_VERTEX_PROGRAM_ARB, /* == GL_VERTEX_PROGRAM_NV */
      CONTEXT_BOOL(VertexProgram.Enabled),
-     extra_ARB_vertex_program_NV_vertex_program },
+     extra_ARB_vertex_program },
    { GL_VERTEX_PROGRAM_POINT_SIZE_ARB, /* == GL_VERTEX_PROGRAM_POINT_SIZE_NV*/
      CONTEXT_BOOL(VertexProgram.PointSizeEnabled),
-     extra_ARB_vertex_program_NV_vertex_program },
+     extra_ARB_vertex_program },
    { GL_VERTEX_PROGRAM_TWO_SIDE_ARB, /* == GL_VERTEX_PROGRAM_TWO_SIDE_NV */
      CONTEXT_BOOL(VertexProgram.TwoSideEnabled),
-     extra_ARB_vertex_program_NV_vertex_program },
+     extra_ARB_vertex_program },
    { GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB, /* == GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */
      CONTEXT_INT(Const.MaxProgramMatrixStackDepth),
-     extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+     extra_ARB_vertex_program_ARB_fragment_program },
    { GL_MAX_PROGRAM_MATRICES_ARB, /* == GL_MAX_TRACK_MATRICES_NV */
      CONTEXT_INT(Const.MaxProgramMatrices),
-     extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+     extra_ARB_vertex_program_ARB_fragment_program },
    { GL_CURRENT_MATRIX_STACK_DEPTH_ARB, /* == GL_CURRENT_MATRIX_STACK_DEPTH_NV */
      LOC_CUSTOM, TYPE_INT, 0,
-     extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+     extra_ARB_vertex_program_ARB_fragment_program },
 
    { GL_CURRENT_MATRIX_ARB, /* == GL_CURRENT_MATRIX_NV */
      LOC_CUSTOM, TYPE_MATRIX, 0,
-     extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+     extra_ARB_vertex_program_ARB_fragment_program },
    { GL_TRANSPOSE_CURRENT_MATRIX_ARB, /* == GL_CURRENT_MATRIX_NV */
      LOC_CUSTOM, TYPE_MATRIX, 0,
      extra_ARB_vertex_program_ARB_fragment_program },
 
    { GL_PROGRAM_ERROR_POSITION_ARB, /* == GL_PROGRAM_ERROR_POSITION_NV */
      CONTEXT_INT(Program.ErrorPos),
-     extra_NV_vertex_program_ARB_vertex_program_ARB_fragment_program_NV_vertex_program },
+     extra_ARB_vertex_program_ARB_fragment_program },
 
    /* GL_ARB_fragment_program */
    { GL_FRAGMENT_PROGRAM_ARB, CONTEXT_BOOL(FragmentProgram.Enabled),
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index c4bc36d..11559ef 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1980,7 +1980,6 @@ struct gl_program
 struct gl_vertex_program
 {
    struct gl_program Base;   /**< base class */
-   GLboolean IsNVProgram;    /**< is this a GL_NV_vertex_program program? */
    GLboolean IsPositionInvariant;
    GLboolean UsesClipDistance;
 };
@@ -3068,8 +3067,6 @@ struct gl_extensions
    GLboolean NV_texgen_reflection;
    GLboolean NV_texture_env_combine4;
    GLboolean NV_texture_rectangle;
-   GLboolean NV_vertex_program;
-   GLboolean NV_vertex_program1_1;
    GLboolean SGIS_texture_lod;
    GLboolean TDFX_texture_compression_FXT1;
    GLboolean S3_s3tc;
diff --git a/src/mesa/main/nvprogram.c b/src/mesa/main/nvprogram.c
index 6807af5..6ad846e3 100644
--- a/src/mesa/main/nvprogram.c
+++ b/src/mesa/main/nvprogram.c
@@ -315,8 +315,7 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
    GET_CURRENT_CONTEXT(ctx);
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
-   if (!ctx->Extensions.NV_vertex_program
-       && !ctx->Extensions.NV_fragment_program) {
+   if (!ctx->Extensions.NV_fragment_program) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV()");
       return;
    }
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 80fc649..c97c696 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -504,7 +504,6 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
          const struct gl_vertex_program *vp = gl_vertex_program_const(prog);
          struct gl_vertex_program *vpc = gl_vertex_program(clone);
          vpc->IsPositionInvariant = vp->IsPositionInvariant;
-         vpc->IsNVProgram = vp->IsNVProgram;
       }
       break;
    case GL_FRAGMENT_PROGRAM_ARB:
diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c
index 61ccece..8ff300c 100644
--- a/src/mesa/tnl/t_vb_program.c
+++ b/src/mesa/tnl/t_vb_program.c
@@ -231,21 +231,6 @@ init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
    memcpy(machine->VertAttribs, ctx->Current.Attrib,
           MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat));
 
-   if (ctx->VertexProgram._Current->IsNVProgram) {
-      GLuint i;
-      /* Output/result regs are initialized to [0,0,0,1] */
-      for (i = 0; i < MAX_NV_VERTEX_PROGRAM_OUTPUTS; i++) {
-         ASSIGN_4V(machine->Outputs[i], 0.0F, 0.0F, 0.0F, 1.0F);
-      }
-      /* Temp regs are initialized to [0,0,0,0] */
-      for (i = 0; i < MAX_NV_VERTEX_PROGRAM_TEMPS; i++) {
-         ASSIGN_4V(machine->Temporaries[i], 0.0F, 0.0F, 0.0F, 0.0F);
-      }
-      for (i = 0; i < MAX_VERTEX_PROGRAM_ADDRESS_REGS; i++) {
-         ASSIGN_4V(machine->AddressReg[i], 0, 0, 0, 0);
-      }
-   }
-
    machine->NumDeriv = 0;
 
    /* init condition codes */
@@ -420,23 +405,6 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage )
 
    unmap_textures(ctx, program);
 
-   /* Fixup fog and point size results if needed */
-   if (program->IsNVProgram) {
-      if (ctx->Fog.Enabled &&
-          (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_FOGC)) == 0) {
-         for (i = 0; i < VB->Count; i++) {
-            store->results[VERT_RESULT_FOGC].data[i][0] = 1.0;
-         }
-      }
-
-      if (ctx->VertexProgram.PointSizeEnabled &&
-          (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) == 0) {
-         for (i = 0; i < VB->Count; i++) {
-            store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size;
-         }
-      }
-   }
-
    if (program->IsPositionInvariant) {
       /* We need the exact same transform as in the fixed function path here
        * to guarantee invariance, depending on compiler optimization flags
-- 
1.7.10.4



More information about the mesa-dev mailing list