Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d9/tests/device.c | 15 +++++++++++++++ dlls/d3d9/texture.c | 15 +++++++++++++++ 2 files changed, 30 insertions(+)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 859ca472948..9064a6701af 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -8051,6 +8051,11 @@ static void test_lockrect_invalid(void) ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x, type %s.\n", hr, resources[r].name);
IDirect3DTexture9_Release(texture); + + hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 1, D3DUSAGE_WRITEONLY, + D3DFMT_A8R8G8B8, resources[r].pool, &texture, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x for type %s.\n", + hr, resources[r].name); } if (cube_texture) { @@ -8090,6 +8095,11 @@ static void test_lockrect_invalid(void) ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x, type %s.\n", hr, resources[r].name);
IDirect3DCubeTexture9_Release(cube_texture); + + hr = IDirect3DDevice9_CreateCubeTexture(device, 128, 1, D3DUSAGE_WRITEONLY, D3DFMT_A8R8G8B8, + resources[r].pool, &cube_texture, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x for type %s.\n", + hr, resources[r].name); } }
@@ -10269,6 +10279,11 @@ static void test_lockbox_invalid(void) ok(SUCCEEDED(hr), "Failed to unlock volume texture, hr %#x.\n", hr);
IDirect3DVolumeTexture9_Release(texture); + + hr = IDirect3DDevice9_CreateVolumeTexture(device, 4, 4, 2, 1, D3DUSAGE_WRITEONLY, + D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &texture, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + refcount = IDirect3DDevice9_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirect3D9_Release(d3d); diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 8dc1ceea698..9f367096b71 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -1330,6 +1330,11 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device, if (is_gdi_compat_wined3dformat(desc.format)) flags |= WINED3D_TEXTURE_CREATE_GET_DC;
+ if (usage & D3DUSAGE_WRITEONLY) + { + WARN("Texture can't be created with the D3DUSAGE_WRITEONLY flags, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } if (usage & D3DUSAGE_AUTOGENMIPMAP) { if (pool == D3DPOOL_SYSTEMMEM) @@ -1419,6 +1424,11 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic if (is_gdi_compat_wined3dformat(desc.format)) flags |= WINED3D_TEXTURE_CREATE_GET_DC;
+ if (usage & D3DUSAGE_WRITEONLY) + { + WARN("Texture can't be created with the D3DUSAGE_WRITEONLY flags, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } if (usage & D3DUSAGE_AUTOGENMIPMAP) { if (pool == D3DPOOL_SYSTEMMEM) @@ -1493,6 +1503,11 @@ HRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *dev desc.depth = depth; desc.size = 0;
+ if (usage & D3DUSAGE_WRITEONLY) + { + WARN("Texture can't be created with the D3DUSAGE_WRITEONLY flags, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } if (usage & D3DUSAGE_AUTOGENMIPMAP) { WARN("D3DUSAGE_AUTOGENMIPMAP volume texture is not supported, returning D3DERR_INVALIDCALL.\n");
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d8/tests/device.c | 15 +++++++++++++++ dlls/d3d8/texture.c | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 884cdb1b8a9..ac04a6ad649 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -5163,6 +5163,11 @@ static void test_lockrect_invalid(void) ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x, type %s.\n", hr, resources[r].name);
IDirect3DTexture8_Release(texture); + + hr = IDirect3DDevice8_CreateTexture(device, 128, 128, 1, D3DUSAGE_WRITEONLY, + D3DFMT_A8R8G8B8, resources[r].pool, &texture); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x for type %s.\n", + hr, resources[r].name); }
if (cube_texture) @@ -5203,6 +5208,11 @@ static void test_lockrect_invalid(void) ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x, type %s.\n", hr, resources[r].name);
IDirect3DTexture8_Release(cube_texture); + + hr = IDirect3DDevice8_CreateCubeTexture(device, 128, 1, D3DUSAGE_WRITEONLY, D3DFMT_A8R8G8B8, + resources[r].pool, &cube_texture); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x for type %s.\n", + hr, resources[r].name); } }
@@ -6949,6 +6959,11 @@ static void test_lockbox_invalid(void) ok(SUCCEEDED(hr), "Failed to unlock volume texture, hr %#x.\n", hr);
IDirect3DVolumeTexture8_Release(texture); + + hr = IDirect3DDevice8_CreateVolumeTexture(device, 4, 4, 2, 1, D3DUSAGE_WRITEONLY, + D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &texture); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + refcount = IDirect3DDevice8_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirect3D8_Release(d3d); diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c index 6f17e9da5fd..5ca69215e1e 100644 --- a/dlls/d3d8/texture.c +++ b/dlls/d3d8/texture.c @@ -1117,6 +1117,12 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, desc.depth = 1; desc.size = 0;
+ if (usage & D3DUSAGE_WRITEONLY) + { + WARN("Texture can't be created with the D3DUSAGE_WRITEONLY flag, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } + if (!levels) levels = wined3d_log2i(max(width, height)) + 1;
@@ -1162,6 +1168,12 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic desc.depth = 1; desc.size = 0;
+ if (usage & D3DUSAGE_WRITEONLY) + { + WARN("Texture can't be created with the D3DUSAGE_WRITEONLY flag, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } + if (!levels) levels = wined3d_log2i(edge_length) + 1;
@@ -1209,6 +1221,12 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev desc.depth = depth; desc.size = 0;
+ if (usage & D3DUSAGE_WRITEONLY) + { + WARN("Texture can't be created with the D3DUSAGE_WRITEONLY flags, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } + if (!levels) levels = wined3d_log2i(max(max(width, height), depth)) + 1;
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47075
Your paranoid android.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/ddraw/surface.c | 10 +++++++++- dlls/ddraw/tests/ddraw4.c | 22 +++++++++++++++++----- dlls/ddraw/tests/ddraw7.c | 24 +++++++++++++++++++----- 3 files changed, 45 insertions(+), 11 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 14aa5ab744e..2b788bd8d13 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -5983,13 +5983,21 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ } if (desc->ddsCaps.dwCaps & (DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY)) { - WARN("DDSCAPS2_TEXTUREMANAGE used width DDSCAPS_VIDEOMEMORY " + WARN("DDSCAPS2_TEXTUREMANAGE used with DDSCAPS_VIDEOMEMORY " "or DDSCAPS_SYSTEMMEMORY, returning DDERR_INVALIDCAPS.\n"); heap_free(texture); return DDERR_INVALIDCAPS; } }
+ if (desc->ddsCaps.dwCaps & DDSCAPS_WRITEONLY + && !(desc->ddsCaps.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE))) + { + WARN("DDSCAPS_WRITEONLY used without DDSCAPS2_TEXTUREMANAGE, returning DDERR_INVALIDCAPS.\n"); + heap_free(texture); + return DDERR_INVALIDCAPS; + } + if (FAILED(hr = wined3d_get_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, &mode, NULL))) { ERR("Failed to get display mode, hr %#x.\n", hr); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index ad4021452a6..bb4d63a928d 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -11154,15 +11154,22 @@ static void test_lockrect_invalid(void) { DWORD caps, caps2; const char *name; + BOOL allowed; HRESULT hr; } resources[] = { - {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY, 0, "sysmem offscreenplain", DDERR_INVALIDPARAMS}, - {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY, 0, "vidmem offscreenplain", DDERR_INVALIDPARAMS}, - {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY, 0, "sysmem texture", DDERR_INVALIDPARAMS}, - {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY, 0, "vidmem texture", DDERR_INVALIDPARAMS}, - {DDSCAPS_TEXTURE, DDSCAPS2_TEXTUREMANAGE, "managed texture", DDERR_INVALIDPARAMS}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY, 0, "sysmem offscreenplain", TRUE, DDERR_INVALIDPARAMS}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY, 0, "vidmem offscreenplain", TRUE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY, 0, "sysmem texture", TRUE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY, 0, "vidmem texture", TRUE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE, DDSCAPS2_TEXTUREMANAGE, "managed texture", TRUE, DDERR_INVALIDPARAMS}, + + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_WRITEONLY, 0, "sysmem offscreenplain writeonly", FALSE, DDERR_INVALIDPARAMS}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_WRITEONLY, 0, "vidmem offscreenplain writeonly", FALSE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_WRITEONLY, 0, "sysmem texture writeonly", FALSE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_WRITEONLY, 0, "vidmem texture writeonly", FALSE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_WRITEONLY, DDSCAPS2_TEXTUREMANAGE, "managed texture writeonly", TRUE, DDERR_INVALIDPARAMS}, };
window = create_window(); @@ -11199,6 +11206,11 @@ static void test_lockrect_invalid(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x0000ff;
hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + if (!resources[r].allowed) + { + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + continue; + } ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, resources[r].name);
hr = IDirectDrawSurface4_Lock(surface, NULL, NULL, DDLOCK_WAIT, NULL); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index d13e238f2e7..a0637917708 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -11054,15 +11054,24 @@ static void test_lockrect_invalid(void) { DWORD caps, caps2; const char *name; + BOOL allowed; HRESULT hr; } resources[] = { - {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY, 0, "sysmem offscreenplain", DDERR_INVALIDPARAMS}, - {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY, 0, "vidmem offscreenplain", DDERR_INVALIDPARAMS}, - {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY, 0, "sysmem texture", DD_OK}, - {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY, 0, "vidmem texture", DDERR_INVALIDPARAMS}, - {DDSCAPS_TEXTURE, DDSCAPS2_TEXTUREMANAGE, "managed texture", DD_OK}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY, 0, "sysmem offscreenplain", TRUE, DDERR_INVALIDPARAMS}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY, 0, "vidmem offscreenplain", TRUE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY, 0, "sysmem texture", TRUE, DD_OK}, + {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY, 0, "vidmem texture", TRUE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE, DDSCAPS2_TEXTUREMANAGE, "managed texture", TRUE, DD_OK}, + + /* FWIW the SDK header mentions DDSCAPS_WRITEONLY as being a "READ + * ONLY" flag. */ + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_WRITEONLY, 0, "sysmem offscreenplain writeonly", FALSE, DDERR_INVALIDPARAMS}, + {DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | DDSCAPS_WRITEONLY, 0, "vidmem offscreenplain writeonly", FALSE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_WRITEONLY, 0, "sysmem texture writeonly", FALSE, DD_OK}, + {DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_WRITEONLY, 0, "vidmem texture writeonly", FALSE, DDERR_INVALIDPARAMS}, + {DDSCAPS_TEXTURE | DDSCAPS_WRITEONLY, DDSCAPS2_TEXTUREMANAGE, "managed texture writeonly", TRUE, DD_OK}, };
window = create_window(); @@ -11099,6 +11108,11 @@ static void test_lockrect_invalid(void) U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x0000ff;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + if (!resources[r].allowed) + { + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name); + continue; + } if (is_ddraw64 && (resources[r].caps & DDSCAPS_TEXTURE)) { todo_wine ok(hr == E_NOINTERFACE, "Got unexpected hr %#x, type %s.\n", hr, resources[r].name);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47076
Your paranoid android.
=== w8 (32 bit report) ===
ddraw: ddraw7.c:3798: Test failed: Lit quad without normals has color 0x00ff00ff, expected 0x00000000. ddraw7.c:3802: Test failed: Lit quad with normals has color 0x00ff00ff, expected 0x00000000. ddraw7.c:3826: Test failed: Lit quad with light has color 0x00ff00ff. ddraw7.c:3826: Test failed: Lit quad with singular world matrix has color 0x00ff00ff. ddraw7.c:3826: Test failed: Lit quad with transformation matrix has color 0x00ff00ff. ddraw7.c:3826: Test failed: Lit quad with non-affine matrix has color 0x00ff00ff.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- This is sort-of a partial revert of commit 6cfab2f7adf8d8a32b5fad6bf75f9859e6fa0b01. This time use a scheme similar to the one used by Henri for system memory buffers to avoid the issues with stateblocks solved by the original patch and, at the same time, restore some lost performance.
It might also help with moving the stateblock stuff to the client libraries but I'm happy to drop this patch if it turns out to be actually harmful in that regard.
dlls/d3d9/d3d9_private.h | 2 ++ dlls/d3d9/device.c | 23 +++++++++++++++++++++-- dlls/d3d9/stateblock.c | 16 +++++++++++++++- 3 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 1032f8e8e9c..3fe0376e5c1 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -111,6 +111,8 @@ struct d3d9_device DWORD recording : 1; DWORD padding : 11;
+ DWORD auto_mipmaps; /* D3D9_MAX_TEXTURE_UNITS */ + unsigned int max_user_clip_planes;
UINT implicit_swapchain_count; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 98ada03af8b..9fffac86ff0 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1012,6 +1012,9 @@ static HRESULT d3d9_device_reset(struct d3d9_device *device, device->device_state = D3D9_DEVICE_STATE_OK; }
+ if (!device->d3d_parent->extended) + device->auto_mipmaps = 0; + rtv = wined3d_device_get_rendertarget_view(device->wined3d_device, 0); device->render_targets[0] = wined3d_rendertarget_view_get_sub_resource_parent(rtv); for (i = 1; i < ARRAY_SIZE(device->render_targets); ++i) @@ -2456,6 +2459,18 @@ static HRESULT WINAPI d3d9_device_SetTexture(IDirect3DDevice9Ex *iface, DWORD st wined3d_mutex_lock(); hr = wined3d_device_set_texture(device->wined3d_device, stage, texture_impl ? texture_impl->wined3d_texture : NULL); + if (SUCCEEDED(hr) && !device->recording) + { + unsigned int i = stage >= D3DVERTEXTEXTURESAMPLER0 ? stage - D3DVERTEXTEXTURESAMPLER0 + 16 : stage; + + if (i < D3D9_MAX_TEXTURE_UNITS) + { + if (texture_impl && texture_impl->usage & D3DUSAGE_AUTOGENMIPMAP) + device->auto_mipmaps |= 1u << i; + else + device->auto_mipmaps &= ~(1u << i); + } + } wined3d_mutex_unlock();
return hr; @@ -2700,10 +2715,14 @@ static float WINAPI d3d9_device_GetNPatchMode(IDirect3DDevice9Ex *iface) static void d3d9_generate_auto_mipmaps(struct d3d9_device *device) { struct wined3d_texture *texture; - unsigned int i, stage; + unsigned int i, stage, map;
- for (i = 0; i < D3D9_MAX_TEXTURE_UNITS; ++i) + map = device->auto_mipmaps; + while (map) { + i = ffs(map) - 1; + map ^= 1u << i; + stage = i >= 16 ? i - 16 + D3DVERTEXTEXTURESAMPLER0 : i; if ((texture = wined3d_device_get_texture(device->wined3d_device, stage))) d3d9_texture_gen_auto_mipmap(wined3d_texture_get_parent(texture)); diff --git a/dlls/d3d9/stateblock.c b/dlls/d3d9/stateblock.c index 8431ef77002..c681e95e277 100644 --- a/dlls/d3d9/stateblock.c +++ b/dlls/d3d9/stateblock.c @@ -109,10 +109,12 @@ static HRESULT WINAPI d3d9_stateblock_Capture(IDirect3DStateBlock9 *iface) static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface) { struct d3d9_stateblock *stateblock = impl_from_IDirect3DStateBlock9(iface); + struct wined3d_texture *wined3d_texture; + unsigned int i, offset, stride, stage; struct wined3d_buffer *wined3d_buffer; struct d3d9_vertexbuffer *buffer; - unsigned int i, offset, stride; enum wined3d_format_id format; + struct d3d9_texture *texture; struct d3d9_device *device; HRESULT hr;
@@ -134,6 +136,18 @@ static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface) } device->sysmem_ib = (wined3d_buffer = wined3d_device_get_index_buffer(device->wined3d_device, &format, &offset)) && (buffer = wined3d_buffer_get_parent(wined3d_buffer)) && buffer->draw_buffer; + device->auto_mipmaps = 0; + for (i = 0; i < D3D9_MAX_TEXTURE_UNITS; ++i) + { + stage = i >= 16 ? i - 16 + D3DVERTEXTEXTURESAMPLER0 : i; + + if ((wined3d_texture = wined3d_device_get_texture(device->wined3d_device, stage)) + && (texture = wined3d_texture_get_parent(wined3d_texture)) + && texture->usage & D3DUSAGE_AUTOGENMIPMAP) + device->auto_mipmaps |= 1u << i; + else + device->auto_mipmaps &= ~(1u << i); + } wined3d_mutex_unlock();
return D3D_OK;
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47077
Your paranoid android.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
On Fri, Feb 1, 2019 at 1:00 PM Matteo Bruni mbruni@codeweavers.com wrote:
unsigned int i = stage >= D3DVERTEXTEXTURESAMPLER0 ? stage - D3DVERTEXTEXTURESAMPLER0 + 16 : stage;
if (i < D3D9_MAX_TEXTURE_UNITS)
{
if (texture_impl && texture_impl->usage & D3DUSAGE_AUTOGENMIPMAP)
device->auto_mipmaps |= 1u << i;
else
device->auto_mipmaps &= ~(1u << i);
}
- }
We probably need to validate the "stage" parameter, otherwise SetTexture() with stage = 16 updates the "auto_mipmaps" for vertex texture sampler 0.
- while (map) {
i = ffs(map) - 1;
map ^= 1u << i;
wined3d_bit_scan() is preferred.
if ((wined3d_texture = wined3d_device_get_texture(device->wined3d_device, stage))
&& (texture = wined3d_texture_get_parent(wined3d_texture))
&& texture->usage & D3DUSAGE_AUTOGENMIPMAP)
device->auto_mipmaps |= 1u << i;
else
device->auto_mipmaps &= ~(1u << i);
Formatting.
From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Fix the tests on Windows (and also accept Nvidia behavior).
dlls/d3d8/tests/device.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index ac04a6ad649..1e1764edebd 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -8951,7 +8951,9 @@ static void test_resource_access(void) hr = IDirect3DDevice8_CreateDepthStencilSurface(device, 16, 16, format, D3DMULTISAMPLE_NONE, &surface); todo_wine_if(tests[j].format == FORMAT_ATI2) - ok(hr == (tests[j].format != FORMAT_COLOUR ? D3D_OK : D3DERR_INVALIDCALL), + ok(hr == (tests[j].format == FORMAT_DEPTH ? D3D_OK + : tests[j].format == FORMAT_COLOUR ? D3DERR_INVALIDCALL : E_INVALIDARG) + || (tests[j].format == FORMAT_ATI2 && hr == D3D_OK), "Test %s %u: Got unexpected hr %#x.\n", surface_types[i].name, j, hr); if (FAILED(hr)) continue; @@ -9047,17 +9049,20 @@ static void test_resource_access(void) HRESULT expected_hr; D3DLOCKED_BOX lb;
- if (tests[j].format == FORMAT_DEPTH) + if (tests[i].format == FORMAT_DEPTH) continue;
- if (tests[j].format == FORMAT_ATI2) + if (tests[i].format == FORMAT_ATI2) format = MAKEFOURCC('A','T','I','2'); else format = colour_format;
hr = IDirect3DDevice8_CreateVolumeTexture(device, 16, 16, 1, 1, tests[i].usage, format, tests[i].pool, &texture); - ok(hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC) ? D3D_OK : D3DERR_INVALIDCALL), + ok((hr == ((!(tests[i].usage & ~D3DUSAGE_DYNAMIC) && tests[i].format != FORMAT_ATI2) + || (tests[i].pool == D3DPOOL_SCRATCH && !tests[i].usage) + ? D3D_OK : D3DERR_INVALIDCALL)) + || (tests[i].format == FORMAT_ATI2 && hr == D3D_OK), "Test %u: Got unexpected hr %#x.\n", i, hr); if (FAILED(hr)) continue; @@ -9075,9 +9080,11 @@ static void test_resource_access(void) expected_hr = D3D_OK; else expected_hr = D3DERR_INVALIDCALL; - ok(hr == expected_hr, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == expected_hr || (volume_desc.Pool == D3DPOOL_DEFAULT && hr == D3D_OK), + "Test %u: Got unexpected hr %#x.\n", i, hr); hr = IDirect3DVolume8_UnlockBox(volume); - ok(hr == expected_hr, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == expected_hr || (volume_desc.Pool == D3DPOOL_DEFAULT && hr == D3D_OK), + "Test %u: Got unexpected hr %#x.\n", i, hr);
hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)texture); ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47078
Your paranoid android.
=== w8 (32 bit report) ===
d3d8: device.c:9062: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w8adm (32 bit report) ===
d3d8: device.c:9062: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w864 (32 bit report) ===
d3d8: device.c:9062: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Fix tests failing on Windows + AMD.
dlls/d3d9/tests/d3d9ex.c | 16 ++++++++++------ dlls/d3d9/tests/device.c | 15 ++++++++++----- 2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 5260fcdeb40..6a9080d9a98 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -4452,18 +4452,20 @@ static void test_resource_access(void) HRESULT expected_hr; D3DLOCKED_BOX lb;
- if (tests[j].format == FORMAT_DEPTH) + if (tests[i].format == FORMAT_DEPTH) continue;
- if (tests[j].format == FORMAT_ATI2) + if (tests[i].format == FORMAT_ATI2) format = MAKEFOURCC('A','T','I','2'); else format = colour_format;
hr = IDirect3DDevice9Ex_CreateVolumeTexture(device, 16, 16, 1, 1, tests[i].usage, format, tests[i].pool, &texture, NULL); - ok(hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC) && tests[i].pool != D3DPOOL_MANAGED - ? D3D_OK : D3DERR_INVALIDCALL), + ok((hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC) + && (tests[i].format != FORMAT_ATI2 || tests[i].pool == D3DPOOL_SCRATCH) + && tests[i].pool != D3DPOOL_MANAGED ? D3D_OK : D3DERR_INVALIDCALL)) + || (tests[i].format == FORMAT_ATI2 && hr == D3D_OK), "Test %u: Got unexpected hr %#x.\n", i, hr); if (FAILED(hr)) continue; @@ -4481,9 +4483,11 @@ static void test_resource_access(void) expected_hr = D3D_OK; else expected_hr = D3DERR_INVALIDCALL; - ok(hr == expected_hr, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == expected_hr || (volume_desc.Pool == D3DPOOL_DEFAULT && hr == D3D_OK), + "Test %u: Got unexpected hr %#x.\n", i, hr); hr = IDirect3DVolume9_UnlockBox(volume); - ok(hr == expected_hr, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == expected_hr || (volume_desc.Pool == D3DPOOL_DEFAULT && hr == D3D_OK), + "Test %u: Got unexpected hr %#x.\n", i, hr);
hr = IDirect3DDevice9Ex_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture); ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 9064a6701af..72559b65d4a 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -12948,17 +12948,20 @@ static void test_resource_access(void) HRESULT expected_hr; D3DLOCKED_BOX lb;
- if (tests[j].format == FORMAT_DEPTH) + if (tests[i].format == FORMAT_DEPTH) continue;
- if (tests[j].format == FORMAT_ATI2) + if (tests[i].format == FORMAT_ATI2) format = MAKEFOURCC('A','T','I','2'); else format = colour_format;
hr = IDirect3DDevice9_CreateVolumeTexture(device, 16, 16, 1, 1, tests[i].usage, format, tests[i].pool, &texture, NULL); - ok(hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC) ? D3D_OK : D3DERR_INVALIDCALL), + ok((hr == (!(tests[i].usage & ~D3DUSAGE_DYNAMIC) + && (tests[i].format != FORMAT_ATI2 || tests[i].pool == D3DPOOL_SCRATCH) + ? D3D_OK : D3DERR_INVALIDCALL)) + || (tests[i].format == FORMAT_ATI2 && hr == D3D_OK), "Test %u: Got unexpected hr %#x.\n", i, hr); if (FAILED(hr)) continue; @@ -12976,9 +12979,11 @@ static void test_resource_access(void) expected_hr = D3D_OK; else expected_hr = D3DERR_INVALIDCALL; - ok(hr == expected_hr, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == expected_hr || (volume_desc.Pool == D3DPOOL_DEFAULT && hr == D3D_OK), + "Test %u: Got unexpected hr %#x.\n", i, hr); hr = IDirect3DVolume9_UnlockBox(volume); - ok(hr == expected_hr, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == expected_hr || (volume_desc.Pool == D3DPOOL_DEFAULT && hr == D3D_OK), + "Test %u: Got unexpected hr %#x.\n", i, hr);
hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture); ok(hr == D3D_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47079
Your paranoid android.
=== w8 (32 bit report) ===
d3d9: d3d9ex.c:4465: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w8adm (32 bit report) ===
d3d9: d3d9ex.c:4465: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w864 (32 bit report) ===
d3d9: d3d9ex.c:4465: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w1064 (32 bit report) ===
d3d9: d3d9ex.c:4465: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w864 (64 bit report) ===
d3d9: d3d9ex.c:4465: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w1064 (64 bit report) ===
d3d9: d3d9ex.c:4465: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w8 (32 bit report) ===
d3d9: device.c:12961: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w8adm (32 bit report) ===
d3d9: device.c:12961: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w864 (32 bit report) ===
d3d9: device.c:12961: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w1064 (32 bit report) ===
d3d9: device.c:12961: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w864 (64 bit report) ===
d3d9: device.c:12961: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== w1064 (64 bit report) ===
d3d9: device.c:12961: Test failed: Test 29: Got unexpected hr 0x8876086c.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=47074
Your paranoid android.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)