Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- Including wined3d_decref, wined3d_shader_decref, wined3d_stateblock_decref. --- dlls/wined3d/buffer.c | 2 ++ dlls/wined3d/cs.c | 2 +- dlls/wined3d/device.c | 2 ++ dlls/wined3d/directx.c | 2 ++ dlls/wined3d/palette.c | 4 ++++ dlls/wined3d/query.c | 2 ++ dlls/wined3d/sampler.c | 2 ++ dlls/wined3d/shader.c | 2 ++ dlls/wined3d/state.c | 6 ++++++ dlls/wined3d/stateblock.c | 2 ++ dlls/wined3d/texture.c | 7 +++++++ dlls/wined3d/vertexdeclaration.c | 2 ++ dlls/wined3d/view.c | 12 ++++++++++++ 13 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index e1a5ec26c29..b4fbb6300ef 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -708,8 +708,10 @@ ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
if (!refcount) { + wined3d_mutex_lock(); buffer->resource.parent_ops->wined3d_object_destroyed(buffer->resource.parent); buffer->resource.device->adapter->adapter_ops->adapter_destroy_buffer(buffer); + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index f828a2e045d..a77b1b983c1 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -99,7 +99,6 @@ ULONG CDECL wined3d_command_list_decref(struct wined3d_command_list *list) { SIZE_T i;
- wined3d_mutex_lock(); for (i = 0; i < list->command_list_count; ++i) wined3d_command_list_decref(list->command_lists[i]); for (i = 0; i < list->resource_count; ++i) @@ -109,6 +108,7 @@ ULONG CDECL wined3d_command_list_decref(struct wined3d_command_list *list) for (i = 0; i < list->query_count; ++i) wined3d_query_decref(list->queries[i].query);
+ wined3d_mutex_lock(); wined3d_cs_destroy_object(device->cs, wined3d_command_list_destroy_object, list); wined3d_mutex_unlock(); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b8c1630ee25..6b2f18c6996 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -263,8 +263,10 @@ ULONG CDECL wined3d_device_decref(struct wined3d_device *device)
if (!refcount) { + wined3d_mutex_lock(); device->adapter->adapter_ops->adapter_destroy_device(device); TRACE("Destroyed device %p.\n", device); + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 990164fd68d..ccaae9d355d 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -187,6 +187,7 @@ ULONG CDECL wined3d_decref(struct wined3d *wined3d) { unsigned int i;
+ wined3d_mutex_lock(); for (i = 0; i < wined3d->adapter_count; ++i) { struct wined3d_adapter *adapter = wined3d->adapters[i]; @@ -194,6 +195,7 @@ ULONG CDECL wined3d_decref(struct wined3d *wined3d) adapter->adapter_ops->adapter_destroy(adapter); } heap_free(wined3d); + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/palette.c b/dlls/wined3d/palette.c index 85105d1f8de..4bc453bde79 100644 --- a/dlls/wined3d/palette.c +++ b/dlls/wined3d/palette.c @@ -47,7 +47,11 @@ ULONG CDECL wined3d_palette_decref(struct wined3d_palette *palette) TRACE("%p decreasing refcount to %u.\n", palette, refcount);
if (!refcount) + { + wined3d_mutex_lock(); wined3d_cs_destroy_object(palette->device->cs, wined3d_palette_destroy_object, palette); + wined3d_mutex_unlock(); + }
return refcount; } diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 8ee7ae07886..1b38eb5e311 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -444,9 +444,11 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) { struct wined3d_device *device = query->device;
+ wined3d_mutex_lock(); query->parent_ops->wined3d_object_destroyed(query->parent); wined3d_cs_destroy_object(device->cs, wined3d_query_destroy_object, query); device->adapter->adapter_ops->adapter_destroy_query(query); + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c index 7eb3a2ae0be..bba3165316e 100644 --- a/dlls/wined3d/sampler.c +++ b/dlls/wined3d/sampler.c @@ -41,8 +41,10 @@ ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler)
if (!refcount) { + wined3d_mutex_lock(); sampler->parent_ops->wined3d_object_destroyed(sampler->parent); sampler->device->adapter->adapter_ops->adapter_destroy_sampler(sampler); + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index fb7115a26dd..957710dbd43 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -3439,8 +3439,10 @@ ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader)
if (!refcount) { + wined3d_mutex_lock(); shader->parent_ops->wined3d_object_destroyed(shader->parent); wined3d_cs_destroy_object(shader->device->cs, wined3d_shader_destroy_object, shader); + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 8316269afcf..c7f041066d1 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -62,8 +62,10 @@ ULONG CDECL wined3d_blend_state_decref(struct wined3d_blend_state *state)
if (!refcount) { + wined3d_mutex_lock(); state->parent_ops->wined3d_object_destroyed(state->parent); wined3d_cs_destroy_object(device->cs, wined3d_blend_state_destroy_object, state); + wined3d_mutex_unlock(); }
return refcount; @@ -136,8 +138,10 @@ ULONG CDECL wined3d_depth_stencil_state_decref(struct wined3d_depth_stencil_stat
if (!refcount) { + wined3d_mutex_lock(); state->parent_ops->wined3d_object_destroyed(state->parent); wined3d_cs_destroy_object(device->cs, wined3d_depth_stencil_state_destroy_object, state); + wined3d_mutex_unlock(); }
return refcount; @@ -199,8 +203,10 @@ ULONG CDECL wined3d_rasterizer_state_decref(struct wined3d_rasterizer_state *sta
if (!refcount) { + wined3d_mutex_lock(); state->parent_ops->wined3d_object_destroyed(state->parent); wined3d_cs_destroy_object(device->cs, wined3d_rasterizer_state_destroy_object, state); + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 39a19984498..8590a2a1c1f 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -585,8 +585,10 @@ ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
if (!refcount) { + wined3d_mutex_lock(); wined3d_stateblock_state_cleanup(&stateblock->stateblock_state); heap_free(stateblock); + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 339bf4e205a..f031daef373 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1536,6 +1536,11 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
if (!refcount) { + bool in_cs_thread = GetCurrentThreadId() == texture->resource.device->cs->thread_id; + + /* This is called from the CS thread to destroy temporary textures. */ + if (!in_cs_thread) + wined3d_mutex_lock(); /* Wait for the texture to become idle if it's using user memory, * since the application is allowed to free that memory once the * texture is destroyed. Note that this implies that @@ -1550,6 +1555,8 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture) } } texture->resource.device->adapter->adapter_ops->adapter_destroy_texture(texture); + if (!in_cs_thread) + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index 45a01f4bdd4..a778352d2cf 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -68,9 +68,11 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration
if (!refcount) { + wined3d_mutex_lock(); declaration->parent_ops->wined3d_object_destroyed(declaration->parent); wined3d_cs_destroy_object(declaration->device->cs, wined3d_vertex_declaration_destroy_object, declaration); + wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index a8b3a7b4f75..94bbe27bd5c 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -376,7 +376,11 @@ ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *v TRACE("%p decreasing refcount to %u.\n", view, refcount);
if (!refcount) + { + wined3d_mutex_lock(); view->resource->device->adapter->adapter_ops->adapter_destroy_rendertarget_view(view); + wined3d_mutex_unlock(); + }
return refcount; } @@ -923,7 +927,11 @@ ULONG CDECL wined3d_shader_resource_view_decref(struct wined3d_shader_resource_v TRACE("%p decreasing refcount to %u.\n", view, refcount);
if (!refcount) + { + wined3d_mutex_lock(); view->resource->device->adapter->adapter_ops->adapter_destroy_shader_resource_view(view); + wined3d_mutex_unlock(); + }
return refcount; } @@ -1441,7 +1449,11 @@ ULONG CDECL wined3d_unordered_access_view_decref(struct wined3d_unordered_access TRACE("%p decreasing refcount to %u.\n", view, refcount);
if (!refcount) + { + wined3d_mutex_lock(); view->resource->device->adapter->adapter_ops->adapter_destroy_unordered_access_view(view); + wined3d_mutex_unlock(); + }
return refcount; }
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 42 ++++++++++++++++++++++++++------------- dlls/wined3d/device.c | 31 +++++++++++++++++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 4 ++++ 4 files changed, 64 insertions(+), 14 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 68b0333604f..31c68f62e68 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1140,7 +1140,11 @@ static void STDMETHODCALLTYPE d3d11_device_context_OMSetRenderTargetsAndUnordere ID3D11DepthStencilView *depth_stencil_view, UINT uav_start_idx, UINT uav_count, ID3D11UnorderedAccessView *const *uavs, const UINT *initial_counts) { + struct d3d_depthstencil_view *dsv = unsafe_impl_from_ID3D11DepthStencilView(depth_stencil_view); + struct wined3d_rendertarget_view *wined3d_rtvs[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {0}; + struct wined3d_unordered_access_view *wined3d_uavs[D3D11_PS_CS_UAV_REGISTER_COUNT] = {0}; struct d3d11_device_context *context = impl_from_ID3D11DeviceContext1(iface); + unsigned int wined3d_initial_counts[D3D11_PS_CS_UAV_REGISTER_COUNT]; unsigned int i;
TRACE("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p, " @@ -1148,18 +1152,29 @@ static void STDMETHODCALLTYPE d3d11_device_context_OMSetRenderTargetsAndUnordere iface, render_target_view_count, render_target_views, depth_stencil_view, uav_start_idx, uav_count, uavs, initial_counts);
- if (render_target_view_count != D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL) + if (render_target_view_count == D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL) + render_target_view_count = ~0u; + else { - d3d11_device_context_OMSetRenderTargets(iface, render_target_view_count, render_target_views, - depth_stencil_view); + if (render_target_view_count > ARRAY_SIZE(wined3d_rtvs)) + { + WARN("View count %u exceeds limit.\n", render_target_view_count); + render_target_view_count = ARRAY_SIZE(wined3d_rtvs); + } + + for (i = 0; i < render_target_view_count; ++i) + { + struct d3d_rendertarget_view *rtv = unsafe_impl_from_ID3D11RenderTargetView(render_target_views[i]); + + wined3d_rtvs[i] = rtv ? rtv->wined3d_view : NULL; + } }
- if (uav_count != D3D11_KEEP_UNORDERED_ACCESS_VIEWS) + if (uav_count == D3D11_KEEP_UNORDERED_ACCESS_VIEWS) + uav_count = ~0u; + else { - struct wined3d_unordered_access_view *wined3d_views[D3D11_PS_CS_UAV_REGISTER_COUNT] = {0}; - unsigned int wined3d_initial_counts[D3D11_PS_CS_UAV_REGISTER_COUNT]; - - if (!wined3d_bound_range(uav_start_idx, uav_count, ARRAY_SIZE(wined3d_views))) + if (!wined3d_bound_range(uav_start_idx, uav_count, ARRAY_SIZE(wined3d_uavs))) { WARN("View count %u exceeds limit; ignoring call.\n", uav_count); return; @@ -1172,15 +1187,14 @@ static void STDMETHODCALLTYPE d3d11_device_context_OMSetRenderTargetsAndUnordere struct d3d11_unordered_access_view *view = unsafe_impl_from_ID3D11UnorderedAccessView(uavs[i]);
- wined3d_views[uav_start_idx + i] = view ? view->wined3d_view : NULL; + wined3d_uavs[uav_start_idx + i] = view ? view->wined3d_view : NULL; wined3d_initial_counts[uav_start_idx + i] = initial_counts ? initial_counts[i] : ~0u; } - - wined3d_mutex_lock(); - wined3d_device_context_set_unordered_access_views(context->wined3d_context, WINED3D_PIPELINE_GRAPHICS, - 0, ARRAY_SIZE(wined3d_views), wined3d_views, wined3d_initial_counts); - wined3d_mutex_unlock(); } + + wined3d_device_context_set_render_targets_and_unordered_access_views(context->wined3d_context, ARRAY_SIZE(wined3d_rtvs), + wined3d_rtvs, dsv ? dsv->wined3d_view : NULL, ARRAY_SIZE(wined3d_uavs), wined3d_uavs, + wined3d_initial_counts); }
static void STDMETHODCALLTYPE d3d11_device_context_OMSetBlendState(ID3D11DeviceContext1 *iface, diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 6b2f18c6996..86945485e20 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2110,6 +2110,37 @@ out: wined3d_mutex_unlock(); }
+void CDECL wined3d_device_context_set_render_targets_and_unordered_access_views(struct wined3d_device_context *context, + unsigned int rtv_count, struct wined3d_rendertarget_view *const *render_target_views, + struct wined3d_rendertarget_view *depth_stencil_view, UINT uav_count, + struct wined3d_unordered_access_view *const *unordered_access_views, const unsigned int *initial_counts) +{ + wined3d_mutex_lock(); + if (rtv_count != ~0u) + { + if (depth_stencil_view && !(depth_stencil_view->resource->bind_flags & WINED3D_BIND_DEPTH_STENCIL)) + { + WARN("View resource %p has incompatible %s bind flags.\n", + depth_stencil_view->resource, wined3d_debug_bind_flags(depth_stencil_view->resource->bind_flags)); + goto out; + } + + if (FAILED(wined3d_device_context_set_rendertarget_views(context, 0, rtv_count, + render_target_views, FALSE))) + goto out; + + wined3d_device_context_set_depth_stencil_view(context, depth_stencil_view); + } + + if (uav_count != ~0u) + { + wined3d_device_context_set_unordered_access_views(context, WINED3D_PIPELINE_GRAPHICS, 0, uav_count, + unordered_access_views, initial_counts); + } +out: + wined3d_mutex_unlock(); +} + static void wined3d_device_context_unbind_srv_for_rtv(struct wined3d_device_context *context, const struct wined3d_rendertarget_view *view, BOOL dsv) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 1bce4def265..48bea5980ff 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -139,6 +139,7 @@ @ cdecl wined3d_device_context_set_stream_outputs(ptr ptr) @ cdecl wined3d_device_context_set_stream_sources(ptr long long ptr) @ cdecl wined3d_device_context_set_unordered_access_views(ptr long long long ptr ptr) +@ cdecl wined3d_device_context_set_render_targets_and_unordered_access_views(ptr long ptr ptr long ptr ptr) @ cdecl wined3d_device_context_set_vertex_declaration(ptr ptr) @ cdecl wined3d_device_context_set_viewports(ptr long ptr) @ cdecl wined3d_device_context_unmap(ptr ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 7be893b8f21..7a6588ea4f4 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2544,6 +2544,10 @@ HRESULT __cdecl wined3d_device_context_set_stream_sources(struct wined3d_device_ void __cdecl wined3d_device_context_set_unordered_access_views(struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int start_idx, unsigned int count, struct wined3d_unordered_access_view *const *uavs, const unsigned int *initial_counts); +void __cdecl wined3d_device_context_set_render_targets_and_unordered_access_views(struct wined3d_device_context *context, + unsigned int rtv_count, struct wined3d_rendertarget_view *const *render_target_views, + struct wined3d_rendertarget_view *depth_stencil_view, UINT uav_count, + struct wined3d_unordered_access_view *const *unordered_access_views, const unsigned int *initial_counts); 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,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100098
Your paranoid android.
=== debiant2 (32 bit report) ===
d3d11: d3d11.c:9770: Test failed: d3d11.c:15131: Test marked todo: Got hr 0 for WRITE. d3d11.c:20087: Test failed: d3d11.c:16404: Test marked todo: Got 0xdeadbeef, expected 0xc0b0a090 or 0x7f7f7f80 at 128, uvec4 0x8fffff90, 0x7fffffa0, 0x7fffffb0, 0x7fffffc0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 31c68f62e68..764fbece076 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1128,11 +1128,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_OMSetRenderTargets(ID3D11Devi
dsv = unsafe_impl_from_ID3D11DepthStencilView(depth_stencil_view);
- wined3d_mutex_lock(); - wined3d_device_context_set_rendertarget_views(context->wined3d_context, 0, - ARRAY_SIZE(wined3d_rtvs), wined3d_rtvs, FALSE); - wined3d_device_context_set_depth_stencil_view(context->wined3d_context, dsv ? dsv->wined3d_view : NULL); - wined3d_mutex_unlock(); + wined3d_device_context_set_render_targets_and_unordered_access_views(context->wined3d_context, + ARRAY_SIZE(wined3d_rtvs), wined3d_rtvs, dsv ? dsv->wined3d_view : NULL, ~0u, NULL, NULL); }
static void STDMETHODCALLTYPE d3d11_device_context_OMSetRenderTargetsAndUnorderedAccessViews( @@ -4988,12 +4985,8 @@ static void STDMETHODCALLTYPE d3d10_device_OMSetRenderTargets(ID3D10Device1 *ifa
dsv = unsafe_impl_from_ID3D10DepthStencilView(depth_stencil_view);
- wined3d_mutex_lock(); - wined3d_device_context_set_rendertarget_views(device->immediate_context.wined3d_context, 0, - ARRAY_SIZE(wined3d_rtvs), wined3d_rtvs, FALSE); - wined3d_device_context_set_depth_stencil_view(device->immediate_context.wined3d_context, - dsv ? dsv->wined3d_view : NULL); - wined3d_mutex_unlock(); + wined3d_device_context_set_render_targets_and_unordered_access_views(device->immediate_context.wined3d_context, + ARRAY_SIZE(wined3d_rtvs), wined3d_rtvs, dsv ? dsv->wined3d_view : NULL, ~0u, NULL, NULL); }
static void STDMETHODCALLTYPE d3d10_device_OMSetBlendState(ID3D10Device1 *iface,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Except wined3d_texture_incref().
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/async.c | 2 -- dlls/d3d11/buffer.c | 2 -- dlls/d3d11/inputlayout.c | 2 -- dlls/d3d11/shader.c | 12 ------------ dlls/d3d11/state.c | 8 -------- dlls/d3d11/view.c | 8 -------- 6 files changed, 34 deletions(-)
diff --git a/dlls/d3d11/async.c b/dlls/d3d11/async.c index fd83871220d..4476d56404f 100644 --- a/dlls/d3d11/async.c +++ b/dlls/d3d11/async.c @@ -72,9 +72,7 @@ static ULONG STDMETHODCALLTYPE d3d11_query_AddRef(ID3D11Query *iface) if (refcount == 1) { ID3D11Device2_AddRef(query->device); - wined3d_mutex_lock(); wined3d_query_incref(query->wined3d_query); - wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c index 09d495c3f61..180641caef5 100644 --- a/dlls/d3d11/buffer.c +++ b/dlls/d3d11/buffer.c @@ -69,9 +69,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_AddRef(ID3D11Buffer *iface) if (refcount == 1) { ID3D11Device2_AddRef(buffer->device); - wined3d_mutex_lock(); wined3d_buffer_incref(buffer->wined3d_buffer); - wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/d3d11/inputlayout.c b/dlls/d3d11/inputlayout.c index 6b59dd994b3..34d273b31c8 100644 --- a/dlls/d3d11/inputlayout.c +++ b/dlls/d3d11/inputlayout.c @@ -138,9 +138,7 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_AddRef(ID3D11InputLayout *ifac if (refcount == 1) { ID3D11Device2_AddRef(layout->device); - wined3d_mutex_lock(); wined3d_vertex_declaration_incref(layout->wined3d_decl); - wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c index 0d19b74ff0b..e474ae692d5 100644 --- a/dlls/d3d11/shader.c +++ b/dlls/d3d11/shader.c @@ -69,9 +69,7 @@ static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_AddRef(ID3D11VertexShader *if if (refcount == 1) { ID3D11Device2_AddRef(shader->device); - wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); - wined3d_mutex_unlock(); }
return refcount; @@ -365,9 +363,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_AddRef(ID3D11HullShader *iface) if (refcount == 1) { ID3D11Device2_AddRef(shader->device); - wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); - wined3d_mutex_unlock(); }
return refcount; @@ -558,9 +554,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_AddRef(ID3D11DomainShader *if if (refcount == 1) { ID3D11Device2_AddRef(shader->device); - wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); - wined3d_mutex_unlock(); }
return refcount; @@ -761,9 +755,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_AddRef(ID3D11GeometryShader if (refcount == 1) { ID3D11Device2_AddRef(shader->device); - wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); - wined3d_mutex_unlock(); }
return refcount; @@ -1265,9 +1257,7 @@ static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_AddRef(ID3D11PixelShader *ifac if (refcount == 1) { ID3D11Device2_AddRef(shader->device); - wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); - wined3d_mutex_unlock(); }
return refcount; @@ -1560,9 +1550,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_AddRef(ID3D11ComputeShader * if (refcount == 1) { ID3D11Device2_AddRef(shader->device); - wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); - wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index d31ea16bbe8..8fa94a12a66 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -64,9 +64,7 @@ static ULONG STDMETHODCALLTYPE d3d11_blend_state_AddRef(ID3D11BlendState *iface) if (refcount == 1) { ID3D11Device2_AddRef(state->device); - wined3d_mutex_lock(); wined3d_blend_state_incref(state->wined3d_state); - wined3d_mutex_unlock(); }
return refcount; @@ -496,9 +494,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_AddRef(ID3D11DepthStenci if (refcount == 1) { ID3D11Device2_AddRef(state->device); - wined3d_mutex_lock(); wined3d_depth_stencil_state_incref(state->wined3d_state); - wined3d_mutex_unlock(); }
return refcount; @@ -896,9 +892,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_AddRef(ID3D11RasterizerSta if (refcount == 1) { ID3D11Device2_AddRef(state->device); - wined3d_mutex_lock(); wined3d_rasterizer_state_incref(state->wined3d_state); - wined3d_mutex_unlock(); }
return refcount; @@ -1284,9 +1278,7 @@ static ULONG STDMETHODCALLTYPE d3d11_sampler_state_AddRef(ID3D11SamplerState *if if (refcount == 1) { ID3D11Device2_AddRef(state->device); - wined3d_mutex_lock(); wined3d_sampler_incref(state->wined3d_sampler); - wined3d_mutex_unlock(); }
return refcount; diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c index 734c9619e5b..1679729e15c 100644 --- a/dlls/d3d11/view.c +++ b/dlls/d3d11/view.c @@ -963,9 +963,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_AddRef(ID3D11DepthStencil if (refcount == 1) { ID3D11Device2_AddRef(view->device); - wined3d_mutex_lock(); wined3d_rendertarget_view_incref(view->wined3d_view); - wined3d_mutex_unlock(); }
return refcount; @@ -1407,9 +1405,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_AddRef(ID3D11RenderTarget if (refcount == 1) { ID3D11Device2_AddRef(view->device); - wined3d_mutex_lock(); wined3d_rendertarget_view_incref(view->wined3d_view); - wined3d_mutex_unlock(); }
return refcount; @@ -1855,9 +1851,7 @@ static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_AddRef(ID3D11ShaderRes if (refcount == 1) { ID3D11Device2_AddRef(view->device); - wined3d_mutex_lock(); wined3d_shader_resource_view_incref(view->wined3d_view); - wined3d_mutex_unlock(); }
return refcount; @@ -2340,9 +2334,7 @@ static ULONG STDMETHODCALLTYPE d3d11_unordered_access_view_AddRef(ID3D11Unordere if (refcount == 1) { ID3D11Device2_AddRef(view->device); - wined3d_mutex_lock(); wined3d_unordered_access_view_incref(view->wined3d_view); - wined3d_mutex_unlock(); }
return refcount;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100100
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:20087: Test failed: d3d11.c:16411: Test marked todo: Got 0xdeadbeef, expected 0xfcfdfeff or 0x7f7f7f7f at 127, uvec4 0x7fffffff, 0x7ffffffe, 0x7ffffffd, 0x7ffffffc.
=== debiant2 (32 bit WoW report) ===
d3d11: d3d11.c:9770: Test failed: d3d11.c:15222: Test marked todo: Got hr 0 for WRITE_DISCARD.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/texture.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c index 061bbb09795..2a43b24b226 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -76,9 +76,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_AddRef(ID3D11Texture1D *iface) if (refcount == 1) { ID3D11Device2_AddRef(texture->device); - wined3d_mutex_lock(); wined3d_texture_incref(texture->wined3d_texture); - wined3d_mutex_unlock(); }
return refcount; @@ -564,9 +562,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_AddRef(ID3D11Texture2D *iface) if (refcount == 1) { ID3D11Device2_AddRef(texture->device); - wined3d_mutex_lock(); wined3d_texture_incref(texture->wined3d_texture); - wined3d_mutex_unlock(); }
return refcount; @@ -1119,9 +1115,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture3d_AddRef(ID3D11Texture3D *iface) if (refcount == 1) { ID3D11Device2_AddRef(texture->device); - wined3d_mutex_lock(); wined3d_texture_incref(texture->wined3d_texture); - wined3d_mutex_unlock(); }
return refcount;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Except wined3d_texture_decref().
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/async.c | 4 ---- dlls/d3d11/buffer.c | 2 -- dlls/d3d11/device.c | 4 ---- dlls/d3d11/inputlayout.c | 4 ---- dlls/d3d11/shader.c | 21 --------------------- dlls/d3d11/state.c | 14 -------------- dlls/d3d11/view.c | 16 ---------------- 7 files changed, 65 deletions(-)
diff --git a/dlls/d3d11/async.c b/dlls/d3d11/async.c index 4476d56404f..74ba62b3d04 100644 --- a/dlls/d3d11/async.c +++ b/dlls/d3d11/async.c @@ -88,11 +88,7 @@ static ULONG STDMETHODCALLTYPE d3d11_query_Release(ID3D11Query *iface) if (!refcount) { ID3D11Device2 *device = query->device; - - wined3d_mutex_lock(); wined3d_query_decref(query->wined3d_query); - wined3d_mutex_unlock(); - ID3D11Device2_Release(device); }
diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c index 180641caef5..ab8471d6f52 100644 --- a/dlls/d3d11/buffer.c +++ b/dlls/d3d11/buffer.c @@ -86,9 +86,7 @@ static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface) { ID3D11Device2 *device = buffer->device;
- wined3d_mutex_lock(); wined3d_buffer_decref(buffer->wined3d_buffer); - wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device); diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 764fbece076..f306f9ebc7a 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -375,9 +375,7 @@ static ULONG STDMETHODCALLTYPE d3d11_command_list_Release(ID3D11CommandList *ifa
if (!refcount) { - wined3d_mutex_lock(); wined3d_command_list_decref(list->wined3d_list); - wined3d_mutex_unlock(); wined3d_private_store_cleanup(&list->private_store); ID3D11Device2_Release(list->device); heap_free(list); @@ -4541,9 +4539,7 @@ static ULONG STDMETHODCALLTYPE d3d_device_inner_Release(IUnknown *iface) d3d11_device_context_cleanup(&device->immediate_context); if (device->wined3d_device) { - wined3d_mutex_lock(); wined3d_device_decref(device->wined3d_device); - wined3d_mutex_unlock(); } wine_rb_destroy(&device->sampler_states, NULL, NULL); wine_rb_destroy(&device->rasterizer_states, NULL, NULL); diff --git a/dlls/d3d11/inputlayout.c b/dlls/d3d11/inputlayout.c index 34d273b31c8..520fa0ba7b3 100644 --- a/dlls/d3d11/inputlayout.c +++ b/dlls/d3d11/inputlayout.c @@ -154,11 +154,7 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_Release(ID3D11InputLayout *ifa if (!refcount) { ID3D11Device2 *device = layout->device; - - wined3d_mutex_lock(); wined3d_vertex_declaration_decref(layout->wined3d_decl); - wined3d_mutex_unlock(); - ID3D11Device2_Release(device); }
diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c index e474ae692d5..eec164a876c 100644 --- a/dlls/d3d11/shader.c +++ b/dlls/d3d11/shader.c @@ -86,9 +86,7 @@ static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_Release(ID3D11VertexShader *i { ID3D11Device2 *device = shader->device;
- wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); - wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device); @@ -379,11 +377,7 @@ static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release(ID3D11HullShader *iface if (!refcount) { ID3D11Device2 *device = shader->device; - - wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); - wined3d_mutex_unlock(); - /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device); @@ -570,11 +564,7 @@ static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release(ID3D11DomainShader *i if (!refcount) { ID3D11Device2 *device = shader->device; - - wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); - wined3d_mutex_unlock(); - /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device); @@ -771,11 +761,7 @@ static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShade if (!refcount) { ID3D11Device2 *device = shader->device; - - wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); - wined3d_mutex_unlock(); - /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device); @@ -1273,10 +1259,7 @@ static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_Release(ID3D11PixelShader *ifa if (!refcount) { ID3D11Device2 *device = shader->device; - - wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); - wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device); @@ -1566,11 +1549,7 @@ static ULONG STDMETHODCALLTYPE d3d11_compute_shader_Release(ID3D11ComputeShader if (!refcount) { ID3D11Device2 *device = shader->device; - - wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); - wined3d_mutex_unlock(); - /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device); diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c index 8fa94a12a66..810217c93b4 100644 --- a/dlls/d3d11/state.c +++ b/dlls/d3d11/state.c @@ -80,11 +80,7 @@ static ULONG STDMETHODCALLTYPE d3d11_blend_state_Release(ID3D11BlendState *iface if (!refcount) { ID3D11Device2 *device = state->device; - - wined3d_mutex_lock(); wined3d_blend_state_decref(state->wined3d_state); - wined3d_mutex_unlock(); - ID3D11Device2_Release(device); }
@@ -511,9 +507,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStenc { ID3D11Device2 *device = state->device;
- wined3d_mutex_lock(); wined3d_depth_stencil_state_decref(state->wined3d_state); - wined3d_mutex_unlock(); ID3D11Device2_Release(device); }
@@ -908,11 +902,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_Release(ID3D11RasterizerSt if (!refcount) { ID3D11Device2 *device = state->device; - - wined3d_mutex_lock(); wined3d_rasterizer_state_decref(state->wined3d_state); - wined3d_mutex_unlock(); - ID3D11Device2_Release(device); }
@@ -1294,11 +1284,7 @@ static ULONG STDMETHODCALLTYPE d3d11_sampler_state_Release(ID3D11SamplerState *i if (!refcount) { ID3D11Device2 *device = state->device; - - wined3d_mutex_lock(); wined3d_sampler_decref(state->wined3d_sampler); - wined3d_mutex_unlock(); - ID3D11Device2_Release(device); }
diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c index 1679729e15c..89c541fa9ed 100644 --- a/dlls/d3d11/view.c +++ b/dlls/d3d11/view.c @@ -979,11 +979,7 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_Release(ID3D11DepthStenci if (!refcount) { ID3D11Device2 *device = view->device; - - wined3d_mutex_lock(); wined3d_rendertarget_view_decref(view->wined3d_view); - wined3d_mutex_unlock(); - ID3D11Device2_Release(device); }
@@ -1421,11 +1417,7 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_Release(ID3D11RenderTarge if (!refcount) { ID3D11Device2 *device = view->device; - - wined3d_mutex_lock(); wined3d_rendertarget_view_decref(view->wined3d_view); - wined3d_mutex_unlock(); - ID3D11Device2_Release(device); }
@@ -1867,11 +1859,7 @@ static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_Release(ID3D11ShaderRe if (!refcount) { ID3D11Device2 *device = view->device; - - wined3d_mutex_lock(); wined3d_shader_resource_view_decref(view->wined3d_view); - wined3d_mutex_unlock(); - ID3D11Device2_Release(device); }
@@ -2350,11 +2338,7 @@ static ULONG STDMETHODCALLTYPE d3d11_unordered_access_view_Release(ID3D11Unorder if (!refcount) { ID3D11Device2 *device = view->device; - - wined3d_mutex_lock(); wined3d_unordered_access_view_decref(view->wined3d_view); - wined3d_mutex_unlock(); - ID3D11Device2_Release(device); }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/texture.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c index 2a43b24b226..4fe395a206c 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -92,10 +92,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture1d_Release(ID3D11Texture1D *iface) if (!refcount) { ID3D11Device2 *device = texture->device; - - wined3d_mutex_lock(); wined3d_texture_decref(texture->wined3d_texture); - wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device); @@ -578,10 +575,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_Release(ID3D11Texture2D *iface) if (!refcount) { ID3D11Device2 *device = texture->device; - - wined3d_mutex_lock(); wined3d_texture_decref(texture->wined3d_texture); - wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device); @@ -1140,9 +1134,7 @@ static ULONG STDMETHODCALLTYPE d3d11_texture3d_Release(ID3D11Texture3D *iface) { ID3D11Device2 *device = texture->device;
- wined3d_mutex_lock(); wined3d_texture_decref(texture->wined3d_texture); - wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ ID3D11Device2_Release(device);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100103
Your paranoid android.
=== debiant2 (32 bit report) ===
d3d11: d3d11.c:9770: Test failed: d3d11.c:15222: Test marked todo: Got hr 0 for WRITE.
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/async.c | 4 ---- dlls/d3d11/device.c | 4 ---- 2 files changed, 8 deletions(-)
diff --git a/dlls/d3d11/async.c b/dlls/d3d11/async.c index 74ba62b3d04..3054c0fca0a 100644 --- a/dlls/d3d11/async.c +++ b/dlls/d3d11/async.c @@ -289,10 +289,8 @@ static void STDMETHODCALLTYPE d3d10_query_Begin(ID3D10Query *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); if (FAILED(hr = wined3d_query_issue(query->wined3d_query, WINED3DISSUE_BEGIN))) ERR("Failed to issue query, hr %#x.\n", hr); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_query_End(ID3D10Query *iface) @@ -302,10 +300,8 @@ static void STDMETHODCALLTYPE d3d10_query_End(ID3D10Query *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); if (FAILED(hr = wined3d_query_issue(query->wined3d_query, WINED3DISSUE_END))) ERR("Failed to issue query, hr %#x.\n", hr); - wined3d_mutex_unlock(); }
static HRESULT STDMETHODCALLTYPE d3d10_query_GetData(ID3D10Query *iface, void *data, UINT data_size, UINT flags) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index f306f9ebc7a..53afb383bc1 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1015,9 +1015,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_Begin(ID3D11DeviceContext1 *i
TRACE("iface %p, asynchronous %p.\n", iface, asynchronous);
- wined3d_mutex_lock(); wined3d_device_context_issue_query(context->wined3d_context, query->wined3d_query, WINED3DISSUE_BEGIN); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_End(ID3D11DeviceContext1 *iface, @@ -1028,9 +1026,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_End(ID3D11DeviceContext1 *ifa
TRACE("iface %p, asynchronous %p.\n", iface, asynchronous);
- wined3d_mutex_lock(); wined3d_device_context_issue_query(context->wined3d_context, query->wined3d_query, WINED3DISSUE_END); - wined3d_mutex_unlock(); }
static HRESULT STDMETHODCALLTYPE d3d11_device_context_GetData(ID3D11DeviceContext1 *iface,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100104
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:9770: Test failed: d3d11.c:15131: Test marked todo: Test 60: Got unexpected color 0xffff00ff at (1, 1). d3d11.c:9770: Test failed: Got hr 0 for WRITE. d3d11.c:9770: Test failed: d3d11.c:15131: Test marked todo: Test 60: Got unexpected color 0xffffffff at (0, 2). d3d11.c:9770: Test failed: Got hr 0 for WRITE. d3d11.c:9770: Test failed: Got hr 0 for WRITE_DISCARD.
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/buffer.c | 4 ---- dlls/d3d11/device.c | 4 ---- dlls/d3d11/texture.c | 12 ------------ 3 files changed, 20 deletions(-)
diff --git a/dlls/d3d11/buffer.c b/dlls/d3d11/buffer.c index ab8471d6f52..5a6ca81dff4 100644 --- a/dlls/d3d11/buffer.c +++ b/dlls/d3d11/buffer.c @@ -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) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 53afb383bc1..47c3a6aec9b 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -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, diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c index 4fe395a206c..87928e638d1 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -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)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 71 --------------------------------------------- 1 file changed, 71 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 47c3a6aec9b..59109eb3767 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -607,10 +607,8 @@ static void d3d11_device_context_set_constant_buffers(ID3D11DeviceContext1 *ifac wined3d_buffers[i].size = (counts ? counts[i] : WINED3D_MAX_CONSTANT_BUFFER_SIZE) * sizeof(struct wined3d_vec4); }
- wined3d_mutex_lock(); wined3d_device_context_set_constant_buffers(context->wined3d_context, type, start_slot, buffer_count, wined3d_buffers); - wined3d_mutex_unlock(); }
static void d3d11_device_context_set_shader_resource_views(ID3D11DeviceContext1 *iface, enum wined3d_shader_type type, @@ -633,10 +631,8 @@ static void d3d11_device_context_set_shader_resource_views(ID3D11DeviceContext1 wined3d_views[i] = view ? view->wined3d_view : NULL; }
- wined3d_mutex_lock(); wined3d_device_context_set_shader_resource_views(context->wined3d_context, type, start_slot, count, wined3d_views); - wined3d_mutex_unlock(); }
static void d3d11_device_context_set_samplers(ID3D11DeviceContext1 *iface, enum wined3d_shader_type type, @@ -659,9 +655,7 @@ static void d3d11_device_context_set_samplers(ID3D11DeviceContext1 *iface, enum wined3d_samplers[i] = sampler ? sampler->wined3d_sampler : NULL; }
- wined3d_mutex_lock(); wined3d_device_context_set_samplers(context->wined3d_context, type, start_slot, count, wined3d_samplers); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_GetDevice(ID3D11DeviceContext1 *iface, ID3D11Device **device) @@ -735,10 +729,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_PSSetShader(ID3D11DeviceConte if (class_instances) FIXME("Dynamic linking is not implemented yet.\n");
- wined3d_mutex_lock(); wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_PIXEL, ps ? ps->wined3d_shader : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_PSSetSamplers(ID3D11DeviceContext1 *iface, @@ -762,10 +754,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_VSSetShader(ID3D11DeviceConte if (class_instances) FIXME("Dynamic linking is not implemented yet.\n");
- wined3d_mutex_lock(); wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_VERTEX, vs ? vs->wined3d_shader : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_DrawIndexed(ID3D11DeviceContext1 *iface, @@ -856,9 +846,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_IASetInputLayout(ID3D11Device
TRACE("iface %p, input_layout %p.\n", iface, input_layout);
- wined3d_mutex_lock(); wined3d_device_context_set_vertex_declaration(context->wined3d_context, layout ? layout->wined3d_decl : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_IASetVertexBuffers(ID3D11DeviceContext1 *iface, @@ -888,9 +876,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_IASetVertexBuffers(ID3D11Devi streams[i].flags = 0; }
- wined3d_mutex_lock(); wined3d_device_context_set_stream_sources(context->wined3d_context, start_slot, buffer_count, streams); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_IASetIndexBuffer(ID3D11DeviceContext1 *iface, @@ -902,11 +888,9 @@ static void STDMETHODCALLTYPE d3d11_device_context_IASetIndexBuffer(ID3D11Device TRACE("iface %p, buffer %p, format %s, offset %u.\n", iface, buffer, debug_dxgi_format(format), offset);
- wined3d_mutex_lock(); wined3d_device_context_set_index_buffer(context->wined3d_context, buffer_impl ? buffer_impl->wined3d_buffer : NULL, wined3dformat_from_dxgi_format(format), offset); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_DrawIndexedInstanced(ID3D11DeviceContext1 *iface, @@ -964,10 +948,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_GSSetShader(ID3D11DeviceConte if (class_instances) FIXME("Dynamic linking is not implemented yet.\n");
- wined3d_mutex_lock(); wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_GEOMETRY, gs ? gs->wined3d_shader : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_IASetPrimitiveTopology(ID3D11DeviceContext1 *iface, @@ -981,9 +963,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_IASetPrimitiveTopology(ID3D11
wined3d_primitive_type_from_d3d11_primitive_topology(topology, &primitive_type, &patch_vertex_count);
- wined3d_mutex_lock(); wined3d_device_context_set_primitive_type(context->wined3d_context, primitive_type, patch_vertex_count); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_VSSetShaderResources(ID3D11DeviceContext1 *iface, @@ -1071,9 +1051,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_SetPredication(ID3D11DeviceCo
query = unsafe_impl_from_ID3D11Query((ID3D11Query *)predicate);
- wined3d_mutex_lock(); wined3d_device_context_set_predication(context->wined3d_context, query ? query->wined3d_query : NULL, value); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_GSSetShaderResources(ID3D11DeviceContext1 *iface, @@ -1197,14 +1175,12 @@ static void STDMETHODCALLTYPE d3d11_device_context_OMSetBlendState(ID3D11DeviceC if (!blend_factor) blend_factor = default_blend_factor;
- wined3d_mutex_lock(); if (!(blend_state_impl = unsafe_impl_from_ID3D11BlendState(blend_state))) wined3d_device_context_set_blend_state(context->wined3d_context, NULL, (const struct wined3d_color *)blend_factor, sample_mask); else wined3d_device_context_set_blend_state(context->wined3d_context, blend_state_impl->wined3d_state, (const struct wined3d_color *)blend_factor, sample_mask); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_OMSetDepthStencilState(ID3D11DeviceContext1 *iface, @@ -1216,16 +1192,13 @@ static void STDMETHODCALLTYPE d3d11_device_context_OMSetDepthStencilState(ID3D11 TRACE("iface %p, depth_stencil_state %p, stencil_ref %u.\n", iface, depth_stencil_state, stencil_ref);
- wined3d_mutex_lock(); if (!(state_impl = unsafe_impl_from_ID3D11DepthStencilState(depth_stencil_state))) { wined3d_device_context_set_depth_stencil_state(context->wined3d_context, NULL, stencil_ref); - wined3d_mutex_unlock(); return; }
wined3d_device_context_set_depth_stencil_state(context->wined3d_context, state_impl->wined3d_state, stencil_ref); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_SOSetTargets(ID3D11DeviceContext1 *iface, UINT buffer_count, @@ -1246,9 +1219,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_SOSetTargets(ID3D11DeviceCont outputs[i].offset = offsets ? offsets[i] : 0; }
- wined3d_mutex_lock(); wined3d_device_context_set_stream_outputs(context->wined3d_context, outputs); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_DrawAuto(ID3D11DeviceContext1 *iface) @@ -1323,11 +1294,9 @@ static void STDMETHODCALLTYPE d3d11_device_context_RSSetState(ID3D11DeviceContex
TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state);
- wined3d_mutex_lock(); rasterizer_state_impl = unsafe_impl_from_ID3D11RasterizerState(rasterizer_state); wined3d_device_context_set_rasterizer_state(context->wined3d_context, rasterizer_state_impl ? rasterizer_state_impl->wined3d_state : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_RSSetViewports(ID3D11DeviceContext1 *iface, @@ -1352,9 +1321,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_RSSetViewports(ID3D11DeviceCo wined3d_vp[i].max_z = viewports[i].MaxDepth; }
- wined3d_mutex_lock(); wined3d_device_context_set_viewports(context->wined3d_context, viewport_count, wined3d_vp); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_RSSetScissorRects(ID3D11DeviceContext1 *iface, @@ -1367,9 +1334,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_RSSetScissorRects(ID3D11Devic if (rect_count > WINED3D_MAX_VIEWPORTS) return;
- wined3d_mutex_lock(); wined3d_device_context_set_scissor_rects(context->wined3d_context, rect_count, rects); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_CopySubresourceRegion(ID3D11DeviceContext1 *iface, @@ -1616,10 +1581,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_HSSetShader(ID3D11DeviceConte if (class_instances) FIXME("Dynamic linking is not implemented yet.\n");
- wined3d_mutex_lock(); wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_HULL, hs ? hs->wined3d_shader : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_HSSetSamplers(ID3D11DeviceContext1 *iface, @@ -1662,10 +1625,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_DSSetShader(ID3D11DeviceConte if (class_instances) FIXME("Dynamic linking is not implemented yet.\n");
- wined3d_mutex_lock(); wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_DOMAIN, ds ? ds->wined3d_shader : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_DSSetSamplers(ID3D11DeviceContext1 *iface, @@ -1719,10 +1680,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_CSSetUnorderedAccessViews(ID3 wined3d_views[i] = view ? view->wined3d_view : NULL; }
- wined3d_mutex_lock(); wined3d_device_context_set_unordered_access_views(context->wined3d_context, WINED3D_PIPELINE_COMPUTE, start_slot, view_count, wined3d_views, initial_counts); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_CSSetShader(ID3D11DeviceContext1 *iface, @@ -1737,10 +1696,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_CSSetShader(ID3D11DeviceConte if (class_instances) FIXME("Dynamic linking is not implemented yet.\n");
- wined3d_mutex_lock(); wined3d_device_context_set_shader(context->wined3d_context, WINED3D_SHADER_TYPE_COMPUTE, cs ? cs->wined3d_shader : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_CSSetSamplers(ID3D11DeviceContext1 *iface, @@ -4615,10 +4572,8 @@ static void d3d10_device_set_constant_buffers(ID3D10Device1 *iface, enum wined3d wined3d_buffers[i].size = WINED3D_MAX_CONSTANT_BUFFER_SIZE * sizeof(struct wined3d_vec4); }
- wined3d_mutex_lock(); wined3d_device_context_set_constant_buffers(device->immediate_context.wined3d_context, type, start_slot, buffer_count, wined3d_buffers); - wined3d_mutex_unlock(); }
static void d3d10_device_set_shader_resource_views(ID3D10Device1 *iface, enum wined3d_shader_type type, @@ -4641,10 +4596,8 @@ static void d3d10_device_set_shader_resource_views(ID3D10Device1 *iface, enum wi wined3d_views[i] = view ? view->wined3d_view : NULL; }
- wined3d_mutex_lock(); wined3d_device_context_set_shader_resource_views(device->immediate_context.wined3d_context, type, start_slot, count, wined3d_views); - wined3d_mutex_unlock(); }
static void d3d10_device_set_samplers(ID3D10Device1 *iface, enum wined3d_shader_type type, @@ -4667,10 +4620,8 @@ static void d3d10_device_set_samplers(ID3D10Device1 *iface, enum wined3d_shader_ wined3d_samplers[i] = sampler ? sampler->wined3d_sampler : NULL; }
- wined3d_mutex_lock(); wined3d_device_context_set_samplers(device->immediate_context.wined3d_context, type, start_slot, count, wined3d_samplers); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device1 *iface, @@ -4700,10 +4651,8 @@ static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device1 *iface,
TRACE("iface %p, shader %p\n", iface, shader);
- wined3d_mutex_lock(); wined3d_device_context_set_shader(device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_PIXEL, ps ? ps->wined3d_shader : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device1 *iface, @@ -4723,10 +4672,8 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device1 *iface,
TRACE("iface %p, shader %p\n", iface, shader);
- wined3d_mutex_lock(); wined3d_device_context_set_shader(device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_VERTEX, vs ? vs->wined3d_shader : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device1 *iface, UINT index_count, @@ -4774,10 +4721,8 @@ static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device1 *iface
TRACE("iface %p, input_layout %p\n", iface, input_layout);
- wined3d_mutex_lock(); wined3d_device_context_set_vertex_declaration(device->immediate_context.wined3d_context, layout ? layout->wined3d_decl : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device1 *iface, UINT start_slot, @@ -4807,10 +4752,8 @@ static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device1 *ifa streams[i].flags = 0; }
- wined3d_mutex_lock(); wined3d_device_context_set_stream_sources(device->immediate_context.wined3d_context, start_slot, buffer_count, streams); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device1 *iface, @@ -4822,11 +4765,9 @@ static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device1 *iface TRACE("iface %p, buffer %p, format %s, offset %u.\n", iface, buffer, debug_dxgi_format(format), offset);
- wined3d_mutex_lock(); wined3d_device_context_set_index_buffer(device->immediate_context.wined3d_context, buffer_impl ? buffer_impl->wined3d_buffer : NULL, wined3dformat_from_dxgi_format(format), offset); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_DrawIndexedInstanced(ID3D10Device1 *iface, @@ -4879,10 +4820,8 @@ static void STDMETHODCALLTYPE d3d10_device_GSSetShader(ID3D10Device1 *iface, ID3
TRACE("iface %p, shader %p.\n", iface, shader);
- wined3d_mutex_lock(); wined3d_device_context_set_shader(device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_GEOMETRY, gs ? gs->wined3d_shader : NULL); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_IASetPrimitiveTopology(ID3D10Device1 *iface, @@ -4892,10 +4831,8 @@ static void STDMETHODCALLTYPE d3d10_device_IASetPrimitiveTopology(ID3D10Device1
TRACE("iface %p, topology %s.\n", iface, debug_d3d10_primitive_topology(topology));
- wined3d_mutex_lock(); wined3d_device_context_set_primitive_type(device->immediate_context.wined3d_context, (enum wined3d_primitive_type)topology, 0); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_VSSetShaderResources(ID3D10Device1 *iface, @@ -4924,10 +4861,8 @@ static void STDMETHODCALLTYPE d3d10_device_SetPredication(ID3D10Device1 *iface, TRACE("iface %p, predicate %p, value %#x.\n", iface, predicate, value);
query = unsafe_impl_from_ID3D10Query((ID3D10Query *)predicate); - wined3d_mutex_lock(); wined3d_device_context_set_predication(device->immediate_context.wined3d_context, query ? query->wined3d_query : NULL, value); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_GSSetShaderResources(ID3D10Device1 *iface, @@ -5023,9 +4958,7 @@ static void STDMETHODCALLTYPE d3d10_device_SOSetTargets(ID3D10Device1 *iface, outputs[i].offset = offsets ? offsets[i] : 0; }
- wined3d_mutex_lock(); wined3d_device_context_set_stream_outputs(device->immediate_context.wined3d_context, outputs); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_DrawAuto(ID3D10Device1 *iface) @@ -5067,9 +5000,7 @@ static void STDMETHODCALLTYPE d3d10_device_RSSetViewports(ID3D10Device1 *iface, wined3d_vp[i].max_z = viewports[i].MaxDepth; }
- wined3d_mutex_lock(); wined3d_device_context_set_viewports(device->immediate_context.wined3d_context, viewport_count, wined3d_vp); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_RSSetScissorRects(ID3D10Device1 *iface, @@ -5082,9 +5013,7 @@ static void STDMETHODCALLTYPE d3d10_device_RSSetScissorRects(ID3D10Device1 *ifac if (rect_count > WINED3D_MAX_VIEWPORTS) return;
- wined3d_mutex_lock(); wined3d_device_context_set_scissor_rects(device->immediate_context.wined3d_context, rect_count, rects); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device1 *iface,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100106
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:9770: Test failed: d3d11.c:15153: Test marked todo: Got hr 0 for WRITE_DISCARD.
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 20 -------------------- 1 file changed, 20 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 59109eb3767..55f1332b555 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -766,10 +766,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_DrawIndexed(ID3D11DeviceConte TRACE("iface %p, index_count %u, start_index_location %u, base_vertex_location %d.\n", iface, index_count, start_index_location, base_vertex_location);
- wined3d_mutex_lock(); wined3d_device_context_draw_indexed(context->wined3d_context, base_vertex_location, start_index_location, index_count, 0, 0); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_Draw(ID3D11DeviceContext1 *iface, @@ -780,9 +778,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_Draw(ID3D11DeviceContext1 *if TRACE("iface %p, vertex_count %u, start_vertex_location %u.\n", iface, vertex_count, start_vertex_location);
- wined3d_mutex_lock(); wined3d_device_context_draw(context->wined3d_context, start_vertex_location, vertex_count, 0, 0); - wined3d_mutex_unlock(); }
static HRESULT STDMETHODCALLTYPE d3d11_device_context_Map(ID3D11DeviceContext1 *iface, ID3D11Resource *resource, @@ -904,10 +900,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_DrawIndexedInstanced(ID3D11De iface, instance_index_count, instance_count, start_index_location, base_vertex_location, start_instance_location);
- wined3d_mutex_lock(); wined3d_device_context_draw_indexed(context->wined3d_context, base_vertex_location, start_index_location, instance_index_count, start_instance_location, instance_count); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_DrawInstanced(ID3D11DeviceContext1 *iface, @@ -920,10 +914,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_DrawInstanced(ID3D11DeviceCon iface, instance_vertex_count, instance_count, start_vertex_location, start_instance_location);
- wined3d_mutex_lock(); wined3d_device_context_draw(context->wined3d_context, start_vertex_location, instance_vertex_count, start_instance_location, instance_count); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_GSSetConstantBuffers(ID3D11DeviceContext1 *iface, @@ -1237,9 +1229,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_DrawIndexedInstancedIndirect(
d3d_buffer = unsafe_impl_from_ID3D11Buffer(buffer);
- wined3d_mutex_lock(); wined3d_device_context_draw_indirect(context->wined3d_context, d3d_buffer->wined3d_buffer, offset, true); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_DrawInstancedIndirect(ID3D11DeviceContext1 *iface, @@ -1252,9 +1242,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_DrawInstancedIndirect(ID3D11D
d3d_buffer = unsafe_impl_from_ID3D11Buffer(buffer);
- wined3d_mutex_lock(); wined3d_device_context_draw_indirect(context->wined3d_context, d3d_buffer->wined3d_buffer, offset, false); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_Dispatch(ID3D11DeviceContext1 *iface, @@ -4684,10 +4672,8 @@ static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device1 *iface, UIN TRACE("iface %p, index_count %u, start_index_location %u, base_vertex_location %d.\n", iface, index_count, start_index_location, base_vertex_location);
- wined3d_mutex_lock(); wined3d_device_context_draw_indexed(device->immediate_context.wined3d_context, base_vertex_location, start_index_location, index_count, 0, 0); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device1 *iface, UINT vertex_count, @@ -4698,9 +4684,7 @@ static void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device1 *iface, UINT verte TRACE("iface %p, vertex_count %u, start_vertex_location %u\n", iface, vertex_count, start_vertex_location);
- wined3d_mutex_lock(); wined3d_device_context_draw(device->immediate_context.wined3d_context, start_vertex_location, vertex_count, 0, 0); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_PSSetConstantBuffers(ID3D10Device1 *iface, @@ -4781,10 +4765,8 @@ static void STDMETHODCALLTYPE d3d10_device_DrawIndexedInstanced(ID3D10Device1 *i iface, instance_index_count, instance_count, start_index_location, base_vertex_location, start_instance_location);
- wined3d_mutex_lock(); wined3d_device_context_draw_indexed(device->immediate_context.wined3d_context, base_vertex_location, start_index_location, instance_index_count, start_instance_location, instance_count); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device1 *iface, @@ -4797,10 +4779,8 @@ static void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device1 *iface, "start_instance_location %u.\n", iface, instance_vertex_count, instance_count, start_vertex_location, start_instance_location);
- wined3d_mutex_lock(); wined3d_device_context_draw(device->immediate_context.wined3d_context, start_vertex_location, instance_vertex_count, start_instance_location, instance_count); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_GSSetConstantBuffers(ID3D10Device1 *iface,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100107
Your paranoid android.
=== debiant2 (32 bit WoW report) ===
d3d11: d3d11.c:16628: Test failed: Dim 0, Test 15: At layer 0, (0,0,0), expected 0x00c01001, got 0x00000000.
=== debiant2 (64 bit WoW report) ===
d3d11: d3d11.c:9770: Test failed: d3d11.c:15421: Test marked todo: Got hr 0x80070057, expected 0 (feature level 0xb000, format 0x59).
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 55f1332b555..d9a75de20e9 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1253,10 +1253,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_Dispatch(ID3D11DeviceContext1 TRACE("iface %p, thread_group_count_x %u, thread_group_count_y %u, thread_group_count_z %u.\n", iface, thread_group_count_x, thread_group_count_y, thread_group_count_z);
- wined3d_mutex_lock(); wined3d_device_context_dispatch(context->wined3d_context, thread_group_count_x, thread_group_count_y, thread_group_count_z); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_DispatchIndirect(ID3D11DeviceContext1 *iface, @@ -1269,9 +1267,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_DispatchIndirect(ID3D11Device
buffer_impl = unsafe_impl_from_ID3D11Buffer(buffer);
- wined3d_mutex_lock(); wined3d_device_context_dispatch_indirect(context->wined3d_context, buffer_impl->wined3d_buffer, offset); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_RSSetState(ID3D11DeviceContext1 *iface,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100108
Your paranoid android.
=== debiant2 (64 bit WoW report) ===
d3d11: d3d11.c:6263: Test failed: d3d11.c:7858: Test marked todo: Got unexpected rendertarget view 00000000025A0B00.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 10 ---------- 1 file changed, 10 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index d9a75de20e9..36dc442d59f 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1343,10 +1343,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_CopySubresourceRegion(ID3D11D
wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); - wined3d_mutex_lock(); wined3d_device_context_copy_sub_resource_region(context->wined3d_context, wined3d_dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL, 0); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_CopyResource(ID3D11DeviceContext1 *iface, @@ -1359,9 +1357,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_CopyResource(ID3D11DeviceCont
wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); - wined3d_mutex_lock(); wined3d_device_context_copy_resource(context->wined3d_context, wined3d_dst_resource, wined3d_src_resource); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_UpdateSubresource(ID3D11DeviceContext1 *iface, @@ -2771,10 +2767,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_CopySubresourceRegion1(ID3D11
wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); - wined3d_mutex_lock(); wined3d_device_context_copy_sub_resource_region(context->wined3d_context, wined3d_dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL, flags); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_UpdateSubresource1(ID3D11DeviceContext1 *iface, @@ -5014,11 +5008,9 @@ static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device1 *
wined3d_dst_resource = wined3d_resource_from_d3d10_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d10_resource(src_resource); - wined3d_mutex_lock(); wined3d_device_context_copy_sub_resource_region(device->immediate_context.wined3d_context, wined3d_dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, src_box ? &wined3d_src_box : NULL, 0); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device1 *iface, @@ -5031,10 +5023,8 @@ static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device1 *iface,
wined3d_dst_resource = wined3d_resource_from_d3d10_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d10_resource(src_resource); - wined3d_mutex_lock(); wined3d_device_context_copy_resource(device->immediate_context.wined3d_context, wined3d_dst_resource, wined3d_src_resource); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_UpdateSubresource(ID3D10Device1 *iface,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100109
Your paranoid android.
=== debiant2 (32 bit report) ===
d3d11: d3d11.c:5926: Test failed: d3d11.c:5757: Test marked todo: Got unexpected CPrimitives count: 3.
=== debiant2 (64 bit WoW report) ===
d3d11: d3d11.c:20087: Test failed: d3d11.c:16404: Test marked todo: Got 0xdeadbeef, expected 0xfff0e0d0 or 0x7f7f7f7f at 127, uvec4 0x7fffffd0, 0x7fffffe0, 0x7ffffff0, 0x7fffffff.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 36dc442d59f..979b0632c49 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1375,10 +1375,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_UpdateSubresource(ID3D11Devic wined3d_box_set(&wined3d_box, box->left, box->top, box->right, box->bottom, box->front, box->back);
wined3d_resource = wined3d_resource_from_d3d11_resource(resource); - wined3d_mutex_lock(); wined3d_device_context_update_sub_resource(context->wined3d_context, wined3d_resource, subresource_idx, box ? &wined3d_box : NULL, data, row_pitch, depth_pitch, 0); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_CopyStructureCount(ID3D11DeviceContext1 *iface, @@ -2787,10 +2785,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_UpdateSubresource1(ID3D11Devi box->front, box->back);
wined3d_resource = wined3d_resource_from_d3d11_resource(resource); - wined3d_mutex_lock(); wined3d_device_context_update_sub_resource(context->wined3d_context, wined3d_resource, subresource_idx, box ? &wined3d_box : NULL, data, row_pitch, depth_pitch, flags); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_DiscardResource(ID3D11DeviceContext1 *iface,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 12 ------------ 1 file changed, 12 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 979b0632c49..84af9a16baf 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1412,11 +1412,9 @@ static void STDMETHODCALLTYPE d3d11_device_context_ClearRenderTargetView(ID3D11D if (!view) return;
- wined3d_mutex_lock(); if (FAILED(hr = wined3d_device_context_clear_rendertarget_view(context->wined3d_context, view->wined3d_view, NULL, WINED3DCLEAR_TARGET, &color, 0.0f, 0))) ERR("Failed to clear view, hr %#x.\n", hr); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_ClearUnorderedAccessViewUint(ID3D11DeviceContext1 *iface, @@ -1429,10 +1427,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_ClearUnorderedAccessViewUint( iface, unordered_access_view, values[0], values[1], values[2], values[3]);
view = unsafe_impl_from_ID3D11UnorderedAccessView(unordered_access_view); - wined3d_mutex_lock(); wined3d_device_context_clear_uav_uint(context->wined3d_context, view->wined3d_view, (const struct wined3d_uvec4 *)values); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_ClearUnorderedAccessViewFloat(ID3D11DeviceContext1 *iface, @@ -1445,10 +1441,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_ClearUnorderedAccessViewFloat iface, unordered_access_view, debug_float4(values));
view = unsafe_impl_from_ID3D11UnorderedAccessView(unordered_access_view); - wined3d_mutex_lock(); wined3d_device_context_clear_uav_float(context->wined3d_context, view->wined3d_view, (const struct wined3d_vec4 *)values); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_ClearDepthStencilView(ID3D11DeviceContext1 *iface, @@ -1467,11 +1461,9 @@ static void STDMETHODCALLTYPE d3d11_device_context_ClearDepthStencilView(ID3D11D
wined3d_flags = wined3d_clear_flags_from_d3d11_clear_flags(flags);
- wined3d_mutex_lock(); if (FAILED(hr = wined3d_device_context_clear_rendertarget_view(context->wined3d_context, view->wined3d_view, NULL, wined3d_flags, NULL, depth, stencil))) ERR("Failed to clear view, hr %#x.\n", hr); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_GenerateMips(ID3D11DeviceContext1 *iface, @@ -5053,11 +5045,9 @@ static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device1 * if (!view) return;
- wined3d_mutex_lock(); if (FAILED(hr = wined3d_device_context_clear_rendertarget_view(device->immediate_context.wined3d_context, view->wined3d_view, NULL, WINED3DCLEAR_TARGET, &color, 0.0f, 0))) ERR("Failed to clear view, hr %#x.\n", hr); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device1 *iface, @@ -5076,11 +5066,9 @@ static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device1 *
wined3d_flags = wined3d_clear_flags_from_d3d11_clear_flags(flags);
- wined3d_mutex_lock(); if (FAILED(hr = wined3d_device_context_clear_rendertarget_view(device->immediate_context.wined3d_context, view->wined3d_view, NULL, wined3d_flags, NULL, depth, stencil))) ERR("Failed to clear view, hr %#x.\n", hr); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device1 *iface,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 84af9a16baf..4839d81dd19 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1510,11 +1510,9 @@ static void STDMETHODCALLTYPE d3d11_device_context_ResolveSubresource(ID3D11Devi wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); wined3d_format = wined3dformat_from_dxgi_format(format); - wined3d_mutex_lock(); wined3d_device_context_resolve_sub_resource(context->wined3d_context, wined3d_dst_resource, dst_subresource_idx, wined3d_src_resource, src_subresource_idx, wined3d_format); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_ExecuteCommandList(ID3D11DeviceContext1 *iface, @@ -5100,11 +5098,9 @@ static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device1 *ifa wined3d_dst_resource = wined3d_resource_from_d3d10_resource(dst_resource); wined3d_src_resource = wined3d_resource_from_d3d10_resource(src_resource); wined3d_format = wined3dformat_from_dxgi_format(format); - wined3d_mutex_lock(); wined3d_device_context_resolve_sub_resource(device->immediate_context.wined3d_context, wined3d_dst_resource, dst_subresource_idx, wined3d_src_resource, src_subresource_idx, wined3d_format); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device1 *iface,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 4839d81dd19..43db6b76b8c 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1474,9 +1474,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_GenerateMips(ID3D11DeviceCont
TRACE("iface %p, view %p.\n", iface, view);
- wined3d_mutex_lock(); wined3d_device_context_generate_mipmaps(context->wined3d_context, srv->wined3d_view); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_SetResourceMinLOD(ID3D11DeviceContext1 *iface, @@ -5077,9 +5075,7 @@ static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device1 *iface,
TRACE("iface %p, view %p.\n", iface, view);
- wined3d_mutex_lock(); wined3d_device_context_generate_mipmaps(device->immediate_context.wined3d_context, srv->wined3d_view); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device1 *iface,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100113
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:9770: Test failed: d3d11.c:15390: Test marked todo: Test 60: Got unexpected color 0xffffffff at (0, 3). d3d11.c:9770: Test failed: Got unexpected hr 0 for typeless format (feature level 0xb000).
=== debiant2 (32 bit WoW report) ===
d3d11: d3d11.c:5943: Test failed: d3d11.c:6240: Test marked todo: Got unexpected CPrimitives count: 3.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 43db6b76b8c..2ea657b9641 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2656,9 +2656,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_ClearState(ID3D11DeviceContex
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); wined3d_device_context_reset_state(context->wined3d_context); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_Flush(ID3D11DeviceContext1 *iface)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100114
Your paranoid android.
=== debiant2 (32 bit WoW report) ===
d3d11: d3d11.c:9770: Test failed: d3d11.c:15222: Test marked todo: Got hr 0 for WRITE.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 2ea657b9641..e5618f09174 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2665,9 +2665,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_Flush(ID3D11DeviceContext1 *i
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); wined3d_device_context_flush(context->wined3d_context); - wined3d_mutex_unlock(); }
static D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE d3d11_device_context_GetType(ID3D11DeviceContext1 *iface) @@ -5755,9 +5753,7 @@ static void STDMETHODCALLTYPE d3d10_device_Flush(ID3D10Device1 *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); wined3d_device_context_flush(device->immediate_context.wined3d_context); - wined3d_mutex_unlock(); }
static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device1 *iface,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index e5618f09174..248634a245d 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1392,10 +1392,8 @@ static void STDMETHODCALLTYPE d3d11_device_context_CopyStructureCount(ID3D11Devi buffer_impl = unsafe_impl_from_ID3D11Buffer(dst_buffer); uav = unsafe_impl_from_ID3D11UnorderedAccessView(src_view);
- wined3d_mutex_lock(); wined3d_device_context_copy_uav_counter(context->wined3d_context, buffer_impl->wined3d_buffer, dst_offset, uav->wined3d_view); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_ClearRenderTargetView(ID3D11DeviceContext1 *iface,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 248634a245d..a49e957c9e8 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1519,9 +1519,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_ExecuteCommandList(ID3D11Devi
TRACE("iface %p, command_list %p, restore_state %#x.\n", iface, command_list, restore_state);
- wined3d_mutex_lock(); wined3d_device_context_execute_command_list(context->wined3d_context, list_impl->wined3d_list, !!restore_state); - wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_device_context_HSSetShaderResources(ID3D11DeviceContext1 *iface,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=100117
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:20087: Test failed: d3d11.c:16411: Test marked todo: Got 0xdeadbeef, expected 0 or 0 at 0, uvec4 0, 0, 0, 0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/device.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index a49e957c9e8..c186ab0d65f 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2698,8 +2698,6 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_FinishCommandList(ID3D11De if (!(object = heap_alloc_zero(sizeof(*object)))) return E_OUTOFMEMORY;
- wined3d_mutex_lock(); - if (FAILED(hr = wined3d_deferred_context_record_command_list(context->wined3d_context, !!restore, &object->wined3d_list))) { @@ -2708,8 +2706,6 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_FinishCommandList(ID3D11De return hr; }
- wined3d_mutex_unlock(); - object->ID3D11CommandList_iface.lpVtbl = &d3d11_command_list_vtbl; object->refcount = 1; object->device = &context->device->ID3D11Device2_iface; @@ -3681,15 +3677,12 @@ static HRESULT d3d11_deferred_context_create(struct d3d_device *device, return E_OUTOFMEMORY; d3d11_device_context_init(object, device, D3D11_DEVICE_CONTEXT_DEFERRED);
- wined3d_mutex_lock(); if (FAILED(hr = wined3d_deferred_context_create(device->wined3d_device, &object->wined3d_context))) { WARN("Failed to create wined3d deferred context, hr %#x.\n", hr); heap_free(object); - wined3d_mutex_unlock(); return hr; } - wined3d_mutex_unlock();
TRACE("Created deferred context %p.\n", object); *context = object;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/wined3d/cs.c | 23 +++-- dlls/wined3d/device.c | 152 ++++++++++++++++----------------- dlls/wined3d/wined3d_private.h | 17 ++++ 3 files changed, 107 insertions(+), 85 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index a77b1b983c1..769ec262169 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1012,7 +1012,7 @@ void CDECL wined3d_device_context_dispatch(struct wined3d_device_context *contex { struct wined3d_cs_dispatch *op;
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_DISPATCH; op->parameters.indirect = FALSE; @@ -1023,7 +1023,7 @@ void CDECL wined3d_device_context_dispatch(struct wined3d_device_context *contex acquire_compute_pipeline_resources(context);
wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_dispatch_indirect(struct wined3d_device_context *context, @@ -1031,7 +1031,7 @@ void CDECL wined3d_device_context_dispatch_indirect(struct wined3d_device_contex { struct wined3d_cs_dispatch *op;
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_DISPATCH; op->parameters.indirect = TRUE; @@ -1042,7 +1042,7 @@ void CDECL wined3d_device_context_dispatch_indirect(struct wined3d_device_contex wined3d_device_context_acquire_resource(context, &buffer->resource);
wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data) @@ -1199,7 +1199,7 @@ void CDECL wined3d_device_context_draw_indirect(struct wined3d_device_context *c const struct wined3d_state *state = context->state; struct wined3d_cs_draw *op;
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_DRAW; op->primitive_type = state->primitive_type; @@ -1213,7 +1213,7 @@ void CDECL wined3d_device_context_draw_indirect(struct wined3d_device_context *c wined3d_device_context_acquire_resource(context, &buffer->resource);
wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
static void wined3d_cs_exec_flush(struct wined3d_cs *cs, const void *data) @@ -3445,6 +3445,7 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) struct wined3d_deferred_context { struct wined3d_device_context c; + CRITICAL_SECTION lock;
SIZE_T data_size, data_capacity; void *data; @@ -3691,8 +3692,10 @@ HRESULT CDECL wined3d_deferred_context_create(struct wined3d_device *device, str return hr; }
+ InitializeCriticalSection(&object->lock); object->c.ops = &wined3d_deferred_context_ops; object->c.device = device; + object->c.lock = &object->lock;
/* Make sure the first command list gets the state reset when executed. * Resets for subsequent command lists are encoded in wined3d_deferred_context_record_command_list(). */ @@ -3732,6 +3735,8 @@ void CDECL wined3d_deferred_context_destroy(struct wined3d_device_context *conte
wined3d_state_destroy(deferred->c.state); heap_free(deferred->data); + + DeleteCriticalSection(&deferred->lock); heap_free(deferred); }
@@ -3744,7 +3749,7 @@ HRESULT CDECL wined3d_deferred_context_record_command_list(struct wined3d_device
TRACE("context %p, list %p.\n", context, list);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); memory = heap_alloc(sizeof(*object) + deferred->resource_count * sizeof(*object->resources) + deferred->upload_count * sizeof(*object->uploads) + deferred->command_list_count * sizeof(*object->command_lists) @@ -3753,7 +3758,7 @@ HRESULT CDECL wined3d_deferred_context_record_command_list(struct wined3d_device
if (!memory) { - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); return E_OUTOFMEMORY; }
@@ -3806,7 +3811,7 @@ HRESULT CDECL wined3d_deferred_context_record_command_list(struct wined3d_device
TRACE("Created command list %p.\n", object); *list = object; - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context);
return S_OK; } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 86945485e20..59d568dfe80 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1649,11 +1649,11 @@ void CDECL wined3d_device_context_reset_state(struct wined3d_device_context *con { TRACE("context %p.\n", context);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); state_cleanup(context->state); wined3d_state_reset(context->state, &context->device->adapter->d3d_info); wined3d_device_context_emit_reset_state(context, true); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_state(struct wined3d_device_context *context, struct wined3d_state *state) @@ -1663,7 +1663,7 @@ void CDECL wined3d_device_context_set_state(struct wined3d_device_context *conte
TRACE("context %p, state %p.\n", context, state);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); context->state = state; wined3d_device_context_emit_set_feature_level(context, state->feature_level);
@@ -1760,7 +1760,7 @@ void CDECL wined3d_device_context_set_state(struct wined3d_device_context *conte wined3d_device_context_emit_set_blend_state(context, state->blend_state, &state->blend_factor, state->sample_mask); wined3d_device_context_emit_set_depth_stencil_state(context, state->depth_stencil_state, state->stencil_ref); wined3d_device_context_emit_set_rasterizer_state(context, state->rasterizer_state); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
struct wined3d_state * CDECL wined3d_device_get_state(struct wined3d_device *device) @@ -1793,7 +1793,7 @@ void CDECL wined3d_device_context_set_shader(struct wined3d_device_context *cont
TRACE("context %p, type %#x, shader %p.\n", context, type, shader);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); prev = state->shader[type]; if (shader == prev) goto out; @@ -1805,7 +1805,7 @@ void CDECL wined3d_device_context_set_shader(struct wined3d_device_context *cont if (prev) wined3d_shader_decref(prev); out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
struct wined3d_shader * CDECL wined3d_device_context_get_shader(const struct wined3d_device_context *context, @@ -1831,7 +1831,7 @@ void CDECL wined3d_device_context_set_constant_buffers(struct wined3d_device_con return; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); if (!memcmp(buffers, &state->cb[type][start_idx], count * sizeof(*buffers))) goto out;
@@ -1848,7 +1848,7 @@ void CDECL wined3d_device_context_set_constant_buffers(struct wined3d_device_con wined3d_buffer_decref(prev); } out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_blend_state(struct wined3d_device_context *context, @@ -1860,7 +1860,7 @@ void CDECL wined3d_device_context_set_blend_state(struct wined3d_device_context TRACE("context %p, blend_state %p, blend_factor %p, sample_mask %#x.\n", context, blend_state, blend_factor, sample_mask);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); prev = state->blend_state; if (prev == blend_state && !memcmp(blend_factor, &state->blend_factor, sizeof(*blend_factor)) && sample_mask == state->sample_mask) @@ -1875,7 +1875,7 @@ void CDECL wined3d_device_context_set_blend_state(struct wined3d_device_context if (prev) wined3d_blend_state_decref(prev); out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_depth_stencil_state(struct wined3d_device_context *context, @@ -1886,7 +1886,7 @@ void CDECL wined3d_device_context_set_depth_stencil_state(struct wined3d_device_
TRACE("context %p, depth_stencil_state %p, stencil_ref %u.\n", context, depth_stencil_state, stencil_ref);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); prev = state->depth_stencil_state; if (prev == depth_stencil_state && state->stencil_ref == stencil_ref) goto out; @@ -1899,7 +1899,7 @@ void CDECL wined3d_device_context_set_depth_stencil_state(struct wined3d_device_ if (prev) wined3d_depth_stencil_state_decref(prev); out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_rasterizer_state(struct wined3d_device_context *context, @@ -1910,7 +1910,7 @@ void CDECL wined3d_device_context_set_rasterizer_state(struct wined3d_device_con
TRACE("context %p, rasterizer_state %p.\n", context, rasterizer_state);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); prev = state->rasterizer_state; if (prev == rasterizer_state) goto out; @@ -1922,7 +1922,7 @@ void CDECL wined3d_device_context_set_rasterizer_state(struct wined3d_device_con if (prev) wined3d_rasterizer_state_decref(prev); out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_viewports(struct wined3d_device_context *context, unsigned int viewport_count, @@ -1939,7 +1939,7 @@ void CDECL wined3d_device_context_set_viewports(struct wined3d_device_context *c viewports[i].width, viewports[i].height, viewports[i].min_z, viewports[i].max_z); }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); if (viewport_count) memcpy(state->viewports, viewports, viewport_count * sizeof(*viewports)); else @@ -1947,7 +1947,7 @@ void CDECL wined3d_device_context_set_viewports(struct wined3d_device_context *c state->viewport_count = viewport_count;
wined3d_device_context_emit_set_viewports(context, viewport_count, viewports); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_scissor_rects(struct wined3d_device_context *context, unsigned int rect_count, @@ -1963,7 +1963,7 @@ void CDECL wined3d_device_context_set_scissor_rects(struct wined3d_device_contex TRACE("%u: %s\n", i, wine_dbgstr_rect(&rects[i])); }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); if (state->scissor_rect_count == rect_count && !memcmp(state->scissor_rects, rects, rect_count * sizeof(*rects))) { @@ -1979,7 +1979,7 @@ void CDECL wined3d_device_context_set_scissor_rects(struct wined3d_device_contex
wined3d_device_context_emit_set_scissor_rects(context, rect_count, rects); out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_shader_resource_views(struct wined3d_device_context *context, @@ -1999,7 +1999,7 @@ void CDECL wined3d_device_context_set_shader_resource_views(struct wined3d_devic return; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); if (!memcmp(views, &state->shader_resource_view[type][start_idx], count * sizeof(*views))) goto out;
@@ -2037,7 +2037,7 @@ void CDECL wined3d_device_context_set_shader_resource_views(struct wined3d_devic } } out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_samplers(struct wined3d_device_context *context, enum wined3d_shader_type type, @@ -2054,7 +2054,7 @@ void CDECL wined3d_device_context_set_samplers(struct wined3d_device_context *co return; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); if (!memcmp(samplers, &state->sampler[type][start_idx], count * sizeof(*samplers))) goto out;
@@ -2071,7 +2071,7 @@ void CDECL wined3d_device_context_set_samplers(struct wined3d_device_context *co wined3d_sampler_decref(prev); } out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_unordered_access_views(struct wined3d_device_context *context, @@ -2090,7 +2090,7 @@ void CDECL wined3d_device_context_set_unordered_access_views(struct wined3d_devi return; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); if (!memcmp(uavs, &state->unordered_access_view[pipeline][start_idx], count * sizeof(*uavs)) && !initial_counts) goto out;
@@ -2107,7 +2107,7 @@ void CDECL wined3d_device_context_set_unordered_access_views(struct wined3d_devi wined3d_unordered_access_view_decref(prev); } out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_render_targets_and_unordered_access_views(struct wined3d_device_context *context, @@ -2115,7 +2115,7 @@ void CDECL wined3d_device_context_set_render_targets_and_unordered_access_views( struct wined3d_rendertarget_view *depth_stencil_view, UINT uav_count, struct wined3d_unordered_access_view *const *unordered_access_views, const unsigned int *initial_counts) { - wined3d_mutex_lock(); + wined3d_device_context_lock(context); if (rtv_count != ~0u) { if (depth_stencil_view && !(depth_stencil_view->resource->bind_flags & WINED3D_BIND_DEPTH_STENCIL)) @@ -2138,7 +2138,7 @@ void CDECL wined3d_device_context_set_render_targets_and_unordered_access_views( unordered_access_views, initial_counts); } out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
static void wined3d_device_context_unbind_srv_for_rtv(struct wined3d_device_context *context, @@ -2200,7 +2200,7 @@ HRESULT CDECL wined3d_device_context_set_rendertarget_views(struct wined3d_devic } }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); /* Set the viewport and scissor rectangles, if requested. Tests show that * stateblock recording is ignored, the change goes directly into the * primary stateblock. */ @@ -2246,7 +2246,7 @@ HRESULT CDECL wined3d_device_context_set_rendertarget_views(struct wined3d_devic wined3d_device_context_unbind_srv_for_rtv(context, view, FALSE); } out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); return WINED3D_OK; }
@@ -2265,7 +2265,7 @@ HRESULT CDECL wined3d_device_context_set_depth_stencil_view(struct wined3d_devic return WINED3DERR_INVALIDCALL; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); prev = fb->depth_stencil; if (prev == view) { @@ -2280,7 +2280,7 @@ HRESULT CDECL wined3d_device_context_set_depth_stencil_view(struct wined3d_devic wined3d_rendertarget_view_decref(prev); wined3d_device_context_unbind_srv_for_rtv(context, view, TRUE); out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); return WINED3D_OK; }
@@ -2292,7 +2292,7 @@ void CDECL wined3d_device_context_set_predication(struct wined3d_device_context
TRACE("context %p, predicate %p, value %#x.\n", context, predicate, value);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); prev = state->predicate; if (predicate) { @@ -2304,7 +2304,7 @@ void CDECL wined3d_device_context_set_predication(struct wined3d_device_context wined3d_device_context_emit_set_predication(context, predicate, value); if (prev) wined3d_query_decref(prev); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
HRESULT CDECL wined3d_device_context_set_stream_sources(struct wined3d_device_context *context, @@ -2332,7 +2332,7 @@ HRESULT CDECL wined3d_device_context_set_stream_sources(struct wined3d_device_co } }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); if (!memcmp(streams, &state->streams[start_idx], count * sizeof(*streams))) goto out;
@@ -2350,7 +2350,7 @@ HRESULT CDECL wined3d_device_context_set_stream_sources(struct wined3d_device_co wined3d_buffer_decref(prev); } out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); return WINED3D_OK; }
@@ -2365,7 +2365,7 @@ void CDECL wined3d_device_context_set_index_buffer(struct wined3d_device_context TRACE("context %p, buffer %p, format %s, offset %u.\n", context, buffer, debug_d3dformat(format_id), offset);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); prev_buffer = state->index_buffer; prev_format = state->index_format; prev_offset = state->index_offset; @@ -2382,7 +2382,7 @@ void CDECL wined3d_device_context_set_index_buffer(struct wined3d_device_context if (prev_buffer) wined3d_buffer_decref(prev_buffer); out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_vertex_declaration(struct wined3d_device_context *context, @@ -2393,7 +2393,7 @@ void CDECL wined3d_device_context_set_vertex_declaration(struct wined3d_device_c
TRACE("context %p, declaration %p.\n", context, declaration);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); prev = state->vertex_declaration; if (declaration == prev) goto out; @@ -2405,7 +2405,7 @@ void CDECL wined3d_device_context_set_vertex_declaration(struct wined3d_device_c if (prev) wined3d_vertex_declaration_decref(prev); out: - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_set_stream_outputs(struct wined3d_device_context *context, @@ -2416,7 +2416,7 @@ void CDECL wined3d_device_context_set_stream_outputs(struct wined3d_device_conte
TRACE("context %p, outputs %p.\n", context, outputs);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_set_stream_outputs(context, outputs); for (i = 0; i < WINED3D_MAX_STREAM_OUTPUT_BUFFERS; ++i) { @@ -2429,7 +2429,7 @@ void CDECL wined3d_device_context_set_stream_outputs(struct wined3d_device_conte if (prev_buffer) wined3d_buffer_decref(prev_buffer); } - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_draw(struct wined3d_device_context *context, unsigned int start_vertex, @@ -2440,10 +2440,10 @@ void CDECL wined3d_device_context_draw(struct wined3d_device_context *context, u TRACE("context %p, start_vertex %u, vertex_count %u, start_instance %u, instance_count %u.\n", context, start_vertex, vertex_count, start_instance, instance_count);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_draw(context, state->primitive_type, state->patch_vertex_count, 0, start_vertex, vertex_count, start_instance, instance_count, false); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_draw_indexed(struct wined3d_device_context *context, int base_vertex_index, @@ -2454,10 +2454,10 @@ void CDECL wined3d_device_context_draw_indexed(struct wined3d_device_context *co TRACE("context %p, base_vertex_index %d, start_index %u, index_count %u, start_instance %u, instance_count %u.\n", context, base_vertex_index, start_index, index_count, start_instance, instance_count);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_draw(context, state->primitive_type, state->patch_vertex_count, base_vertex_index, start_index, index_count, start_instance, instance_count, true); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_get_constant_buffer(const struct wined3d_device_context *context, @@ -4150,10 +4150,10 @@ void CDECL wined3d_device_context_set_primitive_type(struct wined3d_device_conte TRACE("context %p, primitive_type %s, patch_vertex_count %u.\n", context, debug_d3dprimitivetype(primitive_type), patch_vertex_count);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); state->primitive_type = primitive_type; state->patch_vertex_count = patch_vertex_count; - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_get_primitive_type(const struct wined3d_device_context *context, @@ -4471,9 +4471,9 @@ void CDECL wined3d_device_context_copy_uav_counter(struct wined3d_device_context TRACE("context %p, dst_buffer %p, offset %u, uav %p.\n", context, dst_buffer, offset, uav);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_copy_uav_counter(context, dst_buffer, offset, uav); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
static bool resources_format_compatible(const struct wined3d_resource *src_resource, @@ -4548,10 +4548,10 @@ void CDECL wined3d_device_context_copy_resource(struct wined3d_device_context *c if (dst_resource->type == WINED3D_RTYPE_BUFFER) { wined3d_box_set(&src_box, 0, 0, src_resource->size, 1, 0, 1); - wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_blt_sub_resource(context, dst_resource, 0, &src_box, src_resource, 0, &src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); return; }
@@ -4567,7 +4567,7 @@ void CDECL wined3d_device_context_copy_resource(struct wined3d_device_context *c return; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); for (i = 0; i < dst_texture->level_count; ++i) { wined3d_texture_get_level_box(src_texture, i, &src_box); @@ -4580,7 +4580,7 @@ void CDECL wined3d_device_context_copy_resource(struct wined3d_device_context *c src_resource, idx, &src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); } } - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
HRESULT CDECL wined3d_device_context_copy_sub_resource_region(struct wined3d_device_context *context, @@ -4737,10 +4737,10 @@ HRESULT CDECL wined3d_device_context_copy_sub_resource_region(struct wined3d_dev } }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_blt_sub_resource(context, dst_resource, dst_sub_resource_idx, &dst_box, src_resource, src_sub_resource_idx, src_box, WINED3D_BLT_RAW, NULL, WINED3D_TEXF_POINT); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context);
return WINED3D_OK; } @@ -4780,10 +4780,10 @@ void CDECL wined3d_device_context_update_sub_resource(struct wined3d_device_cont return; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_update_sub_resource(context, resource, sub_resource_idx, box, data, row_pitch, depth_pitch); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_resolve_sub_resource(struct wined3d_device_context *context, @@ -4820,7 +4820,7 @@ void CDECL wined3d_device_context_resolve_sub_resource(struct wined3d_device_con return; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); fx.resolve_format_id = format_id;
dst_texture = texture_from_resource(dst_resource); @@ -4834,7 +4834,7 @@ void CDECL wined3d_device_context_resolve_sub_resource(struct wined3d_device_con wined3d_texture_get_level_height(src_texture, src_level)); wined3d_device_context_blt(context, dst_texture, dst_sub_resource_idx, &dst_rect, src_texture, src_sub_resource_idx, &src_rect, 0, &fx, WINED3D_TEXF_POINT); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
HRESULT CDECL wined3d_device_context_clear_rendertarget_view(struct wined3d_device_context *context, @@ -4871,9 +4871,9 @@ HRESULT CDECL wined3d_device_context_clear_rendertarget_view(struct wined3d_devi return hr; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_clear_rendertarget_view(context, view, rect, flags, color, depth, stencil); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context);
return WINED3D_OK; } @@ -4889,9 +4889,9 @@ void CDECL wined3d_device_context_clear_uav_float(struct wined3d_device_context return; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_clear_uav(context, view, (const struct wined3d_uvec4 *)clear_value, true); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_clear_uav_uint(struct wined3d_device_context *context, @@ -4899,9 +4899,9 @@ void CDECL wined3d_device_context_clear_uav_uint(struct wined3d_device_context * { TRACE("context %p, view %p, clear_value %s.\n", context, view, debug_uvec4(clear_value));
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_clear_uav(context, view, clear_value, false); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
static unsigned int sanitise_map_flags(const struct wined3d_resource *resource, unsigned int flags) @@ -4989,9 +4989,9 @@ HRESULT CDECL wined3d_device_context_map(struct wined3d_device_context *context, return WINED3DERR_INVALIDCALL; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); hr = wined3d_device_context_emit_map(context, resource, sub_resource_idx, map_desc, box, flags); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); return hr; }
@@ -5001,9 +5001,9 @@ HRESULT CDECL wined3d_device_context_unmap(struct wined3d_device_context *contex HRESULT hr; TRACE("context %p, resource %p, sub_resource_idx %u.\n", context, resource, sub_resource_idx);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); hr = wined3d_device_context_emit_unmap(context, resource, sub_resource_idx); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); return hr; }
@@ -5012,9 +5012,9 @@ void CDECL wined3d_device_context_issue_query(struct wined3d_device_context *con { TRACE("context %p, query %p, flags %#x.\n", context, query, flags);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); context->ops->issue_query(context, query, flags); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
void CDECL wined3d_device_context_execute_command_list(struct wined3d_device_context *context, @@ -5022,9 +5022,9 @@ void CDECL wined3d_device_context_execute_command_list(struct wined3d_device_con { TRACE("context %p, list %p, restore_state %d.\n", context, list, restore_state);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_execute_command_list(context, list, restore_state); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
struct wined3d_rendertarget_view * CDECL wined3d_device_context_get_rendertarget_view( @@ -5072,9 +5072,9 @@ void CDECL wined3d_device_context_generate_mipmaps(struct wined3d_device_context return; }
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); wined3d_device_context_emit_generate_mipmaps(context, view); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined3d_device *device, @@ -5298,9 +5298,9 @@ void CDECL wined3d_device_context_flush(struct wined3d_device_context *context) { TRACE("context %p.\n", context);
- wined3d_mutex_lock(); + wined3d_device_context_lock(context); context->ops->flush(context); - wined3d_mutex_unlock(); + wined3d_device_context_unlock(context); }
static void update_swapchain_flags(struct wined3d_texture *texture) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 161d36ad76c..c040a5e0f69 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4799,8 +4799,25 @@ struct wined3d_device_context const struct wined3d_device_context_ops *ops; struct wined3d_device *device; struct wined3d_state *state; + CRITICAL_SECTION *lock; };
+static inline void wined3d_device_context_lock(struct wined3d_device_context *context) +{ + if (context->lock) + EnterCriticalSection(context->lock); + else + wined3d_mutex_lock(); +} + +static inline void wined3d_device_context_unlock(struct wined3d_device_context *context) +{ + if (context->lock) + LeaveCriticalSection(context->lock); + else + wined3d_mutex_unlock(); +} + struct wined3d_cs { struct wined3d_device_context c;
On Fri, 15 Oct 2021 at 14:27, Jan Sikorski jsikorski@codeweavers.com wrote:
dlls/wined3d/cs.c | 23 +++-- dlls/wined3d/device.c | 152 ++++++++++++++++----------------- dlls/wined3d/wined3d_private.h | 17 ++++ 3 files changed, 107 insertions(+), 85 deletions(-)
Is that safe at this stage? For example, calling d3d11_device_context_OMGetRenderTargets() on a deferred context would now use wined3d_mutex_lock()/wined3d_mutex_unlock(), while calling d3d11_device_context_OMSetRenderTargets() for that same context would use the lock specific to that context.
On 19 Oct 2021, at 15:56, Henri Verbeet hverbeet@gmail.com wrote:
On Fri, 15 Oct 2021 at 14:27, Jan Sikorski jsikorski@codeweavers.com wrote:
dlls/wined3d/cs.c | 23 +++-- dlls/wined3d/device.c | 152 ++++++++++++++++----------------- dlls/wined3d/wined3d_private.h | 17 ++++ 3 files changed, 107 insertions(+), 85 deletions(-)
Is that safe at this stage? For example, calling d3d11_device_context_OMGetRenderTargets() on a deferred context would now use wined3d_mutex_lock()/wined3d_mutex_unlock(), while calling d3d11_device_context_OMSetRenderTargets() for that same context would use the lock specific to that context.
Right, that’s a good point (and also why I previously thought of taking a shared lock on the global mutex when locking deferred contexts, which somehow escaped me later). Although with getters I suppose it’s mostly a matter of getting back a consistent view of the state. On the other hand, do we even expect that to be thread safe? MS docs say (in the Introduction to Multithreading in Direct3D 11) that the use of a device context is supposed to be externally synchronized. Other parts of the multi threading section also indicate that command list generation is single threaded only. If that’s the case, I guess we could drop device context locking altogether, or do it for the immediate context only, as at least Direct3D 10 still needs it.
- Jan
On Tue, 19 Oct 2021 at 16:28, Jan Sikorski jsikorski@codeweavers.com wrote:
On 19 Oct 2021, at 15:56, Henri Verbeet hverbeet@gmail.com wrote: On Fri, 15 Oct 2021 at 14:27, Jan Sikorski jsikorski@codeweavers.com wrote:
dlls/wined3d/cs.c | 23 +++-- dlls/wined3d/device.c | 152 ++++++++++++++++----------------- dlls/wined3d/wined3d_private.h | 17 ++++ 3 files changed, 107 insertions(+), 85 deletions(-)
Is that safe at this stage? For example, calling d3d11_device_context_OMGetRenderTargets() on a deferred context would now use wined3d_mutex_lock()/wined3d_mutex_unlock(), while calling d3d11_device_context_OMSetRenderTargets() for that same context would use the lock specific to that context.
Right, that’s a good point (and also why I previously thought of taking a shared lock on the global mutex when locking deferred contexts, which somehow escaped me later). Although with getters I suppose it’s mostly a matter of getting back a consistent view of the state. On the other hand, do we even expect that to be thread safe? MS docs say (in the Introduction to Multithreading in Direct3D 11) that the use of a device context is supposed to be externally synchronized. Other parts of the multi threading section also indicate that command list generation is single threaded only. If that’s the case, I guess we could drop device context locking altogether, or do it for the immediate context only, as at least Direct3D 10 still needs it.
The concern would be callers getting back a consistent view of the state, yes. I'm not sure what Direct3D 10/11 actually guarantees. It's perhaps worth pointing out though that it's not unheard of for applications to depend on what the implementation does in practice, instead of on what the documentation guarantees.
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/ddraw/vertexbuffer.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/dlls/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index 584d9d162b9..dd35b445cc5 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -214,11 +214,7 @@ static HRESULT WINAPI d3d_vertex_buffer7_Unlock(IDirect3DVertexBuffer7 *iface) struct d3d_vertex_buffer *buffer = impl_from_IDirect3DVertexBuffer7(iface);
TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); wined3d_resource_unmap(wined3d_buffer_get_resource(buffer->wined3d_buffer), 0); - wined3d_mutex_unlock(); - return D3D_OK; }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/dxgi/surface.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/dlls/dxgi/surface.c b/dlls/dxgi/surface.c index 4b1b83b84a9..ad2c0d7ff1e 100644 --- a/dlls/dxgi/surface.c +++ b/dlls/dxgi/surface.c @@ -196,14 +196,12 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_Map(IDXGISurface1 *iface, DXGI_MAP if (flags & DXGI_MAP_DISCARD) wined3d_map_flags |= WINED3D_MAP_DISCARD;
- wined3d_mutex_lock(); if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), 0, &wined3d_map_desc, NULL, wined3d_map_flags))) { mapped_rect->Pitch = wined3d_map_desc.row_pitch; mapped_rect->pBits = wined3d_map_desc.data; } - wined3d_mutex_unlock();
return hr; } @@ -213,11 +211,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_Unmap(IDXGISurface1 *iface) struct dxgi_surface *surface = impl_from_IDXGISurface1(iface);
TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), 0); - wined3d_mutex_unlock(); - return S_OK; }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/dxgi/factory.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index af18bdd2c32..4c3e3cf0f34 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -80,9 +80,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IWineDXGIFactory *iface) if (factory->device_window) DestroyWindow(factory->device_window);
- wined3d_mutex_lock(); wined3d_decref(factory->wined3d); - wined3d_mutex_unlock(); wined3d_private_store_cleanup(&factory->private_store); heap_free(factory); }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d8/buffer.c | 8 -------- dlls/d3d8/surface.c | 2 -- dlls/d3d8/volume.c | 4 ---- 3 files changed, 14 deletions(-)
diff --git a/dlls/d3d8/buffer.c b/dlls/d3d8/buffer.c index 9eb98bfc2f2..6ab21512472 100644 --- a/dlls/d3d8/buffer.c +++ b/dlls/d3d8/buffer.c @@ -198,11 +198,9 @@ static HRESULT WINAPI d3d8_vertexbuffer_Lock(IDirect3DVertexBuffer8 *iface, UINT
wined3d_box.left = offset; wined3d_box.right = offset + size; - wined3d_mutex_lock(); wined3d_resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); hr = wined3d_resource_map(wined3d_resource, 0, &wined3d_map_desc, &wined3d_box, wined3dmapflags_from_d3dmapflags(flags, buffer->usage)); - wined3d_mutex_unlock(); *data = wined3d_map_desc.data;
return hr; @@ -214,9 +212,7 @@ static HRESULT WINAPI d3d8_vertexbuffer_Unlock(IDirect3DVertexBuffer8 *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); wined3d_resource_unmap(wined3d_buffer_get_resource(buffer->wined3d_buffer), 0); - wined3d_mutex_unlock();
return D3D_OK; } @@ -529,11 +525,9 @@ static HRESULT WINAPI d3d8_indexbuffer_Lock(IDirect3DIndexBuffer8 *iface, UINT o
wined3d_box.left = offset; wined3d_box.right = offset + size; - wined3d_mutex_lock(); wined3d_resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); hr = wined3d_resource_map(wined3d_resource, 0, &wined3d_map_desc, &wined3d_box, wined3dmapflags_from_d3dmapflags(flags, buffer->usage)); - wined3d_mutex_unlock(); *data = wined3d_map_desc.data;
return hr; @@ -545,9 +539,7 @@ static HRESULT WINAPI d3d8_indexbuffer_Unlock(IDirect3DIndexBuffer8 *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); wined3d_resource_unmap(wined3d_buffer_get_resource(buffer->wined3d_buffer), 0); - wined3d_mutex_unlock();
return D3D_OK; } diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index c3d28efba20..5fd8cf4d44b 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -269,9 +269,7 @@ static HRESULT WINAPI d3d8_surface_UnlockRect(IDirect3DSurface8 *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); - wined3d_mutex_unlock();
if (hr == WINEDDERR_NOTLOCKED) { diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c index 9dc68e850d4..6d0d6f7cb22 100644 --- a/dlls/d3d8/volume.c +++ b/dlls/d3d8/volume.c @@ -144,12 +144,10 @@ static HRESULT WINAPI d3d8_volume_LockBox(IDirect3DVolume8 *iface, TRACE("iface %p, locked_box %p, box %p, flags %#x.\n", iface, locked_box, box, flags);
- wined3d_mutex_lock(); if (FAILED(hr = wined3d_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, &map_desc, (const struct wined3d_box *)box, wined3dmapflags_from_d3dmapflags(flags, 0)))) map_desc.data = NULL; - wined3d_mutex_unlock();
locked_box->RowPitch = map_desc.row_pitch; locked_box->SlicePitch = map_desc.slice_pitch; @@ -167,9 +165,7 @@ static HRESULT WINAPI d3d8_volume_UnlockBox(IDirect3DVolume8 *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); - wined3d_mutex_unlock();
if (hr == WINEDDERR_NOTLOCKED) return D3DERR_INVALIDCALL;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d8/buffer.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/dlls/d3d8/buffer.c b/dlls/d3d8/buffer.c index 6ab21512472..0692dbde6e7 100644 --- a/dlls/d3d8/buffer.c +++ b/dlls/d3d8/buffer.c @@ -54,12 +54,10 @@ static ULONG WINAPI d3d8_vertexbuffer_AddRef(IDirect3DVertexBuffer8 *iface) if (refcount == 1) { IDirect3DDevice8_AddRef(buffer->parent_device); - wined3d_mutex_lock(); if (buffer->draw_buffer) wined3d_buffer_incref(buffer->draw_buffer); else wined3d_buffer_incref(buffer->wined3d_buffer); - wined3d_mutex_unlock(); }
return refcount; @@ -77,12 +75,10 @@ static ULONG WINAPI d3d8_vertexbuffer_Release(IDirect3DVertexBuffer8 *iface) struct wined3d_buffer *draw_buffer = buffer->draw_buffer; IDirect3DDevice8 *device = buffer->parent_device;
- wined3d_mutex_lock(); if (draw_buffer) wined3d_buffer_decref(draw_buffer); else wined3d_buffer_decref(buffer->wined3d_buffer); - wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */ IDirect3DDevice8_Release(device); @@ -381,12 +377,10 @@ static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface) if (refcount == 1) { IDirect3DDevice8_AddRef(buffer->parent_device); - wined3d_mutex_lock(); if (buffer->draw_buffer) wined3d_buffer_incref(buffer->draw_buffer); else wined3d_buffer_incref(buffer->wined3d_buffer); - wined3d_mutex_unlock(); }
return refcount; @@ -404,12 +398,10 @@ static ULONG WINAPI d3d8_indexbuffer_Release(IDirect3DIndexBuffer8 *iface) struct wined3d_buffer *draw_buffer = buffer->draw_buffer; IDirect3DDevice8 *device = buffer->parent_device;
- wined3d_mutex_lock(); if (draw_buffer) wined3d_buffer_decref(draw_buffer); else wined3d_buffer_decref(buffer->wined3d_buffer); - wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */ IDirect3DDevice8_Release(device);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d8/surface.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c index 5fd8cf4d44b..62c3a429ba6 100644 --- a/dlls/d3d8/surface.c +++ b/dlls/d3d8/surface.c @@ -66,11 +66,9 @@ static ULONG WINAPI d3d8_surface_AddRef(IDirect3DSurface8 *iface) { if (surface->parent_device) IDirect3DDevice8_AddRef(surface->parent_device); - wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_incref(surface->wined3d_rtv); wined3d_texture_incref(surface->wined3d_texture); - wined3d_mutex_unlock(); }
return refcount; @@ -102,11 +100,9 @@ static ULONG WINAPI d3d8_surface_Release(IDirect3DSurface8 *iface) { IDirect3DDevice8 *parent_device = surface->parent_device;
- wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_decref(surface->wined3d_rtv); wined3d_texture_decref(surface->wined3d_texture); - wined3d_mutex_unlock();
if (parent_device) IDirect3DDevice8_Release(parent_device);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d9/buffer.c | 8 -------- dlls/d3d9/surface.c | 2 -- dlls/d3d9/volume.c | 4 ---- 3 files changed, 14 deletions(-)
diff --git a/dlls/d3d9/buffer.c b/dlls/d3d9/buffer.c index 07bdfa9320e..901557c288f 100644 --- a/dlls/d3d9/buffer.c +++ b/dlls/d3d9/buffer.c @@ -199,11 +199,9 @@ static HRESULT WINAPI d3d9_vertexbuffer_Lock(IDirect3DVertexBuffer9 *iface, UINT
wined3d_box_set(&wined3d_box, offset, 0, offset + size, 1, 0, 1);
- wined3d_mutex_lock(); wined3d_resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); hr = wined3d_resource_map(wined3d_resource, 0, &wined3d_map_desc, &wined3d_box, wined3dmapflags_from_d3dmapflags(flags, buffer->usage)); - wined3d_mutex_unlock(); *data = wined3d_map_desc.data;
return hr; @@ -215,9 +213,7 @@ static HRESULT WINAPI d3d9_vertexbuffer_Unlock(IDirect3DVertexBuffer9 *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); wined3d_resource_unmap(wined3d_buffer_get_resource(buffer->wined3d_buffer), 0); - wined3d_mutex_unlock();
return D3D_OK; } @@ -535,11 +531,9 @@ static HRESULT WINAPI d3d9_indexbuffer_Lock(IDirect3DIndexBuffer9 *iface,
wined3d_box_set(&wined3d_box, offset, 0, offset + size, 1, 0, 1);
- wined3d_mutex_lock(); wined3d_resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); hr = wined3d_resource_map(wined3d_resource, 0, &wined3d_map_desc, &wined3d_box, wined3dmapflags_from_d3dmapflags(flags, buffer->usage)); - wined3d_mutex_unlock(); *data = wined3d_map_desc.data;
return hr; @@ -551,9 +545,7 @@ static HRESULT WINAPI d3d9_indexbuffer_Unlock(IDirect3DIndexBuffer9 *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); wined3d_resource_unmap(wined3d_buffer_get_resource(buffer->wined3d_buffer), 0); - wined3d_mutex_unlock();
return D3D_OK; } diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index d4738d2ca9f..2ff5134781e 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -246,10 +246,8 @@ static HRESULT WINAPI d3d9_surface_LockRect(IDirect3DSurface9 *iface, if (rect) wined3d_box_set(&box, rect->left, rect->top, rect->right, rect->bottom, 0, 1);
- wined3d_mutex_lock(); hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, &map_desc, rect ? &box : NULL, wined3dmapflags_from_d3dmapflags(flags, 0)); - wined3d_mutex_unlock();
if (SUCCEEDED(hr)) { diff --git a/dlls/d3d9/volume.c b/dlls/d3d9/volume.c index 39caa8fb08e..e8091aec7a5 100644 --- a/dlls/d3d9/volume.c +++ b/dlls/d3d9/volume.c @@ -144,12 +144,10 @@ static HRESULT WINAPI d3d9_volume_LockBox(IDirect3DVolume9 *iface, TRACE("iface %p, locked_box %p, box %p, flags %#x.\n", iface, locked_box, box, flags);
- wined3d_mutex_lock(); if (FAILED(hr = wined3d_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, &map_desc, (const struct wined3d_box *)box, wined3dmapflags_from_d3dmapflags(flags, 0)))) map_desc.data = NULL; - wined3d_mutex_unlock();
locked_box->RowPitch = map_desc.row_pitch; locked_box->SlicePitch = map_desc.slice_pitch; @@ -167,9 +165,7 @@ static HRESULT WINAPI d3d9_volume_UnlockBox(IDirect3DVolume9 *iface)
TRACE("iface %p.\n", iface);
- wined3d_mutex_lock(); hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); - wined3d_mutex_unlock();
if (hr == WINEDDERR_NOTLOCKED) return D3DERR_INVALIDCALL;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d8/vertexdeclaration.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d8/vertexdeclaration.c b/dlls/d3d8/vertexdeclaration.c index d0e733b9e37..e63e379444e 100644 --- a/dlls/d3d8/vertexdeclaration.c +++ b/dlls/d3d8/vertexdeclaration.c @@ -319,9 +319,7 @@ void d3d8_vertex_declaration_destroy(struct d3d8_vertex_declaration *declaration { TRACE("declaration %p.\n", declaration);
- wined3d_mutex_lock(); wined3d_vertex_declaration_decref(declaration->wined3d_vertex_declaration); - wined3d_mutex_unlock(); }
static const struct wined3d_parent_ops d3d8_vertexdeclaration_wined3d_parent_ops =
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d9/device.c | 4 ---- dlls/d3d9/directx.c | 2 -- dlls/d3d9/query.c | 3 --- dlls/d3d9/shader.c | 12 ------------ dlls/d3d9/stateblock.c | 2 -- dlls/d3d9/vertexdeclaration.c | 4 ---- 6 files changed, 27 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 1a1bc5ddb6c..ac6a7054838 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2553,9 +2553,7 @@ static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDire
if (!(object = heap_alloc_zero(sizeof(*object)))) { - wined3d_mutex_lock(); wined3d_stateblock_decref(wined3d_stateblock); - wined3d_mutex_unlock(); return E_OUTOFMEMORY; }
@@ -2563,9 +2561,7 @@ static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDire if (FAILED(hr)) { WARN("Failed to initialize stateblock, hr %#x.\n", hr); - wined3d_mutex_lock(); wined3d_stateblock_decref(wined3d_stateblock); - wined3d_mutex_unlock(); heap_free(object); return hr; } diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index e176483f43e..a1ebc986226 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -81,9 +81,7 @@ static ULONG WINAPI d3d9_Release(IDirect3D9Ex *iface)
if (!refcount) { - wined3d_mutex_lock(); wined3d_decref(d3d9->wined3d); - wined3d_mutex_unlock();
heap_free(d3d9->wined3d_outputs); heap_free(d3d9); diff --git a/dlls/d3d9/query.c b/dlls/d3d9/query.c index 207ad55e5a1..450a58091fa 100644 --- a/dlls/d3d9/query.c +++ b/dlls/d3d9/query.c @@ -76,10 +76,7 @@ static ULONG WINAPI d3d9_query_Release(IDirect3DQuery9 *iface)
if (!refcount) { - wined3d_mutex_lock(); wined3d_query_decref(query->wined3d_query); - wined3d_mutex_unlock(); - IDirect3DDevice9Ex_Release(query->parent_device); heap_free(query); } diff --git a/dlls/d3d9/shader.c b/dlls/d3d9/shader.c index 838c7de2cf0..042f8498321 100644 --- a/dlls/d3d9/shader.c +++ b/dlls/d3d9/shader.c @@ -54,9 +54,7 @@ static ULONG WINAPI d3d9_vertexshader_AddRef(IDirect3DVertexShader9 *iface) if (refcount == 1) { IDirect3DDevice9Ex_AddRef(shader->parent_device); - wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); - wined3d_mutex_unlock(); }
return refcount; @@ -72,11 +70,7 @@ static ULONG WINAPI d3d9_vertexshader_Release(IDirect3DVertexShader9 *iface) if (!refcount) { IDirect3DDevice9Ex *device = shader->parent_device; - - wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); - wined3d_mutex_unlock(); - /* Release the device last, as it may cause the device to be destroyed. */ IDirect3DDevice9Ex_Release(device); } @@ -203,9 +197,7 @@ static ULONG WINAPI d3d9_pixelshader_AddRef(IDirect3DPixelShader9 *iface) if (refcount == 1) { IDirect3DDevice9Ex_AddRef(shader->parent_device); - wined3d_mutex_lock(); wined3d_shader_incref(shader->wined3d_shader); - wined3d_mutex_unlock(); }
return refcount; @@ -221,11 +213,7 @@ static ULONG WINAPI d3d9_pixelshader_Release(IDirect3DPixelShader9 *iface) if (!refcount) { IDirect3DDevice9Ex *device = shader->parent_device; - - wined3d_mutex_lock(); wined3d_shader_decref(shader->wined3d_shader); - wined3d_mutex_unlock(); - /* Release the device last, as it may cause the device to be destroyed. */ IDirect3DDevice9Ex_Release(device); } diff --git a/dlls/d3d9/stateblock.c b/dlls/d3d9/stateblock.c index 3c1e3230095..c797ce54b49 100644 --- a/dlls/d3d9/stateblock.c +++ b/dlls/d3d9/stateblock.c @@ -66,9 +66,7 @@ static ULONG WINAPI d3d9_stateblock_Release(IDirect3DStateBlock9 *iface)
if (!refcount) { - wined3d_mutex_lock(); wined3d_stateblock_decref(stateblock->wined3d_stateblock); - wined3d_mutex_unlock();
IDirect3DDevice9Ex_Release(stateblock->parent_device); heap_free(stateblock); diff --git a/dlls/d3d9/vertexdeclaration.c b/dlls/d3d9/vertexdeclaration.c index 60701a9a910..1ddc0cbc1ca 100644 --- a/dlls/d3d9/vertexdeclaration.c +++ b/dlls/d3d9/vertexdeclaration.c @@ -225,9 +225,7 @@ static ULONG WINAPI d3d9_vertex_declaration_AddRef(IDirect3DVertexDeclaration9 * if (refcount == 1) { IDirect3DDevice9Ex_AddRef(declaration->parent_device); - wined3d_mutex_lock(); wined3d_vertex_declaration_incref(declaration->wined3d_declaration); - wined3d_mutex_unlock(); }
return refcount; @@ -243,9 +241,7 @@ static ULONG WINAPI d3d9_vertex_declaration_Release(IDirect3DVertexDeclaration9 if (!refcount) { IDirect3DDevice9Ex *parent_device = declaration->parent_device; - wined3d_mutex_lock(); wined3d_vertex_declaration_decref(declaration->wined3d_declaration); - wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */ IDirect3DDevice9Ex_Release(parent_device);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d9/buffer.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/dlls/d3d9/buffer.c b/dlls/d3d9/buffer.c index 901557c288f..bcb97011fe5 100644 --- a/dlls/d3d9/buffer.c +++ b/dlls/d3d9/buffer.c @@ -56,12 +56,10 @@ static ULONG WINAPI d3d9_vertexbuffer_AddRef(IDirect3DVertexBuffer9 *iface) if (refcount == 1) { IDirect3DDevice9Ex_AddRef(buffer->parent_device); - wined3d_mutex_lock(); if (buffer->draw_buffer) wined3d_buffer_incref(buffer->draw_buffer); else wined3d_buffer_incref(buffer->wined3d_buffer); - wined3d_mutex_unlock(); }
return refcount; @@ -79,12 +77,10 @@ static ULONG WINAPI d3d9_vertexbuffer_Release(IDirect3DVertexBuffer9 *iface) struct wined3d_buffer *draw_buffer = buffer->draw_buffer; IDirect3DDevice9Ex *device = buffer->parent_device;
- wined3d_mutex_lock(); if (draw_buffer) wined3d_buffer_decref(draw_buffer); else wined3d_buffer_decref(buffer->wined3d_buffer); - wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */ IDirect3DDevice9Ex_Release(device); @@ -388,12 +384,10 @@ static ULONG WINAPI d3d9_indexbuffer_AddRef(IDirect3DIndexBuffer9 *iface) if (refcount == 1) { IDirect3DDevice9Ex_AddRef(buffer->parent_device); - wined3d_mutex_lock(); if (buffer->draw_buffer) wined3d_buffer_incref(buffer->draw_buffer); else wined3d_buffer_incref(buffer->wined3d_buffer); - wined3d_mutex_unlock(); }
return refcount; @@ -411,12 +405,10 @@ static ULONG WINAPI d3d9_indexbuffer_Release(IDirect3DIndexBuffer9 *iface) struct wined3d_buffer *draw_buffer = buffer->draw_buffer; IDirect3DDevice9Ex *device = buffer->parent_device;
- wined3d_mutex_lock(); if (draw_buffer) wined3d_buffer_decref(draw_buffer); else wined3d_buffer_decref(buffer->wined3d_buffer); - wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */ IDirect3DDevice9Ex_Release(device);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d9/query.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/dlls/d3d9/query.c b/dlls/d3d9/query.c index 450a58091fa..b539e22b957 100644 --- a/dlls/d3d9/query.c +++ b/dlls/d3d9/query.c @@ -123,15 +123,8 @@ static DWORD WINAPI d3d9_query_GetDataSize(IDirect3DQuery9 *iface) static HRESULT WINAPI d3d9_query_Issue(IDirect3DQuery9 *iface, DWORD flags) { struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); - HRESULT hr; - TRACE("iface %p, flags %#x.\n", iface, flags); - - wined3d_mutex_lock(); - hr = wined3d_query_issue(query->wined3d_query, flags); - wined3d_mutex_unlock(); - - return hr; + return wined3d_query_issue(query->wined3d_query, flags); }
static HRESULT WINAPI d3d9_query_GetData(IDirect3DQuery9 *iface, void *data, DWORD size, DWORD flags)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d9/surface.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c index 2ff5134781e..175fa6269cc 100644 --- a/dlls/d3d9/surface.c +++ b/dlls/d3d9/surface.c @@ -67,11 +67,9 @@ static ULONG WINAPI d3d9_surface_AddRef(IDirect3DSurface9 *iface) { if (surface->parent_device) IDirect3DDevice9Ex_AddRef(surface->parent_device); - wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_incref(surface->wined3d_rtv); wined3d_texture_incref(surface->wined3d_texture); - wined3d_mutex_unlock(); }
return refcount; @@ -103,11 +101,9 @@ static ULONG WINAPI d3d9_surface_Release(IDirect3DSurface9 *iface) { IDirect3DDevice9Ex *parent_device = surface->parent_device;
- wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_decref(surface->wined3d_rtv); wined3d_texture_decref(surface->wined3d_texture); - wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */ if (parent_device)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com