forked from Mirrors/wine-wine
wined3d: Send sampler state updates through the command stream.
parent
8cf6d1a429
commit
b2e75e27f3
|
@ -43,6 +43,7 @@ enum wined3d_cs_op
|
|||
WINED3D_CS_OP_SET_PIXEL_SHADER,
|
||||
WINED3D_CS_OP_SET_RENDER_STATE,
|
||||
WINED3D_CS_OP_SET_TEXTURE_STATE,
|
||||
WINED3D_CS_OP_SET_SAMPLER_STATE,
|
||||
};
|
||||
|
||||
struct wined3d_cs_present
|
||||
|
@ -160,6 +161,14 @@ struct wined3d_cs_set_texture_state
|
|||
DWORD value;
|
||||
};
|
||||
|
||||
struct wined3d_cs_set_sampler_state
|
||||
{
|
||||
enum wined3d_cs_op opcode;
|
||||
UINT sampler_idx;
|
||||
enum wined3d_sampler_state state;
|
||||
DWORD value;
|
||||
};
|
||||
|
||||
static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_present *op = data;
|
||||
|
@ -630,6 +639,28 @@ void wined3d_cs_emit_set_texture_state(struct wined3d_cs *cs, UINT stage,
|
|||
cs->ops->submit(cs);
|
||||
}
|
||||
|
||||
static void wined3d_cs_exec_set_sampler_state(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_set_sampler_state *op = data;
|
||||
|
||||
cs->state.sampler_states[op->sampler_idx][op->state] = op->value;
|
||||
device_invalidate_state(cs->device, STATE_SAMPLER(op->sampler_idx));
|
||||
}
|
||||
|
||||
void wined3d_cs_emit_set_sampler_state(struct wined3d_cs *cs, UINT sampler_idx,
|
||||
enum wined3d_sampler_state state, DWORD value)
|
||||
{
|
||||
struct wined3d_cs_set_sampler_state *op;
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op));
|
||||
op->opcode = WINED3D_CS_OP_SET_SAMPLER_STATE;
|
||||
op->sampler_idx = sampler_idx;
|
||||
op->state = state;
|
||||
op->value = value;
|
||||
|
||||
cs->ops->submit(cs);
|
||||
}
|
||||
|
||||
static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_PRESENT */ wined3d_cs_exec_present,
|
||||
|
@ -649,6 +680,7 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
|||
/* WINED3D_CS_OP_SET_PIXEL_SHADER */ wined3d_cs_exec_set_pixel_shader,
|
||||
/* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state,
|
||||
/* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state,
|
||||
/* WINED3D_CS_OP_SET_SAMPLER_STATE */ wined3d_cs_exec_set_sampler_state,
|
||||
};
|
||||
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size)
|
||||
|
|
|
@ -1990,7 +1990,7 @@ void CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
|
|||
return;
|
||||
}
|
||||
|
||||
device_invalidate_state(device, STATE_SAMPLER(sampler_idx));
|
||||
wined3d_cs_emit_set_sampler_state(device->cs, sampler_idx, state, value);
|
||||
}
|
||||
|
||||
DWORD CDECL wined3d_device_get_sampler_state(const struct wined3d_device *device,
|
||||
|
|
|
@ -2495,6 +2495,8 @@ void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs,
|
|||
enum wined3d_render_state state, DWORD value) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_set_render_target(struct wined3d_cs *cs, UINT render_target_idx,
|
||||
struct wined3d_surface *render_target) DECLSPEC_HIDDEN;
|
||||
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_rect(struct wined3d_cs *cs, const RECT *rect) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_set_stream_source(struct wined3d_cs *cs, UINT stream_idx,
|
||||
struct wined3d_buffer *buffer, UINT offset, UINT stride) DECLSPEC_HIDDEN;
|
||||
|
|
Loading…
Reference in New Issue