diff options
author | Xiang, Haihao <[email protected]> | 2008-02-29 11:15:02 +0800 |
---|---|---|
committer | Xiang, Haihao <[email protected]> | 2008-06-04 11:51:19 +0800 |
commit | 41261d64b21d2ad104544c9f8b53f768f8ae282f (patch) | |
tree | ee3b8e6c4ccd92d9cf93ffe74ad143a93b5673fd /src | |
parent | ce7a9efb095472479242d465882c7fbaef81e822 (diff) |
i965: use _Current pointer instead of Current pointer.
Cherry picked from commit de1e9880f8b239768293f7f434a9117dfab20162
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 18 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_metaops.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs_tnl.c | 6 | ||||
-rw-r--r-- | src/mesa/main/texenvprogram.c | 3 |
4 files changed, 7 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 9266e73570a..e19d36eb493 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -64,23 +64,7 @@ static const struct dri_extension brw_extensions[] = static void brwUseProgram(GLcontext *ctx, GLuint program) { - struct brw_context *brw = brw_context(ctx); - struct gl_shader_program *sh_prog; - _mesa_use_program(ctx, program); - sh_prog = ctx->Shader.CurrentProgram; - if (sh_prog) { - if (sh_prog->VertexProgram) { - brw->attribs.VertexProgram->Current = sh_prog->VertexProgram; - ctx->VertexProgram.Enabled = GL_TRUE; - }else - ctx->VertexProgram.Enabled = GL_FALSE; - - if (sh_prog->FragmentProgram) { - brw->attribs.FragmentProgram->Current = sh_prog->FragmentProgram; - ctx->FragmentProgram.Enabled = GL_TRUE; - } else - ctx->FragmentProgram.Enabled = GL_FALSE; - } + _mesa_use_program(ctx, program); } static void brwInitProgFuncs( struct dd_function_table *functions ) diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c index 6e030f191ef..cd6d287aa06 100644 --- a/src/mesa/drivers/dri/i965/brw_metaops.c +++ b/src/mesa/drivers/dri/i965/brw_metaops.c @@ -195,7 +195,7 @@ static void init_metaops_state( struct brw_context *brw ) vp_prog, strlen(vp_prog), brw->metaops.vp); - brw->metaops.attribs.VertexProgram->Current = brw->metaops.vp; + brw->metaops.attribs.VertexProgram->_Current = brw->metaops.vp; brw->metaops.attribs.VertexProgram->_Enabled = GL_TRUE; brw->metaops.attribs.FragmentProgram->_Current = brw->metaops.fp; diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c index 0166923aeec..0170d3acee3 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c +++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c @@ -1580,7 +1580,7 @@ static void update_tnl_program( struct brw_context *brw ) struct gl_vertex_program *old = brw->tnl_program; /* _NEW_PROGRAM */ - if (brw->attribs.VertexProgram->_Enabled) + if (brw->attribs.VertexProgram->_Current) return; /* Grab all the relevent state and put it in a single structure: @@ -1644,8 +1644,8 @@ static void update_active_vertprog( struct brw_context *brw ) const struct gl_vertex_program *prev = brw->vertex_program; /* NEW_PROGRAM */ - if (brw->attribs.VertexProgram->_Enabled) { - brw->vertex_program = brw->attribs.VertexProgram->Current; + if (brw->attribs.VertexProgram->_Current) { + brw->vertex_program = brw->attribs.VertexProgram->_Current; } else { /* BRW_NEW_TNL_PROGRAM */ diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 5ab50ffac66..f813a46c193 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1271,7 +1271,8 @@ _mesa_UpdateTexEnvProgram( GLcontext *ctx ) } } else { - ctx->FragmentProgram._Current = ctx->FragmentProgram.Current; + /* _Current pointer has been updated in update_program */ + // ctx->FragmentProgram._Current = ctx->FragmentProgram.Current; } /* Tell the driver about the change. Could define a new target for |