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
a3d89689
Commit
a3d89689
authored
Nov 08, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Get rid of the extension removal hack in wglGetProcAddress and clean up the tracing.
parent
449deda6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
63 deletions
+34
-63
wgl.c
dlls/opengl32/wgl.c
+34
-63
No files found.
dlls/opengl32/wgl.c
View file @
a3d89689
...
...
@@ -738,79 +738,50 @@ static BOOL is_extension_supported(const char* extension)
/***********************************************************************
* wglGetProcAddress (OPENGL32.@)
*/
PROC
WINAPI
wglGetProcAddress
(
LPCSTR
lpszProc
)
PROC
WINAPI
wglGetProcAddress
(
LPCSTR
name
)
{
struct
opengl_funcs
*
funcs
=
NtCurrentTeb
()
->
glTable
;
void
**
func_ptr
;
void
*
local_func
;
OpenGL_extension
ext
;
const
OpenGL_extension
*
ext_ret
;
struct
wgl_handle
*
context
=
get_current_context_ptr
();
struct
opengl_funcs
*
funcs
=
NtCurrentTeb
()
->
glTable
;
void
**
func_ptr
;
OpenGL_extension
ext
;
const
OpenGL_extension
*
ext_ret
;
TRACE
(
"(%s)
\n
"
,
lpszProc
)
;
if
(
!
name
)
return
NULL
;
if
(
lpszProc
==
NULL
)
return
NULL
;
/* Without an active context opengl32 doesn't know to what
* driver it has to dispatch wglGetProcAddress.
*/
if
(
!
context
)
{
WARN
(
"No active WGL context found
\n
"
);
return
NULL
;
}
/* Search in the thunks to find the real name of the extension */
ext
.
name
=
lpszProc
;
ext_ret
=
bsearch
(
&
ext
,
extension_registry
,
extension_registry_size
,
sizeof
(
OpenGL_extension
),
compar
);
if
(
!
ext_ret
)
{
WARN
(
"Extension '%s' not defined in opengl32.dll's function table!
\n
"
,
lpszProc
);
return
NULL
;
}
func_ptr
=
(
void
**
)
&
funcs
->
ext
+
(
ext_ret
-
extension_registry
);
if
(
!*
func_ptr
)
{
/* Check if the GL extension required by the function is available */
if
(
!
is_extension_supported
(
ext_ret
->
extension
))
{
WARN
(
"Extension '%s' required by function '%s' not supported!
\n
"
,
ext_ret
->
extension
,
lpszProc
);
/* Without an active context opengl32 doesn't know to what
* driver it has to dispatch wglGetProcAddress.
*/
if
(
!
get_current_context_ptr
())
{
WARN
(
"No active WGL context found
\n
"
);
return
NULL
;
}
local_func
=
context
->
funcs
->
wgl
.
p_wglGetProcAddress
(
ext_ret
->
name
);
/* After that, look at the extensions defined in the Linux OpenGL library */
if
(
local_func
==
NULL
)
{
char
buf
[
256
];
void
*
ret
=
NULL
;
/* Remove the last 3 letters (EXT, ARB, ...).
ext
.
name
=
name
;
ext_ret
=
bsearch
(
&
ext
,
extension_registry
,
extension_registry_size
,
sizeof
(
ext
),
compar
);
if
(
!
ext_ret
)
{
WARN
(
"Function %s unknown
\n
"
,
name
);
return
NULL
;
}
I know that some extensions have more than 3 letters (MESA, NV,
INTEL, ...), but this is only a stop-gap measure to fix buggy
OpenGL drivers (moreover, it is only useful for old 1.0 apps
that query the glBindTextureEXT extension).
*/
memcpy
(
buf
,
ext_ret
->
name
,
strlen
(
ext_ret
->
name
)
-
3
);
buf
[
strlen
(
ext_ret
->
name
)
-
3
]
=
'\0'
;
TRACE
(
"Extension not found in the Linux OpenGL library, checking against libGL bug with %s..
\n
"
,
buf
);
func_ptr
=
(
void
**
)
&
funcs
->
ext
+
(
ext_ret
-
extension_registry
);
if
(
!*
func_ptr
)
{
void
*
driver_func
=
funcs
->
wgl
.
p_wglGetProcAddress
(
name
);
ret
=
GetProcAddress
(
opengl32_handle
,
buf
);
if
(
ret
!=
NULL
)
{
TRACE
(
"Found function in main OpenGL library (%p)!
\n
"
,
ret
);
}
else
{
WARN
(
"Did not find function %s (%s) in your OpenGL library!
\n
"
,
lpszProc
,
ext_ret
->
name
);
}
if
(
!
is_extension_supported
(
ext_ret
->
extension
))
WARN
(
"Extension %s required for %s not supported
\n
"
,
ext_ret
->
extension
,
name
);
return
ret
;
if
(
driver_func
==
NULL
)
{
WARN
(
"Function %s not supported by driver
\n
"
,
name
);
return
NULL
;
}
*
func_ptr
=
driver_func
;
}
*
func_ptr
=
local_func
;
}
TRACE
(
"returning function (%p)
\n
"
,
ext_ret
->
func
);
return
ext_ret
->
func
;
TRACE
(
"returning %s -> %p
\n
"
,
name
,
ext_ret
->
func
);
return
ext_ret
->
func
;
}
/***********************************************************************
...
...
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