H. Verbeet : wined3d:
Skip WINED3DTSS_TEXCOORDINDEX state application 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: aced8de8532a6308a419c43a6c94027a702dd1ec
URL: http://source.winehq.org/git/wine.git/?a=commit;h=aced8de8532a6308a419c43a6c94027a702dd1ec
Author: H. Verbeet <hverbeet at gmail.com>
Date: Wed Jan 3 19:18:51 2007 +0100
wined3d: Skip WINED3DTSS_TEXCOORDINDEX state application for stages that aren't mapped to a texture unit.
---
dlls/wined3d/state.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index d0ef1e2..b76b53b 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1499,13 +1499,18 @@ static void transform_texture(DWORD stat
static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock) {
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / WINED3D_HIGHEST_TEXTURE_STATE;
+ DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
+
+ if (mapped_stage == -1) {
+ TRACE("No texture unit mapped to stage %d. Skipping texture coordinates.\n", stage);
+ return;
+ }
if (GL_SUPPORT(ARB_MULTITEXTURE)) {
- /* TODO: register combiners! */
if(stage >= GL_LIMITS(sampler_stages)) {
return;
}
- GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + stateblock->wineD3DDevice->texUnitMap[stage]));
+ GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + mapped_stage));
checkGLcall("glActiveTextureARB");
} else if (stage > 0) {
/* We can't do anything here */
More information about the wine-cvs
mailing list