This commit is contained in:
Aapo Tahkola 2006-07-31 23:21:50 +00:00
parent 667dd3c3e8
commit 689df543db
2 changed files with 10 additions and 21 deletions

View file

@ -1676,14 +1676,24 @@ void r300UpdateShaders(r300ContextPtr rmesa)
{
GLcontext *ctx;
struct r300_vertex_program *vp;
int i;
ctx = rmesa->radeon.glCtx;
if (rmesa->NewGLState && hw_tcl_on) {
rmesa->NewGLState = 0;
for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
rmesa->temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i];
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &rmesa->dummy_attrib[i];
}
_tnl_UpdateFixedFunctionProgram(ctx);
for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i];
}
vp = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
if (vp->translated == GL_FALSE)
r300_translate_vertex_shader(vp);

View file

@ -303,14 +303,7 @@ static void radeonDrawElements( GLenum mode, GLsizei count, GLenum type, const G
if (ctx->NewState)
_mesa_update_state( ctx );
for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
rmesa->temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i];
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &rmesa->dummy_attrib[i];
}
r300UpdateShaders(rmesa);
for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i];
}
if (rmesa->state.VB.LockCount) {
if (rmesa->state.VB.lock_uptodate == GL_FALSE) {
@ -487,14 +480,7 @@ static void radeonDrawRangeElements(GLenum mode, GLuint min, GLuint max, GLsizei
if (ctx->NewState)
_mesa_update_state( ctx );
for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
rmesa->temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i];
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &rmesa->dummy_attrib[i];
}
r300UpdateShaders(rmesa);
for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i];
}
if (rmesa->state.VB.LockCount) {
if (rmesa->state.VB.lock_uptodate == GL_FALSE) {
@ -583,14 +569,7 @@ static void radeonDrawArrays( GLenum mode, GLint start, GLsizei count )
/* XXX: setup_arrays before state update? */
for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
rmesa->temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i];
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &rmesa->dummy_attrib[i];
}
r300UpdateShaders(rmesa);
for (i=_TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
TNL_CONTEXT(ctx)->vb.AttribPtr[i] = rmesa->temp_attrib[i];
}
if (rmesa->state.VB.LockCount) {
if (rmesa->state.VB.lock_uptodate == GL_FALSE) {