diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 666b2829f7e..067fdecf3cf 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1887,21 +1887,9 @@ struct wined3d_device_context * CDECL wined3d_device_get_immediate_context(struc void CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *device, struct wined3d_vertex_declaration *declaration) { - struct wined3d_state *state = device->cs->c.state; - struct wined3d_vertex_declaration *prev; - TRACE("device %p, declaration %p.\n", device, declaration); - prev = state->vertex_declaration; - if (declaration == prev) - return; - - if (declaration) - wined3d_vertex_declaration_incref(declaration); - state->vertex_declaration = declaration; - wined3d_device_context_emit_set_vertex_declaration(&device->cs->c, declaration); - if (prev) - wined3d_vertex_declaration_decref(prev); + wined3d_device_context_set_vertex_declaration(&device->cs->c, declaration); } struct wined3d_vertex_declaration * CDECL wined3d_device_get_vertex_declaration(const struct wined3d_device *device) @@ -2381,6 +2369,26 @@ void CDECL wined3d_device_context_set_index_buffer(struct wined3d_device_context wined3d_buffer_decref(prev_buffer); } +void CDECL wined3d_device_context_set_vertex_declaration(struct wined3d_device_context *context, + struct wined3d_vertex_declaration *declaration) +{ + struct wined3d_state *state = context->state; + struct wined3d_vertex_declaration *prev; + + TRACE("context %p, declaration %p.\n", context, declaration); + + prev = state->vertex_declaration; + if (declaration == prev) + return; + + if (declaration) + wined3d_vertex_declaration_incref(declaration); + state->vertex_declaration = declaration; + wined3d_device_context_emit_set_vertex_declaration(context, declaration); + if (prev) + wined3d_vertex_declaration_decref(prev); +} + void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader) { TRACE("device %p, shader %p.\n", device, shader); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 54d4ef4c23c..4f0d1e8e0b3 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -180,6 +180,7 @@ @ cdecl wined3d_device_context_set_shader_resource_view(ptr long long ptr) @ cdecl wined3d_device_context_set_stream_source(ptr long ptr long long) @ cdecl wined3d_device_context_set_unordered_access_view(ptr long long ptr long) +@ cdecl wined3d_device_context_set_vertex_declaration(ptr ptr) @ cdecl wined3d_device_context_set_viewports(ptr long ptr) @ cdecl wined3d_output_find_closest_matching_mode(ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 3937f1f5be2..e8f5e824bc3 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2584,6 +2584,8 @@ HRESULT __cdecl wined3d_device_context_set_stream_source(struct wined3d_device_c void __cdecl wined3d_device_context_set_unordered_access_view(struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int idx, struct wined3d_unordered_access_view *uav, unsigned int initial_count); +void __cdecl wined3d_device_context_set_vertex_declaration(struct wined3d_device_context *context, + struct wined3d_vertex_declaration *declaration); void __cdecl wined3d_device_context_set_viewports(struct wined3d_device_context *context, unsigned int viewport_count, const struct wined3d_viewport *viewports);