https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7b66aec721c94d7e0bd67…
commit 7b66aec721c94d7e0bd674b9258f57693906ee72
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Mon Sep 21 22:56:59 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Thu Feb 4 16:37:04 2021 +0100
[WINESYNC] d3dx9/tests: Add a test for loading surfaces not divisible by the block
size.
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 7f39c726fc91d84d4b26241c3a031381ad9e59cb by Matteo Bruni
<mbruni(a)codeweavers.com>
---
modules/rostests/winetests/d3dx9_36/surface.c | 34 +++++++++++++++++++++++++++
sdk/tools/winesync/d3dx9.cfg | 2 +-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/winetests/d3dx9_36/surface.c
b/modules/rostests/winetests/d3dx9_36/surface.c
index 4a10492a08f..2f8149fd01a 100644
--- a/modules/rostests/winetests/d3dx9_36/surface.c
+++ b/modules/rostests/winetests/d3dx9_36/surface.c
@@ -167,6 +167,20 @@ static const unsigned char dds_volume_map[] = {
0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x84,0xef,0x7b,0xaa,0xab,0xab,0xab
};
+/* 4x2 dxt5 */
+static const BYTE dds_dxt5[] =
+{
+ 0x44,0x44,0x53,0x20,0x7c,0x00,0x00,0x00,0x07,0x10,0x08,0x00,0x02,0x00,0x00,0x00,
+ 0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
+ 0x04,0x00,0x00,0x00,0x44,0x58,0x54,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x87,0x0f,0x78,0x05,0x05,0x50,0x50,
+};
+
static HRESULT create_file(const char *filename, const unsigned char *data, const
unsigned int size)
{
DWORD received;
@@ -1269,6 +1283,26 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
ok(SUCCEEDED(hr), "Failed to get the surface, hr %#x.\n", hr);
hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL,
D3DX_FILTER_NONE, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to convert pixels to DXT5
format.\n");
+
+ SetRect(&rect, 0, 0, 4, 2);
+ hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, &rect, surf, NULL,
&rect, D3DX_FILTER_NONE, 0);
+ todo_wine ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = D3DXLoadSurfaceFromMemory(newsurf, NULL, &rect, &dds_dxt5[128],
+ D3DFMT_DXT5, 16, NULL, &rect, D3DX_FILTER_NONE, 0);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ check_release((IUnknown *)newsurf, 1);
+ check_release((IUnknown *)tex, 0);
+
+ /* Test a rect larger than but not an integer multiple of the block size. */
+ hr = IDirect3DDevice9_CreateTexture(device, 4, 8, 1, 0, D3DFMT_DXT5,
D3DPOOL_SYSTEMMEM, &tex, NULL);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ SetRect(&rect, 0, 0, 4, 6);
+ hr = D3DXLoadSurfaceFromMemory(newsurf, NULL, &rect, &dds_dxt5[112],
+ D3DFMT_DXT5, 16, NULL, &rect, D3DX_FILTER_POINT, 0);
+ ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
check_release((IUnknown*)newsurf, 1);
check_release((IUnknown*)tex, 0);
}
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index 9119a897fda..2bf3eabe470 100644
--- a/sdk/tools/winesync/d3dx9.cfg
+++ b/sdk/tools/winesync/d3dx9.cfg
@@ -15,4 +15,4 @@ files: {include/d3dx9.h: sdk/include/dxsdk/d3dx9.h, include/d3dx9anim.h:
sdk/inc
include/d3dx9mesh.h: sdk/include/dxsdk/d3dx9mesh.h, include/d3dx9of.h:
sdk/include/dxsdk/d3dx9of.h,
include/d3dx9shader.h: sdk/include/dxsdk/d3dx9shader.h, include/d3dx9shape.h:
sdk/include/dxsdk/d3dx9shape.h,
include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h, include/d3dx9xof.h:
sdk/include/dxsdk/d3dx9xof.h}
-tags: {wine: e371085aaf4424e6ef9b5b76ebf3107121d22f50}
+tags: {wine: 7f39c726fc91d84d4b26241c3a031381ad9e59cb}