On Sun Jun 30 10:49:00 2024 +0000, Matteo Bruni wrote:
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.
I can fix this in a future patch, I didn't really investigate the original behavior and just assumed it was fine. :)