修訂 | 74237c1a101e2943960b5597d3920d06b0cca2e9 (tree) |
---|---|
時間 | 2009-10-31 19:03:34 |
作者 | Chia-I Wu <olvaffe@gmai...> |
Commiter | Chia-I Wu |
mesa: Remember client active texture in _mesa_meta_draw_tex.
@@ -2082,6 +2082,7 @@ _mesa_meta_draw_tex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, | ||
2082 | 2082 | |
2083 | 2083 | if (drawtex->ArrayObj == 0) { |
2084 | 2084 | /* one-time setup */ |
2085 | + GLint active_texture; | |
2085 | 2086 | |
2086 | 2087 | /* create vertex array object */ |
2087 | 2088 | _mesa_GenVertexArrays(1, &drawtex->ArrayObj); |
@@ -2093,6 +2094,9 @@ _mesa_meta_draw_tex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, | ||
2093 | 2094 | _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), |
2094 | 2095 | NULL, GL_DYNAMIC_DRAW_ARB); |
2095 | 2096 | |
2097 | + /* client active texture is not part of the array object */ | |
2098 | + active_texture = ctx->Array.ActiveTexture; | |
2099 | + | |
2096 | 2100 | /* setup vertex arrays */ |
2097 | 2101 | _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); |
2098 | 2102 | _mesa_EnableClientState(GL_VERTEX_ARRAY); |
@@ -2101,6 +2105,9 @@ _mesa_meta_draw_tex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, | ||
2101 | 2105 | _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(st[i])); |
2102 | 2106 | _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); |
2103 | 2107 | } |
2108 | + | |
2109 | + /* restore client active texture */ | |
2110 | + _mesa_ClientActiveTextureARB(GL_TEXTURE0 + active_texture); | |
2104 | 2111 | } |
2105 | 2112 | else { |
2106 | 2113 | _mesa_BindVertexArray(drawtex->ArrayObj); |