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
dc2a2eaf
Commit
dc2a2eaf
authored
Feb 25, 2023
by
Giovanni Mascellani
Committed by
Alexandre Julliard
Mar 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi/tests: Test that ResizeBuffers() resets the back buffer index to zero.
parent
8af43e1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
2 deletions
+47
-2
dxgi.c
dlls/dxgi/tests/dxgi.c
+47
-2
No files found.
dlls/dxgi/tests/dxgi.c
View file @
dc2a2eaf
...
...
@@ -4941,7 +4941,6 @@ static void test_swapchain_backbuffer_index(IUnknown *device, BOOL is_d3d12)
swapchain_desc
.
SampleDesc
.
Count
=
1
;
swapchain_desc
.
SampleDesc
.
Quality
=
0
;
swapchain_desc
.
BufferUsage
=
DXGI_USAGE_RENDER_TARGET_OUTPUT
;
swapchain_desc
.
BufferCount
=
4
;
swapchain_desc
.
OutputWindow
=
create_window
();
swapchain_desc
.
Windowed
=
TRUE
;
swapchain_desc
.
SwapEffect
=
DXGI_SWAP_EFFECT_DISCARD
;
...
...
@@ -4954,6 +4953,7 @@ static void test_swapchain_backbuffer_index(IUnknown *device, BOOL is_d3d12)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
swap_effects
);
++
i
)
{
swapchain_desc
.
BufferCount
=
4
;
swapchain_desc
.
SwapEffect
=
swap_effects
[
i
];
expected_hr
=
is_d3d12
&&
!
is_flip_model
(
swap_effects
[
i
])
?
DXGI_ERROR_INVALID_CALL
:
S_OK
;
hr
=
IDXGIFactory_CreateSwapChain
(
factory
,
device
,
&
swapchain_desc
,
&
swapchain
);
...
...
@@ -4969,10 +4969,55 @@ static void test_swapchain_backbuffer_index(IUnknown *device, BOOL is_d3d12)
goto
done
;
}
for
(
j
=
0
;
j
<
2
*
swapchain_desc
.
BufferCount
;
++
j
)
for
(
j
=
0
;
j
<
2
*
swapchain_desc
.
BufferCount
+
2
;
++
j
)
{
index
=
IDXGISwapChain3_GetCurrentBackBufferIndex
(
swapchain3
);
expected_index
=
is_d3d12
?
j
%
swapchain_desc
.
BufferCount
:
0
;
ok
(
index
==
expected_index
,
"Got back buffer index %u, expected %u.
\n
"
,
index
,
expected_index
);
hr
=
IDXGISwapChain3_Present
(
swapchain3
,
0
,
0
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
}
swapchain_desc
.
BufferCount
=
3
;
hr
=
IDXGISwapChain_ResizeBuffers
(
swapchain
,
swapchain_desc
.
BufferCount
,
rect
.
right
,
rect
.
bottom
,
DXGI_FORMAT_UNKNOWN
,
swapchain_desc
.
Flags
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
/* The back buffer index restarts from 0. */
for
(
j
=
0
;
j
<
swapchain_desc
.
BufferCount
+
2
;
++
j
)
{
index
=
IDXGISwapChain3_GetCurrentBackBufferIndex
(
swapchain3
);
expected_index
=
is_d3d12
?
j
%
swapchain_desc
.
BufferCount
:
0
;
todo_wine_if
(
is_d3d12
)
ok
(
index
==
expected_index
,
"Got back buffer index %u, expected %u.
\n
"
,
index
,
expected_index
);
hr
=
IDXGISwapChain3_Present
(
swapchain3
,
0
,
0
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
}
hr
=
IDXGISwapChain_ResizeBuffers
(
swapchain
,
swapchain_desc
.
BufferCount
,
rect
.
right
,
rect
.
bottom
,
DXGI_FORMAT_UNKNOWN
,
swapchain_desc
.
Flags
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
/* Even when not really changing the buffer count. */
for
(
j
=
0
;
j
<
swapchain_desc
.
BufferCount
+
1
;
++
j
)
{
index
=
IDXGISwapChain3_GetCurrentBackBufferIndex
(
swapchain3
);
expected_index
=
is_d3d12
?
j
%
swapchain_desc
.
BufferCount
:
0
;
todo_wine_if
(
is_d3d12
)
ok
(
index
==
expected_index
,
"Got back buffer index %u, expected %u.
\n
"
,
index
,
expected_index
);
hr
=
IDXGISwapChain3_Present
(
swapchain3
,
0
,
0
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
}
hr
=
IDXGISwapChain_ResizeBuffers
(
swapchain
,
0
,
rect
.
right
,
rect
.
bottom
,
DXGI_FORMAT_UNKNOWN
,
swapchain_desc
.
Flags
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
for
(
j
=
0
;
j
<
swapchain_desc
.
BufferCount
+
2
;
++
j
)
{
index
=
IDXGISwapChain3_GetCurrentBackBufferIndex
(
swapchain3
);
expected_index
=
is_d3d12
?
j
%
swapchain_desc
.
BufferCount
:
0
;
todo_wine_if
(
is_d3d12
)
ok
(
index
==
expected_index
,
"Got back buffer index %u, expected %u.
\n
"
,
index
,
expected_index
);
hr
=
IDXGISwapChain3_Present
(
swapchain3
,
0
,
0
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
...
...
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