Commit 9b350454 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Pass a wined3d_device_context to wined3d_cs_emit_blt_sub_resource().

parent 1afbe2e1
......@@ -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)
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
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