Commit a86f3165 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Move texture filter lookup table initialization to basetexture_init().

parent 351d6de8
......@@ -48,6 +48,17 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT levels, WINED3DR
texture->baseTexture.is_srgb = FALSE;
texture->baseTexture.pow2Matrix_identity = TRUE;
if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING)
{
texture->baseTexture.minMipLookup = minMipLookup;
texture->baseTexture.magLookup = magLookup;
}
else
{
texture->baseTexture.minMipLookup = minMipLookup_noFilter;
texture->baseTexture.magLookup = magLookup_noFilter;
}
return WINED3D_OK;
}
......
......@@ -192,17 +192,6 @@ HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UIN
return hr;
}
if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING)
{
texture->baseTexture.minMipLookup = minMipLookup;
texture->baseTexture.magLookup = magLookup;
}
else
{
texture->baseTexture.minMipLookup = minMipLookup_noFilter;
texture->baseTexture.magLookup = magLookup_noFilter;
}
/* Find the nearest pow2 match. */
pow2_edge_length = 1;
while (pow2_edge_length < edge_length) pow2_edge_length <<= 1;
......
......@@ -197,17 +197,6 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT
return hr;
}
if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING)
{
texture->baseTexture.minMipLookup = minMipLookup;
texture->baseTexture.magLookup = magLookup;
}
else
{
texture->baseTexture.minMipLookup = minMipLookup_noFilter;
texture->baseTexture.magLookup = magLookup_noFilter;
}
/* Precalculated scaling for 'faked' non power of two texture coords.
* Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE
* is used in combination with texture uploads (RTL_READTEX/RTL_TEXTEX). The reason is that EXT_PALETTED_TEXTURE
......
......@@ -150,17 +150,6 @@ HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT
return hr;
}
if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING)
{
texture->baseTexture.minMipLookup = minMipLookup;
texture->baseTexture.magLookup = magLookup;
}
else
{
texture->baseTexture.minMipLookup = minMipLookup_noFilter;
texture->baseTexture.magLookup = magLookup_noFilter;
}
/* Is NP2 support for volumes needed? */
texture->baseTexture.pow2Matrix[0] = 1.0f;
texture->baseTexture.pow2Matrix[5] = 1.0f;
......
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