From a2db9f9ff42435bc952ae1897b76b42610aeb7b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 23 Mar 2017 23:59:56 +0100 Subject: [PATCH] mesa: remove dd_function_table::BindProgram MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Edward O'Callaghan Reviewed-by: Timothy Arceri Reviewed-by: Nicolai Hähnle --- src/mesa/drivers/common/driverfuncs.c | 1 - src/mesa/main/arbprogram.c | 3 -- src/mesa/main/atifragshader.c | 3 -- src/mesa/main/dd.h | 3 -- src/mesa/main/state.c | 55 +++++------------------------------ src/mesa/tnl/t_vp_build.c | 8 ----- 6 files changed, 7 insertions(+), 66 deletions(-) diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 642cd91..db0a107 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -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; diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index 2c60310..f3a0a54c 100644 --- a/src/mesa/main/arbprogram.c +++ b/src/mesa/main/arbprogram.c @@ -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); } diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c index 83a449a..27d8b86 100644 --- a/src/mesa/main/atifragshader.c +++ b/src/mesa/main/atifragshader.c @@ -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 diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index f300ad6..b3a85f1 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -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); diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 07629d8..5a760f5 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -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; } diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 18d105f..3d8210c 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -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); - } } -- 2.7.4