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
360e1a46
Commit
360e1a46
authored
Aug 05, 2019
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a wined3d_context_gl structure to context_set_current().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8003f1fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
17 deletions
+16
-17
context.c
dlls/wined3d/context.c
+14
-15
wined3d_main.c
dlls/wined3d/wined3d_main.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/context.c
View file @
360e1a46
...
...
@@ -1255,13 +1255,13 @@ static BOOL wined3d_context_gl_set_gl_context(struct wined3d_context_gl *context
if
(
context_gl
->
c
.
destroyed
||
!
swapchain
)
{
FIXME
(
"Unable to get backup dc for destroyed context %p.
\n
"
,
context_gl
);
context
_set_current
(
NULL
);
wined3d_context_gl
_set_current
(
NULL
);
return
FALSE
;
}
if
(
!
(
context_gl
->
dc
=
swapchain_get_backup_dc
(
swapchain
)))
{
context
_set_current
(
NULL
);
wined3d_context_gl
_set_current
(
NULL
);
return
FALSE
;
}
...
...
@@ -1272,7 +1272,7 @@ static BOOL wined3d_context_gl_set_gl_context(struct wined3d_context_gl *context
{
ERR
(
"Failed to set pixel format %d on device context %p.
\n
"
,
context_gl
->
pixel_format
,
context_gl
->
dc
);
context
_set_current
(
NULL
);
wined3d_context_gl
_set_current
(
NULL
);
return
FALSE
;
}
...
...
@@ -1280,7 +1280,7 @@ static BOOL wined3d_context_gl_set_gl_context(struct wined3d_context_gl *context
{
ERR
(
"Fallback to backup window (dc %p) failed too, last error %#x.
\n
"
,
context_gl
->
dc
,
GetLastError
());
context
_set_current
(
NULL
);
wined3d_context_gl
_set_current
(
NULL
);
return
FALSE
;
}
...
...
@@ -1297,7 +1297,7 @@ static void context_restore_gl_context(const struct wined3d_gl_info *gl_info, HD
{
ERR
(
"Failed to restore GL context %p on device context %p, last error %#x.
\n
"
,
gl_ctx
,
dc
,
GetLastError
());
context
_set_current
(
NULL
);
wined3d_context_gl
_set_current
(
NULL
);
}
}
...
...
@@ -1508,13 +1508,14 @@ struct wined3d_context *context_get_current(void)
return
TlsGetValue
(
wined3d_context_tls_idx
);
}
BOOL
context_set_current
(
struct
wined3d_context
*
ctx
)
BOOL
wined3d_context_gl_set_current
(
struct
wined3d_context_gl
*
context_gl
)
{
struct
wined3d_context
*
ctx
=
context_gl
?
&
context_gl
->
c
:
NULL
;
struct
wined3d_context
*
old
=
context_get_current
();
if
(
old
==
ctx
)
{
TRACE
(
"Already using D3D context %p.
\n
"
,
c
tx
);
TRACE
(
"Already using D3D context %p.
\n
"
,
c
ontext_gl
);
return
TRUE
;
}
...
...
@@ -1532,20 +1533,18 @@ BOOL context_set_current(struct wined3d_context *ctx)
if
(
wglGetCurrentContext
())
{
const
struct
wined3d_gl_info
*
gl_info
=
old
->
gl_info
;
TRACE
(
"Flushing context %p before switching to %p.
\n
"
,
old
,
c
tx
);
TRACE
(
"Flushing context %p before switching to %p.
\n
"
,
old
,
c
ontext_gl
);
gl_info
->
gl_ops
.
gl
.
p_glFlush
();
}
old
->
current
=
0
;
}
}
if
(
c
tx
)
if
(
c
ontext_gl
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
ctx
);
if
(
!
context_gl
->
valid
)
{
ERR
(
"Trying to make invalid context %p current
\n
"
,
ctx
);
ERR
(
"Trying to make invalid context %p current
.
\n
"
,
context_gl
);
return
FALSE
;
}
...
...
@@ -1553,7 +1552,7 @@ BOOL context_set_current(struct wined3d_context *ctx)
context_gl
,
context_gl
->
gl_ctx
,
context_gl
->
dc
);
if
(
!
wined3d_context_gl_set_gl_context
(
context_gl
))
return
FALSE
;
c
tx
->
current
=
1
;
c
ontext_gl
->
c
.
current
=
1
;
}
else
if
(
wglGetCurrentContext
())
{
...
...
@@ -2146,7 +2145,7 @@ HRESULT wined3d_context_gl_init(struct wined3d_context_gl *context_gl, struct wi
context_gl
->
needs_set
=
1
;
/* Set up the context defaults */
if
(
!
context_set_current
(
context
))
if
(
!
wined3d_context_gl_set_current
(
context_gl
))
{
ERR
(
"Cannot activate context to set up defaults.
\n
"
);
context_release
(
context
);
...
...
@@ -4201,7 +4200,7 @@ static void wined3d_context_gl_activate(struct wined3d_context_gl *context_gl,
if
(
&
context_gl
->
c
!=
context_get_current
())
{
if
(
!
context_set_current
(
&
context_gl
->
c
))
if
(
!
wined3d_context_gl_set_current
(
context_gl
))
ERR
(
"Failed to activate the new context.
\n
"
);
}
else
if
(
context_gl
->
needs_set
)
...
...
dlls/wined3d/wined3d_main.c
View file @
360e1a46
...
...
@@ -820,7 +820,7 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
break
;
case
DLL_THREAD_DETACH
:
if
(
!
context
_set_current
(
NULL
))
if
(
!
wined3d_context_gl
_set_current
(
NULL
))
{
ERR
(
"Failed to clear current context.
\n
"
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
360e1a46
...
...
@@ -2116,6 +2116,7 @@ void *wined3d_context_gl_map_bo_address(struct wined3d_context_gl *context_gl,
const
struct
wined3d_bo_address
*
data
,
size_t
size
,
GLenum
binding
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
struct
wined3d_context_gl
*
wined3d_context_gl_reacquire
(
struct
wined3d_context_gl
*
context_gl
)
DECLSPEC_HIDDEN
;
void
wined3d_context_gl_release
(
struct
wined3d_context_gl
*
context_gl
)
DECLSPEC_HIDDEN
;
BOOL
wined3d_context_gl_set_current
(
struct
wined3d_context_gl
*
context_gl
)
DECLSPEC_HIDDEN
;
void
wined3d_context_gl_set_draw_buffer
(
struct
wined3d_context_gl
*
context_gl
,
GLenum
buffer
)
DECLSPEC_HIDDEN
;
void
wined3d_context_gl_texture_update
(
struct
wined3d_context_gl
*
context_gl
,
const
struct
wined3d_texture_gl
*
texture_gl
)
DECLSPEC_HIDDEN
;
...
...
@@ -2271,7 +2272,6 @@ void context_invalidate_state(struct wined3d_context *context, DWORD state_id) D
void
context_resource_released
(
const
struct
wined3d_device
*
device
,
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
void
context_restore
(
struct
wined3d_context
*
context
,
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
)
DECLSPEC_HIDDEN
;
BOOL
context_set_current
(
struct
wined3d_context
*
ctx
)
DECLSPEC_HIDDEN
;
void
context_set_tls_idx
(
DWORD
idx
)
DECLSPEC_HIDDEN
;
void
context_state_drawbuf
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
...
...
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