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
cc9c18a4
Commit
cc9c18a4
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: Synchronise resource destruction with the command stream.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b21f3c93
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
buffer.c
dlls/wined3d/buffer.c
+2
-0
resource.c
dlls/wined3d/resource.c
+2
-0
texture.c
dlls/wined3d/texture.c
+1
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+16
-0
No files found.
dlls/wined3d/buffer.c
View file @
cc9c18a4
...
...
@@ -1342,6 +1342,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
ERR
(
"Out of memory.
\n
"
);
buffer_unload
(
&
buffer
->
resource
);
resource_cleanup
(
&
buffer
->
resource
);
wined3d_resource_wait_idle
(
&
buffer
->
resource
);
return
E_OUTOFMEMORY
;
}
buffer
->
maps_size
=
1
;
...
...
@@ -1351,6 +1352,7 @@ static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device
ERR
(
"Failed to upload data, hr %#x.
\n
"
,
hr
);
buffer_unload
(
&
buffer
->
resource
);
resource_cleanup
(
&
buffer
->
resource
);
wined3d_resource_wait_idle
(
&
buffer
->
resource
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
->
maps
);
return
hr
;
}
...
...
dlls/wined3d/resource.c
View file @
cc9c18a4
...
...
@@ -239,6 +239,7 @@ static void wined3d_resource_destroy_object(void *object)
wined3d_resource_free_sysmem
(
resource
);
context_resource_released
(
resource
->
device
,
resource
,
resource
->
type
);
wined3d_resource_release
(
resource
);
}
void
resource_cleanup
(
struct
wined3d_resource
*
resource
)
...
...
@@ -254,6 +255,7 @@ void resource_cleanup(struct wined3d_resource *resource)
}
device_resource_released
(
resource
->
device
,
resource
);
wined3d_resource_acquire
(
resource
);
wined3d_cs_emit_destroy_object
(
resource
->
device
->
cs
,
wined3d_resource_destroy_object
,
resource
);
}
...
...
dlls/wined3d/texture.c
View file @
cc9c18a4
...
...
@@ -816,6 +816,7 @@ static void wined3d_texture_cleanup_sync(struct wined3d_texture *texture)
{
wined3d_texture_sub_resources_destroyed
(
texture
);
resource_cleanup
(
&
texture
->
resource
);
wined3d_resource_wait_idle
(
&
texture
->
resource
);
wined3d_texture_cleanup
(
texture
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
cc9c18a4
...
...
@@ -2498,6 +2498,7 @@ struct wined3d_resource
DWORD
priority
;
void
*
heap_memory
;
struct
list
resource_list_entry
;
LONG
access_count
;
void
*
parent
;
const
struct
wined3d_parent_ops
*
parent_ops
;
...
...
@@ -2514,6 +2515,21 @@ static inline ULONG wined3d_resource_decref(struct wined3d_resource *resource)
return
resource
->
resource_ops
->
resource_decref
(
resource
);
}
static
inline
void
wined3d_resource_acquire
(
struct
wined3d_resource
*
resource
)
{
InterlockedIncrement
(
&
resource
->
access_count
);
}
static
inline
void
wined3d_resource_release
(
struct
wined3d_resource
*
resource
)
{
InterlockedDecrement
(
&
resource
->
access_count
);
}
static
inline
void
wined3d_resource_wait_idle
(
struct
wined3d_resource
*
resource
)
{
while
(
InterlockedCompareExchange
(
&
resource
->
access_count
,
0
,
0
));
}
void
resource_cleanup
(
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
HRESULT
resource_init
(
struct
wined3d_resource
*
resource
,
struct
wined3d_device
*
device
,
enum
wined3d_resource_type
type
,
const
struct
wined3d_format
*
format
,
...
...
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