mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-21 19:14:09 +00:00
d3d11: Don't grab wined3d lock for resource mapping and unmapping.
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:
parent
af43bbdccc
commit
e2bbce0faf
|
@ -304,11 +304,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_buffer_Map(ID3D10Buffer *iface, D3D10_MAP
|
|||
if (map_flags)
|
||||
FIXME("Ignoring map_flags %#x.\n", map_flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = wined3d_resource_map(wined3d_buffer_get_resource(buffer->wined3d_buffer), 0,
|
||||
&wined3d_map_desc, NULL, wined3d_map_flags_from_d3d10_map_type(map_type));
|
||||
*data = wined3d_map_desc.data;
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
@ -319,9 +317,7 @@ static void STDMETHODCALLTYPE d3d10_buffer_Unmap(ID3D10Buffer *iface)
|
|||
|
||||
TRACE("iface %p.\n", iface);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_resource_unmap(wined3d_buffer_get_resource(buffer->wined3d_buffer), 0);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_buffer_GetDesc(ID3D10Buffer *iface, D3D10_BUFFER_DESC *desc)
|
||||
|
|
|
@ -815,10 +815,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_Map(ID3D11DeviceContext1 *
|
|||
|
||||
wined3d_resource = wined3d_resource_from_d3d11_resource(resource);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
hr = wined3d_device_context_map(context->wined3d_context, wined3d_resource, subresource_idx,
|
||||
&map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type));
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
mapped_subresource->pData = map_desc.data;
|
||||
mapped_subresource->RowPitch = map_desc.row_pitch;
|
||||
|
@ -837,9 +835,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_Unmap(ID3D11DeviceContext1 *i
|
|||
|
||||
wined3d_resource = wined3d_resource_from_d3d11_resource(resource);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_device_context_unmap(context->wined3d_context, wined3d_resource, subresource_idx);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d11_device_context_PSSetConstantBuffers(ID3D11DeviceContext1 *iface,
|
||||
|
|
|
@ -349,13 +349,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture1d_Map(ID3D10Texture1D *iface, UIN
|
|||
if (map_flags)
|
||||
FIXME("Ignoring map_flags %#x.\n", map_flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx,
|
||||
&wined3d_map_desc, NULL, wined3d_map_flags_from_d3d10_map_type(map_type))))
|
||||
{
|
||||
*data = wined3d_map_desc.data;
|
||||
}
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
@ -366,9 +364,7 @@ static void STDMETHODCALLTYPE d3d10_texture1d_Unmap(ID3D10Texture1D *iface, UINT
|
|||
|
||||
TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_texture1d_GetDesc(ID3D10Texture1D *iface, D3D10_TEXTURE1D_DESC *desc)
|
||||
|
@ -846,14 +842,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture2d_Map(ID3D10Texture2D *iface, UIN
|
|||
if (map_flags)
|
||||
FIXME("Ignoring map_flags %#x.\n", map_flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx,
|
||||
&wined3d_map_desc, NULL, wined3d_map_flags_from_d3d10_map_type(map_type))))
|
||||
{
|
||||
mapped_texture->pData = wined3d_map_desc.data;
|
||||
mapped_texture->RowPitch = wined3d_map_desc.row_pitch;
|
||||
}
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
@ -864,9 +858,7 @@ static void STDMETHODCALLTYPE d3d10_texture2d_Unmap(ID3D10Texture2D *iface, UINT
|
|||
|
||||
TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_texture2d_GetDesc(ID3D10Texture2D *iface, D3D10_TEXTURE2D_DESC *desc)
|
||||
|
@ -1339,7 +1331,6 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN
|
|||
if (map_flags)
|
||||
FIXME("Ignoring map_flags %#x.\n", map_flags);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx,
|
||||
&wined3d_map_desc, NULL, wined3d_map_flags_from_d3d10_map_type(map_type))))
|
||||
{
|
||||
|
@ -1347,7 +1338,6 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UIN
|
|||
mapped_texture->RowPitch = wined3d_map_desc.row_pitch;
|
||||
mapped_texture->DepthPitch = wined3d_map_desc.slice_pitch;
|
||||
}
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
@ -1358,9 +1348,7 @@ static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT
|
|||
|
||||
TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx);
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx);
|
||||
wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d10_texture3d_GetDesc(ID3D10Texture3D *iface, D3D10_TEXTURE3D_DESC *desc)
|
||||
|
|
Loading…
Reference in a new issue