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,