Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ab6c51f2
Commit
ab6c51f2
authored
Aug 04, 2023
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi/tests: Test swapchains with zero dimensions.
parent
77fb8e04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
dxgi.c
dlls/dxgi/tests/dxgi.c
+71
-0
No files found.
dlls/dxgi/tests/dxgi.c
View file @
ab6c51f2
...
...
@@ -7886,6 +7886,75 @@ done:
ok
(
!
refcount
,
"Device has %lu references left.
\n
"
,
refcount
);
}
static
void
test_zero_size
(
IUnknown
*
device
,
BOOL
is_d3d12
)
{
DXGI_SWAP_CHAIN_DESC
swapchain_desc
;
IDXGISwapChain
*
swapchain
;
unsigned
int
i
,
expected
;
IDXGIFactory
*
factory
;
HWND
window
;
HRESULT
hr
;
RECT
r
;
static
const
struct
{
INT
w
,
h
;
}
tests
[]
=
{
{
0
,
0
},
{
200
,
0
},
{
0
,
200
},
{
200
,
200
},
/* FIXME: How to create a window with a client rect width or height above 0 but less than 8?
* If I try to AdjustWindowRect a (100,100)-(104,104) rectangle I get a larger window. I
* suspect the decoration style and DPI will play into it too. The size below creates a
* 176x4 client rect on my system. */
{
100
,
60
}
};
get_factory
(
device
,
is_d3d12
,
&
factory
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
++
i
)
{
window
=
CreateWindowA
(
"static"
,
"dxgi_test"
,
WS_VISIBLE
,
0
,
0
,
tests
[
i
].
w
,
tests
[
i
].
h
,
0
,
0
,
0
,
0
);
swapchain_desc
.
BufferDesc
.
Width
=
0
;
swapchain_desc
.
BufferDesc
.
Height
=
0
;
swapchain_desc
.
BufferDesc
.
RefreshRate
.
Numerator
=
60
;
swapchain_desc
.
BufferDesc
.
RefreshRate
.
Denominator
=
60
;
swapchain_desc
.
BufferDesc
.
Format
=
DXGI_FORMAT_R8G8B8A8_UNORM
;
swapchain_desc
.
BufferDesc
.
ScanlineOrdering
=
DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED
;
swapchain_desc
.
BufferDesc
.
Scaling
=
DXGI_MODE_SCALING_UNSPECIFIED
;
swapchain_desc
.
SampleDesc
.
Count
=
1
;
swapchain_desc
.
SampleDesc
.
Quality
=
0
;
swapchain_desc
.
BufferUsage
=
DXGI_USAGE_RENDER_TARGET_OUTPUT
;
swapchain_desc
.
BufferCount
=
is_d3d12
?
2
:
1
;
swapchain_desc
.
OutputWindow
=
window
;
swapchain_desc
.
Windowed
=
TRUE
;
swapchain_desc
.
SwapEffect
=
is_d3d12
?
DXGI_SWAP_EFFECT_FLIP_DISCARD
:
DXGI_SWAP_EFFECT_DISCARD
;
swapchain_desc
.
Flags
=
0
;
hr
=
IDXGIFactory_CreateSwapChain
(
factory
,
device
,
&
swapchain_desc
,
&
swapchain
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
swapchain_desc
.
BufferDesc
.
Width
&&
!
swapchain_desc
.
BufferDesc
.
Height
,
"Input desc was modified.
\n
"
);
hr
=
IDXGISwapChain_GetDesc
(
swapchain
,
&
swapchain_desc
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
GetClientRect
(
swapchain_desc
.
OutputWindow
,
&
r
);
expected
=
r
.
right
>
0
?
r
.
right
:
8
;
ok
(
swapchain_desc
.
BufferDesc
.
Width
==
expected
,
"Got width %u, expected %u, test %u.
\n
"
,
swapchain_desc
.
BufferDesc
.
Width
,
expected
,
i
);
expected
=
r
.
bottom
>
0
?
r
.
bottom
:
8
;
ok
(
swapchain_desc
.
BufferDesc
.
Height
==
expected
,
"Got height %u, expected %u, test %u.
\n
"
,
swapchain_desc
.
BufferDesc
.
Height
,
expected
,
i
);
IDXGISwapChain_Release
(
swapchain
);
DestroyWindow
(
window
);
}
IDXGIFactory_Release
(
factory
);
}
static
void
run_on_d3d10
(
void
(
*
test_func
)(
IUnknown
*
device
,
BOOL
is_d3d12
))
{
IDXGIDevice
*
device
;
...
...
@@ -8010,6 +8079,7 @@ START_TEST(dxgi)
run_on_d3d10
(
test_swapchain_present_count
);
run_on_d3d10
(
test_resize_target_wndproc
);
run_on_d3d10
(
test_swapchain_window_messages
);
run_on_d3d10
(
test_zero_size
);
if
(
!
(
d3d12_module
=
LoadLibraryA
(
"d3d12.dll"
)))
{
...
...
@@ -8043,6 +8113,7 @@ START_TEST(dxgi)
run_on_d3d12
(
test_swapchain_present_count
);
run_on_d3d12
(
test_resize_target_wndproc
);
run_on_d3d12
(
test_swapchain_window_messages
);
run_on_d3d12
(
test_zero_size
);
FreeLibrary
(
d3d12_module
);
}
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