Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3dx9_36/tests/surface.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/d3dx9_36/tests/surface.c b/dlls/d3dx9_36/tests/surface.c index 6cb1ddb73ce..b7c52a28b0f 100644 --- a/dlls/d3dx9_36/tests/surface.c +++ b/dlls/d3dx9_36/tests/surface.c @@ -847,21 +847,24 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
/* non-lockable render target */ hr = IDirect3DDevice9_CreateRenderTarget(device, 256, 256, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, FALSE, &newsurf, NULL); - if (SUCCEEDED(hr)) { - hr = D3DXLoadSurfaceFromSurface(surf, NULL, NULL, newsurf, NULL, NULL, D3DX_FILTER_NONE, 0); - ok(hr == D3D_OK, "D3DXLoadSurfaceFromSurface returned %#x, expected %#x\n", hr, D3D_OK); - - IDirect3DSurface9_Release(newsurf); - } else skip("Failed to create render target surface\n"); + ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr); + hr = D3DXLoadSurfaceFromSurface(surf, NULL, NULL, newsurf, NULL, NULL, D3DX_FILTER_NONE, 0); + ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr); + IDirect3DSurface9_Release(newsurf);
/* non-lockable multisampled render target */ hr = IDirect3DDevice9_CreateRenderTarget(device, 256, 256, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_2_SAMPLES, 0, FALSE, &newsurf, NULL); - if (SUCCEEDED(hr)) { + if (SUCCEEDED(hr)) + { hr = D3DXLoadSurfaceFromSurface(surf, NULL, NULL, newsurf, NULL, NULL, D3DX_FILTER_NONE, 0); - ok(hr == D3D_OK, "D3DXLoadSurfaceFromSurface returned %#x, expected %#x\n", hr, D3D_OK); + ok(hr == D3D_OK, "Unexpected hr %#x.\n", hr);
IDirect3DSurface9_Release(newsurf); - } else skip("Failed to create multisampled render target.\n"); + } + else + { + skip("Failed to create multisampled render target.\n"); + }
hr = IDirect3DDevice9_GetRenderTarget(device, 0, &newsurf); ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderTarget returned %#x, expected %#x.\n", hr, D3D_OK);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3dx9_36/tests/effect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 5fd922747aa..8f2f06b1de4 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -343,7 +343,7 @@ static void test_create_effect_and_pool(IDirect3DDevice9 *device)
hr = pool->lpVtbl->QueryInterface(pool, &IID_ID3DXEffectPool, (void **)&pool2); ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr); - ok(pool == pool2, "Release failed, got %p, expected %p\n", pool2, pool); + ok(pool == pool2, "Got effect pool %p, expected %p.\n", pool2, pool);
count = pool2->lpVtbl->Release(pool2); ok(count == 1, "Release failed, got %u, expected 1\n", count); @@ -359,7 +359,7 @@ static void test_create_effect_and_pool(IDirect3DDevice9 *device)
hr = effect->lpVtbl->GetPool(effect, &pool); ok(hr == D3D_OK, "GetPool failed, got %x, expected 0 (D3D_OK)\n", hr); - ok(pool == pool2, "GetPool failed, got %p, expected %p\n", pool2, pool); + ok(pool == pool2, "Got effect pool %p, expected %p.\n", pool2, pool);
count = pool2->lpVtbl->Release(pool2); ok(count == 2, "Release failed, got %u, expected 2\n", count);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d9/tests/d3d9ex.c | 191 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+)
diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 82acaf4d6a8..3e94c2b9a3f 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -4563,6 +4563,196 @@ static void test_resource_access(void) DestroyWindow(window); }
+static void test_sysmem_draw(void) +{ + static const DWORD texture_data[4] = {0xffff0000, 0xff00ff00, 0xff0000ff, 0xffffffff}; + static const D3DVERTEXELEMENT9 decl_elements[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {1, 0, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END() + }; + static const short indices[] = {0, 1, 2, 3}; + static const struct + { + struct vec3 + { + float x, y, z; + } position; + DWORD diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, + }; + static const struct vec3 quad_s0[] = + { + {-1.0f, -1.0f, 0.0f}, + {-1.0f, 1.0f, 0.0f}, + { 1.0f, -1.0f, 0.0f}, + { 1.0f, 1.0f, 0.0f}, + }; + static const DWORD quad_s1[] = + { + 0xffff0000, + 0xff00ff00, + 0xff0000ff, + 0xffffffff, + }; + IDirect3DVertexDeclaration9 *vertex_declaration; + IDirect3DVertexBuffer9 *vb, *vb_s0, *vb_s1; + IDirect3DTexture9 *texture; + IDirect3DDevice9Ex *device; + IDirect3DIndexBuffer9 *ib; + D3DLOCKED_RECT lr; + D3DCOLOR colour; + ULONG refcount; + HWND window; + HRESULT hr; + BYTE *data; + + window = create_window(); + if (!(device = create_device(window, NULL))) + { + skip("Failed to create a D3D device.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9Ex_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_CreateVertexBuffer(device, sizeof(quad), 0, 0, D3DPOOL_SYSTEMMEM, &vb, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad), (void **)&data, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(data, quad, sizeof(quad)); + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_SetStreamSource(device, 0, vb, 0, sizeof(*quad)); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + colour = get_pixel_color(device, 320, 240); + ok(color_match(colour, 0x00007f7f, 1), "Got unexpected colour 0x%08x.\n", colour); + + hr = IDirect3DDevice9Ex_CreateIndexBuffer(device, sizeof(indices), 0, + D3DFMT_INDEX16, D3DPOOL_SYSTEMMEM, &ib, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DIndexBuffer9_Lock(ib, 0, sizeof(indices), (void **)&data, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(data, indices, sizeof(indices)); + hr = IDirect3DIndexBuffer9_Unlock(ib); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_SetIndices(device, ib); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 0, 4, 0, 2); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + colour = get_pixel_color(device, 320, 240); + ok(color_match(colour, 0x00007f7f, 1), "Got unexpected colour 0x%08x.\n", colour); + + hr = IDirect3DDevice9Ex_CreateVertexDeclaration(device, decl_elements, &vertex_declaration); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_SetVertexDeclaration(device, vertex_declaration); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_CreateVertexBuffer(device, sizeof(quad_s0), 0, 0, D3DPOOL_SYSTEMMEM, &vb_s0, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DVertexBuffer9_Lock(vb_s0, 0, sizeof(quad_s0), (void **)&data, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(data, quad_s0, sizeof(quad_s0)); + hr = IDirect3DVertexBuffer9_Unlock(vb_s0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_CreateVertexBuffer(device, sizeof(quad_s1), 0, 0, D3DPOOL_SYSTEMMEM, &vb_s1, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DVertexBuffer9_Lock(vb_s1, 0, sizeof(quad_s1), (void **)&data, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(data, quad_s1, sizeof(quad_s1)); + hr = IDirect3DVertexBuffer9_Unlock(vb_s1); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_SetStreamSource(device, 0, vb_s0, 0, sizeof(*quad_s0)); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_SetStreamSource(device, 1, vb_s1, 0, sizeof(*quad_s1)); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 0, 4, 0, 2); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + colour = get_pixel_color(device, 320, 240); + ok(color_match(colour, 0x00007f7f, 1), "Got unexpected colour 0x%08x.\n", colour); + + hr = IDirect3DDevice9Ex_CreateTexture(device, 2, 2, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &texture, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memset(&lr, 0, sizeof(lr)); + hr = IDirect3DTexture9_LockRect(texture, 0, &lr, NULL, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(lr.pBits, texture_data, sizeof(texture_data)); + hr = IDirect3DTexture9_UnlockRect(texture, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_SetFVF(device, D3DFVF_XYZ); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == D3D_OK || hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9Ex_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9Ex_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + IDirect3DTexture9_Release(texture); + IDirect3DVertexBuffer9_Release(vb_s1); + IDirect3DVertexBuffer9_Release(vb_s0); + IDirect3DVertexDeclaration9_Release(vertex_declaration); + IDirect3DIndexBuffer9_Release(ib); + IDirect3DVertexBuffer9_Release(vb); + refcount = IDirect3DDevice9Ex_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + START_TEST(d3d9ex) { DEVMODEW current_mode; @@ -4615,4 +4805,5 @@ START_TEST(d3d9ex) test_device_caps(); test_frame_latency(); test_resource_access(); + test_sysmem_draw(); }
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=46537
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)
=== 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)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d9/tests/visual.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index fb7c3e4ea4a..1f28fe13e88 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -24328,9 +24328,11 @@ static void test_sysmem_draw(void) { IDirect3DVertexBuffer9 *vb, *vb_s0, *vb_s1, *dst_vb; IDirect3DVertexDeclaration9 *vertex_declaration; + IDirect3DTexture9 *texture; IDirect3DIndexBuffer9 *ib; IDirect3DDevice9 *device; struct vec4 *dst_data; + D3DLOCKED_RECT lr; IDirect3D9 *d3d; D3DCOLOR colour; unsigned int i; @@ -24339,6 +24341,7 @@ static void test_sysmem_draw(void) HRESULT hr; BYTE *data;
+ static const DWORD texture_data[4] = {0xffff0000, 0xff00ff00, 0xff0000ff, 0xffffffff}; static const D3DVERTEXELEMENT9 decl_elements[] = { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, @@ -24518,9 +24521,35 @@ static void test_sysmem_draw(void) colour = getPixelColor(device, 320, 240); ok(color_match(colour, 0x00443322, 1), "Got unexpected colour 0x%08x.\n", colour);
+ hr = IDirect3DDevice9_CreateTexture(device, 2, 2, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &texture, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memset(&lr, 0, sizeof(lr)); + hr = IDirect3DTexture9_LockRect(texture, 0, &lr, NULL, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(lr.pBits, texture_data, sizeof(texture_data)); + hr = IDirect3DTexture9_UnlockRect(texture, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == D3D_OK || hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ IDirect3DTexture9_Release(texture); IDirect3DVertexBuffer9_Release(vb_s1); IDirect3DVertexBuffer9_Release(vb_s0); IDirect3DVertexDeclaration9_Release(vertex_declaration);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d8/tests/visual.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index cc5992281f3..7399d270e8d 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -10447,7 +10447,7 @@ static void test_color_vertex(void) hr = IDirect3DDevice8_SetRenderState(device, D3DRS_EMISSIVEMATERIALSOURCE, tests[i].emissive); ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | tests[i].fvf); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to set vertex format, hr %#x.\n", hr);
hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); ok(SUCCEEDED(hr), "Failed to clear depth/stencil, hr %#x.\n", hr); @@ -10475,9 +10475,11 @@ static void test_sysmem_draw(void) { IDirect3DVertexBuffer8 *vb, *vb_s0, *vb_s1, *dst_vb; D3DPRESENT_PARAMETERS present_parameters = {0}; + IDirect3DTexture8 *texture; IDirect3DIndexBuffer8 *ib; IDirect3DDevice8 *device; struct vec4 *dst_data; + D3DLOCKED_RECT lr; IDirect3D8 *d3d; D3DCOLOR colour; unsigned int i; @@ -10487,6 +10489,7 @@ static void test_sysmem_draw(void) BYTE *data; DWORD vs;
+ static const DWORD texture_data[4] = {0xffff0000, 0xff00ff00, 0xff0000ff, 0xffffffff}; static const DWORD decl[] = { D3DVSD_STREAM(0), @@ -10695,9 +10698,35 @@ static void test_sysmem_draw(void) colour = getPixelColor(device, 320, 240); ok(color_match(colour, 0x00443322, 1), "Got unexpected colour 0x%08x.\n", colour);
+ hr = IDirect3DDevice8_CreateTexture(device, 2, 2, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memset(&lr, 0, sizeof(lr)); + hr = IDirect3DTexture8_LockRect(texture, 0, &lr, NULL, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(lr.pBits, texture_data, sizeof(texture_data)); + hr = IDirect3DTexture8_UnlockRect(texture, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice8_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == D3D_OK || hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice8_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ IDirect3DTexture8_Release(texture); IDirect3DVertexBuffer8_Release(vb_s1); IDirect3DVertexBuffer8_Release(vb_s0); IDirect3DDevice8_DeleteVertexShader(device, vs);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/ddraw/tests/ddraw4.c | 40 ++++++++++++++++++++++++++++++++++++++- dlls/ddraw/tests/ddraw7.c | 36 ++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 8062fe870a9..ad4021452a6 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -15444,11 +15444,14 @@ static void test_killfocus(void) static void test_sysmem_draw(void) { D3DRECT rect_full = {{0}, {0}, {640}, {480}}; + IDirectDrawSurface4 *rt, *surface; IDirect3DViewport3 *viewport; + DDSURFACEDESC2 surface_desc; D3DVERTEXBUFFERDESC vb_desc; + IDirect3DTexture2 *texture; IDirect3DVertexBuffer *vb; IDirect3DDevice3 *device; - IDirectDrawSurface4 *rt; + IDirectDraw4 *ddraw; IDirect3D3 *d3d; D3DCOLOR color; ULONG refcount; @@ -15482,6 +15485,8 @@ static void test_sysmem_draw(void)
hr = IDirect3DDevice3_GetDirect3D(device, &d3d); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice3_GetRenderTarget(device, &rt); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
@@ -15531,9 +15536,42 @@ static void test_sysmem_draw(void) color = get_surface_color(rt, 320, 240); ok(compare_color(color, 0x00007f7f, 1), "Got unexpected color 0x%08x.\n", color);
+ memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.dwHeight = 2; + surface_desc.dwWidth = 2; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(surface_desc).ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; + U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirectDrawSurface4_QueryInterface(surface, &IID_IDirect3DTexture2, (void **)&texture); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface4_Release(surface); + hr = IDirect3DDevice3_SetTexture(device, 0, texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice3_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice3_EndScene(device); + ok(hr == D3D_OK || hr == D3DERR_SCENE_END_FAILED, "Got unexpected hr %#x.\n", hr); + + IDirect3DTexture2_Release(texture); IDirect3DVertexBuffer_Release(vb); IDirect3DViewport3_Release(viewport); IDirectDrawSurface4_Release(rt); + IDirectDraw4_Release(ddraw); IDirect3D3_Release(d3d); refcount = IDirect3DDevice3_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 6ef696d34fd..d13e238f2e7 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -15158,10 +15158,12 @@ static void test_killfocus(void)
static void test_sysmem_draw(void) { + IDirectDrawSurface7 *rt, *texture; + DDSURFACEDESC2 surface_desc; D3DVERTEXBUFFERDESC vb_desc; IDirect3DVertexBuffer7 *vb; IDirect3DDevice7 *device; - IDirectDrawSurface7 *rt; + IDirectDraw7 *ddraw; IDirect3D7 *d3d; D3DCOLOR colour; ULONG refcount; @@ -15195,6 +15197,8 @@ static void test_sysmem_draw(void)
hr = IDirect3DDevice7_GetDirect3D(device, &d3d); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice7_GetRenderTarget(device, &rt); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
@@ -15240,8 +15244,38 @@ static void test_sysmem_draw(void) colour = get_surface_color(rt, 320, 240); ok(compare_color(colour, 0x00007f7f, 1), "Got unexpected colour 0x%08x.\n", colour);
+ memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.dwHeight = 2; + surface_desc.dwWidth = 2; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(surface_desc).ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; + U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &texture, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTexture(device, 0, texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice7_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 4, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice7_EndScene(device); + ok(hr == D3D_OK || hr == D3DERR_SCENE_END_FAILED, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface7_Release(texture); IDirect3DVertexBuffer7_Release(vb); IDirectDrawSurface7_Release(rt); + IDirectDraw7_Release(ddraw); IDirect3D7_Release(d3d); refcount = IDirect3DDevice7_Release(device); ok(!refcount, "Device has %u references left.\n", refcount);
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=46540
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)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com