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
e9c5dda4
Commit
e9c5dda4
authored
Aug 01, 2019
by
Conor McCarthy
Committed by
Alexandre Julliard
Aug 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi/tests: Run test_resize_target() on d3d12 as well.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9b493d42
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
31 deletions
+13
-31
dxgi.c
dlls/dxgi/tests/dxgi.c
+13
-31
No files found.
dlls/dxgi/tests/dxgi.c
View file @
e9c5dda4
...
...
@@ -380,7 +380,7 @@ static void check_swapchain_fullscreen_state_(unsigned int line, IDXGISwapChain
HRESULT
hr
;
hr
=
IDXGISwapChain_GetDesc
(
swapchain
,
&
swapchain_desc
);
ok_
(
__FILE__
,
line
)(
SUCCEEDED
(
hr
),
"GetDesc failed
, hr %#x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Failed to get swapchain desc
, hr %#x.
\n
"
,
hr
);
check_window_fullscreen_state_
(
line
,
swapchain_desc
.
OutputWindow
,
&
expected_state
->
fullscreen_state
);
ok_
(
__FILE__
,
line
)(
swapchain_desc
.
Windowed
==
!
expected_state
->
fullscreen
,
...
...
@@ -388,23 +388,19 @@ static void check_swapchain_fullscreen_state_(unsigned int line, IDXGISwapChain
swapchain_desc
.
Windowed
,
!
expected_state
->
fullscreen
);
hr
=
IDXGISwapChain_GetFullscreenState
(
swapchain
,
&
fullscreen
,
&
target
);
ok_
(
__FILE__
,
line
)(
SUCCEEDED
(
hr
),
"GetFullscreenState failed
, hr %#x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Failed to get fullscreen state
, hr %#x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
fullscreen
==
expected_state
->
fullscreen
,
"Got fullscreen %#x, expected %#x.
\n
"
,
fullscreen
,
expected_state
->
fullscreen
);
if
(
!
swapchain_desc
.
Windowed
&&
expected_state
->
fullscreen
)
{
IDXGIAdapter
*
adapter
;
IDXGIDevice
*
device
;
hr
=
IDXGISwapChain_GetDevice
(
swapchain
,
&
IID_IDXGIDevice
,
(
void
**
)
&
device
);
ok_
(
__FILE__
,
line
)(
SUCCEEDED
(
hr
),
"GetDevice failed, hr %#x.
\n
"
,
hr
);
hr
=
IDXGIDevice_GetAdapter
(
device
,
&
adapter
);
ok_
(
__FILE__
,
line
)(
SUCCEEDED
(
hr
),
"GetAdapter failed, hr %#x.
\n
"
,
hr
);
IDXGIDevice_Release
(
device
);
hr
=
IDXGISwapChain_GetContainingOutput
(
swapchain
,
&
containing_output
);
ok_
(
__FILE__
,
line
)(
SUCCEEDED
(
hr
),
"GetContainingOutput failed, hr %#x.
\n
"
,
hr
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Failed to get containing output, hr %#x.
\n
"
,
hr
);
hr
=
IDXGIOutput_GetParent
(
containing_output
,
&
IID_IDXGIAdapter
,
(
void
**
)
&
adapter
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"Failed to get parent, hr %#x.
\n
"
,
hr
);
check_output_equal_
(
line
,
target
,
expected_state
->
target
);
ok_
(
__FILE__
,
line
)(
target
==
containing_output
,
"Got target %p, expected %p.
\n
"
,
...
...
@@ -2688,14 +2684,12 @@ static void test_fullscreen_resize_target(IDXGISwapChain *swapchain,
IDXGIOutput_Release
(
target
);
}
static
void
test_resize_target
(
void
)
static
void
test_resize_target
(
IUnknown
*
device
,
BOOL
is_d3d12
)
{
struct
swapchain_fullscreen_state
initial_state
,
expected_state
;
DXGI_SWAP_CHAIN_DESC
swapchain_desc
;
IDXGISwapChain
*
swapchain
;
IDXGIFactory
*
factory
;
IDXGIAdapter
*
adapter
;
IDXGIDevice
*
device
;
unsigned
int
i
;
ULONG
refcount
;
HRESULT
hr
;
...
...
@@ -2723,17 +2717,7 @@ static void test_resize_target(void)
{{
10
,
10
},
FALSE
,
TRUE
,
DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH
},
};
if
(
!
(
device
=
create_device
(
0
)))
{
skip
(
"Failed to create device.
\n
"
);
return
;
}
hr
=
IDXGIDevice_GetAdapter
(
device
,
&
adapter
);
ok
(
SUCCEEDED
(
hr
),
"GetAdapter failed, hr %#x.
\n
"
,
hr
);
hr
=
IDXGIAdapter_GetParent
(
adapter
,
&
IID_IDXGIFactory
,
(
void
**
)
&
factory
);
ok
(
SUCCEEDED
(
hr
),
"GetParent failed, hr %#x.
\n
"
,
hr
);
get_factory
(
device
,
is_d3d12
,
&
factory
);
swapchain_desc
.
BufferDesc
.
Width
=
800
;
swapchain_desc
.
BufferDesc
.
Height
=
600
;
...
...
@@ -2745,9 +2729,9 @@ static void test_resize_target(void)
swapchain_desc
.
SampleDesc
.
Count
=
1
;
swapchain_desc
.
SampleDesc
.
Quality
=
0
;
swapchain_desc
.
BufferUsage
=
DXGI_USAGE_RENDER_TARGET_OUTPUT
;
swapchain_desc
.
BufferCount
=
1
;
swapchain_desc
.
BufferCount
=
is_d3d12
?
2
:
1
;
swapchain_desc
.
Windowed
=
TRUE
;
swapchain_desc
.
SwapEffect
=
DXGI_SWAP_EFFECT_DISCARD
;
swapchain_desc
.
SwapEffect
=
is_d3d12
?
DXGI_SWAP_EFFECT_FLIP_DISCARD
:
DXGI_SWAP_EFFECT_DISCARD
;
swapchain_desc
.
Flags
=
0
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
tests
);
++
i
)
...
...
@@ -2829,11 +2813,8 @@ static void test_resize_target(void)
DestroyWindow
(
swapchain_desc
.
OutputWindow
);
}
IDXGIAdapter_Release
(
adapter
);
refcount
=
IDXGIDevice_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left.
\n
"
,
refcount
);
refcount
=
IDXGIFactory_Release
(
factory
);
ok
(
!
refcount
,
"Factory has %u references left
.
\n
"
,
refcount
);
ok
(
refcount
==
!
is_d3d12
,
"Got unexpected refcount %u
.
\n
"
,
refcount
);
}
static
LRESULT
CALLBACK
resize_target_wndproc
(
HWND
hwnd
,
unsigned
int
message
,
WPARAM
wparam
,
LPARAM
lparam
)
...
...
@@ -5723,13 +5704,13 @@ START_TEST(dxgi)
test_create_swapchain
();
test_set_fullscreen
();
test_default_fullscreen_target_output
();
test_resize_target
();
test_inexact_modes
();
test_gamma_control
();
test_swapchain_parameters
();
test_swapchain_window_messages
();
test_swapchain_window_styles
();
test_window_association
();
run_on_d3d10
(
test_resize_target
);
run_on_d3d10
(
test_swapchain_resize
);
run_on_d3d10
(
test_swapchain_present
);
run_on_d3d10
(
test_swapchain_backbuffer_index
);
...
...
@@ -5751,6 +5732,7 @@ START_TEST(dxgi)
ID3D12Debug_Release
(
debug
);
}
run_on_d3d12
(
test_resize_target
);
run_on_d3d12
(
test_swapchain_resize
);
run_on_d3d12
(
test_swapchain_present
);
run_on_d3d12
(
test_swapchain_backbuffer_index
);
...
...
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