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
c3eca06a
Commit
c3eca06a
authored
Apr 09, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Apr 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32/tests: Make the wglShareLists tests comprehensive.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51311
parent
467604c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
44 deletions
+74
-44
opengl.c
dlls/opengl32/tests/opengl.c
+74
-44
No files found.
dlls/opengl32/tests/opengl.c
View file @
c3eca06a
...
...
@@ -541,54 +541,84 @@ static void test_setpixelformat(HDC winhdc)
static
void
test_sharelists
(
HDC
winhdc
)
{
HGLRC
hglrc1
,
hglrc2
,
hglrc3
;
BOOL
res
;
hglrc1
=
wglCreateContext
(
winhdc
);
res
=
wglShareLists
(
0
,
0
);
ok
(
res
==
FALSE
,
"Sharing display lists for no contexts passed!
\n
"
);
BOOL
res
,
nvidia
,
amd
,
source_current
,
source_sharing
,
dest_current
,
dest_sharing
;
HGLRC
source
,
dest
,
other
;
/* Test 1: Create a context and just share lists without doing anything special */
hglrc2
=
wglCreateContext
(
winhdc
);
if
(
hglrc2
)
{
res
=
wglShareLists
(
hglrc1
,
hglrc2
);
ok
(
res
,
"Sharing of display lists failed
\n
"
);
wglDeleteContext
(
hglrc2
);
}
res
=
wglShareLists
(
NULL
,
NULL
);
ok
(
!
res
,
"Sharing display lists for no contexts passed!
\n
"
);
/* Test 2: Share display lists with a 'destination' context which has been made current */
hglrc2
=
wglCreateContext
(
winhdc
);
if
(
hglrc2
)
{
res
=
wglMakeCurrent
(
winhdc
,
hglrc2
);
ok
(
res
,
"Make current failed
\n
"
);
res
=
wglShareLists
(
hglrc1
,
hglrc2
);
todo_wine
ok
(
res
,
"Sharing display lists with a destination context which has been made current failed
\n
"
);
wglMakeCurrent
(
0
,
0
);
wglDeleteContext
(
hglrc2
);
}
nvidia
=
!!
strstr
((
const
char
*
)
glGetString
(
GL_VENDOR
),
"NVIDIA"
);
amd
=
strstr
((
const
char
*
)
glGetString
(
GL_VENDOR
),
"AMD"
)
||
strstr
((
const
char
*
)
glGetString
(
GL_VENDOR
),
"ATI"
);
/* Test 3: Share display lists with a context which already shares display lists with another context.
* According to MSDN the second parameter cannot share any display lists but some buggy drivers might allow it */
hglrc3
=
wglCreateContext
(
winhdc
);
if
(
hglrc3
)
for
(
source_current
=
FALSE
;
source_current
<=
TRUE
;
source_current
++
)
{
res
=
wglShareLists
(
hglrc3
,
hglrc1
);
ok
(
res
==
FALSE
,
"Sharing of display lists passed for a context which already shared lists before
\n
"
);
wglDeleteContext
(
hglrc3
);
}
/* Test 4: Share display lists with a 'source' context which has been made current */
hglrc2
=
wglCreateContext
(
winhdc
);
if
(
hglrc2
)
{
res
=
wglMakeCurrent
(
winhdc
,
hglrc1
);
ok
(
res
,
"Make current failed
\n
"
);
res
=
wglShareLists
(
hglrc1
,
hglrc2
);
ok
(
res
,
"Sharing display lists with a source context which has been made current failed
\n
"
);
wglMakeCurrent
(
0
,
0
);
wglDeleteContext
(
hglrc2
);
for
(
source_sharing
=
FALSE
;
source_sharing
<=
TRUE
;
source_sharing
++
)
{
for
(
dest_current
=
FALSE
;
dest_current
<=
TRUE
;
dest_current
++
)
{
for
(
dest_sharing
=
FALSE
;
dest_sharing
<=
TRUE
;
dest_sharing
++
)
{
winetest_push_context
(
"source_current=%d source_sharing=%d dest_current=%d dest_sharing=%d"
,
source_current
,
source_sharing
,
dest_current
,
dest_sharing
);
source
=
wglCreateContext
(
winhdc
);
ok
(
!!
source
,
"Create source context failed
\n
"
);
dest
=
wglCreateContext
(
winhdc
);
ok
(
!!
dest
,
"Create dest context failed
\n
"
);
other
=
wglCreateContext
(
winhdc
);
ok
(
!!
other
,
"Create other context failed
\n
"
);
if
(
source_current
)
{
res
=
wglMakeCurrent
(
winhdc
,
source
);
ok
(
res
,
"Make source current failed
\n
"
);
}
if
(
source_sharing
)
{
res
=
wglShareLists
(
other
,
source
);
todo_wine_if
(
source_current
)
ok
(
res
,
"Sharing of display lists from other to source failed
\n
"
);
}
if
(
dest_current
)
{
res
=
wglMakeCurrent
(
winhdc
,
dest
);
ok
(
res
,
"Make dest current failed
\n
"
);
}
if
(
dest_sharing
)
{
res
=
wglShareLists
(
other
,
dest
);
todo_wine_if
(
dest_current
)
ok
(
res
,
"Sharing of display lists from other to dest failed
\n
"
);
}
res
=
wglShareLists
(
source
,
dest
);
todo_wine_if
(
dest_current
||
dest_sharing
)
ok
(
res
||
broken
(
nvidia
&&
!
source_sharing
&&
dest_sharing
),
"Sharing of display lists from source to dest failed
\n
"
);
if
(
source_current
||
dest_current
)
{
res
=
wglMakeCurrent
(
NULL
,
NULL
);
ok
(
res
,
"Make none current failed
\n
"
);
}
res
=
wglDeleteContext
(
source
);
ok
(
res
,
"Delete source context failed
\n
"
);
res
=
wglDeleteContext
(
dest
);
ok
(
res
,
"Delete dest context failed
\n
"
);
if
(
!
strcmp
(
winetest_platform
,
"wine"
)
||
!
amd
||
source_sharing
||
!
dest_sharing
)
{
/* If source_sharing=FALSE and dest_sharing=TRUE, wglShareLists succeeds on AMD, but
* sometimes wglDeleteContext crashes afterwards. On Wine, both functions should always
* succeed in this case. */
res
=
wglDeleteContext
(
other
);
ok
(
res
,
"Delete other context failed
\n
"
);
}
winetest_pop_context
();
}
}
}
}
}
...
...
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