Star Trek Starfleet Academy does not like it when available video memory goes down after creating a system memory resource. It destroys all its textures and recreates them, and in some sitations forgets to recreate one or another texture, resulting in rendering bugs.
I suspect the game is trying to detect focus loss by monitoring for unexpected video memory changes.
---
I am open to renaming WINED3DUSAGE_PRIVATE to something else, like WINED3DUSAGE_NO_VIDMEM_ACCOUNTING. This particular name is ugly long though.
-- v3: ddraw/tests: Add some video memory accounting tests.
From: Stefan D��singer stefan@codeweavers.com
Star Trek Starfleet Academy does not like it when available video memory goes down after creating a system memory resource. It destroys all its textures and recreates them, and in some sitations forgets to recreate one or another texture, resulting in rendering bugs.
I suspect the game is trying to detect focus loss by monitoring for unexpected video memory changes.
---
I am open to renaming WINED3DUSAGE_PRIVATE to something else, like WINED3DUSAGE_NO_VIDMEM_ACCOUNTING. This particular name is ugly long though. --- dlls/ddraw/surface.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 421ce68fa1c..afba0d5ac4b 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -5998,6 +5998,7 @@ static HRESULT ddraw_surface_create_wined3d_texture(DDSURFACEDESC2 *desc, struct draw_texture_desc = *wined3d_desc; draw_texture_desc.bind_flags = bind_flags; draw_texture_desc.access = WINED3D_RESOURCE_ACCESS_GPU; + draw_texture_desc.usage = WINED3DUSAGE_PRIVATE;
if (FAILED(hr = wined3d_texture_create(wined3d_device, &draw_texture_desc, layers, levels, 0, NULL, texture, &ddraw_texture_wined3d_parent_ops, &draw_texture)))
From: Stefan D��singer stefan@codeweavers.com
---
Version 2: Accept DDERR_NODIRECTDRAWHW from GetAvailableVideoMemory. --- dlls/ddraw/tests/ddraw1.c | 52 ++++++++++++++++++++++++++++++++++--- dlls/ddraw/tests/ddraw2.c | 54 ++++++++++++++++++++++++++++++++++++--- dlls/ddraw/tests/ddraw4.c | 54 ++++++++++++++++++++++++++++++++++++--- dlls/ddraw/tests/ddraw7.c | 54 ++++++++++++++++++++++++++++++++++++--- 4 files changed, 202 insertions(+), 12 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index b05c65937e4..0d95c95593e 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -6010,8 +6010,9 @@ cleanup:
static void test_create_surface_pitch(void) { - IDirectDrawSurface *surface; + IDirectDrawSurface *surface, *primary; DDSURFACEDESC surface_desc; + DDCAPS caps1, caps2; IDirectDraw *ddraw; unsigned int i; ULONG refcount; @@ -6070,16 +6071,19 @@ static void test_create_surface_pitch(void) {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, 0, 0, DDERR_INVALIDCAPS, 0, 0, 0 }, + /* 15 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, - /* 15 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, 0, 0, 0 }, @@ -6089,11 +6093,26 @@ static void test_create_surface_pitch(void) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr);
mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((63 * 4) + 8) * 63);
+ /* We need a primary surface and exclusive mode for video memory accounting to work + * right on Windows. Otherwise it gives us junk data, like creating a video memory + * surface freeing up memory. */ + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS; + surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &primary, NULL); + ok(SUCCEEDED(hr), "Failed to create a primary surface, hr %#lx.\n", hr); + + memset(&caps1, 0, sizeof(caps1)); + caps1.dwSize = sizeof(caps1); + hr = IDirectDraw_GetCaps(ddraw, &caps1, NULL); + ok(SUCCEEDED(hr), "Failed to get ddraw caps, hr %#lx.\n", hr); + for (i = 0; i < ARRAY_SIZE(test_data); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); @@ -6143,7 +6162,34 @@ static void test_create_surface_pitch(void) } ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface);
+ memset(&caps2, 0, sizeof(caps2)); + caps2.dwSize = sizeof(caps2); + hr = IDirectDraw_GetCaps(ddraw, &caps2, NULL); + ok(SUCCEEDED(hr), "Failed to get ddraw caps, hr %#lx.\n", hr); + if (surface_desc.ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY) + { + /* Star Trek Starfleet Academy cares about this bit here: That creating a system memory + * resource does not influence available video memory. */ + ok(caps2.dwVidMemFree == caps1.dwVidMemFree, "Free video memory changed from %#lx to %#lx, test %u.\n", + caps1.dwVidMemFree, caps2.dwVidMemFree, i); + } + else if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) + { + /* DDSCAPS_ALLOCONLOAD does not seem to delay video memory allocation, at least not on + * modern Windows. + * + * The amount of video memory consumed is different from what dwHeight * lPitch would + * suggest, although not by much. */ + ok(caps2.dwVidMemFree < caps1.dwVidMemFree, + "Expected free video memory to change, but it did not, test %u.\n", i); + } + IDirectDrawSurface_Release(surface); + + hr = IDirectDraw_GetCaps(ddraw, &caps2, NULL); + ok(SUCCEEDED(hr), "Failed to get ddraw caps, hr %#lx.\n", hr); + ok(caps2.dwVidMemFree == caps1.dwVidMemFree, "Free video memory changed from %#lx to %#lx, test %u.\n", + caps1.dwVidMemFree, caps2.dwVidMemFree, i); }
HeapFree(GetProcessHeap(), 0, mem); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 2d08718d131..7d38f1758cb 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -7107,7 +7107,9 @@ cleanup:
static void test_create_surface_pitch(void) { - IDirectDrawSurface *surface; + DWORD vidmem_total = 0, vidmem_free = 0, vidmem_free2 = 0; + DDSCAPS vidmem_caps = {DDSCAPS_TEXTURE}; + IDirectDrawSurface * surface, *primary; DDSURFACEDESC surface_desc; IDirectDraw2 *ddraw; unsigned int i; @@ -7167,16 +7169,19 @@ static void test_create_surface_pitch(void) {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, 0, 0, DDERR_INVALIDCAPS, 0, 0, 0 }, + /* 15 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, - /* 15 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, 0, 0, 0 }, @@ -7186,11 +7191,25 @@ static void test_create_surface_pitch(void) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr);
mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((63 * 4) + 8) * 63);
+ /* We need a primary surface and exclusive mode for video memory accounting to work + * right on Windows. Otherwise it gives us junk data, like creating a video memory + * surface freeing up memory. */ + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS; + surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &primary, NULL); + ok(SUCCEEDED(hr), "Failed to create a primary surface, hr %#lx.\n", hr); + + hr = IDirectDraw2_GetAvailableVidMem(ddraw, &vidmem_caps, &vidmem_total, &vidmem_free); + ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, + "Failed to get available video memory, hr %#lx.\n", hr); + for (i = 0; i < ARRAY_SIZE(test_data); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); @@ -7241,9 +7260,38 @@ static void test_create_surface_pitch(void) } ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface);
+ hr = IDirectDraw2_GetAvailableVidMem(ddraw, &vidmem_caps, &vidmem_total, &vidmem_free2); + ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, + "Failed to get available video memory, hr %#lx.\n", hr); + if (SUCCEEDED(hr) && surface_desc.ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY) + { + /* Star Trek Starfleet Academy cares about this bit here: That creating a system memory + * resource does not influence available video memory. */ + ok(vidmem_free2 == vidmem_free, "Free video memory changed from %#lx to %#lx, test %u.\n", + vidmem_free, vidmem_free2, i); + } + else if (SUCCEEDED(hr) && surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) + { + /* DDSCAPS_ALLOCONLOAD does not seem to delay video memory allocation, at least not on + * modern Windows. + * + * The amount of video memory consumed is different from what dwHeight * lPitch would + * suggest, although not by much. */ + ok(vidmem_free2 < vidmem_free, + "Expected free video memory to change, but it did not, test %u.\n", i); + } + IDirectDrawSurface_Release(surface); + + hr = IDirectDraw2_GetAvailableVidMem(ddraw, &vidmem_caps, &vidmem_total, &vidmem_free2); + ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, + "Failed to get available video memory, hr %#lx.\n", hr); + ok(hr == DDERR_NODIRECTDRAWHW || vidmem_free2 == vidmem_free, + "Free video memory changed from %#lx to %#lx, test %u.\n", + vidmem_free, vidmem_free2, i); }
+ IDirectDrawSurface_Release(primary); HeapFree(GetProcessHeap(), 0, mem); refcount = IDirectDraw2_Release(ddraw); ok(!refcount, "Got unexpected refcount %lu.\n", refcount); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 153cc89d095..db1b6b35ebe 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -8990,7 +8990,9 @@ cleanup:
static void test_create_surface_pitch(void) { - IDirectDrawSurface4 *surface; + DWORD vidmem_total = 0, vidmem_free = 0, vidmem_free2 = 0; + DDSCAPS2 vidmem_caps = {DDSCAPS_TEXTURE, 0, 0, {0}}; + IDirectDrawSurface4 * surface, *primary; DDSURFACEDESC2 surface_desc; IDirectDraw4 *ddraw; unsigned int i; @@ -9069,13 +9071,16 @@ static void test_create_surface_pitch(void) {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0, 0 }, + /* 20 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, 0, 0, DDERR_INVALIDCAPS, 0, 0, 0 }, - /* 20 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, @@ -9088,11 +9093,25 @@ static void test_create_surface_pitch(void) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr);
mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((63 * 4) + 8) * 63);
+ /* We need a primary surface and exclusive mode for video memory accounting to work + * right on Windows. Otherwise it gives us junk data, like creating a video memory + * surface freeing up memory. */ + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS; + surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &primary, NULL); + ok(SUCCEEDED(hr), "Failed to create a primary surface, hr %#lx.\n", hr); + + hr = IDirectDraw4_GetAvailableVidMem(ddraw, &vidmem_caps, &vidmem_total, &vidmem_free); + ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, + "Failed to get available video memory, hr %#lx.\n", hr); + for (i = 0; i < ARRAY_SIZE(test_data); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); @@ -9143,9 +9162,38 @@ static void test_create_surface_pitch(void) } ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface);
+ hr = IDirectDraw4_GetAvailableVidMem(ddraw, &vidmem_caps, &vidmem_total, &vidmem_free2); + ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, + "Failed to get available video memory, hr %#lx.\n", hr); + if (SUCCEEDED(hr) && surface_desc.ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY) + { + /* Star Trek Starfleet Academy cares about this bit here: That creating a system memory + * resource does not influence available video memory. */ + ok(vidmem_free2 == vidmem_free, "Free video memory changed from %#lx to %#lx, test %u.\n", + vidmem_free, vidmem_free2, i); + } + else if (SUCCEEDED(hr) && surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) + { + /* DDSCAPS_ALLOCONLOAD does not seem to delay video memory allocation, at least not on + * modern Windows. + * + * The amount of video memory consumed is different from what dwHeight * lPitch would + * suggest, although not by much. */ + ok(vidmem_free2 < vidmem_free, + "Expected free video memory to change, but it did not, test %u.\n", i); + } + IDirectDrawSurface4_Release(surface); + + hr = IDirectDraw4_GetAvailableVidMem(ddraw, &vidmem_caps, &vidmem_total, &vidmem_free2); + ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, + "Failed to get available video memory, hr %#lx.\n", hr); + ok(hr == DDERR_NODIRECTDRAWHW || vidmem_free2 == vidmem_free, + "Free video memory changed from %#lx to %#lx, test %u.\n", + vidmem_free, vidmem_free2, i); }
+ IDirectDrawSurface4_Release(primary); HeapFree(GetProcessHeap(), 0, mem); refcount = IDirectDraw4_Release(ddraw); ok(!refcount, "Got unexpected refcount %lu.\n", refcount); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index a4d270fe5f1..b365d9a00df 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -8830,7 +8830,9 @@ cleanup:
static void test_create_surface_pitch(void) { - IDirectDrawSurface7 *surface; + DWORD vidmem_total = 0, vidmem_free = 0, vidmem_free2 = 0; + DDSCAPS2 vidmem_caps = {DDSCAPS_TEXTURE, 0, 0, {0}}; + IDirectDrawSurface7 *surface, *primary; DDSURFACEDESC2 surface_desc; IDirectDraw7 *ddraw; unsigned int i; @@ -8909,13 +8911,16 @@ static void test_create_surface_pitch(void) {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, + {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE, + 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0 }, {DDSCAPS_VIDEOMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0, 0 }, + /* 20 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_ALLOCONLOAD, 0, 0, DDERR_INVALIDCAPS, 0, 0, 0 }, - /* 20 */ {DDSCAPS_SYSTEMMEMORY | DDSCAPS_TEXTURE | DDSCAPS_ALLOCONLOAD, 0, 0, DD_OK, DDSD_PITCH, 0x100, 0 }, @@ -8928,11 +8933,25 @@ static void test_create_surface_pitch(void) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#lx.\n", hr);
mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((63 * 4) + 8) * 63);
+ /* We need a primary surface and exclusive mode for video memory accounting to work + * right on Windows. Otherwise it gives us junk data, like creating a video memory + * surface freeing up memory. */ + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS; + surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &primary, NULL); + ok(SUCCEEDED(hr), "Failed to create a primary surface, hr %#lx.\n", hr); + + hr = IDirectDraw7_GetAvailableVidMem(ddraw, &vidmem_caps, &vidmem_total, &vidmem_free); + ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, + "Failed to get available video memory, hr %#lx.\n", hr); + for (i = 0; i < ARRAY_SIZE(test_data); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); @@ -8986,9 +9005,38 @@ static void test_create_surface_pitch(void) } ok(!surface_desc.lpSurface, "Test %u: Got unexpected lpSurface %p.\n", i, surface_desc.lpSurface);
+ hr = IDirectDraw7_GetAvailableVidMem(ddraw, &vidmem_caps, &vidmem_total, &vidmem_free2); + ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, + "Failed to get available video memory, hr %#lx.\n", hr); + if (SUCCEEDED(hr) && surface_desc.ddsCaps.dwCaps & DDSCAPS_SYSTEMMEMORY) + { + /* Star Trek Starfleet Academy cares about this bit here: That creating a system memory + * resource does not influence available video memory. */ + ok(vidmem_free2 == vidmem_free, "Free video memory changed from %#lx to %#lx, test %u.\n", + vidmem_free, vidmem_free2, i); + } + else if (SUCCEEDED(hr) && surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) + { + /* DDSCAPS_ALLOCONLOAD does not seem to delay video memory allocation, at least not on + * modern Windows. + * + * The amount of video memory consumed is different from what dwHeight * lPitch would + * suggest, although not by much. */ + ok(vidmem_free2 < vidmem_free, + "Expected free video memory to change, but it did not, test %u.\n", i); + } + IDirectDrawSurface7_Release(surface); + + hr = IDirectDraw7_GetAvailableVidMem(ddraw, &vidmem_caps, &vidmem_total, &vidmem_free2); + ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, + "Failed to get available video memory, hr %#lx.\n", hr); + ok(hr == DDERR_NODIRECTDRAWHW || vidmem_free2 == vidmem_free, + "Free video memory changed from %#lx to %#lx, test %u.\n", + vidmem_free, vidmem_free2, i); }
+ IDirectDrawSurface7_Release(primary); HeapFree(GetProcessHeap(), 0, mem); refcount = IDirectDraw7_Release(ddraw); ok(!refcount, "Got unexpected refcount %lu.\n", refcount);
On Thu Jul 28 14:52:56 2022 +0000, **** wrote:
Marvin replied on the mailing list:
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=120070 Your paranoid android. === debian11 (32 bit Chinese:China report) === Report validation errors: ddraw7: Timeout === debian11 (build log) === WineRunWineTest.pl:error: The task timed out
No idea here, I blame this on some testbot hiccup. The test I modified ran waaay before this timed out and I don't see how my test would slow Wine down.
This merge request was approved by Zebediah Figura.
This merge request was approved by Jan Sikorski.