wined3d: Introduce wined3d_device_set_compute_shader().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6e585b19cf
commit
f24dee797c
|
@ -2859,6 +2859,23 @@ struct wined3d_sampler * CDECL wined3d_device_get_gs_sampler(const struct wined3
|
|||
return device->state.sampler[WINED3D_SHADER_TYPE_GEOMETRY][idx];
|
||||
}
|
||||
|
||||
void CDECL wined3d_device_set_compute_shader(struct wined3d_device *device, struct wined3d_shader *shader)
|
||||
{
|
||||
struct wined3d_shader *prev;
|
||||
|
||||
TRACE("device %p, shader %p.\n", device, shader);
|
||||
|
||||
prev = device->update_state->shader[WINED3D_SHADER_TYPE_COMPUTE];
|
||||
if (device->recording || shader == prev)
|
||||
return;
|
||||
if (shader)
|
||||
wined3d_shader_incref(shader);
|
||||
device->update_state->shader[WINED3D_SHADER_TYPE_COMPUTE] = shader;
|
||||
wined3d_cs_emit_set_shader(device->cs, WINED3D_SHADER_TYPE_COMPUTE, shader);
|
||||
if (prev)
|
||||
wined3d_shader_decref(prev);
|
||||
}
|
||||
|
||||
void CDECL wined3d_device_set_unordered_access_view(struct wined3d_device *device,
|
||||
unsigned int idx, struct wined3d_unordered_access_view *uav)
|
||||
{
|
||||
|
|
|
@ -3723,9 +3723,10 @@ void apply_pixelshader(struct wined3d_context *context, const struct wined3d_sta
|
|||
context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
|
||||
}
|
||||
|
||||
static void state_geometry_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||
static void state_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||
{
|
||||
context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_GEOMETRY;
|
||||
enum wined3d_shader_type shader_type = state_id - STATE_SHADER(0);
|
||||
context->shader_update_mask |= 1u << shader_type;
|
||||
}
|
||||
|
||||
static void shader_bumpenv(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||
|
@ -5176,7 +5177,8 @@ const struct StateEntryTemplate misc_state_template[] =
|
|||
{ STATE_BASEVERTEXINDEX, { STATE_STREAMSRC, NULL, }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_FRAMEBUFFER, { STATE_FRAMEBUFFER, context_state_fb }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), context_state_drawbuf},WINED3D_GL_EXT_NONE },
|
||||
{ STATE_SHADER(WINED3D_SHADER_TYPE_GEOMETRY), { STATE_SHADER(WINED3D_SHADER_TYPE_GEOMETRY), state_geometry_shader}, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_SHADER(WINED3D_SHADER_TYPE_GEOMETRY), { STATE_SHADER(WINED3D_SHADER_TYPE_GEOMETRY), state_shader }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_SHADER(WINED3D_SHADER_TYPE_COMPUTE), { STATE_SHADER(WINED3D_SHADER_TYPE_COMPUTE), state_shader }, WINED3D_GL_EXT_NONE },
|
||||
{0 /* Terminate */, { 0, 0 }, WINED3D_GL_EXT_NONE },
|
||||
};
|
||||
|
||||
|
@ -5958,6 +5960,7 @@ static void validate_state_table(struct StateEntry *state_table)
|
|||
STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX),
|
||||
STATE_SHADER(WINED3D_SHADER_TYPE_GEOMETRY),
|
||||
STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL),
|
||||
STATE_SHADER(WINED3D_SHADER_TYPE_COMPUTE),
|
||||
STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_VERTEX),
|
||||
STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_GEOMETRY),
|
||||
STATE_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_PIXEL),
|
||||
|
|
|
@ -109,6 +109,7 @@
|
|||
@ cdecl wined3d_device_set_base_vertex_index(ptr long)
|
||||
@ cdecl wined3d_device_set_clip_plane(ptr long ptr)
|
||||
@ cdecl wined3d_device_set_clip_status(ptr ptr)
|
||||
@ cdecl wined3d_device_set_compute_shader(ptr ptr)
|
||||
@ cdecl wined3d_device_set_cursor_position(ptr long long long)
|
||||
@ cdecl wined3d_device_set_cursor_properties(ptr long long ptr long)
|
||||
@ cdecl wined3d_device_set_depth_stencil_view(ptr ptr)
|
||||
|
|
|
@ -2235,6 +2235,7 @@ HRESULT __cdecl wined3d_device_set_clip_plane(struct wined3d_device *device,
|
|||
UINT plane_idx, const struct wined3d_vec4 *plane);
|
||||
HRESULT __cdecl wined3d_device_set_clip_status(struct wined3d_device *device,
|
||||
const struct wined3d_clip_status *clip_status);
|
||||
void __cdecl wined3d_device_set_compute_shader(struct wined3d_device *device, struct wined3d_shader *shader);
|
||||
void __cdecl wined3d_device_set_cursor_position(struct wined3d_device *device,
|
||||
int x_screen_space, int y_screen_space, DWORD flags);
|
||||
HRESULT __cdecl wined3d_device_set_cursor_properties(struct wined3d_device *device,
|
||||
|
|
Loading…
Reference in New Issue