d3d8: Don't grab wined3d lock in vertex/indexbuffer AddRef/Release().

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jan Sikorski 2021-10-15 14:26:24 +02:00 committed by Alexandre Julliard
parent 154f612cd9
commit 0ceabaae80
1 changed files with 0 additions and 8 deletions

View File

@ -54,12 +54,10 @@ static ULONG WINAPI d3d8_vertexbuffer_AddRef(IDirect3DVertexBuffer8 *iface)
if (refcount == 1) if (refcount == 1)
{ {
IDirect3DDevice8_AddRef(buffer->parent_device); IDirect3DDevice8_AddRef(buffer->parent_device);
wined3d_mutex_lock();
if (buffer->draw_buffer) if (buffer->draw_buffer)
wined3d_buffer_incref(buffer->draw_buffer); wined3d_buffer_incref(buffer->draw_buffer);
else else
wined3d_buffer_incref(buffer->wined3d_buffer); wined3d_buffer_incref(buffer->wined3d_buffer);
wined3d_mutex_unlock();
} }
return refcount; return refcount;
@ -77,12 +75,10 @@ static ULONG WINAPI d3d8_vertexbuffer_Release(IDirect3DVertexBuffer8 *iface)
struct wined3d_buffer *draw_buffer = buffer->draw_buffer; struct wined3d_buffer *draw_buffer = buffer->draw_buffer;
IDirect3DDevice8 *device = buffer->parent_device; IDirect3DDevice8 *device = buffer->parent_device;
wined3d_mutex_lock();
if (draw_buffer) if (draw_buffer)
wined3d_buffer_decref(draw_buffer); wined3d_buffer_decref(draw_buffer);
else else
wined3d_buffer_decref(buffer->wined3d_buffer); wined3d_buffer_decref(buffer->wined3d_buffer);
wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */ /* Release the device last, as it may cause the device to be destroyed. */
IDirect3DDevice8_Release(device); IDirect3DDevice8_Release(device);
@ -381,12 +377,10 @@ static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface)
if (refcount == 1) if (refcount == 1)
{ {
IDirect3DDevice8_AddRef(buffer->parent_device); IDirect3DDevice8_AddRef(buffer->parent_device);
wined3d_mutex_lock();
if (buffer->draw_buffer) if (buffer->draw_buffer)
wined3d_buffer_incref(buffer->draw_buffer); wined3d_buffer_incref(buffer->draw_buffer);
else else
wined3d_buffer_incref(buffer->wined3d_buffer); wined3d_buffer_incref(buffer->wined3d_buffer);
wined3d_mutex_unlock();
} }
return refcount; return refcount;
@ -404,12 +398,10 @@ static ULONG WINAPI d3d8_indexbuffer_Release(IDirect3DIndexBuffer8 *iface)
struct wined3d_buffer *draw_buffer = buffer->draw_buffer; struct wined3d_buffer *draw_buffer = buffer->draw_buffer;
IDirect3DDevice8 *device = buffer->parent_device; IDirect3DDevice8 *device = buffer->parent_device;
wined3d_mutex_lock();
if (draw_buffer) if (draw_buffer)
wined3d_buffer_decref(draw_buffer); wined3d_buffer_decref(draw_buffer);
else else
wined3d_buffer_decref(buffer->wined3d_buffer); wined3d_buffer_decref(buffer->wined3d_buffer);
wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */ /* Release the device last, as it may cause the device to be destroyed. */
IDirect3DDevice8_Release(device); IDirect3DDevice8_Release(device);