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
ab70da6d
Commit
ab70da6d
authored
Apr 19, 2024
by
Alexandros Frantzis
Committed by
Alexandre Julliard
Apr 24, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Cache driver pixel format information.
Use the glReserved1 area in the Teb to cache the latest pixel format information requested from the driver.
parent
9943ab6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
wgl.c
dlls/opengl32/wgl.c
+23
-1
No files found.
dlls/opengl32/wgl.c
View file @
ab70da6d
...
...
@@ -42,6 +42,11 @@ WINE_DECLARE_DEBUG_CHANNEL(fps);
static
const
MAT2
identity
=
{
{
0
,
1
},{
0
,
0
},{
0
,
0
},{
0
,
1
}
};
#define WINE_GL_RESERVED_FORMATS_HDC 2
#define WINE_GL_RESERVED_FORMATS_PTR 3
#define WINE_GL_RESERVED_FORMATS_NUM 4
#define WINE_GL_RESERVED_FORMATS_ONSCREEN 5
#ifndef _WIN64
static
char
**
wow64_strings
;
...
...
@@ -299,8 +304,16 @@ static struct wgl_pixel_format *get_pixel_formats( HDC hdc, UINT *num_formats,
UINT
*
num_onscreen_formats
)
{
struct
get_pixel_formats_params
args
=
{
.
teb
=
NtCurrentTeb
(),
.
hdc
=
hdc
};
PVOID
*
glReserved
=
NtCurrentTeb
()
->
glReserved1
;
NTSTATUS
status
;
if
(
glReserved
[
WINE_GL_RESERVED_FORMATS_HDC
]
==
hdc
)
{
*
num_formats
=
PtrToUlong
(
glReserved
[
WINE_GL_RESERVED_FORMATS_NUM
]
);
*
num_onscreen_formats
=
PtrToUlong
(
glReserved
[
WINE_GL_RESERVED_FORMATS_ONSCREEN
]
);
return
glReserved
[
WINE_GL_RESERVED_FORMATS_PTR
];
}
if
((
status
=
UNIX_CALL
(
get_pixel_formats
,
&
args
)))
goto
error
;
if
(
!
(
args
.
formats
=
malloc
(
sizeof
(
*
args
.
formats
)
*
args
.
num_formats
)))
goto
error
;
args
.
max_formats
=
args
.
num_formats
;
...
...
@@ -308,6 +321,13 @@ static struct wgl_pixel_format *get_pixel_formats( HDC hdc, UINT *num_formats,
*
num_formats
=
args
.
num_formats
;
*
num_onscreen_formats
=
args
.
num_onscreen_formats
;
free
(
glReserved
[
WINE_GL_RESERVED_FORMATS_PTR
]
);
glReserved
[
WINE_GL_RESERVED_FORMATS_HDC
]
=
hdc
;
glReserved
[
WINE_GL_RESERVED_FORMATS_PTR
]
=
args
.
formats
;
glReserved
[
WINE_GL_RESERVED_FORMATS_NUM
]
=
ULongToPtr
(
args
.
num_formats
);
glReserved
[
WINE_GL_RESERVED_FORMATS_ONSCREEN
]
=
ULongToPtr
(
args
.
num_onscreen_formats
);
return
args
.
formats
;
error:
...
...
@@ -333,7 +353,6 @@ INT WINAPI wglDescribePixelFormat( HDC hdc, int index, UINT size, PIXELFORMATDES
*
ppfd
=
formats
[
index
-
1
].
pfd
;
free
(
formats
);
return
num_onscreen_formats
;
}
...
...
@@ -1374,6 +1393,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
#ifndef _WIN64
cleanup_wow64_strings
();
#endif
/* fallthrough */
case
DLL_THREAD_DETACH
:
free
(
NtCurrentTeb
()
->
glReserved1
[
WINE_GL_RESERVED_FORMATS_PTR
]
);
return
TRUE
;
}
return
TRUE
;
...
...
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