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
ac84e9b7
Commit
ac84e9b7
authored
Jan 28, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Implement IDXGIAdapter1.
parent
e9f9c150
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
22 deletions
+73
-22
adapter.c
dlls/dxgi/adapter.c
+43
-21
device.c
dlls/dxgi/tests/device.c
+29
-0
winedxgi.idl
include/wine/winedxgi.idl
+1
-1
No files found.
dlls/dxgi/adapter.c
View file @
ac84e9b7
...
...
@@ -38,6 +38,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IWineDXGIAdapter *i
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIObject
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIAdapter
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIAdapter1
)
||
IsEqualGUID
(
riid
,
&
IID_IWineDXGIAdapter
))
{
IUnknown_AddRef
(
iface
);
...
...
@@ -135,9 +136,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetDesc
(
IWineDXGIAdapter
*
iface
,
DXGI_ADAPTER_DESC
*
desc
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetDesc
1
(
IWineDXGIAdapter
*
iface
,
DXGI_ADAPTER_DESC1
*
desc
)
{
struct
dxgi_adapter
*
This
=
impl_from_IWineDXGIAdapter
(
iface
);
struct
dxgi_adapter
*
adapter
=
impl_from_IWineDXGIAdapter
(
iface
);
struct
wined3d_adapter_identifier
adapter_id
;
char
description
[
128
];
struct
wined3d
*
wined3d
;
...
...
@@ -145,38 +146,57 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IWineDXGIAdapter *iface, D
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
if
(
!
desc
)
return
E_INVALIDARG
;
if
(
!
desc
)
return
E_INVALIDARG
;
wined3d
=
IWineDXGIFactory_get_wined3d
(
This
->
parent
);
wined3d
=
IWineDXGIFactory_get_wined3d
(
adapter
->
parent
);
adapter_id
.
driver_size
=
0
;
adapter_id
.
description
=
description
;
adapter_id
.
description_size
=
sizeof
(
description
);
adapter_id
.
device_name_size
=
0
;
EnterCriticalSection
(
&
dxgi_cs
);
hr
=
wined3d_get_adapter_identifier
(
wined3d
,
This
->
ordinal
,
0
,
&
adapter_id
);
hr
=
wined3d_get_adapter_identifier
(
wined3d
,
adapter
->
ordinal
,
0
,
&
adapter_id
);
wined3d_decref
(
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
if
(
SUCCEEDED
(
hr
))
if
(
FAILED
(
hr
))
return
hr
;
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
description
,
-
1
,
desc
->
Description
,
128
))
{
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
description
,
-
1
,
desc
->
Description
,
128
))
{
DWORD
err
=
GetLastError
();
ERR
(
"Failed to translate description %s (%#x).
\n
"
,
debugstr_a
(
description
),
err
);
hr
=
E_FAIL
;
}
desc
->
VendorId
=
adapter_id
.
vendor_id
;
desc
->
DeviceId
=
adapter_id
.
device_id
;
desc
->
SubSysId
=
adapter_id
.
subsystem_id
;
desc
->
Revision
=
adapter_id
.
revision
;
desc
->
DedicatedVideoMemory
=
adapter_id
.
video_memory
;
desc
->
DedicatedSystemMemory
=
0
;
/* FIXME */
desc
->
SharedSystemMemory
=
0
;
/* FIXME */
memcpy
(
&
desc
->
AdapterLuid
,
&
adapter_id
.
adapter_luid
,
sizeof
(
desc
->
AdapterLuid
));
DWORD
err
=
GetLastError
();
ERR
(
"Failed to translate description %s (%#x).
\n
"
,
debugstr_a
(
description
),
err
);
hr
=
E_FAIL
;
}
desc
->
VendorId
=
adapter_id
.
vendor_id
;
desc
->
DeviceId
=
adapter_id
.
device_id
;
desc
->
SubSysId
=
adapter_id
.
subsystem_id
;
desc
->
Revision
=
adapter_id
.
revision
;
desc
->
DedicatedVideoMemory
=
adapter_id
.
video_memory
;
desc
->
DedicatedSystemMemory
=
0
;
/* FIXME */
desc
->
SharedSystemMemory
=
0
;
/* FIXME */
memcpy
(
&
desc
->
AdapterLuid
,
&
adapter_id
.
adapter_luid
,
sizeof
(
desc
->
AdapterLuid
));
desc
->
Flags
=
0
;
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetDesc
(
IWineDXGIAdapter
*
iface
,
DXGI_ADAPTER_DESC
*
desc
)
{
DXGI_ADAPTER_DESC1
desc1
;
HRESULT
hr
;
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
if
(
!
desc
)
return
E_INVALIDARG
;
if
(
FAILED
(
hr
=
dxgi_adapter_GetDesc1
(
iface
,
&
desc1
)))
return
hr
;
memcpy
(
desc
,
&
desc1
,
sizeof
(
*
desc
));
return
hr
;
}
...
...
@@ -214,6 +234,8 @@ static const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl =
dxgi_adapter_EnumOutputs
,
dxgi_adapter_GetDesc
,
dxgi_adapter_CheckInterfaceSupport
,
/* IDXGIAdapter1 methods */
dxgi_adapter_GetDesc1
,
/* IWineDXGIAdapter methods */
dxgi_adapter_get_ordinal
,
};
...
...
dlls/dxgi/tests/device.c
View file @
ac84e9b7
...
...
@@ -101,6 +101,8 @@ static void test_device_interfaces(IDXGIDevice *device)
static
void
test_adapter_desc
(
IDXGIDevice
*
device
)
{
DXGI_ADAPTER_DESC1
desc1
;
IDXGIAdapter1
*
adapter1
;
DXGI_ADAPTER_DESC
desc
;
IDXGIAdapter
*
adapter
;
HRESULT
hr
;
...
...
@@ -126,6 +128,33 @@ static void test_adapter_desc(IDXGIDevice *device)
desc
.
SharedSystemMemory
,
desc
.
SharedSystemMemory
/
(
1024
*
1024
));
trace
(
"LUID: %08x:%08x.
\n
"
,
desc
.
AdapterLuid
.
HighPart
,
desc
.
AdapterLuid
.
LowPart
);
hr
=
IDXGIAdapter_QueryInterface
(
adapter
,
&
IID_IDXGIAdapter1
,
(
void
**
)
&
adapter1
);
ok
(
SUCCEEDED
(
hr
)
||
broken
(
hr
==
E_NOINTERFACE
),
"Got unexpected hr %#x.
\n
"
,
hr
);
if
(
hr
==
E_NOINTERFACE
)
goto
done
;
hr
=
IDXGIAdapter1_GetDesc1
(
adapter1
,
&
desc1
);
ok
(
SUCCEEDED
(
hr
),
"GetDesc1 failed, hr %#x.
\n
"
,
hr
);
ok
(
!
lstrcmpW
(
desc
.
Description
,
desc1
.
Description
),
"Got unexpected description %s.
\n
"
,
wine_dbgstr_w
(
desc1
.
Description
));
ok
(
desc1
.
VendorId
==
desc
.
VendorId
,
"Got unexpected vendor ID %04x.
\n
"
,
desc1
.
VendorId
);
ok
(
desc1
.
DeviceId
==
desc
.
DeviceId
,
"Got unexpected device ID %04x.
\n
"
,
desc1
.
DeviceId
);
ok
(
desc1
.
SubSysId
==
desc
.
SubSysId
,
"Got unexpected sub system ID %04x.
\n
"
,
desc1
.
SubSysId
);
ok
(
desc1
.
Revision
==
desc
.
Revision
,
"Got unexpected revision %02x.
\n
"
,
desc1
.
Revision
);
ok
(
desc1
.
DedicatedVideoMemory
==
desc
.
DedicatedVideoMemory
,
"Got unexpected dedicated video memory %lu.
\n
"
,
desc1
.
DedicatedVideoMemory
);
ok
(
desc1
.
DedicatedSystemMemory
==
desc
.
DedicatedSystemMemory
,
"Got unexpected dedicated system memory %lu.
\n
"
,
desc1
.
DedicatedSystemMemory
);
ok
(
desc1
.
SharedSystemMemory
==
desc
.
SharedSystemMemory
,
"Got unexpected shared system memory %lu.
\n
"
,
desc1
.
SharedSystemMemory
);
ok
(
!
memcmp
(
&
desc
.
AdapterLuid
,
&
desc1
.
AdapterLuid
,
sizeof
(
desc
.
AdapterLuid
)),
"Got unexpected adapter LUID %08x:%08x.
\n
"
,
desc1
.
AdapterLuid
.
HighPart
,
desc1
.
AdapterLuid
.
LowPart
);
trace
(
"Flags: %08x.
\n
"
,
desc1
.
Flags
);
IDXGIAdapter1_Release
(
adapter1
);
done:
IDXGIAdapter_Release
(
adapter
);
}
...
...
include/wine/winedxgi.idl
View file @
ac84e9b7
...
...
@@ -33,7 +33,7 @@ interface IWineDXGIFactory : IDXGIFactory
local
,
uuid
(
ab1de34c
-
2963
-
4
ffd
-
8493
-
40
f580e510e5
)
]
interface
IWineDXGIAdapter
:
IDXGIAdapter
interface
IWineDXGIAdapter
:
IDXGIAdapter
1
{
UINT
get_ordinal
()
;
}
...
...
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