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

wined3d: Pass a wined3d_device_context to wined3d_cs_emit_set_shader().

parent 94607a15
......@@ -1622,16 +1622,17 @@ static void wined3d_cs_exec_set_shader(struct wined3d_cs *cs, const void *data)
device_invalidate_state(cs->c.device, STATE_COMPUTE_SHADER_RESOURCE_BINDING);
}
void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader)
void wined3d_device_context_emit_set_shader(struct wined3d_device_context *context,
enum wined3d_shader_type type, struct wined3d_shader *shader)
{
struct wined3d_cs_set_shader *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_SET_SHADER;
op->type = type;
op->shader = shader;
wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT);
wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT);
}
static void wined3d_cs_exec_set_blend_state(struct wined3d_cs *cs, const void *data)
......
......@@ -1959,7 +1959,7 @@ void CDECL wined3d_device_set_state(struct wined3d_device *device, struct wined3
for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
{
wined3d_cs_emit_set_shader(device->cs, i, state->shader[i]);
wined3d_device_context_emit_set_shader(&device->cs->c, i, state->shader[i]);
for (j = 0; j < MAX_CONSTANT_BUFFERS; ++j)
{
wined3d_cs_emit_set_constant_buffer(device->cs, i, j, state->cb[i][j]);
......@@ -2095,7 +2095,7 @@ void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struc
if (shader)
wined3d_shader_incref(shader);
state->shader[WINED3D_SHADER_TYPE_VERTEX] = shader;
wined3d_cs_emit_set_shader(device->cs, WINED3D_SHADER_TYPE_VERTEX, shader);
wined3d_device_context_emit_set_shader(&device->cs->c, WINED3D_SHADER_TYPE_VERTEX, shader);
if (prev)
wined3d_shader_decref(prev);
}
......@@ -2333,7 +2333,7 @@ void CDECL wined3d_device_set_pixel_shader(struct wined3d_device *device, struct
if (shader)
wined3d_shader_incref(shader);
state->shader[WINED3D_SHADER_TYPE_PIXEL] = shader;
wined3d_cs_emit_set_shader(device->cs, WINED3D_SHADER_TYPE_PIXEL, shader);
wined3d_device_context_emit_set_shader(&device->cs->c, WINED3D_SHADER_TYPE_PIXEL, shader);
if (prev)
wined3d_shader_decref(prev);
}
......@@ -2442,7 +2442,7 @@ void CDECL wined3d_device_set_hull_shader(struct wined3d_device *device, struct
if (shader)
wined3d_shader_incref(shader);
state->shader[WINED3D_SHADER_TYPE_HULL] = shader;
wined3d_cs_emit_set_shader(device->cs, WINED3D_SHADER_TYPE_HULL, shader);
wined3d_device_context_emit_set_shader(&device->cs->c, WINED3D_SHADER_TYPE_HULL, shader);
if (prev)
wined3d_shader_decref(prev);
}
......@@ -2498,7 +2498,7 @@ void CDECL wined3d_device_set_domain_shader(struct wined3d_device *device, struc
if (shader)
wined3d_shader_incref(shader);
state->shader[WINED3D_SHADER_TYPE_DOMAIN] = shader;
wined3d_cs_emit_set_shader(device->cs, WINED3D_SHADER_TYPE_DOMAIN, shader);
wined3d_device_context_emit_set_shader(&device->cs->c, WINED3D_SHADER_TYPE_DOMAIN, shader);
if (prev)
wined3d_shader_decref(prev);
}
......@@ -2554,7 +2554,7 @@ void CDECL wined3d_device_set_geometry_shader(struct wined3d_device *device, str
if (shader)
wined3d_shader_incref(shader);
state->shader[WINED3D_SHADER_TYPE_GEOMETRY] = shader;
wined3d_cs_emit_set_shader(device->cs, WINED3D_SHADER_TYPE_GEOMETRY, shader);
wined3d_device_context_emit_set_shader(&device->cs->c, WINED3D_SHADER_TYPE_GEOMETRY, shader);
if (prev)
wined3d_shader_decref(prev);
}
......@@ -2609,7 +2609,7 @@ void CDECL wined3d_device_set_compute_shader(struct wined3d_device *device, stru
if (shader)
wined3d_shader_incref(shader);
state->shader[WINED3D_SHADER_TYPE_COMPUTE] = shader;
wined3d_cs_emit_set_shader(device->cs, WINED3D_SHADER_TYPE_COMPUTE, shader);
wined3d_device_context_emit_set_shader(&device->cs->c, WINED3D_SHADER_TYPE_COMPUTE, shader);
if (prev)
wined3d_shader_decref(prev);
}
......
......@@ -4774,8 +4774,6 @@ void wined3d_cs_emit_set_sampler(struct wined3d_cs *cs, enum wined3d_shader_type
void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
enum wined3d_sampler_state state, DWORD value) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_scissor_rects(struct wined3d_cs *cs, unsigned int rect_count, const RECT *rects) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_shader(struct wined3d_cs *cs, enum wined3d_shader_type type,
struct wined3d_shader *shader) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_stream_output(struct wined3d_cs *cs, UINT stream_idx,
struct wined3d_buffer *buffer, UINT offset) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
......@@ -4815,6 +4813,9 @@ 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_set_shader(struct wined3d_device_context *context, enum wined3d_shader_type type,
struct wined3d_shader *shader) DECLSPEC_HIDDEN;
static inline void wined3d_resource_wait_idle(struct wined3d_resource *resource)
{
const struct wined3d_cs *cs = resource->device->cs;
......
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