Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
30a7487b
Commit
30a7487b
authored
Apr 14, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
May 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Hold a reference to the wined3d swapchain from d3d11 swapchain textures.
parent
3ba9a7f7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
d3d11_private.h
dlls/d3d11/d3d11_private.h
+1
-0
texture.c
dlls/d3d11/texture.c
+9
-0
No files found.
dlls/d3d11/d3d11_private.h
View file @
30a7487b
...
@@ -138,6 +138,7 @@ struct d3d_texture2d
...
@@ -138,6 +138,7 @@ struct d3d_texture2d
IUnknown
*
dxgi_resource
;
IUnknown
*
dxgi_resource
;
struct
wined3d_texture
*
wined3d_texture
;
struct
wined3d_texture
*
wined3d_texture
;
struct
wined3d_swapchain
*
swapchain
;
D3D11_TEXTURE2D_DESC
desc
;
D3D11_TEXTURE2D_DESC
desc
;
ID3D11Device2
*
device
;
ID3D11Device2
*
device
;
};
};
...
...
dlls/d3d11/texture.c
View file @
30a7487b
...
@@ -558,6 +558,8 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_AddRef(ID3D11Texture2D *iface)
...
@@ -558,6 +558,8 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_AddRef(ID3D11Texture2D *iface)
{
{
ID3D11Device2_AddRef
(
texture
->
device
);
ID3D11Device2_AddRef
(
texture
->
device
);
wined3d_texture_incref
(
texture
->
wined3d_texture
);
wined3d_texture_incref
(
texture
->
wined3d_texture
);
if
(
texture
->
swapchain
)
wined3d_swapchain_incref
(
texture
->
swapchain
);
}
}
return
refcount
;
return
refcount
;
...
@@ -573,6 +575,10 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_Release(ID3D11Texture2D *iface)
...
@@ -573,6 +575,10 @@ static ULONG STDMETHODCALLTYPE d3d11_texture2d_Release(ID3D11Texture2D *iface)
if
(
!
refcount
)
if
(
!
refcount
)
{
{
ID3D11Device2
*
device
=
texture
->
device
;
ID3D11Device2
*
device
=
texture
->
device
;
if
(
texture
->
swapchain
)
wined3d_swapchain_decref
(
texture
->
swapchain
);
/* Releasing the texture may free the d3d11 object, so do not access it
* after releasing the texture. */
wined3d_texture_decref
(
texture
->
wined3d_texture
);
wined3d_texture_decref
(
texture
->
wined3d_texture
);
/* Release the device last, it may cause the wined3d device to be
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
* destroyed. */
...
@@ -984,6 +990,9 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE
...
@@ -984,6 +990,9 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE
texture
,
&
d3d_texture2d_wined3d_parent_ops
);
texture
,
&
d3d_texture2d_wined3d_parent_ops
);
wined3d_texture_incref
(
wined3d_texture
);
wined3d_texture_incref
(
wined3d_texture
);
texture
->
wined3d_texture
=
wined3d_texture
;
texture
->
wined3d_texture
=
wined3d_texture
;
if
((
texture
->
swapchain
=
wined3d_texture_get_swapchain
(
wined3d_texture
)))
wined3d_swapchain_incref
(
texture
->
swapchain
);
}
}
else
else
{
{
...
...
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