Signed-off-by: Pablo Martin pmart-wine@riseup.net --- Prepares wined3d_device_copy_sub_resource_region so the flags parameter can be sent from CopySubresourceRegion1 in the next patch.
After this series is done and I'm sure about the way we want to do this, I will prepare a similar one for adding flags to wined3d_device_update_sub_resource for UpdateSubresource1.
Some remarks: - touches on d3d11, d3d9, ddraw modules, but I set 'wined3d:' in the subject since the patch is about one modification in wined3d that needs small adaptations in other places. Please let me know if this is not the best way. - I named the parameter in wined3d_device_update_sub_resource 'flags', but it might be better to call it 'copy_flags'.
Tested on Ubuntu 17.10.
dlls/d3d11/device.c | 4 ++-- dlls/d3d9/device.c | 2 +- dlls/ddraw/executebuffer.c | 2 +- dlls/wined3d/device.c | 9 ++++++--- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index c930248e54..495ddc139f 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1021,7 +1021,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion(ID3D 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, - dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL); + dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL, 0); wined3d_mutex_unlock(); }
@@ -4514,7 +4514,7 @@ static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device1 * 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); + 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/d3d9/device.c b/dlls/d3d9/device.c index e3562c7c57..2f3ad2880d 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1536,7 +1536,7 @@ static HRESULT WINAPI d3d9_device_UpdateSurface(IDirect3DDevice9Ex *iface, hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, 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); + src->sub_resource_idx, &src_box, 0); if (SUCCEEDED(hr) && dst->texture) d3d9_texture_flag_auto_gen_mipmap(dst->texture);
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index b20b9eda71..2ba29a7ed7 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -345,7 +345,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, wined3d_device_copy_sub_resource_region(device->wined3d_device, 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); + wined3d_buffer_get_resource(buffer->src_vertex_buffer), 0, &box, 0); break;
default: diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c853b43440..97f9049379 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4154,14 +4154,17 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, 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 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, " - "src_resource %p, src_sub_resource_idx %u, src_box %s.\n", + "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, - src_resource, src_sub_resource_idx, debug_box(src_box)); + src_resource, src_sub_resource_idx, debug_box(src_box), flags); + + if (flags) + FIXME("Ignoring flags %#x.\n", flags);
if (src_resource == dst_resource && src_sub_resource_idx == dst_sub_resource_idx) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index bf29e206b5..7a8cf20381 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -40,7 +40,7 @@ @ 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) +@ cdecl wined3d_device_copy_sub_resource_region(ptr ptr long long long long ptr long ptr long) @ cdecl wined3d_device_copy_uav_counter(ptr ptr long ptr) @ cdecl wined3d_device_create(ptr long long ptr long long ptr ptr) @ cdecl wined3d_device_decref(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 15e14e5c5f..3393014baf 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2214,7 +2214,7 @@ void __cdecl wined3d_device_copy_resource(struct wined3d_device *device, 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 src_sub_resource_idx, const struct wined3d_box *src_box, unsigned int flags); void __cdecl wined3d_device_copy_uav_counter(struct wined3d_device *device, struct wined3d_buffer *dst_buffer, unsigned int offset, struct wined3d_unordered_access_view *uav); HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx,