diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index 0ad043326d4..76090991e27 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -463,7 +463,8 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface This->baseTexture.states[WINED3DTEXSTA_MINFILTER], This->baseTexture.states[WINED3DTEXSTA_MIPFILTER]); } - glValue = minMipLookup[min(max(samplerStates[WINED3DSAMP_MINFILTER],WINED3DTEXF_NONE), WINED3DTEXF_ANISOTROPIC)] + glValue = (*This->baseTexture.minMipLookup) + [min(max(samplerStates[WINED3DSAMP_MINFILTER],WINED3DTEXF_NONE), WINED3DTEXF_ANISOTROPIC)] [min(max(samplerStates[WINED3DSAMP_MIPFILTER],WINED3DTEXF_NONE), WINED3DTEXF_LINEAR)]; TRACE("ValueMIN=%d, ValueMIP=%d, setting MINFILTER to %x\n", diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 8e1e24af740..82bdf2f6588 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -789,6 +789,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U D3DINITIALIZEBASETEXTURE(object->baseTexture); object->width = Width; object->height = Height; + object->baseTexture.minMipLookup = &minMipLookup; /** Non-power2 support **/ if (GL_SUPPORT(ARB_TEXTURE_NON_POWER_OF_TWO)) { @@ -934,6 +935,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa object->baseTexture.pow2Matrix[10] = 1.0; object->baseTexture.pow2Matrix[15] = 1.0; + object->baseTexture.minMipLookup = &minMipLookup; + /* Calculate levels for mip mapping */ if (Usage & WINED3DUSAGE_AUTOGENMIPMAP) { if(!GL_SUPPORT(SGIS_GENERATE_MIPMAP)) { @@ -1081,6 +1084,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface object->baseTexture.pow2Matrix[10] = ((float)EdgeLength) / ((float)pow2EdgeLength); object->baseTexture.pow2Matrix[15] = 1.0; + object->baseTexture.minMipLookup = &minMipLookup; + /* Calculate levels for mip mapping */ if (Usage & WINED3DUSAGE_AUTOGENMIPMAP) { if(!GL_SUPPORT(SGIS_GENERATE_MIPMAP)) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 19ad58d9bf0..46075fa8034 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -112,7 +112,8 @@ extern int minLookup[MAX_LOOKUPS]; extern int maxLookup[MAX_LOOKUPS]; extern DWORD *stateLookup[MAX_LOOKUPS]; -extern DWORD minMipLookup[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1]; +typedef DWORD minMipLookup_t[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1]; +extern minMipLookup_t minMipLookup; void init_type_lookup(WineD3D_GL_Info *gl_info); #define WINED3D_ATR_TYPE(type) GLINFO_LOCATION.glTypeLookup[type].d3dType @@ -1090,6 +1091,7 @@ typedef struct IWineD3DBaseTextureClass UINT srgb_mode_change_count; WINED3DFORMAT shader_conversion_group; float pow2Matrix[16]; + minMipLookup_t *minMipLookup; } IWineD3DBaseTextureClass; typedef struct IWineD3DBaseTextureImpl