Commit e2bbce0f authored by Jan Sikorski's avatar Jan Sikorski Committed by Alexandre Julliard

d3d11: Don't grab wined3d lock for resource mapping and unmapping.

parent af43bbdc
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment