Module: wine Branch: master Commit: 731cb3957ca859fec71972cdb11f4c8bf0d4beb3 URL: https://gitlab.winehq.org/wine/wine/-/commit/731cb3957ca859fec71972cdb11f4c8...
Author: Connor McAdams cmcadams@codeweavers.com Date: Mon Jul 1 05:00:37 2024 -0400
d3dx9: Apply the DDS skip mip level bitmask.
Signed-off-by: Connor McAdams cmcadams@codeweavers.com
---
dlls/d3dx9_36/tests/texture.c | 4 ++-- dlls/d3dx9_36/texture.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 60a8dfb0fcd..2c022b470d5 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -2208,7 +2208,7 @@ static void test_D3DXCreateTextureFromFileInMemoryEx(IDirect3DDevice9 *device) 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_image_info(&img_info, 2, 2, 1, 2, D3DFMT_R8G8B8, D3DRTYPE_TEXTURE, D3DXIFF_DDS, TRUE); + check_image_info(&img_info, 2, 2, 1, 2, D3DFMT_R8G8B8, D3DRTYPE_TEXTURE, D3DXIFF_DDS, FALSE); IDirect3DTexture9_Release(texture);
/* @@ -2486,7 +2486,7 @@ static void test_D3DXCreateVolumeTextureFromFileInMemoryEx(IDirect3DDevice9 *dev 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_image_info(&img_info, 8, 8, 1, 4, D3DFMT_R8G8B8, D3DRTYPE_TEXTURE, D3DXIFF_DDS, TRUE); + check_image_info(&img_info, 8, 8, 1, 4, D3DFMT_R8G8B8, D3DRTYPE_TEXTURE, D3DXIFF_DDS, FALSE); IDirect3DVolumeTexture9_Release(texture);
hr = D3DXCreateVolumeTextureFromFileInMemoryEx(device, dds_24bit_8_8, sizeof(dds_24bit_8_8), diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index b42c9db3f2d..6ecd9adfece 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -588,6 +588,7 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi
staging_tex = tex = *texture = NULL; skip_levels = mipfilter != D3DX_DEFAULT ? mipfilter >> D3DX_SKIP_DDS_MIP_LEVELS_SHIFT : 0; + skip_levels &= D3DX_SKIP_DDS_MIP_LEVELS_MASK; hr = d3dx_image_init(srcdata, srcdatasize, &image, skip_levels, 0); if (FAILED(hr)) { @@ -1115,6 +1116,7 @@ HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemoryEx(IDirect3DDevice9 *devic
staging_tex = tex = *volume_texture = NULL; skip_levels = mip_filter != D3DX_DEFAULT ? mip_filter >> D3DX_SKIP_DDS_MIP_LEVELS_SHIFT : 0; + skip_levels &= D3DX_SKIP_DDS_MIP_LEVELS_MASK; hr = d3dx_image_init(data, data_size, &image, skip_levels, 0); if (FAILED(hr)) {