Commit 481bcdfe authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Disable MAG filters on formats that do not support them.

parent a22203ad
......@@ -434,7 +434,7 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface
if (state < WINED3DTEXF_NONE || state > WINED3DTEXF_ANISOTROPIC) {
FIXME("Unrecognized or unsupported MAGFILTER* value %d\n", state);
}
glValue = magLookup[state - WINED3DTEXF_NONE];
glValue = (*This->baseTexture.magLookup)[state - WINED3DTEXF_NONE];
TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue);
glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue);
/* We need to reset the Anisotropic filtering state when we change the mag filter to WINED3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentation to see how it should be switched off. */
......
......@@ -792,8 +792,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING) {
object->baseTexture.minMipLookup = &minMipLookup;
object->baseTexture.magLookup = &magLookup;
} else {
object->baseTexture.minMipLookup = &minMipLookup_noFilter;
object->baseTexture.magLookup = &magLookup_noFilter;
}
/** Non-power2 support **/
......@@ -942,8 +944,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING) {
object->baseTexture.minMipLookup = &minMipLookup;
object->baseTexture.magLookup = &magLookup;
} else {
object->baseTexture.minMipLookup = &minMipLookup_noFilter;
object->baseTexture.magLookup = &magLookup_noFilter;
}
/* Calculate levels for mip mapping */
......@@ -1095,8 +1099,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
if(glDesc->Flags & WINED3DFMT_FLAG_FILTERING) {
object->baseTexture.minMipLookup = &minMipLookup;
object->baseTexture.magLookup = &magLookup;
} else {
object->baseTexture.minMipLookup = &minMipLookup_noFilter;
object->baseTexture.magLookup = &magLookup_noFilter;
}
/* Calculate levels for mip mapping */
......
......@@ -163,6 +163,9 @@ DWORD minMipLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1]
};
DWORD magLookup[WINED3DTEXF_ANISOTROPIC + 1];
DWORD magLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1] = {
GL_NEAREST, GL_NEAREST, GL_NEAREST, GL_NEAREST
};
/* drawStridedSlow attributes */
glAttribFunc position_funcs[WINED3DDECLTYPE_UNUSED];
......
......@@ -113,6 +113,7 @@ extern DWORD *stateLookup[MAX_LOOKUPS];
typedef DWORD magLookup_t[WINED3DTEXF_ANISOTROPIC + 1];
extern magLookup_t magLookup;
extern magLookup_t magLookup_noFilter;
typedef DWORD minMipLookup_t[WINED3DTEXF_ANISOTROPIC + 1][WINED3DTEXF_LINEAR + 1];
extern minMipLookup_t minMipLookup;
......@@ -1095,6 +1096,7 @@ typedef struct IWineD3DBaseTextureClass
WINED3DFORMAT shader_conversion_group;
float pow2Matrix[16];
minMipLookup_t *minMipLookup;
magLookup_t *magLookup;
} IWineD3DBaseTextureClass;
typedef struct IWineD3DBaseTextureImpl
......
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