Henri Verbeet : wined3d: Send sampler object desctruction through the command stream.
Module: wine Branch: master Commit: 29788075e0bc736c09f92c9200ecf56509f601c1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=29788075e0bc736c09f92c9200... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jun 22 10:39:00 2016 +0200 wined3d: Send sampler object desctruction through the command stream. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/sampler.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c index 865198b..1a2e2a1 100644 --- a/dlls/wined3d/sampler.c +++ b/dlls/wined3d/sampler.c @@ -33,23 +33,28 @@ ULONG CDECL wined3d_sampler_incref(struct wined3d_sampler *sampler) return refcount; } -ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler) +static void wined3d_sample_destroy_object(void *object) { - ULONG refcount = InterlockedDecrement(&sampler->refcount); + struct wined3d_sampler *sampler = object; const struct wined3d_gl_info *gl_info; struct wined3d_context *context; + context = context_acquire(sampler->device, NULL); + gl_info = context->gl_info; + GL_EXTCALL(glDeleteSamplers(1, &sampler->name)); + context_release(context); + + HeapFree(GetProcessHeap(), 0, sampler); +} + +ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler) +{ + ULONG refcount = InterlockedDecrement(&sampler->refcount); + TRACE("%p decreasing refcount to %u.\n", sampler, refcount); if (!refcount) - { - context = context_acquire(sampler->device, NULL); - gl_info = context->gl_info; - GL_EXTCALL(glDeleteSamplers(1, &sampler->name)); - context_release(context); - - HeapFree(GetProcessHeap(), 0, sampler); - } + wined3d_cs_emit_destroy_object(sampler->device->cs, wined3d_sample_destroy_object, sampler); return refcount; }
participants (1)
-
Alexandre Julliard