wined3d: Get rid of the ANISOTROPIC entry from the filter lookup tables.

Anisotropy and texture filters are orthogonal in GL. In D3D
D3DTEXF_ANISOTROPIC just selects the best (linear) filter type and enables
anisotropy.
This commit is contained in:
Henri Verbeet 2009-08-05 09:01:02 +02:00 committed by Alexandre Julliard
parent 62ac872b36
commit 9e8f7898c9
3 changed files with 18 additions and 20 deletions

View File

@ -388,12 +388,12 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
if (state > WINED3DTEXF_ANISOTROPIC) {
FIXME("Unrecognized or unsupported MAGFILTER* value %d\n", state);
}
else
{
glValue = wined3d_gl_mag_filter(This->baseTexture.magLookup, state);
TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue);
glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue);
}
glValue = wined3d_gl_mag_filter(This->baseTexture.magLookup,
min(max(state, WINED3DTEXF_POINT), WINED3DTEXF_LINEAR));
TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue);
glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue);
states[WINED3DTEXSTA_MAGFILTER] = state;
}
@ -406,8 +406,8 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
states[WINED3DTEXSTA_MINFILTER] = samplerStates[WINED3DSAMP_MINFILTER];
states[WINED3DTEXSTA_MAXMIPLEVEL] = samplerStates[WINED3DSAMP_MAXMIPLEVEL];
if (states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC ||
states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_LINEAR)
if (states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC
|| states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_ANISOTROPIC)
{
FIXME("Unrecognized or unsupported D3DSAMP_MINFILTER value %d D3DSAMP_MIPFILTER value %d\n",
@ -415,8 +415,8 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
states[WINED3DTEXSTA_MIPFILTER]);
}
glValue = wined3d_gl_min_mip_filter(This->baseTexture.minMipLookup,
min(max(samplerStates[WINED3DSAMP_MINFILTER],WINED3DTEXF_NONE), WINED3DTEXF_ANISOTROPIC),
min(max(samplerStates[WINED3DSAMP_MIPFILTER],WINED3DTEXF_NONE), WINED3DTEXF_LINEAR));
min(max(samplerStates[WINED3DSAMP_MINFILTER], WINED3DTEXF_NONE), WINED3DTEXF_LINEAR),
min(max(samplerStates[WINED3DSAMP_MIPFILTER], WINED3DTEXF_NONE), WINED3DTEXF_LINEAR));
TRACE("ValueMIN=%d, ValueMIP=%d, setting MINFILTER to %x\n",
samplerStates[WINED3DSAMP_MINFILTER],

View File

@ -174,7 +174,6 @@ const struct min_lookup minMipLookup[] =
{{GL_LINEAR, GL_LINEAR, GL_LINEAR}}, /* NONE */
{{GL_NEAREST, GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR}}, /* POINT*/
{{GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_LINEAR}}, /* LINEAR */
{{GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_LINEAR}}, /* ANISOTROPIC */
};
const struct min_lookup minMipLookup_noFilter[] =
@ -183,19 +182,18 @@ const struct min_lookup minMipLookup_noFilter[] =
{{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* NONE */
{{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* POINT */
{{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* LINEAR */
{{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* ANISOTROPIC */
};
const GLenum magLookup[] =
{
/* NONE POINT LINEAR ANISOTROPIC */
GL_NEAREST, GL_NEAREST, GL_LINEAR, GL_LINEAR,
/* NONE POINT LINEAR */
GL_NEAREST, GL_NEAREST, GL_LINEAR,
};
const GLenum magLookup_noFilter[] =
{
/* NONE POINT LINEAR ANISOTROPIC */
GL_NEAREST, GL_NEAREST, GL_NEAREST, GL_NEAREST,
/* NONE POINT LINEAR */
GL_NEAREST, GL_NEAREST, GL_NEAREST,
};
/* drawStridedSlow attributes */

View File

@ -176,10 +176,10 @@ struct min_lookup
GLenum mip[WINED3DTEXF_LINEAR + 1];
};
const struct min_lookup minMipLookup[WINED3DTEXF_ANISOTROPIC + 1];
const struct min_lookup minMipLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1];
const GLenum magLookup[WINED3DTEXF_ANISOTROPIC + 1];
const GLenum magLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1];
const struct min_lookup minMipLookup[WINED3DTEXF_LINEAR + 1];
const struct min_lookup minMipLookup_noFilter[WINED3DTEXF_LINEAR + 1];
const GLenum magLookup[WINED3DTEXF_LINEAR + 1];
const GLenum magLookup_noFilter[WINED3DTEXF_LINEAR + 1];
static inline GLenum wined3d_gl_mag_filter(const GLenum mag_lookup[], WINED3DTEXTUREFILTERTYPE mag_filter)
{