Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2a1186db
Commit
2a1186db
authored
Sep 17, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Sep 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Add locking around remaining wined3d calls.
parent
0eefb935
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
3 deletions
+31
-3
device.c
dlls/dxgi/device.c
+10
-2
factory.c
dlls/dxgi/factory.c
+2
-0
surface.c
dlls/dxgi/surface.c
+2
-0
swapchain.c
dlls/dxgi/swapchain.c
+17
-1
No files found.
dlls/dxgi/device.c
View file @
2a1186db
...
...
@@ -194,6 +194,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
surface_desc
.
depth
=
1
;
surface_desc
.
size
=
0
;
wined3d_mutex_lock
();
memset
(
surface
,
0
,
surface_count
*
sizeof
(
*
surface
));
for
(
i
=
0
;
i
<
surface_count
;
++
i
)
{
...
...
@@ -218,11 +219,13 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IWineDXGIDevice *ifac
TRACE
(
"Created IDXGISurface %p (%u/%u)
\n
"
,
surface
[
i
],
i
+
1
,
surface_count
);
}
wined3d_mutex_unlock
();
IWineDXGIDeviceParent_Release
(
dxgi_device_parent
);
return
S_OK
;
fail:
wined3d_mutex_unlock
();
for
(
j
=
0
;
j
<
i
;
++
j
)
{
IDXGISurface_Release
(
surface
[
i
]);
...
...
@@ -364,6 +367,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
device
->
IWineDXGIDevice_iface
.
lpVtbl
=
&
dxgi_device_vtbl
;
device
->
refcount
=
1
;
wined3d_mutex_lock
();
wined3d_private_store_init
(
&
device
->
private_store
);
layer_base
=
device
+
1
;
...
...
@@ -373,6 +377,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
{
WARN
(
"Failed to create device, returning %#x.
\n
"
,
hr
);
wined3d_private_store_cleanup
(
&
device
->
private_store
);
wined3d_mutex_unlock
();
return
hr
;
}
...
...
@@ -382,6 +387,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
ERR
(
"DXGI device should implement IWineD3DDeviceParent.
\n
"
);
IUnknown_Release
(
device
->
child_layer
);
wined3d_private_store_cleanup
(
&
device
->
private_store
);
wined3d_mutex_unlock
();
return
hr
;
}
wined3d_device_parent
=
IWineDXGIDeviceParent_get_wined3d_device_parent
(
dxgi_device_parent
);
...
...
@@ -397,18 +403,18 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
hr
=
E_FAIL
;
IUnknown_Release
(
device
->
child_layer
);
wined3d_private_store_cleanup
(
&
device
->
private_store
);
wined3d_mutex_unlock
();
return
hr
;
}
wined3d_mutex_lock
();
hr
=
wined3d_device_create
(
dxgi_factory
->
wined3d
,
dxgi_adapter
->
ordinal
,
WINED3D_DEVICE_TYPE_HAL
,
NULL
,
0
,
4
,
wined3d_device_parent
,
&
device
->
wined3d_device
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create a wined3d device, returning %#x.
\n
"
,
hr
);
IUnknown_Release
(
device
->
child_layer
);
wined3d_private_store_cleanup
(
&
device
->
private_store
);
wined3d_mutex_unlock
();
return
hr
;
}
...
...
@@ -422,8 +428,10 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
wined3d_device_decref
(
device
->
wined3d_device
);
IUnknown_Release
(
device
->
child_layer
);
wined3d_private_store_cleanup
(
&
device
->
private_store
);
wined3d_mutex_unlock
();
return
hr
;
}
wined3d_mutex_unlock
();
device
->
factory
=
&
dxgi_factory
->
IDXGIFactory1_iface
;
IDXGIFactory1_AddRef
(
device
->
factory
);
...
...
dlls/dxgi/factory.c
View file @
2a1186db
...
...
@@ -253,7 +253,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory1 *ifa
return
hr
;
}
wined3d_mutex_lock
();
*
swapchain
=
wined3d_swapchain_get_parent
(
wined3d_swapchain
);
wined3d_mutex_unlock
();
return
S_OK
;
}
...
...
dlls/dxgi/surface.c
View file @
2a1186db
...
...
@@ -168,7 +168,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDesc(IDXGISurface *iface, DXGI_
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
wined3d_mutex_lock
();
wined3d_resource_get_desc
(
surface
->
wined3d_resource
,
&
wined3d_desc
);
wined3d_mutex_unlock
();
desc
->
Width
=
wined3d_desc
.
width
;
desc
->
Height
=
wined3d_desc
.
height
;
desc
->
Format
=
dxgi_format_from_wined3dformat
(
wined3d_desc
.
format
);
...
...
dlls/dxgi/swapchain.c
View file @
2a1186db
...
...
@@ -59,7 +59,11 @@ static ULONG STDMETHODCALLTYPE dxgi_swapchain_AddRef(IDXGISwapChain *iface)
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
if
(
refcount
==
1
)
{
wined3d_mutex_lock
();
wined3d_swapchain_incref
(
This
->
wined3d_swapchain
);
wined3d_mutex_unlock
();
}
return
refcount
;
}
...
...
@@ -72,7 +76,11 @@ static ULONG STDMETHODCALLTYPE dxgi_swapchain_Release(IDXGISwapChain *iface)
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
if
(
!
refcount
)
{
wined3d_mutex_lock
();
wined3d_swapchain_decref
(
This
->
wined3d_swapchain
);
wined3d_mutex_unlock
();
}
return
refcount
;
}
...
...
@@ -130,13 +138,18 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetDevice(IDXGISwapChain *iface,
static
HRESULT
STDMETHODCALLTYPE
dxgi_swapchain_Present
(
IDXGISwapChain
*
iface
,
UINT
sync_interval
,
UINT
flags
)
{
struct
dxgi_swapchain
*
This
=
impl_from_IDXGISwapChain
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, sync_interval %u, flags %#x
\n
"
,
iface
,
sync_interval
,
flags
);
if
(
sync_interval
)
FIXME
(
"Unimplemented sync interval %u
\n
"
,
sync_interval
);
if
(
flags
)
FIXME
(
"Unimplemented flags %#x
\n
"
,
flags
);
return
wined3d_swapchain_present
(
This
->
wined3d_swapchain
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
wined3d_mutex_lock
();
hr
=
wined3d_swapchain_present
(
This
->
wined3d_swapchain
,
NULL
,
NULL
,
NULL
,
NULL
,
0
);
wined3d_mutex_unlock
();
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_swapchain_GetBuffer
(
IDXGISwapChain
*
iface
,
...
...
@@ -327,6 +340,7 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device
swapchain
->
IDXGISwapChain_iface
.
lpVtbl
=
&
dxgi_swapchain_vtbl
;
swapchain
->
refcount
=
1
;
wined3d_mutex_lock
();
wined3d_private_store_init
(
&
swapchain
->
private_store
);
if
(
FAILED
(
hr
=
wined3d_swapchain_create
(
device
->
wined3d_device
,
desc
,
swapchain
,
...
...
@@ -334,8 +348,10 @@ HRESULT dxgi_swapchain_init(struct dxgi_swapchain *swapchain, struct dxgi_device
{
WARN
(
"Failed to create wined3d swapchain, hr %#x.
\n
"
,
hr
);
wined3d_private_store_cleanup
(
&
swapchain
->
private_store
);
wined3d_mutex_unlock
();
return
hr
;
}
wined3d_mutex_unlock
();
return
S_OK
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment