[Mesa-dev] [PATCH 5/6] r200: remove BindProgram
Marek Olšák
maraeo at gmail.com
Thu Mar 23 23:42:05 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
---
src/mesa/drivers/dri/r200/r200_state.c | 5 +++++
src/mesa/drivers/dri/r200/r200_vertprog.c | 16 ----------------
2 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index 4a248d2..86733a8 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -2272,26 +2272,31 @@ GLboolean r200ValidateState( struct gl_context *ctx )
else TCL_FALLBACK(ctx, R200_TCL_FALLBACK_VERTEX_PROGRAM, 0);
}
rmesa->radeon.NewGLState = 0;
return GL_TRUE;
}
static void r200InvalidateState( struct gl_context *ctx, GLuint new_state )
{
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
_vbo_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
_ae_invalidate_state( ctx, new_state );
R200_CONTEXT(ctx)->radeon.NewGLState |= new_state;
+
+ if (new_state & _NEW_PROGRAM)
+ rmesa->curr_vp_hw = NULL;
}
/* A hack. The r200 can actually cope just fine with materials
* between begin/ends, so fix this.
* Should map to inputs just like the generic vertex arrays for vertex progs.
* In theory there could still be too many and we'd still need a fallback.
*/
static GLboolean check_material( struct gl_context *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index 0a3e984..100b715 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -1176,35 +1176,20 @@ void r200SetupVertexProg( struct gl_context *ctx ) {
rmesa->hw.vpi[1].cmd_size = 1 + 4 * (count - 64);
tmp.i = rmesa->hw.vpi[1].cmd[VPI_CMD_0];
tmp.veclinear.count = count - 64;
rmesa->hw.vpi[1].cmd[VPI_CMD_0] = tmp.i;
}
rmesa->curr_vp_hw = vp;
}
}
-static void
-r200BindProgram(struct gl_context *ctx, GLenum target, struct gl_program *prog)
-{
- r200ContextPtr rmesa = R200_CONTEXT(ctx);
-
- switch(target){
- case GL_VERTEX_PROGRAM_ARB:
- rmesa->curr_vp_hw = NULL;
- break;
- default:
- _mesa_problem(ctx, "Target not supported yet!");
- break;
- }
-}
-
static struct gl_program *
r200NewProgram(struct gl_context *ctx, GLenum target, GLuint id,
bool is_arb_asm)
{
switch(target){
case GL_VERTEX_PROGRAM_ARB: {
struct r200_vertex_program *vp = rzalloc(NULL,
struct r200_vertex_program);
return _mesa_init_gl_program(&vp->mesa_program, target, id, is_arb_asm);
}
@@ -1264,15 +1249,14 @@ r200IsProgramNative(struct gl_context *ctx, GLenum target, struct gl_program *pr
return vp->native;
default:
_mesa_problem(ctx, "Bad target in r200NewProgram");
}
return 0;
}
void r200InitShaderFuncs(struct dd_function_table *functions)
{
functions->NewProgram = r200NewProgram;
- functions->BindProgram = r200BindProgram;
functions->DeleteProgram = r200DeleteProgram;
functions->ProgramStringNotify = r200ProgramStringNotify;
functions->IsProgramNative = r200IsProgramNative;
}
--
2.7.4
More information about the mesa-dev
mailing list