Commit f65fafe3 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Pass a wined3d_device_context to wined3d_device_copy_resource().

parent 9b350454
......@@ -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();
}
......
......@@ -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);
}
}
......
......@@ -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)
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment