Am 08.07.2020 um 22:44 schrieb Paul Gofman <pgofman(a)codeweavers.com>:
+ hr = IDirect3DVertexBuffer9_Lock(buffer, 0, size, (void **)&quads, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* The data has been reset for the whole buffer. */ + for (i = 0; i < quad_count - 1; ++i) + ok(memcmp(&quads[i], &quad1, sizeof(quad1)), "Quads match, i %u.\n", i); + + ok(!memcmp(&quads[i], &quad2, sizeof(quad2)), "Quads do not match, i %u.\n", i); + + for (i = 0; i < quad_count; ++i) + quads[i] = quad1; + + hr = IDirect3DVertexBuffer9_Unlock(buffer); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetStreamSource(device, 0, buffer2, 0, sizeof(*quads->strip)); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
What happens if you draw something from 'buffer' between the Unlock and SetStreamSource? See test_vb_discard() in ddraw7.c, although I think Henri ported the test to d3d8/9 at some point. I couldn't find it on a quick search though. What happens if you bind the a to a stream that is not used by the vertex declaration?