Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/cs.c | 20 +++++++++++++------- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/texture.c | 4 ++-- dlls/wined3d/wined3d_private.h | 8 ++++---- 4 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 462e6d8a93b..f7b947616dd 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -474,6 +474,12 @@ static inline void wined3d_device_context_submit(struct wined3d_device_context * context->ops->submit(context, queue_id); }
+static inline void wined3d_device_context_finish(struct wined3d_device_context *context, + enum wined3d_cs_queue_id queue_id) +{ + context->ops->finish(context, queue_id); +} + static const char *debug_cs_op(enum wined3d_cs_op op) { switch (op) @@ -2425,14 +2431,14 @@ error: wined3d_resource_release(op->dst_resource); }
-void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *dst_resource, - unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_resource *src_resource, - unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, DWORD flags, - const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) +void wined3d_device_context_emit_blt_sub_resource(struct wined3d_device_context *context, + struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, + struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, + unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) { struct wined3d_cs_blt_sub_resource *op;
- op = wined3d_device_context_require_space(&cs->c, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); + op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_BLT_SUB_RESOURCE; op->dst_resource = dst_resource; op->dst_sub_resource_idx = dst_sub_resource_idx; @@ -2451,9 +2457,9 @@ void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_reso if (src_resource) wined3d_resource_acquire(src_resource);
- wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); if (flags & WINED3D_BLT_SYNCHRONOUS) - wined3d_cs_finish(cs, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_finish(context, WINED3D_CS_QUEUE_DEFAULT); }
static void wined3d_cs_exec_update_sub_resource(struct wined3d_cs *cs, const void *data) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c03621c706a..004d3ec8d2a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4613,7 +4613,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, wined3d_texture_get_level_box(dst_texture, i, &box); for (j = 0; j < layer_count; ++j) { - wined3d_cs_emit_blt_sub_resource(device->cs, + wined3d_device_context_emit_blt_sub_resource(&device->cs->c, &dst_texture->resource, j * dst_level_count + i, &box, &src_texture->resource, j * src_level_count + i + src_skip_levels, &box, 0, NULL, WINED3D_TEXF_POINT); @@ -4659,7 +4659,7 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, wined3d_texture_get_level_depth(src_texture, src_level)); }
- wined3d_cs_emit_blt_sub_resource(device->cs, + wined3d_device_context_emit_blt_sub_resource(&device->cs->c, &dst_texture->resource, i * dst_level_count + j, &box, &src_texture->resource, i * src_level_count + src_level, &box, 0, NULL, WINED3D_TEXF_POINT); @@ -4893,7 +4893,7 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, if (dst_resource->type == WINED3D_RTYPE_BUFFER) { wined3d_box_set(&src_box, 0, 0, src_resource->size, 1, 0, 1); - wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, 0, &src_box, + wined3d_device_context_emit_blt_sub_resource(&device->cs->c, dst_resource, 0, &src_box, src_resource, 0, &src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); return; } @@ -4918,7 +4918,7 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, { unsigned int idx = j * dst_texture->level_count + i;
- wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, idx, &dst_box, + wined3d_device_context_emit_blt_sub_resource(&device->cs->c, dst_resource, idx, &dst_box, src_resource, idx, &src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); } } @@ -5079,7 +5079,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev } }
- wined3d_cs_emit_blt_sub_resource(device->cs, dst_resource, dst_sub_resource_idx, &dst_box, + wined3d_device_context_emit_blt_sub_resource(&device->cs->c, dst_resource, dst_sub_resource_idx, &dst_box, src_resource, src_sub_resource_idx, src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT);
return WINED3D_OK; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 0736f612f12..363f4641b3f 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -3911,8 +3911,8 @@ HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned return E_NOTIMPL; }
- wined3d_cs_emit_blt_sub_resource(dst_texture->resource.device->cs, &dst_texture->resource, dst_sub_resource_idx, - &dst_box, &src_texture->resource, src_sub_resource_idx, &src_box, flags, fx, filter); + wined3d_device_context_emit_blt_sub_resource(&dst_texture->resource.device->cs->c, &dst_texture->resource, + dst_sub_resource_idx, &dst_box, &src_texture->resource, src_sub_resource_idx, &src_box, flags, fx, filter);
return WINED3D_OK; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 957290c7ece..38f19b21fbf 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4723,10 +4723,6 @@ void wined3d_cs_destroy_object(struct wined3d_cs *cs, void (*callback)(void *object), void *object) DECLSPEC_HIDDEN; void wined3d_cs_emit_add_dirty_texture_region(struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int layer) DECLSPEC_HIDDEN; -void wined3d_cs_emit_blt_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *dst_resource, - unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_resource *src_resource, - unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, DWORD flags, - const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN; void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, @@ -4781,6 +4777,10 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d cs->c.ops->push_constants(&cs->c, p, start_idx, count, constants); }
+void wined3d_device_context_emit_blt_sub_resource(struct wined3d_device_context *context, + struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, + struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, + unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; void wined3d_device_context_emit_copy_uav_counter(struct wined3d_device_context *context, struct wined3d_buffer *dst_buffer, unsigned int offset, struct wined3d_unordered_access_view *uav) DECLSPEC_HIDDEN;
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 e84f88ff5f2..dfe3b60c369 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1237,7 +1237,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion(ID3D static void STDMETHODCALLTYPE d3d11_immediate_context_CopyResource(ID3D11DeviceContext1 *iface, ID3D11Resource *dst_resource, ID3D11Resource *src_resource) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource;
TRACE("iface %p, dst_resource %p, src_resource %p.\n", iface, dst_resource, src_resource); @@ -1245,7 +1245,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopyResource(ID3D11DeviceC wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); wined3d_mutex_lock(); - wined3d_device_copy_resource(device->wined3d_device, wined3d_dst_resource, wined3d_src_resource); + wined3d_device_context_copy_resource(context->wined3d_context, wined3d_dst_resource, wined3d_src_resource); wined3d_mutex_unlock(); }
@@ -4896,7 +4896,8 @@ static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device1 *iface, wined3d_dst_resource = wined3d_resource_from_d3d10_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d10_resource(src_resource); wined3d_mutex_lock(); - wined3d_device_copy_resource(device->wined3d_device, wined3d_dst_resource, wined3d_src_resource); + wined3d_device_context_copy_resource(device->immediate_context.wined3d_context, + wined3d_dst_resource, wined3d_src_resource); wined3d_mutex_unlock(); }
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 004d3ec8d2a..18f5d5e89a2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4839,7 +4839,7 @@ static bool resources_format_compatible(const struct wined3d_resource *src_resou return false; }
-void CDECL wined3d_device_copy_resource(struct wined3d_device *device, +void CDECL wined3d_device_context_copy_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource) { unsigned int src_row_block_count, dst_row_block_count; @@ -4848,7 +4848,7 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, struct wined3d_box src_box, dst_box; unsigned int i, j;
- TRACE("device %p, dst_resource %p, src_resource %p.\n", device, dst_resource, src_resource); + TRACE("context %p, dst_resource %p, src_resource %p.\n", context, dst_resource, src_resource);
if (src_resource == dst_resource) { @@ -4893,7 +4893,7 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, if (dst_resource->type == WINED3D_RTYPE_BUFFER) { wined3d_box_set(&src_box, 0, 0, src_resource->size, 1, 0, 1); - wined3d_device_context_emit_blt_sub_resource(&device->cs->c, dst_resource, 0, &src_box, + wined3d_device_context_emit_blt_sub_resource(context, dst_resource, 0, &src_box, src_resource, 0, &src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); return; } @@ -4918,7 +4918,7 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, { unsigned int idx = j * dst_texture->level_count + i;
- wined3d_device_context_emit_blt_sub_resource(&device->cs->c, dst_resource, idx, &dst_box, + wined3d_device_context_emit_blt_sub_resource(context, dst_resource, idx, &dst_box, src_resource, idx, &src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); } } diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 3ea90e0c925..79170de8032 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -44,7 +44,6 @@ @ cdecl wined3d_device_clear(ptr long ptr long ptr float long) @ cdecl wined3d_device_clear_rendertarget_view(ptr ptr ptr long ptr float long) @ cdecl wined3d_device_clear_unordered_access_view_uint(ptr ptr ptr) -@ cdecl wined3d_device_copy_resource(ptr ptr ptr) @ cdecl wined3d_device_copy_sub_resource_region(ptr ptr long long long long ptr long ptr long) @ cdecl wined3d_device_create(ptr ptr long ptr long long ptr long ptr ptr) @ cdecl wined3d_device_decref(ptr) @@ -165,6 +164,7 @@ @ cdecl wined3d_device_update_texture(ptr ptr ptr) @ cdecl wined3d_device_validate_device(ptr ptr)
+@ cdecl wined3d_device_context_copy_resource(ptr ptr ptr) @ cdecl wined3d_device_context_copy_uav_counter(ptr ptr long ptr) @ cdecl wined3d_device_context_draw(ptr long long long long) @ cdecl wined3d_device_context_draw_indexed(ptr long long long long long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index bff77b2b949..9540c3a631f 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2357,8 +2357,6 @@ HRESULT __cdecl wined3d_device_clear_rendertarget_view(struct wined3d_device *de const struct wined3d_color *color, float depth, DWORD stencil); void __cdecl wined3d_device_clear_unordered_access_view_uint(struct wined3d_device *device, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value); -void __cdecl wined3d_device_copy_resource(struct wined3d_device *device, - struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource); HRESULT __cdecl wined3d_device_copy_sub_resource_region(struct wined3d_device *device, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, @@ -2555,6 +2553,8 @@ HRESULT __cdecl wined3d_device_update_texture(struct wined3d_device *device, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture); HRESULT __cdecl wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes);
+void __cdecl wined3d_device_context_copy_resource(struct wined3d_device_context *context, + struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource); void __cdecl wined3d_device_context_copy_uav_counter(struct wined3d_device_context *context, struct wined3d_buffer *dst_buffer, unsigned int offset, struct wined3d_unordered_access_view *uav); void __cdecl wined3d_device_context_dispatch(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=88370
Your paranoid android.
=== debiant2 (32 bit report) ===
d3d11: Unhandled exception: page fault on read access to 0xabab0052 in 32-bit code (0x7e8b37e3).
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 13 +++++++------ dlls/d3d8/device.c | 4 ++-- dlls/d3d9/device.c | 6 +++--- dlls/ddraw/ddraw_private.h | 4 ++-- dlls/ddraw/executebuffer.c | 2 +- dlls/wined3d/device.c | 8 ++++---- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 8 ++++---- 8 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index dfe3b60c369..ef15dc71af7 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1210,7 +1210,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion(ID3D ID3D11Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z, ID3D11Resource *src_resource, UINT src_subresource_idx, const D3D11_BOX *src_box) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; struct wined3d_box wined3d_src_box;
@@ -1229,7 +1229,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion(ID3D wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); wined3d_mutex_lock(); - wined3d_device_copy_sub_resource_region(device->wined3d_device, wined3d_dst_resource, dst_subresource_idx, + wined3d_device_context_copy_sub_resource_region(context->wined3d_context, wined3d_dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL, 0); wined3d_mutex_unlock(); } @@ -2675,7 +2675,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion1(ID3 ID3D11Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z, ID3D11Resource *src_resource, UINT src_subresource_idx, const D3D11_BOX *src_box, UINT flags) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; struct wined3d_box wined3d_src_box;
@@ -2694,7 +2694,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion1(ID3 wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); wined3d_mutex_lock(); - wined3d_device_copy_sub_resource_region(device->wined3d_device, wined3d_dst_resource, dst_subresource_idx, + wined3d_device_context_copy_sub_resource_region(context->wined3d_context, wined3d_dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL, flags); wined3d_mutex_unlock(); } @@ -4880,8 +4880,9 @@ static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device1 * wined3d_dst_resource = wined3d_resource_from_d3d10_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d10_resource(src_resource); wined3d_mutex_lock(); - wined3d_device_copy_sub_resource_region(device->wined3d_device, wined3d_dst_resource, dst_subresource_idx, - dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL, 0); + wined3d_device_context_copy_sub_resource_region(device->immediate_context.wined3d_context, + wined3d_dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, + wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL, 0); wined3d_mutex_unlock(); }
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 8464b99e32c..d1f7de37978 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2453,7 +2453,7 @@ static void d3d8_device_upload_sysmem_vertex_buffers(struct d3d8_device *device, wined3d_resource_get_desc(dst_resource, &desc); box.left = stream->offset + start_vertex * stride; box.right = min(box.left + vertex_count * stride, desc.size); - if (FAILED(hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, + if (FAILED(hr = wined3d_device_context_copy_sub_resource_region(device->immediate_context, dst_resource, 0, box.left, 0, 0, wined3d_buffer_get_resource(d3d8_buffer->wined3d_buffer), 0, &box, 0))) ERR("Failed to update buffer.\n"); @@ -2484,7 +2484,7 @@ static void d3d8_device_upload_sysmem_index_buffer(struct d3d8_device *device, idx_size = format == WINED3DFMT_R16_UINT ? 2 : 4; box.left = start_idx * idx_size; box.right = min(box.left + idx_count * idx_size, desc.size); - if (FAILED(hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, + if (FAILED(hr = wined3d_device_context_copy_sub_resource_region(device->immediate_context, dst_resource, 0, box.left, 0, 0, wined3d_buffer_get_resource(d3d8_buffer->wined3d_buffer), 0, &box, 0))) ERR("Failed to update buffer.\n"); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 2cd9d73d0d9..9896fd2cdd7 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1710,7 +1710,7 @@ static HRESULT WINAPI d3d9_device_UpdateSurface(IDirect3DDevice9Ex *iface, else wined3d_box_set(&src_box, 0, 0, src_desc.width, src_desc.height, 0, 1);
- hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, + hr = wined3d_device_context_copy_sub_resource_region(device->immediate_context, wined3d_texture_get_resource(dst->wined3d_texture), dst->sub_resource_idx, dst_point ? dst_point->x : 0, dst_point ? dst_point->y : 0, 0, wined3d_texture_get_resource(src->wined3d_texture), src->sub_resource_idx, &src_box, 0); @@ -2976,7 +2976,7 @@ static void d3d9_device_upload_sysmem_vertex_buffers(struct d3d9_device *device, wined3d_resource_get_desc(dst_resource, &desc); box.left = stream->offset + start_vertex * stride; box.right = min(box.left + vertex_count * stride, desc.size); - if (FAILED(hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, + if (FAILED(hr = wined3d_device_context_copy_sub_resource_region(device->immediate_context, dst_resource, 0, box.left, 0, 0, wined3d_buffer_get_resource(d3d9_buffer->wined3d_buffer), 0, &box, 0))) ERR("Failed to update buffer.\n"); @@ -3007,7 +3007,7 @@ static void d3d9_device_upload_sysmem_index_buffer(struct d3d9_device *device, idx_size = format == WINED3DFMT_R16_UINT ? 2 : 4; box.left = start_idx * idx_size; box.right = min(box.left + idx_count * idx_size, desc.size); - if (FAILED(hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, + if (FAILED(hr = wined3d_device_context_copy_sub_resource_region(device->immediate_context, dst_resource, 0, box.left, 0, 0, wined3d_buffer_get_resource(d3d9_buffer->wined3d_buffer), 0, &box, 0))) ERR("Failed to update buffer.\n"); diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index b49d84a7961..7929e9e1795 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -670,7 +670,7 @@ static inline struct wined3d_texture *ddraw_surface_get_default_texture(struct d { if (flags & DDRAW_SURFACE_READ && !(surface->texture_location & DDRAW_SURFACE_LOCATION_DEFAULT)) { - wined3d_device_copy_sub_resource_region(surface->ddraw->wined3d_device, + wined3d_device_context_copy_sub_resource_region(surface->ddraw->immediate_context, wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, 0, 0, 0, wined3d_texture_get_resource(surface->draw_texture), surface->sub_resource_idx, NULL, 0); surface->texture_location |= DDRAW_SURFACE_LOCATION_DEFAULT; @@ -689,7 +689,7 @@ static inline struct wined3d_texture *ddraw_surface_get_draw_texture(struct ddra
if (flags & DDRAW_SURFACE_READ && !(surface->texture_location & DDRAW_SURFACE_LOCATION_DRAW)) { - wined3d_device_copy_sub_resource_region(surface->ddraw->wined3d_device, + wined3d_device_context_copy_sub_resource_region(surface->ddraw->immediate_context, wined3d_texture_get_resource(surface->draw_texture), surface->sub_resource_idx, 0, 0, 0, wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, NULL, 0); surface->texture_location |= DDRAW_SURFACE_LOCATION_DRAW; diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index 1427e32e28c..7b477a79415 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -322,7 +322,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d box.right = box.left + ci->dwCount * sizeof(D3DTLVERTEX); box.top = box.front = 0; box.bottom = box.back = 1; - wined3d_device_copy_sub_resource_region(device->wined3d_device, + wined3d_device_context_copy_sub_resource_region(device->immediate_context, wined3d_buffer_get_resource(buffer->dst_vertex_buffer), 0, ci->wDest * sizeof(D3DTLVERTEX), 0, 0, wined3d_buffer_get_resource(buffer->src_vertex_buffer), 0, &box, 0); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 18f5d5e89a2..58fdfb87d08 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4924,16 +4924,16 @@ void CDECL wined3d_device_context_copy_resource(struct wined3d_device_context *c } }
-HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device, +HRESULT CDECL wined3d_device_context_copy_sub_resource_region(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, unsigned int flags) { struct wined3d_box dst_box, b;
- TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " + TRACE("context %p, dst_resource %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, " "src_resource %p, src_sub_resource_idx %u, src_box %s, flags %#x.\n", - device, dst_resource, dst_sub_resource_idx, dst_x, dst_y, dst_z, + context, dst_resource, dst_sub_resource_idx, dst_x, dst_y, dst_z, src_resource, src_sub_resource_idx, debug_box(src_box), flags);
if (flags) @@ -5079,7 +5079,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev } }
- wined3d_device_context_emit_blt_sub_resource(&device->cs->c, dst_resource, dst_sub_resource_idx, &dst_box, + wined3d_device_context_emit_blt_sub_resource(context, dst_resource, dst_sub_resource_idx, &dst_box, src_resource, src_sub_resource_idx, src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT);
return WINED3D_OK; diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 79170de8032..01b90b67cc6 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -44,7 +44,6 @@ @ cdecl wined3d_device_clear(ptr long ptr long ptr float long) @ cdecl wined3d_device_clear_rendertarget_view(ptr ptr ptr long ptr float long) @ cdecl wined3d_device_clear_unordered_access_view_uint(ptr ptr ptr) -@ cdecl wined3d_device_copy_sub_resource_region(ptr ptr long long long long ptr long ptr long) @ cdecl wined3d_device_create(ptr ptr long ptr long long ptr long ptr ptr) @ cdecl wined3d_device_decref(ptr) @ cdecl wined3d_device_dispatch_compute(ptr long long long) @@ -165,6 +164,7 @@ @ cdecl wined3d_device_validate_device(ptr ptr)
@ cdecl wined3d_device_context_copy_resource(ptr ptr ptr) +@ cdecl wined3d_device_context_copy_sub_resource_region(ptr ptr long long long long ptr long ptr long) @ cdecl wined3d_device_context_copy_uav_counter(ptr ptr long ptr) @ cdecl wined3d_device_context_draw(ptr long long long long) @ cdecl wined3d_device_context_draw_indexed(ptr long long long long long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9540c3a631f..125d4931a80 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2357,10 +2357,6 @@ HRESULT __cdecl wined3d_device_clear_rendertarget_view(struct wined3d_device *de const struct wined3d_color *color, float depth, DWORD stencil); void __cdecl wined3d_device_clear_unordered_access_view_uint(struct wined3d_device *device, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value); -HRESULT __cdecl wined3d_device_copy_sub_resource_region(struct wined3d_device *device, - struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, - unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, - unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, unsigned int flags); HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, struct wined3d_adapter *adapter, enum wined3d_device_type device_type, HWND focus_window, DWORD behaviour_flags, BYTE surface_alignment, const enum wined3d_feature_level *feature_levels, unsigned int feature_level_count, @@ -2555,6 +2551,10 @@ HRESULT __cdecl wined3d_device_validate_device(const struct wined3d_device *devi
void __cdecl wined3d_device_context_copy_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource); +HRESULT __cdecl wined3d_device_context_copy_sub_resource_region(struct wined3d_device_context *context, + struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, + unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, + unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, unsigned int flags); void __cdecl wined3d_device_context_copy_uav_counter(struct wined3d_device_context *context, struct wined3d_buffer *dst_buffer, unsigned int offset, struct wined3d_unordered_access_view *uav); void __cdecl wined3d_device_context_dispatch(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=88371
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:3660: Test failed: Test 12: Failed to create depth stencil view, hr 0x80070057. Unhandled exception: page fault on execute access to 0x00b032a8 in 32-bit code (0x00b032a8).
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 9 ++++++--- dlls/d3d9/device.c | 9 ++++++--- dlls/ddraw/device.c | 4 ++-- dlls/ddraw/surface.c | 16 +++++++++------- dlls/wined3d/cs.c | 4 ++-- dlls/wined3d/device.c | 2 +- dlls/wined3d/swapchain.c | 2 +- dlls/wined3d/texture.c | 11 ++++++----- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 7 ++++--- 10 files changed, 38 insertions(+), 28 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index d1f7de37978..f69b56acc37 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1348,6 +1348,7 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface, IDirect3DSurface8 *src_surface, const RECT *src_rects, UINT rect_count, IDirect3DSurface8 *dst_surface, const POINT *dst_points) { + struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); struct d3d8_surface *src = unsafe_impl_from_IDirect3DSurface8(src_surface); struct d3d8_surface *dst = unsafe_impl_from_IDirect3DSurface8(dst_surface); enum wined3d_format_id src_format, dst_format; @@ -1394,7 +1395,7 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface, if (!rect_count && !src_rects && !dst_points) { RECT rect = {0, 0, src_w, src_h}; - wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &rect, + wined3d_device_context_blt(device->immediate_context, dst->wined3d_texture, dst->sub_resource_idx, &rect, src->wined3d_texture, src->sub_resource_idx, &rect, 0, NULL, WINED3D_TEXF_POINT); } else @@ -1410,7 +1411,8 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface, RECT dst_rect = {dst_points[i].x, dst_points[i].y, dst_points[i].x + w, dst_points[i].y + h};
- wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &dst_rect, + wined3d_device_context_blt(device->immediate_context, + dst->wined3d_texture, dst->sub_resource_idx, &dst_rect, src->wined3d_texture, src->sub_resource_idx, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT); } } @@ -1422,7 +1424,8 @@ static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface, UINT h = src_rects[i].bottom - src_rects[i].top; RECT dst_rect = {0, 0, w, h};
- wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &dst_rect, + wined3d_device_context_blt(device->immediate_context, + dst->wined3d_texture, dst->sub_resource_idx, &dst_rect, src->wined3d_texture, src->sub_resource_idx, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT); } } diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 9896fd2cdd7..2b63f458a5d 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1750,6 +1750,7 @@ static HRESULT WINAPI d3d9_device_UpdateTexture(IDirect3DDevice9Ex *iface, static HRESULT WINAPI d3d9_device_GetRenderTargetData(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *render_target, IDirect3DSurface9 *dst_surface) { + struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct d3d9_surface *rt_impl = unsafe_impl_from_IDirect3DSurface9(render_target); struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface); struct wined3d_sub_resource_desc wined3d_desc; @@ -1772,7 +1773,8 @@ static HRESULT WINAPI d3d9_device_GetRenderTargetData(IDirect3DDevice9Ex *iface, if (wined3d_desc.multisample_type) hr = D3DERR_INVALIDCALL; else - hr = wined3d_texture_blt(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &dst_rect, + hr = wined3d_device_context_blt(device->immediate_context, + dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &dst_rect, rt_impl->wined3d_texture, rt_impl->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT); wined3d_mutex_unlock();
@@ -1873,8 +1875,9 @@ static HRESULT WINAPI d3d9_device_StretchRect(IDirect3DDevice9Ex *iface, IDirect } }
- hr = wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, dst_rect, src->wined3d_texture, - src->sub_resource_idx, src_rect, 0, NULL, wined3d_texture_filter_type_from_d3d(filter)); + hr = wined3d_device_context_blt(device->immediate_context, dst->wined3d_texture, + dst->sub_resource_idx, dst_rect, src->wined3d_texture, src->sub_resource_idx, + src_rect, 0, NULL, wined3d_texture_filter_type_from_d3d(filter)); if (hr == WINEDDERR_INVALIDRECT) hr = D3DERR_INVALIDCALL; if (SUCCEEDED(hr) && dst->texture) diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index feec6774b15..52d20fc5a62 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -6173,8 +6173,8 @@ static void copy_mipmap_chain(struct d3d_device *device, struct ddraw_surface *d UINT src_h = src_rect.bottom - src_rect.top; RECT dst_rect = {point.x, point.y, point.x + src_w, point.y + src_h};
- if (FAILED(hr = wined3d_texture_blt(ddraw_surface_get_any_texture(dst_level, DDRAW_SURFACE_RW), - dst_level->sub_resource_idx, &dst_rect, + if (FAILED(hr = wined3d_device_context_blt(device->immediate_context, + ddraw_surface_get_any_texture(dst_level, DDRAW_SURFACE_RW), dst_level->sub_resource_idx, &dst_rect, ddraw_surface_get_any_texture(src_level, DDRAW_SURFACE_READ), src_level->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) ERR("Blit failed, hr %#x.\n", hr); diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 0eaaeec9975..f5c3528cfa4 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -112,7 +112,7 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, else dst_texture = ddraw->wined3d_frontbuffer;
- if (SUCCEEDED(hr = wined3d_texture_blt(dst_texture, 0, rect, + if (SUCCEEDED(hr = wined3d_device_context_blt(ddraw->immediate_context, dst_texture, 0, rect, ddraw_surface_get_any_texture(surface, DDRAW_SURFACE_READ), surface->sub_resource_idx, rect, 0, NULL, WINED3D_TEXF_POINT)) && swap_interval) { @@ -1561,9 +1561,10 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT * if (!(flags & DDBLT_ASYNC)) wined3d_flags |= WINED3D_BLT_SYNCHRONOUS;
- return wined3d_texture_blt(ddraw_surface_get_any_texture(dst_surface, DDRAW_SURFACE_RW), - dst_surface->sub_resource_idx, dst_rect, ddraw_surface_get_any_texture(src_surface, DDRAW_SURFACE_READ), - src_surface->sub_resource_idx, src_rect, wined3d_flags, fx, filter); + return wined3d_device_context_blt(dst_surface->ddraw->immediate_context, + ddraw_surface_get_any_texture(dst_surface, DDRAW_SURFACE_RW), dst_surface->sub_resource_idx, dst_rect, + ddraw_surface_get_any_texture(src_surface, DDRAW_SURFACE_READ), src_surface->sub_resource_idx, src_rect, + wined3d_flags, fx, filter); }
static HRESULT ddraw_surface_blt_clipped(struct ddraw_surface *dst_surface, const RECT *dst_rect_in, @@ -4410,9 +4411,10 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_BltFast(IDirectDrawSurfac if (src_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) hr = ddraw_surface_update_frontbuffer(src_impl, src_rect, TRUE, 0); if (SUCCEEDED(hr)) - hr = wined3d_texture_blt(ddraw_surface_get_any_texture(dst_impl, DDRAW_SURFACE_RW), - dst_impl->sub_resource_idx, &dst_rect, ddraw_surface_get_any_texture(src_impl,DDRAW_SURFACE_READ), - src_impl->sub_resource_idx, src_rect, flags, NULL, WINED3D_TEXF_POINT); + hr = wined3d_device_context_blt(dst_impl->ddraw->immediate_context, + ddraw_surface_get_any_texture(dst_impl, DDRAW_SURFACE_RW), dst_impl->sub_resource_idx, &dst_rect, + ddraw_surface_get_any_texture(src_impl,DDRAW_SURFACE_READ), src_impl->sub_resource_idx, src_rect, + flags, NULL, WINED3D_TEXF_POINT); if (SUCCEEDED(hr) && (dst_impl->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)) hr = ddraw_surface_update_frontbuffer(dst_impl, &dst_rect, FALSE, 0); wined3d_mutex_unlock(); diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index f7b947616dd..fb8411b3048 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -563,7 +563,7 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) RECT rect = {0, 0, logo_texture->resource.width, logo_texture->resource.height};
/* Blit the logo into the upper left corner of the back-buffer. */ - wined3d_texture_blt(back_buffer, 0, &rect, logo_texture, 0, + wined3d_device_context_blt(&cs->c, back_buffer, 0, &rect, logo_texture, 0, &rect, WINED3D_BLT_SRC_CKEY, NULL, WINED3D_TEXF_POINT); }
@@ -588,7 +588,7 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data) if (desc->windowed) MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&dst_rect, 2); if (wined3d_clip_blit(&clip_rect, &dst_rect, &src_rect)) - wined3d_texture_blt(back_buffer, 0, &dst_rect, cursor_texture, 0, + wined3d_device_context_blt(&cs->c, back_buffer, 0, &dst_rect, cursor_texture, 0, &src_rect, WINED3D_BLT_ALPHA_TEST, NULL, WINED3D_TEXF_POINT); }
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 58fdfb87d08..78fbe668857 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5197,7 +5197,7 @@ void CDECL wined3d_device_resolve_sub_resource(struct wined3d_device *device, src_level = src_sub_resource_idx % src_texture->level_count; SetRect(&src_rect, 0, 0, wined3d_texture_get_level_width(src_texture, src_level), wined3d_texture_get_level_height(src_texture, src_level)); - wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect, + wined3d_device_context_blt(&device->cs->c, dst_texture, dst_sub_resource_idx, &dst_rect, src_texture, src_sub_resource_idx, &src_rect, 0, &fx, WINED3D_TEXF_POINT); }
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 49d198180f0..92df08461d9 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -266,7 +266,7 @@ HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapc wine_dbgstr_rect(&dst_rect)); }
- return wined3d_texture_blt(dst_texture, sub_resource_idx, &dst_rect, + return wined3d_device_context_blt(&swapchain->device->cs->c, dst_texture, sub_resource_idx, &dst_rect, swapchain->front_buffer, 0, &src_rect, 0, NULL, WINED3D_TEXF_POINT); }
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 363f4641b3f..487f0806ce3 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -3858,17 +3858,18 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc return WINED3D_OK; }
-HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, - const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, - const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) +HRESULT CDECL wined3d_device_context_blt(struct wined3d_device_context *context, + struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, + struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, + unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) { struct wined3d_box src_box = {src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1}; struct wined3d_box dst_box = {dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, 0, 1}; HRESULT hr;
- TRACE("dst_texture %p, dst_sub_resource_idx %u, dst_rect %s, src_texture %p, " + TRACE("context %p, dst_texture %p, dst_sub_resource_idx %u, dst_rect %s, src_texture %p, " "src_sub_resource_idx %u, src_rect %s, flags %#x, fx %p, filter %s.\n", - dst_texture, dst_sub_resource_idx, wine_dbgstr_rect(dst_rect), src_texture, + context, dst_texture, dst_sub_resource_idx, wine_dbgstr_rect(dst_rect), src_texture, src_sub_resource_idx, wine_dbgstr_rect(src_rect), flags, fx, debug_d3dtexturefiltertype(filter));
if (dst_sub_resource_idx >= dst_texture->level_count * dst_texture->layer_count diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 01b90b67cc6..d15b56b89d4 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -163,6 +163,7 @@ @ cdecl wined3d_device_update_texture(ptr ptr ptr) @ cdecl wined3d_device_validate_device(ptr ptr)
+@ cdecl wined3d_device_context_blt(ptr ptr long ptr ptr long ptr long ptr long) @ cdecl wined3d_device_context_copy_resource(ptr ptr ptr) @ cdecl wined3d_device_context_copy_sub_resource_region(ptr ptr long long long long ptr long ptr long) @ cdecl wined3d_device_context_copy_uav_counter(ptr ptr long ptr) @@ -327,7 +328,6 @@ @ cdecl wined3d_swapchain_state_set_fullscreen(ptr ptr ptr)
@ cdecl wined3d_texture_add_dirty_region(ptr long ptr) -@ cdecl wined3d_texture_blt(ptr long ptr ptr long ptr long ptr long) @ cdecl wined3d_texture_create(ptr ptr long long long ptr ptr ptr ptr) @ cdecl wined3d_texture_decref(ptr) @ cdecl wined3d_texture_from_resource(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 125d4931a80..e3667cd3f60 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2549,6 +2549,10 @@ HRESULT __cdecl wined3d_device_update_texture(struct wined3d_device *device, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture); HRESULT __cdecl wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes);
+HRESULT __cdecl wined3d_device_context_blt(struct wined3d_device_context *context, + struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, + struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, + unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter); void __cdecl wined3d_device_context_copy_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource); HRESULT __cdecl wined3d_device_context_copy_sub_resource_region(struct wined3d_device_context *context, @@ -2893,9 +2897,6 @@ HRESULT __cdecl wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_
HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region); -HRESULT __cdecl wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_idx, const RECT *dst_rect_in, - struct wined3d_texture *src_texture, unsigned int src_idx, const RECT *src_rect_in, DWORD flags, - const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter); HRESULT __cdecl wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, DWORD flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture);
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=88372
Your paranoid android.
=== debiant2 (32 bit report) ===
ddraw: ddraw4.c:18173: Test failed: Expect window rect (0,0)-(1024,768), got (7,26)-(1017,761).
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 6 +++--- dlls/d3d8/device.c | 2 +- dlls/d3d9/device.c | 2 +- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 7 +++---- 6 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index ef15dc71af7..ada668e3164 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1387,7 +1387,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ResolveSubresource(ID3D11D ID3D11Resource *src_resource, UINT src_subresource_idx, DXGI_FORMAT format) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; enum wined3d_format_id wined3d_format;
@@ -1400,7 +1400,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ResolveSubresource(ID3D11D wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); wined3d_format = wined3dformat_from_dxgi_format(format); wined3d_mutex_lock(); - wined3d_device_resolve_sub_resource(device->wined3d_device, + wined3d_device_context_resolve_sub_resource(context->wined3d_context, wined3d_dst_resource, dst_subresource_idx, wined3d_src_resource, src_subresource_idx, wined3d_format); wined3d_mutex_unlock(); @@ -4991,7 +4991,7 @@ static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device1 *ifa wined3d_src_resource = wined3d_resource_from_d3d10_resource(src_resource); wined3d_format = wined3dformat_from_dxgi_format(format); wined3d_mutex_lock(); - wined3d_device_resolve_sub_resource(device->wined3d_device, + wined3d_device_context_resolve_sub_resource(device->immediate_context.wined3d_context, wined3d_dst_resource, dst_subresource_idx, wined3d_src_resource, src_subresource_idx, wined3d_format); wined3d_mutex_unlock(); diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index f69b56acc37..b07c20f71a0 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1932,7 +1932,7 @@ static void resolve_depth_buffer(struct d3d8_device *device) return; d3d8_dsv = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
- wined3d_device_resolve_sub_resource(device->wined3d_device, dst_resource, 0, + wined3d_device_context_resolve_sub_resource(device->immediate_context, dst_resource, 0, wined3d_rendertarget_view_get_resource(wined3d_dsv), d3d8_dsv->sub_resource_idx, desc.format); }
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 2b63f458a5d..6492eecc7b9 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2429,7 +2429,7 @@ static void resolve_depth_buffer(struct d3d9_device *device) return; d3d9_dsv = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
- wined3d_device_resolve_sub_resource(device->wined3d_device, dst_resource, 0, + wined3d_device_context_resolve_sub_resource(device->immediate_context, dst_resource, 0, wined3d_rendertarget_view_get_resource(wined3d_dsv), d3d9_dsv->sub_resource_idx, desc.format); }
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 78fbe668857..e21e22a46f7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1590,7 +1590,7 @@ static void resolve_depth_buffer(struct wined3d_device *device) if (!(src_view = state->fb.depth_stencil)) return;
- wined3d_device_resolve_sub_resource(device, dst_resource, 0, + wined3d_device_context_resolve_sub_resource(&device->cs->c, dst_resource, 0, src_view->resource, src_view->sub_resource_idx, dst_resource->format->id); }
@@ -5152,7 +5152,7 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); }
-void CDECL wined3d_device_resolve_sub_resource(struct wined3d_device *device, +void CDECL wined3d_device_context_resolve_sub_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, enum wined3d_format_id format_id) @@ -5162,9 +5162,9 @@ void CDECL wined3d_device_resolve_sub_resource(struct wined3d_device *device, struct wined3d_blt_fx fx = {0}; RECT dst_rect, src_rect;
- TRACE("device %p, dst_resource %p, dst_sub_resource_idx %u, " + TRACE("context %p, dst_resource %p, dst_sub_resource_idx %u, " "src_resource %p, src_sub_resource_idx %u, format %s.\n", - device, dst_resource, dst_sub_resource_idx, + context, dst_resource, dst_sub_resource_idx, src_resource, src_sub_resource_idx, debug_d3dformat(format_id));
if (wined3d_format_is_typeless(dst_resource->format) @@ -5197,7 +5197,7 @@ void CDECL wined3d_device_resolve_sub_resource(struct wined3d_device *device, src_level = src_sub_resource_idx % src_texture->level_count; SetRect(&src_rect, 0, 0, wined3d_texture_get_level_width(src_texture, src_level), wined3d_texture_get_level_height(src_texture, src_level)); - wined3d_device_context_blt(&device->cs->c, dst_texture, dst_sub_resource_idx, &dst_rect, + wined3d_device_context_blt(context, dst_texture, dst_sub_resource_idx, &dst_rect, src_texture, src_sub_resource_idx, &src_rect, 0, &fx, WINED3D_TEXF_POINT); }
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index d15b56b89d4..34eca80a94e 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -111,7 +111,6 @@ @ cdecl wined3d_device_process_vertices(ptr long long long ptr ptr long long) @ cdecl wined3d_device_release_focus_window(ptr) @ cdecl wined3d_device_reset(ptr ptr ptr ptr long) -@ cdecl wined3d_device_resolve_sub_resource(ptr ptr long ptr long long) @ cdecl wined3d_device_set_base_vertex_index(ptr long) @ cdecl wined3d_device_set_blend_state(ptr ptr ptr) @ cdecl wined3d_device_set_clip_status(ptr ptr) @@ -172,6 +171,7 @@ @ cdecl wined3d_device_context_draw_indirect(ptr ptr long long) @ cdecl wined3d_device_context_dispatch(ptr long long long) @ cdecl wined3d_device_context_dispatch_indirect(ptr ptr long) +@ cdecl wined3d_device_context_resolve_sub_resource(ptr ptr long ptr long long) @ cdecl wined3d_device_context_set_blend_state(ptr ptr ptr long) @ cdecl wined3d_device_context_set_constant_buffer(ptr long long ptr) @ cdecl wined3d_device_context_set_depth_stencil_state(ptr ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index e3667cd3f60..0e356aa7ecb 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2461,10 +2461,6 @@ void __cdecl wined3d_device_release_focus_window(struct wined3d_device *device); HRESULT __cdecl wined3d_device_reset(struct wined3d_device *device, const struct wined3d_swapchain_desc *swapchain_desc, const struct wined3d_display_mode *mode, wined3d_device_reset_cb callback, BOOL reset_state); -void __cdecl wined3d_device_resolve_sub_resource(struct wined3d_device *device, - struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, - struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, - enum wined3d_format_id format_id); void __cdecl wined3d_device_set_base_vertex_index(struct wined3d_device *device, INT base_index); void __cdecl wined3d_device_set_blend_state(struct wined3d_device *device, struct wined3d_blend_state *blend_state, const struct wined3d_color *blend_factor, unsigned int sample_mask); @@ -2571,6 +2567,9 @@ void __cdecl wined3d_device_context_draw_indexed(struct wined3d_device_context * unsigned int start_index, unsigned int index_count, unsigned int start_instance, unsigned int instance_count); void __cdecl wined3d_device_context_draw_indirect(struct wined3d_device_context *context, struct wined3d_buffer *buffer, unsigned int offset, bool indexed); +void __cdecl wined3d_device_context_resolve_sub_resource(struct wined3d_device_context *context, + struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, + struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, enum wined3d_format_id format_id); void __cdecl wined3d_device_context_set_blend_state(struct wined3d_device_context *context, struct wined3d_blend_state *state, const struct wined3d_color *blend_factor, unsigned int sample_mask); void __cdecl wined3d_device_context_set_constant_buffer(struct wined3d_device_context *context,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com