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
b59b68b8
Commit
b59b68b8
authored
May 16, 2011
by
Ričardas Barkauskas
Committed by
Alexandre Julliard
May 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Fix GetDisplayModeList parameter handling.
parent
32f79acc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
103 additions
and
5 deletions
+103
-5
output.c
dlls/dxgi/output.c
+19
-5
device.c
dlls/dxgi/tests/device.c
+81
-0
dxgi.idl
include/dxgi.idl
+3
-0
No files found.
dlls/dxgi/output.c
View file @
b59b68b8
...
...
@@ -121,24 +121,38 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
enum
wined3d_format_id
wined3d_format
;
struct
wined3d
*
wined3d
;
UINT
i
;
UINT
max_count
;
TRACE
(
"iface %p, format %s, flags %#x, mode_count %p, desc %p.
\n
"
,
FIXME
(
"iface %p, format %s, flags %#x, mode_count %p, desc %p partial stub!
\n
"
,
iface
,
debug_dxgi_format
(
format
),
flags
,
mode_count
,
desc
);
if
(
!
mode_count
)
{
return
S_OK
;
}
if
(
format
==
DXGI_FORMAT_UNKNOWN
)
{
*
mode_count
=
0
;
return
S_OK
;
}
wined3d
=
IWineDXGIFactory_get_wined3d
(
This
->
adapter
->
parent
);
wined3d_format
=
wined3dformat_from_dxgi_format
(
format
);
EnterCriticalSection
(
&
dxgi_cs
);
max_count
=
wined3d_get_adapter_mode_count
(
wined3d
,
This
->
adapter
->
ordinal
,
wined3d_format
);
if
(
!
desc
)
{
EnterCriticalSection
(
&
dxgi_cs
);
*
mode_count
=
wined3d_get_adapter_mode_count
(
wined3d
,
This
->
adapter
->
ordinal
,
wined3d_format
);
wined3d_decref
(
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
*
mode_count
=
max_count
;
return
S_OK
;
}
EnterCriticalSection
(
&
dxgi_cs
);
*
mode_count
=
min
(
*
mode_count
,
max_count
);
for
(
i
=
0
;
i
<
*
mode_count
;
++
i
)
{
WINED3DDISPLAYMODE
mode
;
...
...
dlls/dxgi/tests/device.c
View file @
b59b68b8
...
...
@@ -212,6 +212,86 @@ static void test_parents(IDXGIDevice *device)
IDXGIAdapter_Release
(
adapter
);
}
static
void
test_output
(
IDXGIDevice
*
device
)
{
IDXGIAdapter
*
adapter
;
HRESULT
hr
;
IDXGIOutput
*
output
;
UINT
mode_count
,
mode_count_comp
,
i
;
DXGI_MODE_DESC
*
modes
;
hr
=
IDXGIDevice_GetAdapter
(
device
,
&
adapter
);
ok
(
SUCCEEDED
(
hr
),
"GetAdapter failed, hr %#x.
\n
"
,
hr
);
hr
=
IDXGIAdapter_EnumOutputs
(
adapter
,
0
,
&
output
);
if
(
hr
==
DXGI_ERROR_NOT_FOUND
)
{
skip
(
"Adapter has not outputs, skipping output tests.
\n
"
);
IDXGIAdapter_Release
(
adapter
);
return
;
}
ok
(
SUCCEEDED
(
hr
),
"EnumOutputs failed, hr %#x.
\n
"
,
hr
);
IDXGIOutput_GetDisplayModeList
(
output
,
DXGI_FORMAT_R8G8B8A8_UNORM
,
0
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to list modes, hr %#x.
\n
"
,
hr
);
IDXGIOutput_GetDisplayModeList
(
output
,
DXGI_FORMAT_R8G8B8A8_UNORM
,
0
,
&
mode_count
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to list modes, hr %#x.
\n
"
,
hr
);
mode_count_comp
=
mode_count
;
IDXGIOutput_GetDisplayModeList
(
output
,
0
,
0
,
&
mode_count
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to list modes, hr %#x.
\n
"
,
hr
);
ok
(
!
mode_count
,
"Expected 0 got %d
\n
"
,
mode_count
);
IDXGIOutput_GetDisplayModeList
(
output
,
DXGI_FORMAT_R8G8B8A8_UNORM
,
DXGI_ENUM_MODES_SCALING
,
&
mode_count
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to list modes, hr %#x.
\n
"
,
hr
);
ok
(
mode_count
>=
mode_count_comp
,
"Flag implies trying to enumerate more modes
\n
"
);
mode_count_comp
=
mode_count
;
modes
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DXGI_MODE_DESC
)
*
mode_count
+
10
);
IDXGIOutput_GetDisplayModeList
(
output
,
DXGI_FORMAT_R8G8B8A8_UNORM
,
DXGI_ENUM_MODES_SCALING
,
NULL
,
modes
);
ok
(
SUCCEEDED
(
hr
),
"Failed to list modes, hr %#x.
\n
"
,
hr
);
ok
(
!
modes
[
0
].
Height
,
"No output was expected
\n
"
);
mode_count
=
0
;
IDXGIOutput_GetDisplayModeList
(
output
,
DXGI_FORMAT_R8G8B8A8_UNORM
,
DXGI_ENUM_MODES_SCALING
,
&
mode_count
,
modes
);
ok
(
SUCCEEDED
(
hr
),
"Failed to list modes, hr %#x.
\n
"
,
hr
);
ok
(
!
modes
[
0
].
Height
,
"No output was expected
\n
"
);
mode_count
=
mode_count_comp
;
IDXGIOutput_GetDisplayModeList
(
output
,
DXGI_FORMAT_R8G8B8A8_UNORM
,
DXGI_ENUM_MODES_SCALING
,
&
mode_count
,
modes
);
ok
(
SUCCEEDED
(
hr
),
"Failed to list modes, hr %#x.
\n
"
,
hr
);
ok
(
mode_count
==
mode_count_comp
,
"Expected %d, got %d
\n
"
,
mode_count_comp
,
mode_count
);
for
(
i
=
0
;
i
<
mode_count
;
i
++
)
{
ok
(
modes
[
i
].
Height
&&
modes
[
i
].
Width
,
"Proper mode was expected
\n
"
);
}
mode_count
+=
5
;
IDXGIOutput_GetDisplayModeList
(
output
,
DXGI_FORMAT_R8G8B8A8_UNORM
,
DXGI_ENUM_MODES_SCALING
,
&
mode_count
,
modes
);
ok
(
SUCCEEDED
(
hr
),
"Failed to list modes, hr %#x.
\n
"
,
hr
);
ok
(
mode_count
==
mode_count_comp
,
"Expected %d, got %d
\n
"
,
mode_count_comp
,
mode_count
);
if
(
mode_count_comp
)
{
mode_count
=
mode_count_comp
-
1
;
IDXGIOutput_GetDisplayModeList
(
output
,
DXGI_FORMAT_R8G8B8A8_UNORM
,
DXGI_ENUM_MODES_SCALING
,
&
mode_count
,
modes
);
ok
(
SUCCEEDED
(
hr
),
"Failed to list modes, hr %#x.
\n
"
,
hr
);
ok
(
mode_count
==
mode_count_comp
-
1
,
"Expected %d, got %d
\n
"
,
mode_count_comp
,
mode_count
);
}
else
{
skip
(
"Not enough modes for test, skipping
\n
"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
modes
);
IDXGIOutput_Release
(
output
);
IDXGIAdapter_Release
(
adapter
);
}
START_TEST
(
device
)
{
HMODULE
d3d10core
=
LoadLibraryA
(
"d3d10core.dll"
);
...
...
@@ -236,6 +316,7 @@ START_TEST(device)
test_device_interfaces
(
device
);
test_create_surface
(
device
);
test_parents
(
device
);
test_output
(
device
);
refcount
=
IDXGIDevice_Release
(
device
);
ok
(
!
refcount
,
"Device has %u references left
\n
"
,
refcount
);
...
...
include/dxgi.idl
View file @
b59b68b8
...
...
@@ -59,6 +59,9 @@ const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
const
DXGI_USAGE
DXGI_USAGE_SHARED
=
0
x80L
;
const
DXGI_USAGE
DXGI_USAGE_READ_ONLY
=
0
x100L
;
const
UINT
DXGI_ENUM_MODES_INTERLACED
=
1
;
const
UINT
DXGI_ENUM_MODES_SCALING
=
2
;
typedef
enum
DXGI_SWAP_EFFECT
{
DXGI_SWAP_EFFECT_DISCARD
=
0
,
DXGI_SWAP_EFFECT_SEQUENTIAL
=
1
,
...
...
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