Commit 91c3a5ea authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Directly call basetexture_apply_state_changes().

All the implementations of IWineD3DBaseTexture::ApplyStateChanges() forward to basetexture_apply_state_changes().
parent 4bd4812b
...@@ -322,13 +322,15 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface, ...@@ -322,13 +322,15 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
GLint textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface); GLint textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface);
BOOL cond_np2 = IWineD3DBaseTexture_IsCondNP2(iface); BOOL cond_np2 = IWineD3DBaseTexture_IsCondNP2(iface);
TRACE("iface %p, textureStates %p, samplerStates %p\n", iface, textureStates, samplerStates);
if(This->baseTexture.is_srgb) { if(This->baseTexture.is_srgb) {
states = This->baseTexture.srgbstates; states = This->baseTexture.srgbstates;
} else { } else {
states = This->baseTexture.states; states = This->baseTexture.states;
} }
/* ApplyStateChanges relies on the correct texture being bound and loaded. */ /* This function relies on the correct texture being bound and loaded. */
if(samplerStates[WINED3DSAMP_ADDRESSU] != states[WINED3DTEXSTA_ADDRESSU]) { if(samplerStates[WINED3DSAMP_ADDRESSU] != states[WINED3DTEXSTA_ADDRESSU]) {
state = samplerStates[WINED3DSAMP_ADDRESSU]; state = samplerStates[WINED3DSAMP_ADDRESSU];
......
...@@ -257,14 +257,6 @@ static BOOL WINAPI IWineD3DCubeTextureImpl_IsCondNP2(IWineD3DCubeTexture *iface) ...@@ -257,14 +257,6 @@ static BOOL WINAPI IWineD3DCubeTextureImpl_IsCondNP2(IWineD3DCubeTexture *iface)
return FALSE; return FALSE;
} }
static void WINAPI IWineD3DCubeTextureImpl_ApplyStateChanges(IWineD3DCubeTexture *iface,
const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1],
const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) {
TRACE("(%p) : relay to BaseTexture\n", iface);
basetexture_apply_state_changes((IWineD3DBaseTexture *)iface, textureStates, samplerStates);
}
/* ******************************************* /* *******************************************
IWineD3DCubeTexture IWineD3DCubeTexture parts follow IWineD3DCubeTexture IWineD3DCubeTexture parts follow
******************************************* */ ******************************************* */
...@@ -399,7 +391,6 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl = ...@@ -399,7 +391,6 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
IWineD3DCubeTextureImpl_BindTexture, IWineD3DCubeTextureImpl_BindTexture,
IWineD3DCubeTextureImpl_GetTextureDimensions, IWineD3DCubeTextureImpl_GetTextureDimensions,
IWineD3DCubeTextureImpl_IsCondNP2, IWineD3DCubeTextureImpl_IsCondNP2,
IWineD3DCubeTextureImpl_ApplyStateChanges,
/* IWineD3DCubeTexture */ /* IWineD3DCubeTexture */
IWineD3DCubeTextureImpl_Destroy, IWineD3DCubeTextureImpl_Destroy,
IWineD3DCubeTextureImpl_GetLevelDesc, IWineD3DCubeTextureImpl_GetLevelDesc,
......
...@@ -3308,7 +3308,7 @@ static void sampler_texmatrix(DWORD state, IWineD3DStateBlockImpl *stateblock, W ...@@ -3308,7 +3308,7 @@ static void sampler_texmatrix(DWORD state, IWineD3DStateBlockImpl *stateblock, W
if(!texture) return; if(!texture) return;
/* The fixed function np2 texture emulation uses the texture matrix to fix up the coordinates /* The fixed function np2 texture emulation uses the texture matrix to fix up the coordinates
* IWineD3DBaseTexture::ApplyStateChanges multiplies the set matrix with a fixup matrix. Before the * basetexture_apply_state_changes() multiplies the set matrix with a fixup matrix. Before the
* scaling is reapplied or removed, the texture matrix has to be reapplied * scaling is reapplied or removed, the texture matrix has to be reapplied
* *
* The mapped stage is already active because the sampler() function below, which is part of the * The mapped stage is already active because the sampler() function below, which is part of the
...@@ -3356,7 +3356,8 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont ...@@ -3356,7 +3356,8 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
IWineD3DBaseTextureImpl *tex_impl = (IWineD3DBaseTextureImpl *) stateblock->textures[sampler]; IWineD3DBaseTextureImpl *tex_impl = (IWineD3DBaseTextureImpl *) stateblock->textures[sampler];
tex_impl->baseTexture.internal_preload(stateblock->textures[sampler], srgb ? SRGB_SRGB : SRGB_RGB); tex_impl->baseTexture.internal_preload(stateblock->textures[sampler], srgb ? SRGB_SRGB : SRGB_RGB);
IWineD3DBaseTexture_BindTexture(stateblock->textures[sampler], srgb); IWineD3DBaseTexture_BindTexture(stateblock->textures[sampler], srgb);
IWineD3DBaseTexture_ApplyStateChanges(stateblock->textures[sampler], stateblock->textureState[sampler], stateblock->samplerState[sampler]); basetexture_apply_state_changes(stateblock->textures[sampler],
stateblock->textureState[sampler], stateblock->samplerState[sampler]);
if (GL_SUPPORT(EXT_TEXTURE_LOD_BIAS)) { if (GL_SUPPORT(EXT_TEXTURE_LOD_BIAS)) {
tmpvalue.d = stateblock->samplerState[sampler][WINED3DSAMP_MIPMAPLODBIAS]; tmpvalue.d = stateblock->samplerState[sampler][WINED3DSAMP_MIPMAPLODBIAS];
......
...@@ -271,13 +271,6 @@ static BOOL WINAPI IWineD3DTextureImpl_IsCondNP2(IWineD3DTexture *iface) { ...@@ -271,13 +271,6 @@ static BOOL WINAPI IWineD3DTextureImpl_IsCondNP2(IWineD3DTexture *iface) {
return This->cond_np2; return This->cond_np2;
} }
static void WINAPI IWineD3DTextureImpl_ApplyStateChanges(IWineD3DTexture *iface,
const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1],
const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) {
TRACE("(%p) : relay to BaseTexture\n", iface);
basetexture_apply_state_changes((IWineD3DBaseTexture *)iface, textureStates, samplerStates);
}
/* ******************************************* /* *******************************************
IWineD3DTexture IWineD3DTexture parts follow IWineD3DTexture IWineD3DTexture parts follow
******************************************* */ ******************************************* */
...@@ -401,7 +394,6 @@ const IWineD3DTextureVtbl IWineD3DTexture_Vtbl = ...@@ -401,7 +394,6 @@ const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
IWineD3DTextureImpl_BindTexture, IWineD3DTextureImpl_BindTexture,
IWineD3DTextureImpl_GetTextureDimensions, IWineD3DTextureImpl_GetTextureDimensions,
IWineD3DTextureImpl_IsCondNP2, IWineD3DTextureImpl_IsCondNP2,
IWineD3DTextureImpl_ApplyStateChanges,
/* IWineD3DTexture */ /* IWineD3DTexture */
IWineD3DTextureImpl_Destroy, IWineD3DTextureImpl_Destroy,
IWineD3DTextureImpl_GetLevelDesc, IWineD3DTextureImpl_GetLevelDesc,
......
...@@ -211,15 +211,6 @@ static BOOL WINAPI IWineD3DVolumeTextureImpl_IsCondNP2(IWineD3DVolumeTexture *if ...@@ -211,15 +211,6 @@ static BOOL WINAPI IWineD3DVolumeTextureImpl_IsCondNP2(IWineD3DVolumeTexture *if
return FALSE; return FALSE;
} }
static void WINAPI IWineD3DVolumeTextureImpl_ApplyStateChanges(IWineD3DVolumeTexture *iface,
const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1],
const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) {
IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
TRACE("(%p) : nothing to do, passing to base texture\n", This);
basetexture_apply_state_changes((IWineD3DBaseTexture *)iface, textureStates, samplerStates);
}
/* ******************************************* /* *******************************************
IWineD3DVolumeTexture IWineD3DVolumeTexture parts follow IWineD3DVolumeTexture IWineD3DVolumeTexture parts follow
******************************************* */ ******************************************* */
...@@ -330,7 +321,6 @@ const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl = ...@@ -330,7 +321,6 @@ const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
IWineD3DVolumeTextureImpl_BindTexture, IWineD3DVolumeTextureImpl_BindTexture,
IWineD3DVolumeTextureImpl_GetTextureDimensions, IWineD3DVolumeTextureImpl_GetTextureDimensions,
IWineD3DVolumeTextureImpl_IsCondNP2, IWineD3DVolumeTextureImpl_IsCondNP2,
IWineD3DVolumeTextureImpl_ApplyStateChanges,
/* volume texture */ /* volume texture */
IWineD3DVolumeTextureImpl_Destroy, IWineD3DVolumeTextureImpl_Destroy,
IWineD3DVolumeTextureImpl_GetLevelDesc, IWineD3DVolumeTextureImpl_GetLevelDesc,
......
...@@ -2616,10 +2616,6 @@ interface IWineD3DBaseTexture : IWineD3DResource ...@@ -2616,10 +2616,6 @@ interface IWineD3DBaseTexture : IWineD3DResource
); );
BOOL IsCondNP2( BOOL IsCondNP2(
); );
void ApplyStateChanges(
const DWORD texture_states[WINED3D_HIGHEST_TEXTURE_STATE + 1],
const DWORD sampler_states[WINED3D_HIGHEST_SAMPLER_STATE + 1]
);
} }
[ [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment