Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
3c07f7a6
Commit
3c07f7a6
authored
14 years ago
by
Henri Verbeet
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d9: Get rid of the implicit swapchain refcounting hacks.
parent
4e56a4fe
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/d3d9/d3d9_private.h
+0
-3
0 additions, 3 deletions
dlls/d3d9/d3d9_private.h
dlls/d3d9/device.c
+5
-11
5 additions, 11 deletions
dlls/d3d9/device.c
dlls/d3d9/swapchain.c
+6
-11
6 additions, 11 deletions
dlls/d3d9/swapchain.c
with
11 additions
and
25 deletions
dlls/d3d9/d3d9_private.h
+
0
−
3
View file @
3c07f7a6
...
...
@@ -222,9 +222,6 @@ typedef struct IDirect3DSwapChain9Impl
/* Parent reference */
LPDIRECT3DDEVICE9EX
parentDevice
;
/* Flags an implicit swap chain */
BOOL
isImplicit
;
}
IDirect3DSwapChain9Impl
;
HRESULT
swapchain_init
(
IDirect3DSwapChain9Impl
*
swapchain
,
IDirect3DDevice9Impl
*
device
,
...
...
This diff is collapsed.
Click to expand it.
dlls/d3d9/device.c
+
5
−
11
View file @
3c07f7a6
...
...
@@ -183,14 +183,9 @@ static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, U
static
ULONG
WINAPI
D3D9CB_DestroySwapChain
(
IWineD3DSwapChain
*
swapchain
)
{
IDirect3DSwapChain9Impl
*
parent
;
TRACE
(
"swapchain %p.
\n
"
,
swapchain
);
parent
=
IWineD3DSwapChain_GetParent
(
swapchain
);
parent
->
isImplicit
=
FALSE
;
IDirect3DSwapChain9_AddRef
((
IDirect3DSwapChain9
*
)
parent
);
return
IDirect3DSwapChain9_Release
((
IDirect3DSwapChain9
*
)
parent
);
return
IWineD3DSwapChain_Release
(
swapchain
);
}
/* IDirect3D IUnknown parts follow: */
...
...
@@ -3174,8 +3169,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar
WINED3DPRESENT_PARAMETERS
*
present_parameters
,
IWineD3DSwapChain
**
swapchain
)
{
struct
IDirect3DDevice9Impl
*
This
=
device_from_device_parent
(
iface
);
IDirect3DSwapChain9Impl
*
d3d_swapchain
;
D3DPRESENT_PARAMETERS
local_parameters
;
IDirect3DSwapChain9
*
d3d_swapchain
;
HRESULT
hr
;
TRACE
(
"iface %p, present_parameters %p, swapchain %p
\n
"
,
iface
,
present_parameters
,
swapchain
);
...
...
@@ -3197,7 +3192,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar
local_parameters
.
PresentationInterval
=
present_parameters
->
PresentationInterval
;
hr
=
IDirect3DDevice9Impl_CreateAdditionalSwapChain
((
IDirect3DDevice9Ex
*
)
This
,
&
local_parameters
,
(
IDirect3DSwapChain9
**
)
&
d3d_swapchain
);
&
local_parameters
,
&
d3d_swapchain
);
if
(
FAILED
(
hr
))
{
ERR
(
"(%p) CreateAdditionalSwapChain failed, returning %#x
\n
"
,
iface
,
hr
);
...
...
@@ -3205,9 +3200,8 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSwapChain(IWineD3DDevicePar
return
hr
;
}
*
swapchain
=
d3d_swapchain
->
wineD3DSwapChain
;
d3d_swapchain
->
isImplicit
=
TRUE
;
/* Implicit swap chains are created with an refcount of 0 */
*
swapchain
=
((
IDirect3DSwapChain9Impl
*
)
d3d_swapchain
)
->
wineD3DSwapChain
;
IWineD3DSwapChain_AddRef
(
*
swapchain
);
IDirect3DSwapChain9_Release
((
IDirect3DSwapChain9
*
)
d3d_swapchain
);
/* Copy back the presentation parameters */
...
...
This diff is collapsed.
Click to expand it.
dlls/d3d9/swapchain.c
+
6
−
11
View file @
3c07f7a6
...
...
@@ -55,12 +55,9 @@ static ULONG WINAPI IDirect3DSwapChain9Impl_AddRef(LPDIRECT3DSWAPCHAIN9 iface) {
if
(
This
->
parentDevice
)
IDirect3DDevice9Ex_AddRef
(
This
->
parentDevice
);
if
(
!
This
->
isImplicit
)
{
wined3d_mutex_lock
();
IWineD3DSwapChain_AddRef
(
This
->
wineD3DSwapChain
);
wined3d_mutex_unlock
();
}
wined3d_mutex_lock
();
IWineD3DSwapChain_AddRef
(
This
->
wineD3DSwapChain
);
wined3d_mutex_unlock
();
}
return
ref
;
...
...
@@ -75,11 +72,9 @@ static ULONG WINAPI IDirect3DSwapChain9Impl_Release(LPDIRECT3DSWAPCHAIN9 iface)
if
(
ref
==
0
)
{
IDirect3DDevice9Ex
*
parentDevice
=
This
->
parentDevice
;
if
(
!
This
->
isImplicit
)
{
wined3d_mutex_lock
();
IWineD3DSwapChain_Destroy
(
This
->
wineD3DSwapChain
);
wined3d_mutex_unlock
();
}
wined3d_mutex_lock
();
IWineD3DSwapChain_Release
(
This
->
wineD3DSwapChain
);
wined3d_mutex_unlock
();
/* Release the device last, as it may cause the device to be destroyed. */
if
(
parentDevice
)
IDirect3DDevice9Ex_Release
(
parentDevice
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment