Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
11842376
Commit
11842376
authored
Jul 08, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Send texture destruction through the command stream.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
229616a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
19 deletions
+40
-19
texture.c
dlls/wined3d/texture.c
+40
-19
No files found.
dlls/wined3d/texture.c
View file @
11842376
...
...
@@ -468,6 +468,24 @@ static void wined3d_texture_unload_gl_texture(struct wined3d_texture *texture)
resource_unload
(
&
texture
->
resource
);
}
static
void
wined3d_texture_sub_resources_destroyed
(
struct
wined3d_texture
*
texture
)
{
unsigned
int
sub_count
=
texture
->
level_count
*
texture
->
layer_count
;
struct
wined3d_texture_sub_resource
*
sub_resource
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
sub_count
;
++
i
)
{
sub_resource
=
&
texture
->
sub_resources
[
i
];
if
(
sub_resource
->
parent
)
{
TRACE
(
"sub-resource %u.
\n
"
,
i
);
sub_resource
->
parent_ops
->
wined3d_object_destroyed
(
sub_resource
->
parent
);
sub_resource
->
parent
=
NULL
;
}
}
}
static
void
wined3d_texture_cleanup
(
struct
wined3d_texture
*
texture
)
{
unsigned
int
sub_count
=
texture
->
level_count
*
texture
->
layer_count
;
...
...
@@ -499,19 +517,8 @@ static void wined3d_texture_cleanup(struct wined3d_texture *texture)
if
(
context
)
context_release
(
context
);
for
(
i
=
0
;
i
<
sub_count
;
++
i
)
{
struct
wined3d_texture_sub_resource
*
sub_resource
=
&
texture
->
sub_resources
[
i
];
if
(
sub_resource
->
parent
)
{
TRACE
(
"sub-resource %u.
\n
"
,
i
);
sub_resource
->
parent_ops
->
wined3d_object_destroyed
(
sub_resource
->
parent
);
}
}
texture
->
texture_ops
->
texture_cleanup_sub_resources
(
texture
);
wined3d_texture_unload_gl_texture
(
texture
);
resource_cleanup
(
&
texture
->
resource
);
}
void
wined3d_texture_set_swapchain
(
struct
wined3d_texture
*
texture
,
struct
wined3d_swapchain
*
swapchain
)
...
...
@@ -805,6 +812,19 @@ ULONG CDECL wined3d_texture_incref(struct wined3d_texture *texture)
return
refcount
;
}
static
void
wined3d_texture_cleanup_sync
(
struct
wined3d_texture
*
texture
)
{
wined3d_texture_sub_resources_destroyed
(
texture
);
resource_cleanup
(
&
texture
->
resource
);
wined3d_texture_cleanup
(
texture
);
}
static
void
wined3d_texture_destroy_object
(
void
*
object
)
{
wined3d_texture_cleanup
(
object
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
}
ULONG
CDECL
wined3d_texture_decref
(
struct
wined3d_texture
*
texture
)
{
ULONG
refcount
;
...
...
@@ -819,9 +839,10 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
if
(
!
refcount
)
{
wined3d_texture_
cleanup
(
texture
);
wined3d_texture_
sub_resources_destroyed
(
texture
);
texture
->
resource
.
parent_ops
->
wined3d_object_destroyed
(
texture
->
resource
.
parent
);
HeapFree
(
GetProcessHeap
(),
0
,
texture
);
resource_cleanup
(
&
texture
->
resource
);
wined3d_cs_emit_destroy_object
(
texture
->
resource
.
device
->
cs
,
wined3d_texture_destroy_object
,
texture
);
}
return
refcount
;
...
...
@@ -1993,7 +2014,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
if
(
level_count
>
~
(
SIZE_T
)
0
/
layer_count
||
!
(
surfaces
=
wined3d_calloc
(
level_count
*
layer_count
,
sizeof
(
*
surfaces
))))
{
wined3d_texture_cleanup
(
texture
);
wined3d_texture_cleanup
_sync
(
texture
);
return
E_OUTOFMEMORY
;
}
...
...
@@ -2037,7 +2058,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
{
WARN
(
"Failed to create surface parent, hr %#x.
\n
"
,
hr
);
sub_resource
->
parent
=
NULL
;
wined3d_texture_cleanup
(
texture
);
wined3d_texture_cleanup
_sync
(
texture
);
return
hr
;
}
...
...
@@ -2048,7 +2069,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
if
(((
desc
->
usage
&
WINED3DUSAGE_OWNDC
)
||
(
device
->
wined3d
->
flags
&
WINED3D_NO3D
))
&&
FAILED
(
hr
=
wined3d_surface_create_dc
(
surface
)))
{
wined3d_texture_cleanup
(
texture
);
wined3d_texture_cleanup
_sync
(
texture
);
return
hr
;
}
}
...
...
@@ -2257,7 +2278,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
if
(
!
(
volumes
=
wined3d_calloc
(
level_count
,
sizeof
(
*
volumes
))))
{
wined3d_texture_cleanup
(
texture
);
wined3d_texture_cleanup
_sync
(
texture
);
return
E_OUTOFMEMORY
;
}
...
...
@@ -2280,7 +2301,7 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
{
WARN
(
"Failed to create volume parent, hr %#x.
\n
"
,
hr
);
sub_resource
->
parent
=
NULL
;
wined3d_texture_cleanup
(
texture
);
wined3d_texture_cleanup
_sync
(
texture
);
return
hr
;
}
...
...
@@ -2585,7 +2606,7 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
* in this case. */
if
(
data
&&
FAILED
(
hr
=
wined3d_texture_upload_data
(
object
,
data
)))
{
wined3d_texture_cleanup
(
object
);
wined3d_texture_cleanup
_sync
(
object
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
...
...
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