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
ecc480c8
Commit
ecc480c8
authored
Feb 27, 2023
by
Giovanni Mascellani
Committed by
Alexandre Julliard
Apr 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi/tests: Test GetLastPresentCount() with DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT.
parent
2f3673ca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
dxgi.c
dlls/dxgi/tests/dxgi.c
+22
-4
No files found.
dlls/dxgi/tests/dxgi.c
View file @
ecc480c8
...
@@ -908,8 +908,8 @@ static IDXGIAdapter *get_adapter_(unsigned int line, IUnknown *device, BOOL is_d
...
@@ -908,8 +908,8 @@ static IDXGIAdapter *get_adapter_(unsigned int line, IUnknown *device, BOOL is_d
return
adapter
;
return
adapter
;
}
}
#define create_swapchain(a, b, c
) create_swapchain_(__LINE__, a, b, c
)
#define create_swapchain(a, b, c
, d) create_swapchain_(__LINE__, a, b, c, d
)
static
IDXGISwapChain
*
create_swapchain_
(
unsigned
int
line
,
IUnknown
*
device
,
BOOL
is_d3d12
,
HWND
window
)
static
IDXGISwapChain
*
create_swapchain_
(
unsigned
int
line
,
IUnknown
*
device
,
BOOL
is_d3d12
,
HWND
window
,
UINT
flags
)
{
{
DXGI_SWAP_CHAIN_DESC
desc
;
DXGI_SWAP_CHAIN_DESC
desc
;
IDXGISwapChain
*
swapchain
;
IDXGISwapChain
*
swapchain
;
...
@@ -930,7 +930,7 @@ static IDXGISwapChain *create_swapchain_(unsigned int line, IUnknown *device, BO
...
@@ -930,7 +930,7 @@ static IDXGISwapChain *create_swapchain_(unsigned int line, IUnknown *device, BO
desc
.
OutputWindow
=
window
;
desc
.
OutputWindow
=
window
;
desc
.
Windowed
=
TRUE
;
desc
.
Windowed
=
TRUE
;
desc
.
SwapEffect
=
is_d3d12
?
DXGI_SWAP_EFFECT_FLIP_DISCARD
:
DXGI_SWAP_EFFECT_DISCARD
;
desc
.
SwapEffect
=
is_d3d12
?
DXGI_SWAP_EFFECT_FLIP_DISCARD
:
DXGI_SWAP_EFFECT_DISCARD
;
desc
.
Flags
=
0
;
desc
.
Flags
=
flags
;
get_factory
(
device
,
is_d3d12
,
&
factory
);
get_factory
(
device
,
is_d3d12
,
&
factory
);
hr
=
IDXGIFactory_CreateSwapChain
(
factory
,
device
,
&
desc
,
&
swapchain
);
hr
=
IDXGIFactory_CreateSwapChain
(
factory
,
device
,
&
desc
,
&
swapchain
);
...
@@ -7564,17 +7564,33 @@ done:
...
@@ -7564,17 +7564,33 @@ done:
static
void
test_swapchain_present_count
(
IUnknown
*
device
,
BOOL
is_d3d12
)
static
void
test_swapchain_present_count
(
IUnknown
*
device
,
BOOL
is_d3d12
)
{
{
static
const
UINT
test_flags
[]
=
{
0
,
DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT
,
};
UINT
present_count
,
expected
;
UINT
present_count
,
expected
;
IDXGISwapChain
*
swapchain
;
IDXGISwapChain
*
swapchain
;
unsigned
int
i
;
HWND
window
;
HWND
window
;
HRESULT
hr
;
HRESULT
hr
;
window
=
create_window
();
window
=
create_window
();
swapchain
=
create_swapchain
(
device
,
is_d3d12
,
window
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
test_flags
);
++
i
)
{
UINT
flags
=
test_flags
[
i
];
if
(
!
is_d3d12
&&
(
flags
&
DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT
))
continue
;
swapchain
=
create_swapchain
(
device
,
is_d3d12
,
window
,
flags
);
present_count
=
~
0u
;
present_count
=
~
0u
;
hr
=
IDXGISwapChain_GetLastPresentCount
(
swapchain
,
&
present_count
);
hr
=
IDXGISwapChain_GetLastPresentCount
(
swapchain
,
&
present_count
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine_if
(
flags
&
DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT
)
ok
(
!
present_count
,
"Got unexpected present count %u.
\n
"
,
present_count
);
ok
(
!
present_count
,
"Got unexpected present count %u.
\n
"
,
present_count
);
hr
=
IDXGISwapChain_Present
(
swapchain
,
0
,
0
);
hr
=
IDXGISwapChain_Present
(
swapchain
,
0
,
0
);
...
@@ -7615,6 +7631,8 @@ static void test_swapchain_present_count(IUnknown *device, BOOL is_d3d12)
...
@@ -7615,6 +7631,8 @@ static void test_swapchain_present_count(IUnknown *device, BOOL is_d3d12)
ok
(
present_count
==
expected
,
"Got unexpected present count %u, expected %u.
\n
"
,
present_count
,
expected
);
ok
(
present_count
==
expected
,
"Got unexpected present count %u, expected %u.
\n
"
,
present_count
,
expected
);
IDXGISwapChain_Release
(
swapchain
);
IDXGISwapChain_Release
(
swapchain
);
}
DestroyWindow
(
window
);
DestroyWindow
(
window
);
}
}
...
...
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