Commit 9e8f7898 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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.
parent 62ac872b
...@@ -388,12 +388,12 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface, ...@@ -388,12 +388,12 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
if (state > WINED3DTEXF_ANISOTROPIC) { if (state > WINED3DTEXF_ANISOTROPIC) {
FIXME("Unrecognized or unsupported MAGFILTER* value %d\n", state); FIXME("Unrecognized or unsupported MAGFILTER* value %d\n", state);
} }
else
{ glValue = wined3d_gl_mag_filter(This->baseTexture.magLookup,
glValue = wined3d_gl_mag_filter(This->baseTexture.magLookup, state); min(max(state, WINED3DTEXF_POINT), WINED3DTEXF_LINEAR));
TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue); TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue);
glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue); glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue);
}
states[WINED3DTEXSTA_MAGFILTER] = state; states[WINED3DTEXSTA_MAGFILTER] = state;
} }
...@@ -406,8 +406,8 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface, ...@@ -406,8 +406,8 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
states[WINED3DTEXSTA_MINFILTER] = samplerStates[WINED3DSAMP_MINFILTER]; states[WINED3DTEXSTA_MINFILTER] = samplerStates[WINED3DSAMP_MINFILTER];
states[WINED3DTEXSTA_MAXMIPLEVEL] = samplerStates[WINED3DSAMP_MAXMIPLEVEL]; states[WINED3DTEXSTA_MAXMIPLEVEL] = samplerStates[WINED3DSAMP_MAXMIPLEVEL];
if (states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC || if (states[WINED3DTEXSTA_MINFILTER] > WINED3DTEXF_ANISOTROPIC
states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_LINEAR) || states[WINED3DTEXSTA_MIPFILTER] > WINED3DTEXF_ANISOTROPIC)
{ {
FIXME("Unrecognized or unsupported D3DSAMP_MINFILTER value %d D3DSAMP_MIPFILTER value %d\n", FIXME("Unrecognized or unsupported D3DSAMP_MINFILTER value %d D3DSAMP_MIPFILTER value %d\n",
...@@ -415,8 +415,8 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface, ...@@ -415,8 +415,8 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
states[WINED3DTEXSTA_MIPFILTER]); states[WINED3DTEXSTA_MIPFILTER]);
} }
glValue = wined3d_gl_min_mip_filter(This->baseTexture.minMipLookup, glValue = wined3d_gl_min_mip_filter(This->baseTexture.minMipLookup,
min(max(samplerStates[WINED3DSAMP_MINFILTER],WINED3DTEXF_NONE), WINED3DTEXF_ANISOTROPIC), min(max(samplerStates[WINED3DSAMP_MINFILTER], WINED3DTEXF_NONE), WINED3DTEXF_LINEAR),
min(max(samplerStates[WINED3DSAMP_MIPFILTER],WINED3DTEXF_NONE), WINED3DTEXF_LINEAR)); min(max(samplerStates[WINED3DSAMP_MIPFILTER], WINED3DTEXF_NONE), WINED3DTEXF_LINEAR));
TRACE("ValueMIN=%d, ValueMIP=%d, setting MINFILTER to %x\n", TRACE("ValueMIN=%d, ValueMIP=%d, setting MINFILTER to %x\n",
samplerStates[WINED3DSAMP_MINFILTER], samplerStates[WINED3DSAMP_MINFILTER],
......
...@@ -174,7 +174,6 @@ const struct min_lookup minMipLookup[] = ...@@ -174,7 +174,6 @@ const struct min_lookup minMipLookup[] =
{{GL_LINEAR, GL_LINEAR, GL_LINEAR}}, /* NONE */ {{GL_LINEAR, GL_LINEAR, GL_LINEAR}}, /* NONE */
{{GL_NEAREST, GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR}}, /* POINT*/ {{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}}, /* LINEAR */
{{GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_LINEAR}}, /* ANISOTROPIC */
}; };
const struct min_lookup minMipLookup_noFilter[] = const struct min_lookup minMipLookup_noFilter[] =
...@@ -183,19 +182,18 @@ 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}}, /* NONE */
{{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* POINT */ {{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* POINT */
{{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* LINEAR */ {{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* LINEAR */
{{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* ANISOTROPIC */
}; };
const GLenum magLookup[] = const GLenum magLookup[] =
{ {
/* NONE POINT LINEAR ANISOTROPIC */ /* NONE POINT LINEAR */
GL_NEAREST, GL_NEAREST, GL_LINEAR, GL_LINEAR, GL_NEAREST, GL_NEAREST, GL_LINEAR,
}; };
const GLenum magLookup_noFilter[] = const GLenum magLookup_noFilter[] =
{ {
/* NONE POINT LINEAR ANISOTROPIC */ /* NONE POINT LINEAR */
GL_NEAREST, GL_NEAREST, GL_NEAREST, GL_NEAREST, GL_NEAREST, GL_NEAREST, GL_NEAREST,
}; };
/* drawStridedSlow attributes */ /* drawStridedSlow attributes */
......
...@@ -176,10 +176,10 @@ struct min_lookup ...@@ -176,10 +176,10 @@ struct min_lookup
GLenum mip[WINED3DTEXF_LINEAR + 1]; GLenum mip[WINED3DTEXF_LINEAR + 1];
}; };
const struct min_lookup minMipLookup[WINED3DTEXF_ANISOTROPIC + 1]; const struct min_lookup minMipLookup[WINED3DTEXF_LINEAR + 1];
const struct min_lookup minMipLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1]; const struct min_lookup minMipLookup_noFilter[WINED3DTEXF_LINEAR + 1];
const GLenum magLookup[WINED3DTEXF_ANISOTROPIC + 1]; const GLenum magLookup[WINED3DTEXF_LINEAR + 1];
const GLenum magLookup_noFilter[WINED3DTEXF_ANISOTROPIC + 1]; const GLenum magLookup_noFilter[WINED3DTEXF_LINEAR + 1];
static inline GLenum wined3d_gl_mag_filter(const GLenum mag_lookup[], WINED3DTEXTUREFILTERTYPE mag_filter) static inline GLenum wined3d_gl_mag_filter(const GLenum mag_lookup[], WINED3DTEXTUREFILTERTYPE mag_filter)
{ {
......
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