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
6bb5724a
Commit
6bb5724a
authored
May 03, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
May 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce wined3d_context_gl_destroy().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
166e75e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
18 deletions
+33
-18
context.c
dlls/wined3d/context.c
+28
-18
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-0
No files found.
dlls/wined3d/context.c
View file @
6bb5724a
...
...
@@ -1482,6 +1482,32 @@ static void wined3d_context_cleanup(struct wined3d_context *context)
heap_free
(
context
->
texture_type
);
}
static
void
wined3d_context_gl_cleanup
(
struct
wined3d_context_gl
*
context_gl
)
{
wined3d_context_cleanup
(
&
context_gl
->
c
);
}
static
void
wined3d_context_gl_destroy
(
struct
wined3d_context_gl
*
context_gl
)
{
if
(
context_gl
->
c
.
current
&&
context_gl
->
c
.
tid
!=
GetCurrentThreadId
())
{
struct
wined3d_gl_info
*
gl_info
;
/* Make a copy of gl_info for wined3d_context_gl_cleanup() use, the
* one in wined3d_adapter may go away in the meantime. */
gl_info
=
heap_alloc
(
sizeof
(
*
gl_info
));
*
gl_info
=
*
context_gl
->
c
.
gl_info
;
context_gl
->
c
.
gl_info
=
gl_info
;
context_gl
->
c
.
destroyed
=
1
;
return
;
}
wined3d_context_gl_cleanup
(
context_gl
);
TlsSetValue
(
wined3d_context_tls_idx
,
NULL
);
heap_free
(
context_gl
);
}
DWORD
context_get_tls_idx
(
void
)
{
return
wined3d_context_tls_idx
;
...
...
@@ -1512,7 +1538,7 @@ BOOL context_set_current(struct wined3d_context *ctx)
if
(
old
->
destroyed
)
{
TRACE
(
"Switching away from destroyed context %p.
\n
"
,
old
);
wined3d_context_
cleanup
(
old
);
wined3d_context_
gl_cleanup
(
wined3d_context_gl
(
old
)
);
heap_free
((
void
*
)
old
->
gl_info
);
heap_free
(
old
);
}
...
...
@@ -2325,23 +2351,7 @@ void wined3d_context_destroy(struct wined3d_context *context)
device
->
adapter
->
fragment_pipe
->
free_context_data
(
context
);
device_context_remove
(
device
,
context
);
if
(
context
->
current
&&
context
->
tid
!=
GetCurrentThreadId
())
{
struct
wined3d_gl_info
*
gl_info
;
/* Make a copy of gl_info for wined3d_context_cleanup() use, the
* one in wined3d_adapter may go away in the meantime. */
gl_info
=
heap_alloc
(
sizeof
(
*
gl_info
));
*
gl_info
=
*
context
->
gl_info
;
context
->
gl_info
=
gl_info
;
context
->
destroyed
=
1
;
return
;
}
wined3d_context_cleanup
(
context
);
TlsSetValue
(
wined3d_context_tls_idx
,
NULL
);
heap_free
(
context
);
wined3d_context_gl_destroy
(
wined3d_context_gl
(
context
));
}
const
DWORD
*
context_get_tex_unit_mapping
(
const
struct
wined3d_context
*
context
,
...
...
dlls/wined3d/wined3d_private.h
View file @
6bb5724a
...
...
@@ -2034,6 +2034,11 @@ struct wined3d_context_gl
struct
wined3d_context
c
;
};
static
inline
struct
wined3d_context_gl
*
wined3d_context_gl
(
struct
wined3d_context
*
context
)
{
return
CONTAINING_RECORD
(
context
,
struct
wined3d_context_gl
,
c
);
}
struct
wined3d_fb_state
{
struct
wined3d_rendertarget_view
*
render_targets
[
MAX_RENDER_TARGET_VIEWS
];
...
...
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