aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texstate.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-22 14:27:38 +0100
committermarha <marha@users.sourceforge.net>2013-01-22 14:27:38 +0100
commit7002c66cfba01e7d3b88dae498a195f78f0e83f5 (patch)
tree2fbbd202a6a4243f0e64a8b22e22417a609ae19d /mesalib/src/mesa/main/texstate.c
parent50c07563e17397daf040a32d8fdd3ab397e72371 (diff)
parent470f7ca9f0be348faf2f03fc16811844c5eeffce (diff)
downloadvcxsrv-7002c66cfba01e7d3b88dae498a195f78f0e83f5.tar.gz
vcxsrv-7002c66cfba01e7d3b88dae498a195f78f0e83f5.tar.bz2
vcxsrv-7002c66cfba01e7d3b88dae498a195f78f0e83f5.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig libfontenc mesa mkfontscale pixman xserver xkeyboard-config Conflicts: mesalib/src/mesa/main/syncobj.c mesalib/src/mesa/main/syncobj.h xorg-server/hw/xwin/winconfig.c xorg-server/hw/xwin/winmultiwindowwndproc.c
Diffstat (limited to 'mesalib/src/mesa/main/texstate.c')
-rw-r--r--mesalib/src/mesa/main/texstate.c81
1 files changed, 41 insertions, 40 deletions
diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c
index 8e9bbf6a1..9e591d3b9 100644
--- a/mesalib/src/mesa/main/texstate.c
+++ b/mesalib/src/mesa/main/texstate.c
@@ -297,8 +297,6 @@ _mesa_ActiveTexture(GLenum texture)
ctx->Const.MaxTextureCoordUnits);
ASSERT(k <= Elements(ctx->Texture.Unit));
-
- ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glActiveTexture %s\n",
@@ -329,7 +327,6 @@ _mesa_ClientActiveTexture(GLenum texture)
{
GET_CURRENT_CONTEXT(ctx);
GLuint texUnit = texture - GL_TEXTURE0;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE))
_mesa_debug(ctx, "glClientActiveTexture %s\n",
@@ -480,6 +477,43 @@ update_tex_combine(struct gl_context *ctx, struct gl_texture_unit *texUnit)
}
}
+static void
+update_texgen(struct gl_context *ctx)
+{
+ GLuint unit;
+
+ /* Setup texgen for those texture coordinate sets that are in use */
+ for (unit = 0; unit < ctx->Const.MaxTextureCoordUnits; unit++) {
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
+
+ texUnit->_GenFlags = 0x0;
+
+ if (!(ctx->Texture._EnabledCoordUnits & (1 << unit)))
+ continue;
+
+ if (texUnit->TexGenEnabled) {
+ if (texUnit->TexGenEnabled & S_BIT) {
+ texUnit->_GenFlags |= texUnit->GenS._ModeBit;
+ }
+ if (texUnit->TexGenEnabled & T_BIT) {
+ texUnit->_GenFlags |= texUnit->GenT._ModeBit;
+ }
+ if (texUnit->TexGenEnabled & R_BIT) {
+ texUnit->_GenFlags |= texUnit->GenR._ModeBit;
+ }
+ if (texUnit->TexGenEnabled & Q_BIT) {
+ texUnit->_GenFlags |= texUnit->GenQ._ModeBit;
+ }
+
+ ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(unit);
+ ctx->Texture._GenFlags |= texUnit->_GenFlags;
+ }
+
+ ASSERT(unit < Elements(ctx->TextureMatrixStack));
+ if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY)
+ ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
+ }
+}
/**
* \note This routine refers to derived texture matrix values to
@@ -500,11 +534,6 @@ update_texture_state( struct gl_context *ctx )
if (ctx->Shader.CurrentVertexProgram &&
ctx->Shader.CurrentVertexProgram->LinkStatus) {
vprog = ctx->Shader.CurrentVertexProgram->_LinkedShaders[MESA_SHADER_VERTEX]->Program;
- } else if (ctx->VertexProgram._Enabled) {
- /* XXX enable this if/when non-shader vertex programs get
- * texture fetches:
- vprog = &ctx->VertexProgram.Current->Base;
- */
}
if (ctx->Shader.CurrentFragmentProgram &&
@@ -623,7 +652,8 @@ update_texture_state( struct gl_context *ctx )
if (enabledFragTargets)
enabledFragUnits |= (1 << unit);
- update_tex_combine(ctx, texUnit);
+ if (!fprog)
+ update_tex_combine(ctx, texUnit);
}
@@ -637,37 +667,8 @@ update_texture_state( struct gl_context *ctx )
ctx->Texture._EnabledCoordUnits = enabledFragUnits;
}
- /* Setup texgen for those texture coordinate sets that are in use */
- for (unit = 0; unit < ctx->Const.MaxTextureCoordUnits; unit++) {
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-
- texUnit->_GenFlags = 0x0;
-
- if (!(ctx->Texture._EnabledCoordUnits & (1 << unit)))
- continue;
-
- if (texUnit->TexGenEnabled) {
- if (texUnit->TexGenEnabled & S_BIT) {
- texUnit->_GenFlags |= texUnit->GenS._ModeBit;
- }
- if (texUnit->TexGenEnabled & T_BIT) {
- texUnit->_GenFlags |= texUnit->GenT._ModeBit;
- }
- if (texUnit->TexGenEnabled & R_BIT) {
- texUnit->_GenFlags |= texUnit->GenR._ModeBit;
- }
- if (texUnit->TexGenEnabled & Q_BIT) {
- texUnit->_GenFlags |= texUnit->GenQ._ModeBit;
- }
-
- ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(unit);
- ctx->Texture._GenFlags |= texUnit->_GenFlags;
- }
-
- ASSERT(unit < Elements(ctx->TextureMatrixStack));
- if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY)
- ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(unit);
- }
+ if (!fprog || !vprog)
+ update_texgen(ctx);
}