Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/texture.c:
return D3DERR_INVALIDCALL; staging_tex = tex = *volume_texture = NULL;
- hr = D3DXGetImageInfoFromFileInMemory(data, data_size, &image_info);
- if (FAILED(hr)) return hr;
- skip_levels = mip_filter != D3DX_DEFAULT ? mip_filter >> D3DX_SKIP_DDS_MIP_LEVELS_SHIFT : 0;
Obviously this is not new, but I noticed it only now: we're not applying `D3DX_SKIP_DDS_MIP_LEVELS_MASK` to the value and, as it turns out, that's potentially significant since that means we're taking into account an extra bit compared to the other option. Quickly hacking a test seems to show that native does indeed ignore it:
``` diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index da7521ab134..b46a07ffdf0 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -2192,7 +2192,7 @@ static void test_D3DXCreateTextureFromFileInMemoryEx(IDirect3DDevice9 *device) /* Test values returned in the D3DXIMAGE_INFO structure. */ hr = D3DXCreateTextureFromFileInMemoryEx(device, dds_24bit, sizeof(dds_24bit), D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DUSAGE_DYNAMIC, D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, - D3DX_DEFAULT, D3DX_SKIP_DDS_MIP_LEVELS(0, D3DX_FILTER_POINT), 0, &img_info, NULL, &texture); + D3DX_DEFAULT, D3DX_FILTER_POINT | (0x20u << D3DX_SKIP_DDS_MIP_LEVELS_SHIFT), 0, &img_info, NULL, &texture); ok(hr == D3D_OK, "Unexpected hr %#lx.\n", hr);
check_texture_mip_levels(texture, 2, FALSE);
```
This certainly isn't a big deal and can be fixed in a follow up or whenever it feels right.