Stefan Dösinger (@stefan) commented about dlls/d3d8/tests/device.c:
BOOL has_texture;
DWORD filters[7];
- }
- tests[] =
- {
{
TRUE,
{
D3DTEXF_NONE,
D3DTEXF_POINT,
D3DTEXF_LINEAR,
D3DTEXF_ANISOTROPIC,
D3DTEXF_FLATCUBIC,
D3DTEXF_GAUSSIANCUBIC,
0xdeadbeef,
},
This feels awkward, the filter enum is the same in both cases.
I think the test[] array can be removed entirely, or one filter[] array be used for both. (At which point tests[] becomes a relatively pointless array with TRUE and FALSE in it).
I am not married to testing the value 0xdeadbeef, D3DTEXF_GAUSSIANCUBIC + 1 (6) would work just as well imo. That'd allow you to do for (mip = 0; mip <= D3DTEXF_GAUSSIANCUBIC + 1; ++mip).
To answer your question re texture formats that can't be filtered: To my knowledge that doesn't exist in d3d8, and there is no equivalent to D3DUSAGE_QUERY_FILTER in d3d8 - this value is used to check for filtering capability in IDirect3D9::CheckDeviceFormat.
Hypothetically, a volume texture could have different filter capabilities than a 2D texture. This seems to be the case even on my r200 - it supports mip filters (D3DPTFILTERCAPS_MIPFPOINT, D3DPTFILTERCAPS_MIPFLINEAR) for 2D, but not cube or 3D textures. I highly doubt that it complains about this in ValidateTexture though. I'll give it a try just in case.