Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 6 +++--- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 66fa1b24014..2b923d65d23 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1799,7 +1799,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetInputLayout(ID3D11Dev static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetVertexBuffers(ID3D11DeviceContext1 *iface, UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers, UINT *strides, UINT *offsets) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i;
TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p.\n", @@ -1811,7 +1811,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetVertexBuffers(ID3D11D struct wined3d_buffer *wined3d_buffer = NULL; struct d3d_buffer *buffer_impl;
- if (FAILED(wined3d_device_get_stream_source(device->wined3d_device, start_slot + i, + if (FAILED(wined3d_device_context_get_stream_source(context->wined3d_context, start_slot + i, &wined3d_buffer, &offsets[i], &strides[i]))) { FIXME("Failed to get vertex buffer %u.\n", start_slot + i); @@ -5174,7 +5174,7 @@ static void STDMETHODCALLTYPE d3d10_device_IAGetVertexBuffers(ID3D10Device1 *ifa struct wined3d_buffer *wined3d_buffer = NULL; struct d3d_buffer *buffer_impl;
- if (FAILED(wined3d_device_get_stream_source(device->wined3d_device, start_slot + i, + if (FAILED(wined3d_device_context_get_stream_source(device->immediate_context.wined3d_context, start_slot + i, &wined3d_buffer, &offsets[i], &strides[i]))) ERR("Failed to get vertex buffer.\n");
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 9e74ab00081..711ca0fe735 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1254,13 +1254,13 @@ HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UI return wined3d_device_context_set_stream_source(&device->cs->c, stream_idx, buffer, offset, stride); }
-HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *device, - UINT stream_idx, struct wined3d_buffer **buffer, UINT *offset, UINT *stride) +HRESULT CDECL wined3d_device_context_get_stream_source(const struct wined3d_device_context *context, + unsigned int stream_idx, struct wined3d_buffer **buffer, unsigned int *offset, unsigned int *stride) { const struct wined3d_stream_state *stream;
- TRACE("device %p, stream_idx %u, buffer %p, offset %p, stride %p.\n", - device, stream_idx, buffer, offset, stride); + TRACE("context %p, stream_idx %u, buffer %p, offset %p, stride %p.\n", + context, stream_idx, buffer, offset, stride);
if (stream_idx >= WINED3D_MAX_STREAMS) { @@ -1268,7 +1268,7 @@ HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *devi return WINED3DERR_INVALIDCALL; }
- stream = &device->cs->c.state->streams[stream_idx]; + stream = &context->state->streams[stream_idx]; *buffer = stream->buffer; if (offset) *offset = stream->offset; diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 9dfeb64b180..a66adbd12d8 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -85,7 +85,6 @@ @ cdecl wined3d_device_get_software_vertex_processing(ptr) @ cdecl wined3d_device_get_state(ptr) @ cdecl wined3d_device_get_stream_output(ptr long ptr) -@ cdecl wined3d_device_get_stream_source(ptr long ptr ptr ptr) @ cdecl wined3d_device_get_swapchain(ptr long) @ cdecl wined3d_device_get_swapchain_count(ptr) @ cdecl wined3d_device_get_unordered_access_view(ptr long) @@ -172,6 +171,7 @@ @ cdecl wined3d_device_context_get_scissor_rects(ptr ptr ptr) @ cdecl wined3d_device_context_get_shader(ptr long) @ cdecl wined3d_device_context_get_shader_resource_view(ptr long long) +@ cdecl wined3d_device_context_get_stream_source(ptr long ptr ptr ptr) @ cdecl wined3d_device_context_get_unordered_access_view(ptr long long) @ cdecl wined3d_device_context_get_vertex_declaration(ptr) @ cdecl wined3d_device_context_get_viewports(ptr ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 07e8ba0f540..41c578971f5 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2420,8 +2420,6 @@ BOOL __cdecl wined3d_device_get_software_vertex_processing(const struct wined3d_ struct wined3d_state * __cdecl wined3d_device_get_state(struct wined3d_device *device); struct wined3d_buffer * __cdecl wined3d_device_get_stream_output(struct wined3d_device *device, UINT idx, UINT *offset); -HRESULT __cdecl wined3d_device_get_stream_source(const struct wined3d_device *device, - UINT stream_idx, struct wined3d_buffer **buffer, UINT *offset, UINT *stride); struct wined3d_swapchain * __cdecl wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx); UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *device); @@ -2573,6 +2571,8 @@ struct wined3d_shader * __cdecl wined3d_device_context_get_shader(const struct w enum wined3d_shader_type type); struct wined3d_shader_resource_view * __cdecl wined3d_device_context_get_shader_resource_view( const struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int idx); +HRESULT __cdecl wined3d_device_context_get_stream_source(const struct wined3d_device_context *context, + unsigned int stream_idx, struct wined3d_buffer **buffer, unsigned int *offset, unsigned int *stride); struct wined3d_unordered_access_view * __cdecl wined3d_device_context_get_unordered_access_view( const struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int idx); struct wined3d_vertex_declaration * __cdecl wined3d_device_context_get_vertex_declaration(
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 7 ++++--- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 2b923d65d23..f1361f306ff 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2190,7 +2190,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetDepthStencilState(ID3 static void STDMETHODCALLTYPE d3d11_immediate_context_SOGetTargets(ID3D11DeviceContext1 *iface, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); unsigned int i;
TRACE("iface %p, buffer_count %u, buffers %p.\n", iface, buffer_count, buffers); @@ -2201,7 +2201,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_SOGetTargets(ID3D11DeviceC struct wined3d_buffer *wined3d_buffer; struct d3d_buffer *buffer_impl;
- if (!(wined3d_buffer = wined3d_device_get_stream_output(device->wined3d_device, i, NULL))) + if (!(wined3d_buffer = wined3d_device_context_get_stream_output(context->wined3d_context, i, NULL))) { buffers[i] = NULL; continue; @@ -5501,7 +5501,8 @@ static void STDMETHODCALLTYPE d3d10_device_SOGetTargets(ID3D10Device1 *iface, struct wined3d_buffer *wined3d_buffer; struct d3d_buffer *buffer_impl;
- if (!(wined3d_buffer = wined3d_device_get_stream_output(device->wined3d_device, i, &offsets[i]))) + if (!(wined3d_buffer = wined3d_device_context_get_stream_output( + device->immediate_context.wined3d_context, i, &offsets[i]))) { buffers[i] = NULL; continue; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 711ca0fe735..19ab5b1e52a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1229,10 +1229,10 @@ void CDECL wined3d_device_set_stream_output(struct wined3d_device *device, UINT wined3d_device_context_set_stream_output(&device->cs->c, idx, buffer, offset); }
-struct wined3d_buffer * CDECL wined3d_device_get_stream_output(struct wined3d_device *device, - UINT idx, UINT *offset) +struct wined3d_buffer * CDECL wined3d_device_context_get_stream_output(struct wined3d_device_context *context, + unsigned int idx, unsigned int *offset) { - TRACE("device %p, idx %u, offset %p.\n", device, idx, offset); + TRACE("context %p, idx %u, offset %p.\n", context, idx, offset);
if (idx >= WINED3D_MAX_STREAM_OUTPUT_BUFFERS) { @@ -1241,8 +1241,8 @@ struct wined3d_buffer * CDECL wined3d_device_get_stream_output(struct wined3d_de }
if (offset) - *offset = device->cs->c.state->stream_output[idx].offset; - return device->cs->c.state->stream_output[idx].buffer; + *offset = context->state->stream_output[idx].offset; + return context->state->stream_output[idx].buffer; }
HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UINT stream_idx, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index a66adbd12d8..aae9474c03a 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -84,7 +84,6 @@ @ cdecl wined3d_device_get_render_state(ptr long) @ cdecl wined3d_device_get_software_vertex_processing(ptr) @ cdecl wined3d_device_get_state(ptr) -@ cdecl wined3d_device_get_stream_output(ptr long ptr) @ cdecl wined3d_device_get_swapchain(ptr long) @ cdecl wined3d_device_get_swapchain_count(ptr) @ cdecl wined3d_device_get_unordered_access_view(ptr long) @@ -171,6 +170,7 @@ @ cdecl wined3d_device_context_get_scissor_rects(ptr ptr ptr) @ cdecl wined3d_device_context_get_shader(ptr long) @ cdecl wined3d_device_context_get_shader_resource_view(ptr long long) +@ cdecl wined3d_device_context_get_stream_output(ptr long ptr) @ cdecl wined3d_device_context_get_stream_source(ptr long ptr ptr ptr) @ cdecl wined3d_device_context_get_unordered_access_view(ptr long long) @ cdecl wined3d_device_context_get_vertex_declaration(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 41c578971f5..657f8cd6758 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2418,8 +2418,6 @@ HRESULT __cdecl wined3d_device_get_raster_status(const struct wined3d_device *de DWORD __cdecl wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state); BOOL __cdecl wined3d_device_get_software_vertex_processing(const struct wined3d_device *device); struct wined3d_state * __cdecl wined3d_device_get_state(struct wined3d_device *device); -struct wined3d_buffer * __cdecl wined3d_device_get_stream_output(struct wined3d_device *device, - UINT idx, UINT *offset); struct wined3d_swapchain * __cdecl wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx); UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *device); @@ -2571,6 +2569,8 @@ struct wined3d_shader * __cdecl wined3d_device_context_get_shader(const struct w enum wined3d_shader_type type); struct wined3d_shader_resource_view * __cdecl wined3d_device_context_get_shader_resource_view( const struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int idx); +struct wined3d_buffer * __cdecl wined3d_device_context_get_stream_output(struct wined3d_device_context *context, + unsigned int idx, unsigned int *offset); HRESULT __cdecl wined3d_device_context_get_stream_source(const struct wined3d_device_context *context, unsigned int stream_idx, struct wined3d_buffer **buffer, unsigned int *offset, unsigned int *stride); struct wined3d_unordered_access_view * __cdecl wined3d_device_context_get_unordered_access_view(
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 10 +++++----- dlls/d3d8/device.c | 12 ++++++++---- dlls/d3d9/device.c | 12 ++++++++---- dlls/ddraw/device.c | 18 ++++++++++++------ dlls/ddraw/executebuffer.c | 6 +++--- dlls/wined3d/device.c | 8 ++++---- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 8 files changed, 43 insertions(+), 29 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index f1361f306ff..c2d2ccd0259 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -766,7 +766,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_IASetPrimitiveTopology(ID3D11DeviceContext1 *iface, D3D11_PRIMITIVE_TOPOLOGY topology) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); enum wined3d_primitive_type primitive_type; unsigned int patch_vertex_count;
@@ -775,7 +775,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_IASetPrimitiveTopology(ID3 wined3d_primitive_type_from_d3d11_primitive_topology(topology, &primitive_type, &patch_vertex_count);
wined3d_mutex_lock(); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, patch_vertex_count); + wined3d_device_context_set_primitive_type(context->wined3d_context, primitive_type, patch_vertex_count); wined3d_mutex_unlock(); }
@@ -2605,7 +2605,6 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetConstantBuffers(ID3D1 static void STDMETHODCALLTYPE d3d11_immediate_context_ClearState(ID3D11DeviceContext1 *iface) { struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); static const float blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; unsigned int i, j;
@@ -2628,7 +2627,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearState(ID3D11DeviceCon } wined3d_device_context_set_index_buffer(context->wined3d_context, NULL, WINED3DFMT_UNKNOWN, 0); wined3d_device_context_set_vertex_declaration(context->wined3d_context, NULL); - wined3d_device_set_primitive_type(device->wined3d_device, WINED3D_PT_UNDEFINED, 0); + wined3d_device_context_set_primitive_type(context->wined3d_context, WINED3D_PT_UNDEFINED, 0); for (i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) { wined3d_device_context_set_rendertarget_view(context->wined3d_context, i, NULL, FALSE); @@ -4631,7 +4630,8 @@ static void STDMETHODCALLTYPE d3d10_device_IASetPrimitiveTopology(ID3D10Device1 TRACE("iface %p, topology %s.\n", iface, debug_d3d10_primitive_topology(topology));
wined3d_mutex_lock(); - wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)topology, 0); + wined3d_device_context_set_primitive_type(device->immediate_context.wined3d_context, + (enum wined3d_primitive_type)topology, 0); wined3d_mutex_unlock(); }
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 938eb19c8f5..b14e6679763 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2505,7 +2505,8 @@ static HRESULT WINAPI d3d8_device_DrawPrimitive(IDirect3DDevice8 *iface, vertex_count = vertex_count_from_primitive_count(primitive_type, primitive_count); wined3d_mutex_lock(); d3d8_device_upload_sysmem_vertex_buffers(device, start_vertex, vertex_count); - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); wined3d_device_context_draw(device->immediate_context, start_vertex, vertex_count, 0, 0); wined3d_mutex_unlock(); @@ -2535,7 +2536,8 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitive(IDirect3DDevice8 *iface, base_vertex_index = device->stateblock_state->base_vertex_index; d3d8_device_upload_sysmem_vertex_buffers(device, base_vertex_index + min_vertex_idx, vertex_count); d3d8_device_upload_sysmem_index_buffer(device, start_idx, index_count); - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); wined3d_device_context_draw_indexed(device->immediate_context, base_vertex_index, start_idx, index_count, 0, 0); wined3d_mutex_unlock(); @@ -2629,7 +2631,8 @@ static HRESULT WINAPI d3d8_device_DrawPrimitiveUP(IDirect3DDevice8 *iface, if (FAILED(hr)) goto done;
- wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); wined3d_device_context_draw(device->immediate_context, vb_pos / stride, vtx_count, 0, 0); wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0); @@ -2759,7 +2762,8 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface base_vertex_idx = vb_pos / vertex_stride - min_vertex_idx; wined3d_stateblock_set_base_vertex_index(device->state, base_vertex_idx);
- wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); wined3d_device_context_draw_indexed(device->immediate_context, base_vertex_idx, ib_pos / idx_fmt_size, idx_count, 0, 0); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index ee1cdc87567..932d6d2d814 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3036,7 +3036,8 @@ static HRESULT WINAPI d3d9_device_DrawPrimitive(IDirect3DDevice9Ex *iface, vertex_count = vertex_count_from_primitive_count(primitive_type, primitive_count); d3d9_device_upload_sysmem_vertex_buffers(device, 0, start_vertex, vertex_count); d3d9_generate_auto_mipmaps(device); - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_context_draw(device->immediate_context, start_vertex, vertex_count, 0, 0); d3d9_rts_flag_auto_gen_mipmap(device); wined3d_mutex_unlock(); @@ -3073,7 +3074,8 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive(IDirect3DDevice9Ex *iface d3d9_device_upload_sysmem_vertex_buffers(device, base_vertex_idx, min_vertex_idx, vertex_count); d3d9_device_upload_sysmem_index_buffer(device, start_idx, index_count); d3d9_generate_auto_mipmaps(device); - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); wined3d_device_context_draw_indexed(device->immediate_context, base_vertex_idx, start_idx, index_count, 0, 0); d3d9_rts_flag_auto_gen_mipmap(device); @@ -3181,7 +3183,8 @@ static HRESULT WINAPI d3d9_device_DrawPrimitiveUP(IDirect3DDevice9Ex *iface, goto done;
d3d9_generate_auto_mipmaps(device); - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); wined3d_device_context_draw(device->immediate_context, vb_pos / stride, vtx_count, 0, 0); wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0); @@ -3323,7 +3326,8 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa wined3dformat_from_d3dformat(index_format));
wined3d_device_apply_stateblock(device->wined3d_device, device->state); - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_context_draw_indexed(device->immediate_context, vb_pos / vertex_stride - min_vertex_idx, ib_pos / idx_fmt_size, idx_count, 0, 0);
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 898bef5e534..e9070cfbda6 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -3520,7 +3520,8 @@ static HRESULT d3d_device7_DrawPrimitive(IDirect3DDevice7 *iface, goto done;
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf)); - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_ddraw(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); wined3d_device_context_draw(device->immediate_context, vb_pos / stride, vertex_count, 0, 0); @@ -3732,7 +3733,8 @@ static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface, wined3d_stateblock_set_index_buffer(device->state, device->index_buffer, WINED3DFMT_R16_UINT);
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf)); - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_ddraw(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); wined3d_device_context_draw_indexed(device->immediate_context, vb_pos / stride, @@ -4060,7 +4062,8 @@ static HRESULT d3d_device7_DrawPrimitiveStrided(IDirect3DDevice7 *iface, D3DPRIM goto done; wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
- wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_ddraw(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); wined3d_device_context_draw(device->immediate_context, vb_pos / dst_stride, vertex_count, 0, 0); @@ -4196,7 +4199,8 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface, wined3d_stateblock_set_index_buffer(device->state, device->index_buffer, WINED3DFMT_R16_UINT);
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf)); - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_ddraw(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); wined3d_device_context_draw_indexed(device->immediate_context, @@ -4320,7 +4324,8 @@ static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVE }
/* Now draw the primitives */ - wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_ddraw(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); wined3d_device_context_draw(device->immediate_context, start_vertex, vertex_count, 0, 0); @@ -4474,7 +4479,8 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface, return hr; }
- wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0); + wined3d_device_context_set_primitive_type(device->immediate_context, + wined3d_primitive_type_from_ddraw(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); wined3d_device_context_draw_indexed(device->immediate_context, start_vertex, diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index 7b477a79415..686b1dd325f 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -74,7 +74,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d case D3DOP_POINT: { const D3DPOINT *p = (D3DPOINT *)instr; - wined3d_device_set_primitive_type(device->wined3d_device, WINED3D_PT_POINTLIST, 0); + wined3d_device_context_set_primitive_type(device->immediate_context, WINED3D_PT_POINTLIST, 0); wined3d_stateblock_set_stream_source(device->state, 0, buffer->dst_vertex_buffer, 0, sizeof(D3DTLVERTEX)); wined3d_stateblock_set_vertex_declaration(device->state, @@ -91,7 +91,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
case D3DOP_LINE: primitive_size = 2; - wined3d_device_set_primitive_type(device->wined3d_device, WINED3D_PT_LINELIST, 0); + wined3d_device_context_set_primitive_type(device->immediate_context, WINED3D_PT_LINELIST, 0); /* Drop through. */ case D3DOP_TRIANGLE: { @@ -104,7 +104,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
if (!primitive_size) { - wined3d_device_set_primitive_type(device->wined3d_device, WINED3D_PT_TRIANGLELIST, 0); + wined3d_device_context_set_primitive_type(device->immediate_context, WINED3D_PT_TRIANGLELIST, 0); primitive_size = 3; }
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 19ab5b1e52a..623f969d690 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4488,13 +4488,13 @@ void CDECL wined3d_device_dispatch_compute_indirect(struct wined3d_device *devic wined3d_device_context_dispatch_indirect(&device->cs->c, buffer, offset); }
-void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, +void CDECL wined3d_device_context_set_primitive_type(struct wined3d_device_context *context, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count) { - struct wined3d_state *state = device->cs->c.state; + struct wined3d_state *state = context->state;
- TRACE("device %p, primitive_type %s, patch_vertex_count %u.\n", - device, debug_d3dprimitivetype(primitive_type), patch_vertex_count); + TRACE("context %p, primitive_type %s, patch_vertex_count %u.\n", + context, debug_d3dprimitivetype(primitive_type), patch_vertex_count);
state->primitive_type = primitive_type; state->patch_vertex_count = patch_vertex_count; diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index aae9474c03a..54f93e87679 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -124,7 +124,6 @@ @ cdecl wined3d_device_set_npatch_mode(ptr float) @ cdecl wined3d_device_set_pixel_shader(ptr ptr) @ cdecl wined3d_device_set_predication(ptr ptr long) -@ cdecl wined3d_device_set_primitive_type(ptr long long) @ cdecl wined3d_device_set_ps_resource_view(ptr long ptr) @ cdecl wined3d_device_set_ps_sampler(ptr long ptr) @ cdecl wined3d_device_set_rasterizer_state(ptr ptr) @@ -184,6 +183,7 @@ @ cdecl wined3d_device_context_set_depth_stencil_view(ptr ptr) @ cdecl wined3d_device_context_set_index_buffer(ptr ptr long long) @ cdecl wined3d_device_context_set_predication(ptr ptr long) +@ cdecl wined3d_device_context_set_primitive_type(ptr long long) @ cdecl wined3d_device_context_set_rasterizer_state(ptr ptr) @ cdecl wined3d_device_context_set_rendertarget_view(ptr long ptr long) @ cdecl wined3d_device_context_set_sampler(ptr long long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 657f8cd6758..3e31de44711 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2483,8 +2483,6 @@ HRESULT __cdecl wined3d_device_set_npatch_mode(struct wined3d_device *device, fl void __cdecl wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader); void __cdecl wined3d_device_set_predication(struct wined3d_device *device, struct wined3d_query *predicate, BOOL value); -void __cdecl wined3d_device_set_primitive_type(struct wined3d_device *device, - enum wined3d_primitive_type primitive_topology, unsigned int patch_vertex_count); void __cdecl wined3d_device_set_ps_resource_view(struct wined3d_device *device, UINT idx, struct wined3d_shader_resource_view *view); void __cdecl wined3d_device_set_ps_sampler(struct wined3d_device *device, UINT idx, struct wined3d_sampler *sampler); @@ -2599,6 +2597,8 @@ void __cdecl wined3d_device_context_set_index_buffer(struct wined3d_device_conte struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset); void __cdecl wined3d_device_context_set_predication(struct wined3d_device_context *context, struct wined3d_query *predicate, BOOL value); +void __cdecl wined3d_device_context_set_primitive_type(struct wined3d_device_context *context, + enum wined3d_primitive_type primitive_topology, unsigned int patch_vertex_count); void __cdecl wined3d_device_context_set_rasterizer_state(struct wined3d_device_context *context, struct wined3d_rasterizer_state *rasterizer_state); HRESULT __cdecl wined3d_device_context_set_rendertarget_view(struct wined3d_device_context *context,
Hi,
While running your changed tests, 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=89099
Your paranoid android.
=== debiant2 (32 bit report) ===
d3d11: d3d11.c:19656: Test failed: d3d11.c:29822: Test marked todo: Got 0xbfff0000, expected 0xffffffff at (200, 0, 0), sub-resource 0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 7 ++++--- dlls/wined3d/device.c | 8 ++++---- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index c2d2ccd0259..ee6ecd2c29c 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1900,14 +1900,14 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetPrimitiveTopology(ID3D11DeviceContext1 *iface, D3D11_PRIMITIVE_TOPOLOGY *topology) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); enum wined3d_primitive_type primitive_type; unsigned int patch_vertex_count;
TRACE("iface %p, topology %p.\n", iface, topology);
wined3d_mutex_lock(); - wined3d_device_get_primitive_type(device->wined3d_device, &primitive_type, &patch_vertex_count); + wined3d_device_context_get_primitive_type(context->wined3d_context, &primitive_type, &patch_vertex_count); wined3d_mutex_unlock();
d3d11_primitive_topology_from_wined3d_primitive_type(primitive_type, patch_vertex_count, topology); @@ -5259,7 +5259,8 @@ static void STDMETHODCALLTYPE d3d10_device_IAGetPrimitiveTopology(ID3D10Device1 TRACE("iface %p, topology %p.\n", iface, topology);
wined3d_mutex_lock(); - wined3d_device_get_primitive_type(device->wined3d_device, (enum wined3d_primitive_type *)topology, NULL); + wined3d_device_context_get_primitive_type(device->immediate_context.wined3d_context, + (enum wined3d_primitive_type *)topology, NULL); wined3d_mutex_unlock(); }
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 623f969d690..bf4c37756a7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4500,13 +4500,13 @@ void CDECL wined3d_device_context_set_primitive_type(struct wined3d_device_conte state->patch_vertex_count = patch_vertex_count; }
-void CDECL wined3d_device_get_primitive_type(const struct wined3d_device *device, +void CDECL wined3d_device_context_get_primitive_type(const struct wined3d_device_context *context, enum wined3d_primitive_type *primitive_type, unsigned int *patch_vertex_count) { - const struct wined3d_state *state = device->cs->c.state; + const struct wined3d_state *state = context->state;
- TRACE("device %p, primitive_type %p, patch_vertex_count %p.\n", - device, primitive_type, patch_vertex_count); + TRACE("context %p, primitive_type %p, patch_vertex_count %p.\n", + context, primitive_type, patch_vertex_count);
*primitive_type = state->primitive_type; if (patch_vertex_count) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 54f93e87679..203ffd67b89 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -77,7 +77,6 @@ @ cdecl wined3d_device_get_max_frame_latency(ptr) @ cdecl wined3d_device_get_npatch_mode(ptr) @ cdecl wined3d_device_get_pixel_shader(ptr) -@ cdecl wined3d_device_get_primitive_type(ptr ptr ptr) @ cdecl wined3d_device_get_ps_resource_view(ptr long) @ cdecl wined3d_device_get_ps_sampler(ptr long) @ cdecl wined3d_device_get_raster_status(ptr long ptr) @@ -163,6 +162,7 @@ @ cdecl wined3d_device_context_get_depth_stencil_view(ptr) @ cdecl wined3d_device_context_get_index_buffer(ptr ptr ptr) @ cdecl wined3d_device_context_get_predication(ptr ptr) +@ cdecl wined3d_device_context_get_primitive_type(ptr ptr ptr) @ cdecl wined3d_device_context_get_rasterizer_state(ptr) @ cdecl wined3d_device_context_get_rendertarget_view(ptr long) @ cdecl wined3d_device_context_get_sampler(ptr long long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 3e31de44711..de96ff0601b 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2408,8 +2408,6 @@ struct wined3d_device_context * __cdecl wined3d_device_get_immediate_context(str unsigned int __cdecl wined3d_device_get_max_frame_latency(const struct wined3d_device *device); float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device); struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device); -void __cdecl wined3d_device_get_primitive_type(const struct wined3d_device *device, - enum wined3d_primitive_type *primitive_topology, unsigned int *patch_vertex_count); struct wined3d_shader_resource_view * __cdecl wined3d_device_get_ps_resource_view(const struct wined3d_device *device, UINT idx); struct wined3d_sampler * __cdecl wined3d_device_get_ps_sampler(const struct wined3d_device *device, UINT idx); @@ -2555,6 +2553,8 @@ struct wined3d_buffer * __cdecl wined3d_device_context_get_index_buffer(const st enum wined3d_format_id *format, unsigned int *offset); struct wined3d_query * __cdecl wined3d_device_context_get_predication(struct wined3d_device_context *context, BOOL *value); +void __cdecl wined3d_device_context_get_primitive_type(const struct wined3d_device_context *context, + enum wined3d_primitive_type *primitive_topology, unsigned int *patch_vertex_count); struct wined3d_rasterizer_state * __cdecl wined3d_device_context_get_rasterizer_state( struct wined3d_device_context *context); struct wined3d_rendertarget_view * __cdecl wined3d_device_context_get_rendertarget_view(
Hi,
While running your changed tests, 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=89100
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
Report validation errors: d3d11:d3d11 crashed (c0000005)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, 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=89097
Your paranoid android.
=== debiant2 (32 bit report) ===
Report validation errors: d3d11:d3d11 crashed (c0000005)