H. Verbeet : wined3d: Don'
t do WINED3DTSS_ALPHAOP texture operations for stages that aren'
t mapped to a texture unit.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jan 4 15:09:31 CST 2007
Module: wine
Branch: master
Commit: c7fad607ba98c5731e5b181ca060f8473b34e75a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c7fad607ba98c5731e5b181ca060f8473b34e75a
Author: H. Verbeet <hverbeet at gmail.com>
Date: Wed Jan 3 19:18:44 2007 +0100
wined3d: Don't do WINED3DTSS_ALPHAOP texture operations for stages that aren't mapped to a texture unit.
---
dlls/wined3d/state.c | 28 +++++++++++++++-------------
1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 1e93787..d0ef1e2 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1438,24 +1438,26 @@ static void tex_colorop(DWORD state, IWi
static void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock) {
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / WINED3D_HIGHEST_TEXTURE_STATE;
+ DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
TRACE("Setting alpha op for stage %d\n", stage);
/* Do not care for enabled / disabled stages, just assign the settigns. colorop disables / enables required stuff */
- if (GL_SUPPORT(ARB_MULTITEXTURE)) {
- /* TODO: register combiners! */
- if(stage >= GL_LIMITS(sampler_stages)) {
- if(stateblock->textureState[stage][WINED3DTSS_COLOROP] != WINED3DTOP_DISABLE &&
- stateblock->textureState[stage][WINED3DTSS_COLOROP] != 0) {
- FIXME("Attempt to enable unsupported stage!\n");
+ if (mapped_stage != -1) {
+ if (GL_SUPPORT(ARB_MULTITEXTURE)) {
+ if (stage >= GL_LIMITS(sampler_stages)) {
+ if (stateblock->textureState[stage][WINED3DTSS_COLOROP] != WINED3DTOP_DISABLE &&
+ stateblock->textureState[stage][WINED3DTSS_COLOROP] != 0) {
+ FIXME("Attempt to enable unsupported stage!\n");
+ }
+ return;
}
+ GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + mapped_stage));
+ checkGLcall("glActiveTextureARB");
+ } else if (stage > 0) {
+ /* We can't do anything here */
+ WARN("Program using multiple concurrent textures which this opengl implementation doesn't support\n");
return;
}
- GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + stateblock->wineD3DDevice->texUnitMap[stage]));
- checkGLcall("glActiveTextureARB");
- } else if (stage > 0) {
- /* We can't do anything here */
- WARN("Program using multiple concurrent textures which this opengl implementation doesn't support\n");
- return;
}
TRACE("Setting alpha op for stage %d\n", stage);
@@ -1465,7 +1467,7 @@ static void tex_alphaop(DWORD state, IWi
stateblock->textureState[stage][WINED3DTSS_ALPHAARG1],
stateblock->textureState[stage][WINED3DTSS_ALPHAARG2],
stateblock->textureState[stage][WINED3DTSS_ALPHAARG0],
- stateblock->wineD3DDevice->texUnitMap[stage]);
+ mapped_stage);
} else {
set_tex_op((IWineD3DDevice *)stateblock->wineD3DDevice, TRUE, stage, stateblock->textureState[stage][WINED3DTSS_ALPHAOP],
stateblock->textureState[stage][WINED3DTSS_ALPHAARG1],
More information about the wine-cvs
mailing list