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
c6c06581
Commit
c6c06581
authored
Feb 28, 2023
by
Giovanni Mascellani
Committed by
Alexandre Julliard
Apr 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Return correct present count with DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT.
parent
ecc480c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
swapchain.c
dlls/dxgi/swapchain.c
+6
-3
dxgi.c
dlls/dxgi/tests/dxgi.c
+0
-1
No files found.
dlls/dxgi/swapchain.c
View file @
c6c06581
...
@@ -2039,15 +2039,19 @@ static HRESULT d3d12_swapchain_present(struct d3d12_swapchain *swapchain,
...
@@ -2039,15 +2039,19 @@ static HRESULT d3d12_swapchain_present(struct d3d12_swapchain *swapchain,
++
swapchain
->
frame_number
;
++
swapchain
->
frame_number
;
if
((
frame_latency_event
=
swapchain
->
frame_latency_event
))
if
((
frame_latency_event
=
swapchain
->
frame_latency_event
))
{
{
/* Bias the frame number to avoid underflowing in
* SetEventOnCompletion(). */
uint64_t
number
=
swapchain
->
frame_number
+
DXGI_MAX_SWAP_CHAIN_BUFFERS
;
if
(
FAILED
(
hr
=
ID3D12CommandQueue_Signal
(
swapchain
->
command_queue
,
if
(
FAILED
(
hr
=
ID3D12CommandQueue_Signal
(
swapchain
->
command_queue
,
swapchain
->
frame_latency_fence
,
swapchain
->
frame_
number
)))
swapchain
->
frame_latency_fence
,
number
)))
{
{
ERR
(
"Failed to signal frame latency fence, hr %#lx.
\n
"
,
hr
);
ERR
(
"Failed to signal frame latency fence, hr %#lx.
\n
"
,
hr
);
return
hr
;
return
hr
;
}
}
if
(
FAILED
(
hr
=
ID3D12Fence_SetEventOnCompletion
(
swapchain
->
frame_latency_fence
,
if
(
FAILED
(
hr
=
ID3D12Fence_SetEventOnCompletion
(
swapchain
->
frame_latency_fence
,
swapchain
->
frame_
number
-
swapchain
->
frame_latency
,
frame_latency_event
)))
number
-
swapchain
->
frame_latency
,
frame_latency_event
)))
{
{
ERR
(
"Failed to enqueue frame latency event, hr %#lx.
\n
"
,
hr
);
ERR
(
"Failed to enqueue frame latency event, hr %#lx.
\n
"
,
hr
);
return
hr
;
return
hr
;
...
@@ -2979,7 +2983,6 @@ static HRESULT d3d12_swapchain_init(struct d3d12_swapchain *swapchain, IWineDXGI
...
@@ -2979,7 +2983,6 @@ static HRESULT d3d12_swapchain_init(struct d3d12_swapchain *swapchain, IWineDXGI
if
(
swapchain_desc
->
Flags
&
DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT
)
if
(
swapchain_desc
->
Flags
&
DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT
)
{
{
swapchain
->
frame_number
=
DXGI_MAX_SWAP_CHAIN_BUFFERS
;
swapchain
->
frame_latency
=
1
;
swapchain
->
frame_latency
=
1
;
if
(
FAILED
(
hr
=
ID3D12Device_CreateFence
(
device
,
DXGI_MAX_SWAP_CHAIN_BUFFERS
,
if
(
FAILED
(
hr
=
ID3D12Device_CreateFence
(
device
,
DXGI_MAX_SWAP_CHAIN_BUFFERS
,
...
...
dlls/dxgi/tests/dxgi.c
View file @
c6c06581
...
@@ -7590,7 +7590,6 @@ static void test_swapchain_present_count(IUnknown *device, BOOL is_d3d12)
...
@@ -7590,7 +7590,6 @@ static void test_swapchain_present_count(IUnknown *device, BOOL is_d3d12)
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
);
...
...
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