Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Get rid of more todo_wine.
dlls/d3d10core/tests/device.c | 4 ++-- dlls/d3d11/tests/d3d11.c | 3 --- dlls/d3d8/device.c | 8 ++++++++ dlls/d3d9/device.c | 8 ++++++++ dlls/d3d9/tests/device.c | 2 +- dlls/d3d9/tests/visual.c | 2 +- dlls/d3dx10_43/tests/d3dx10.c | 4 ++-- dlls/wined3d/device.c | 6 ++---- 8 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 2687ec52b76..8fba7a3badd 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -5493,8 +5493,8 @@ float4 main(float4 color : COLOR) : SV_TARGET for (i = 0; i < D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; ++i) { ok(!tmp_buffer[i], "Got unexpected vertex buffer %p in slot %u.\n", tmp_buffer[i], i); - todo_wine ok(!stride[i], "Got unexpected stride %u in slot %u.\n", stride[i], i); - todo_wine ok(!offset[i], "Got unexpected offset %u in slot %u.\n", offset[i], i); + ok(!stride[i], "Got unexpected stride %u in slot %u.\n", stride[i], i); + ok(!offset[i], "Got unexpected offset %u in slot %u.\n", offset[i], i); } ID3D10Device_IAGetIndexBuffer(device, tmp_buffer, &format, offset); ok(!tmp_buffer[0], "Got unexpected index buffer %p.\n", tmp_buffer[0]); diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index c641372bc8e..ee8d465cb4e 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -10647,11 +10647,8 @@ static void test_clear_state(void) for (i = 0; i < D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; ++i) { ok(!tmp_buffer[i], "Got unexpected vertex buffer %p in slot %u.\n", tmp_buffer[i], i); - todo_wine_if(i < D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT) - { ok(!stride[i], "Got unexpected stride %u in slot %u.\n", stride[i], i); ok(!offset[i], "Got unexpected offset %u in slot %u.\n", offset[i], i); - } } ID3D11DeviceContext_IAGetIndexBuffer(context, tmp_buffer, &format, offset); ok(!tmp_buffer[0], "Got unexpected index buffer %p.\n", tmp_buffer[0]); diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 616886bcafa..e4869c2618e 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -3102,6 +3102,14 @@ static HRESULT WINAPI d3d8_device_SetStreamSource(IDirect3DDevice8 *iface, iface, stream_idx, buffer, stride);
wined3d_mutex_lock(); + if (!stride) + { + struct wined3d_buffer *wined3d_buffer; + unsigned int cur_offset; + + hr = wined3d_device_get_stream_source(device->wined3d_device, stream_idx, &wined3d_buffer, + &cur_offset, &stride); + } hr = wined3d_device_set_stream_source(device->wined3d_device, stream_idx, buffer_impl ? buffer_impl->wined3d_buffer : NULL, 0, stride); wined3d_mutex_unlock(); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 5d0f5071836..e32bc14af5b 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3348,6 +3348,14 @@ static HRESULT WINAPI d3d9_device_SetStreamSource(IDirect3DDevice9Ex *iface, iface, stream_idx, buffer, offset, stride);
wined3d_mutex_lock(); + if (!stride) + { + struct wined3d_buffer *wined3d_buffer; + unsigned int cur_offset; + + hr = wined3d_device_get_stream_source(device->wined3d_device, stream_idx, &wined3d_buffer, + &cur_offset, &stride); + } hr = wined3d_device_set_stream_source(device->wined3d_device, stream_idx, buffer_impl ? buffer_impl->wined3d_buffer : NULL, offset, stride); wined3d_mutex_unlock(); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index b71058de486..66bf5b00c50 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -2973,7 +2973,7 @@ static void test_draw_primitive(void) ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr); ok(!current_vb, "Unexpected vb %p.\n", current_vb); ok(!offset, "Unexpected offset %u.\n", offset); - todo_wine ok(!stride, "Unexpected stride %u.\n", stride); + ok(!stride, "Unexpected stride %u.\n", stride);
/* NULL index buffer, valid vertex declaration, NULL stream source. */ hr = IDirect3DDevice9_SetIndices(device, NULL); diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 1e213abeb18..95982e05155 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -23132,7 +23132,7 @@ static void test_drawindexedprimitiveup(void) ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr); ok(!vb, "Unexpected vb %p.\n", vb); ok(!offset, "Unexpected offset %u.\n", offset); - todo_wine ok(!stride, "Unexpected stride %u.\n", stride); + ok(!stride, "Unexpected stride %u.\n", stride);
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index 2bf92cdb589..cd61d766e8e 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -480,8 +480,8 @@ float4 main(float4 color : COLOR) : SV_TARGET for (i = 0; i < D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; ++i) { ok(!tmp_buffer[i], "Got unexpected vertex buffer %p in slot %u.\n", tmp_buffer[i], i); - todo_wine ok(!stride[i], "Got unexpected stride %u in slot %u.\n", stride[i], i); - todo_wine ok(!offset[i], "Got unexpected offset %u in slot %u.\n", offset[i], i); + ok(!stride[i], "Got unexpected stride %u in slot %u.\n", stride[i], i); + ok(!offset[i], "Got unexpected offset %u in slot %u.\n", offset[i], i); } ID3D10Device_IAGetIndexBuffer(device, tmp_buffer, &format, offset); ok(!tmp_buffer[0], "Got unexpected index buffer %p.\n", tmp_buffer[0]); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 8ef74b6ef0f..6776c5c5e0c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1389,12 +1389,10 @@ HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UI }
stream->buffer = buffer; + stream->stride = stride; + stream->offset = offset; if (buffer) - { - stream->stride = stride; - stream->offset = offset; wined3d_buffer_incref(buffer); - }
if (!device->recording) wined3d_cs_emit_set_stream_source(device->cs, stream_idx, buffer, offset, stride);