mesa: remove dd_function_table::BindProgram
authorMarek Olšák <marek.olsak@amd.com>
Thu, 23 Mar 2017 22:59:56 +0000 (23:59 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 29 Mar 2017 13:44:00 +0000 (15:44 +0200)
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/drivers/common/driverfuncs.c
src/mesa/main/arbprogram.c
src/mesa/main/atifragshader.c
src/mesa/main/dd.h
src/mesa/main/state.c
src/mesa/tnl/t_vp_build.c

index 642cd91ce1fbcf6588772e49f581ddf377d8e987..db0a107fe89f13cb60eb1bea45818bb338534891 100644 (file)
@@ -113,7 +113,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
    driver->DrawTex = _mesa_meta_DrawTex;
 
    /* Vertex/fragment programs */
-   driver->BindProgram = NULL;
    driver->NewProgram = _mesa_new_program;
    driver->DeleteProgram = _mesa_delete_program;
 
index 2c6031096ac7d810cfd90a6367b4e169c2005efa..f3a0a54c0167f40f9554dea73d7266c0ffae49e4 100644 (file)
@@ -118,9 +118,6 @@ _mesa_BindProgramARB(GLenum target, GLuint id)
    /* Never null pointers */
    assert(ctx->VertexProgram.Current);
    assert(ctx->FragmentProgram.Current);
-
-   if (ctx->Driver.BindProgram)
-      ctx->Driver.BindProgram(ctx, target, newProg);
 }
 
 
index 83a449a1b132e73036e22968b4c4974b799787ea..27d8b8647705e953acfcb74f8ef0b836b5ee415d 100644 (file)
@@ -264,9 +264,6 @@ _mesa_BindFragmentShaderATI(GLuint id)
    assert(ctx->ATIFragmentShader.Current);
    if (newProg)
       newProg->RefCount++;
-
-   /*if (ctx->Driver.BindProgram)
-      ctx->Driver.BindProgram(ctx, target, prog); */
 }
 
 void GLAPIENTRY
index f300ad6cc008514c80dec27256491b11a8326325..b3a85f19857c70beeb908c8273e89cdb65331813 100644 (file)
@@ -469,9 +469,6 @@ struct dd_function_table {
     * \name Vertex/fragment program functions
     */
    /*@{*/
-   /** Bind a vertex/fragment program */
-   void (*BindProgram)(struct gl_context *ctx, GLenum target,
-                       struct gl_program *prog);
    /** Allocate a new program */
    struct gl_program * (*NewProgram)(struct gl_context *ctx, GLenum target,
                                      GLuint id, bool is_arb_asm);
index 07629d8ccac8260da6f11a22bfa2a20b25581c08..5a760f5e5d00fe6d8d431b5afd72a32992a65b8c 100644 (file)
@@ -80,8 +80,7 @@ update_program_enables(struct gl_context *ctx)
 
 /**
  * Update the ctx->*Program._Current pointers to point to the
- * current/active programs.  Then call ctx->Driver.BindProgram() to
- * tell the driver which programs to use.
+ * current/active programs.
  *
  * Programs may come from 3 sources: GLSL shaders, ARB/NV_vertex/fragment
  * programs or programs derived from fixed-function state.
@@ -238,53 +237,13 @@ update_program(struct gl_context *ctx)
 
    /* Let the driver know what's happening:
     */
-   if (ctx->FragmentProgram._Current != prevFP) {
+   if (ctx->FragmentProgram._Current != prevFP ||
+       ctx->VertexProgram._Current != prevVP ||
+       ctx->GeometryProgram._Current != prevGP ||
+       ctx->TessEvalProgram._Current != prevTEP ||
+       ctx->TessCtrlProgram._Current != prevTCP ||
+       ctx->ComputeProgram._Current != prevCP)
       new_state |= _NEW_PROGRAM;
-      if (ctx->Driver.BindProgram) {
-         ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB,
-                                 ctx->FragmentProgram._Current);
-      }
-   }
-
-   if (ctx->GeometryProgram._Current != prevGP) {
-      new_state |= _NEW_PROGRAM;
-      if (ctx->Driver.BindProgram) {
-         ctx->Driver.BindProgram(ctx, GL_GEOMETRY_PROGRAM_NV,
-                                 ctx->GeometryProgram._Current);
-      }
-   }
-
-   if (ctx->TessEvalProgram._Current != prevTEP) {
-      new_state |= _NEW_PROGRAM;
-      if (ctx->Driver.BindProgram) {
-         ctx->Driver.BindProgram(ctx, GL_TESS_EVALUATION_PROGRAM_NV,
-                                 ctx->TessEvalProgram._Current);
-      }
-   }
-
-   if (ctx->TessCtrlProgram._Current != prevTCP) {
-      new_state |= _NEW_PROGRAM;
-      if (ctx->Driver.BindProgram) {
-         ctx->Driver.BindProgram(ctx, GL_TESS_CONTROL_PROGRAM_NV,
-                                 ctx->TessCtrlProgram._Current);
-      }
-   }
-
-   if (ctx->VertexProgram._Current != prevVP) {
-      new_state |= _NEW_PROGRAM;
-      if (ctx->Driver.BindProgram) {
-         ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB,
-                                 ctx->VertexProgram._Current);
-      }
-   }
-
-   if (ctx->ComputeProgram._Current != prevCP) {
-      new_state |= _NEW_PROGRAM;
-      if (ctx->Driver.BindProgram) {
-         ctx->Driver.BindProgram(ctx, GL_COMPUTE_PROGRAM_NV,
-                                 ctx->ComputeProgram._Current);
-      }
-   }
 
    return new_state;
 }
index 18d105f5fd02ef75a856a40dd2dcdb6ba90cb87c..3d8210cec25739fa43eac43a7f372985fccc1143 100644 (file)
@@ -48,12 +48,4 @@ void _tnl_UpdateFixedFunctionProgram( struct gl_context *ctx )
          = ctx->VertexProgram._TnlProgram
          = _mesa_get_fixed_func_vertex_program(ctx);
    }
-
-   /* Tell the driver about the change.  Could define a new target for
-    * this?
-    */
-   if (ctx->VertexProgram._Current != prev && ctx->Driver.BindProgram) {
-      ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB,
-                              ctx->VertexProgram._Current);
-   }
 }