diff options
author | Brian Paul <brianp@vmware.com> | 2009-01-23 17:39:44 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-01-23 17:39:44 -0700 |
commit | cba5ce166523a8bb6888a0ea28a26e30204f30a4 (patch) | |
tree | 32ff5dfd46743eefa812d654a4673cc87fea359e /src/mesa/main/texstate.c | |
parent | 628b52241b13132e2d4065b653befdf81236e651 (diff) | |
parent | 96ee3db6f76f25f8dcf36b365f6be93341d90472 (diff) |
Merge branch 'tex_combine4'
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r-- | src/mesa/main/texstate.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 9bfb7e0ec2..7cddec0bce 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -53,10 +53,10 @@ */ static const struct gl_tex_env_combine_state default_combine_state = { GL_MODULATE, GL_MODULATE, - { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT }, - { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT }, - { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA }, - { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA }, + { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT }, + { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT }, + { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA, GL_SRC_ALPHA }, + { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA }, 0, 0, 2, 2 }; @@ -551,7 +551,8 @@ update_texture_state( GLcontext *ctx ) if (texUnit->_ReallyEnabled) ctx->Texture._EnabledUnits |= (1 << unit); - if (texUnit->EnvMode == GL_COMBINE) { + if (texUnit->EnvMode == GL_COMBINE || + texUnit->EnvMode == GL_COMBINE4_NV) { texUnit->_CurrentCombine = & texUnit->Combine; } else { @@ -572,9 +573,14 @@ update_texture_state( GLcontext *ctx ) case GL_REPLACE: texUnit->_CurrentCombine->_NumArgsRGB = 1; break; - case GL_MODULATE: case GL_ADD: case GL_ADD_SIGNED: + if (texUnit->EnvMode == GL_COMBINE4_NV) + texUnit->_CurrentCombine->_NumArgsRGB = 4; + else + texUnit->_CurrentCombine->_NumArgsRGB = 2; + break; + case GL_MODULATE: case GL_SUBTRACT: case GL_DOT3_RGB: case GL_DOT3_RGBA: @@ -598,9 +604,14 @@ update_texture_state( GLcontext *ctx ) case GL_REPLACE: texUnit->_CurrentCombine->_NumArgsA = 1; break; - case GL_MODULATE: case GL_ADD: case GL_ADD_SIGNED: + if (texUnit->EnvMode == GL_COMBINE4_NV) + texUnit->_CurrentCombine->_NumArgsA = 4; + else + texUnit->_CurrentCombine->_NumArgsA = 2; + break; + case GL_MODULATE: case GL_SUBTRACT: texUnit->_CurrentCombine->_NumArgsA = 2; break; |