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
22abd896
Commit
22abd896
authored
Sep 15, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Get rid of IWineDXGIAdapter.
parent
240c4540
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
93 deletions
+63
-93
adapter.c
dlls/dxgi/adapter.c
+45
-61
device.c
dlls/dxgi/device.c
+9
-16
dxgi_private.h
dlls/dxgi/dxgi_private.h
+5
-2
factory.c
dlls/dxgi/factory.c
+4
-4
winedxgi.idl
include/wine/winedxgi.idl
+0
-10
No files found.
dlls/dxgi/adapter.c
View file @
22abd896
...
...
@@ -24,63 +24,58 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dxgi
);
static
inline
struct
dxgi_adapter
*
impl_from_I
WineDXGIAdapter
(
IWineDXGIAdapter
*
iface
)
static
inline
struct
dxgi_adapter
*
impl_from_I
DXGIAdapter1
(
IDXGIAdapter1
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dxgi_adapter
,
I
WineDXGIAdapter
_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
dxgi_adapter
,
I
DXGIAdapter1
_iface
);
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_QueryInterface
(
IWineDXGIAdapter
*
iface
,
REFIID
riid
,
void
**
object
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_QueryInterface
(
IDXGIAdapter1
*
iface
,
REFIID
iid
,
void
**
out
)
{
TRACE
(
"iface %p,
riid %s, object %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
objec
t
);
TRACE
(
"iface %p,
iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
ou
t
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIObject
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIAdapter
)
||
IsEqualGUID
(
riid
,
&
IID_IDXGIAdapter1
)
||
IsEqualGUID
(
riid
,
&
IID_IWineDXGIAdapter
))
if
(
IsEqualGUID
(
iid
,
&
IID_IDXGIAdapter1
)
||
IsEqualGUID
(
iid
,
&
IID_IDXGIAdapter
)
||
IsEqualGUID
(
iid
,
&
IID_IDXGIObject
)
||
IsEqualGUID
(
iid
,
&
IID_IUnknown
))
{
IUnknown_AddRef
(
iface
);
*
o
bjec
t
=
iface
;
*
o
u
t
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
r
iid
));
WARN
(
"%s not implemented, returning E_NOINTERFACE
.
\n
"
,
debugstr_guid
(
iid
));
*
o
bjec
t
=
NULL
;
*
o
u
t
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
dxgi_adapter_AddRef
(
I
WineDXGIAdapter
*
iface
)
static
ULONG
STDMETHODCALLTYPE
dxgi_adapter_AddRef
(
I
DXGIAdapter1
*
iface
)
{
struct
dxgi_adapter
*
This
=
impl_from_IWineDXGIAdapter
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
struct
dxgi_adapter
*
adapter
=
impl_from_IDXGIAdapter1
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
adapter
->
refcount
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p increasing refcount to %u
.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
dxgi_adapter_Release
(
I
WineDXGIAdapter
*
iface
)
static
ULONG
STDMETHODCALLTYPE
dxgi_adapter_Release
(
I
DXGIAdapter1
*
iface
)
{
struct
dxgi_adapter
*
This
=
impl_from_IWineDXGIAdapter
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
refcount
);
struct
dxgi_adapter
*
adapter
=
impl_from_IDXGIAdapter1
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
adapter
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p decreasing refcount to %u
.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
{
IDXGIOutput_Release
(
This
->
output
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
IDXGIOutput_Release
(
adapter
->
output
);
HeapFree
(
GetProcessHeap
(),
0
,
adapter
);
}
return
refcount
;
}
/* IDXGIObject methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_SetPrivateData
(
IWineDXGIAdapter
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_SetPrivateData
(
IDXGIAdapter1
*
iface
,
REFGUID
guid
,
UINT
data_size
,
const
void
*
data
)
{
FIXME
(
"iface %p, guid %s, data_size %u, data %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
...
...
@@ -88,7 +83,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IWineDXGIAdapter *i
return
E_NOTIMPL
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_SetPrivateDataInterface
(
I
WineDXGIAdapter
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_SetPrivateDataInterface
(
I
DXGIAdapter1
*
iface
,
REFGUID
guid
,
const
IUnknown
*
object
)
{
FIXME
(
"iface %p, guid %s, object %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
object
);
...
...
@@ -96,7 +91,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IWineDXGIA
return
E_NOTIMPL
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetPrivateData
(
I
WineDXGIAdapter
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetPrivateData
(
I
DXGIAdapter1
*
iface
,
REFGUID
guid
,
UINT
*
data_size
,
void
*
data
)
{
FIXME
(
"iface %p, guid %s, data_size %p, data %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
...
...
@@ -104,21 +99,19 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IWineDXGIAdapter *i
return
E_NOTIMPL
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetParent
(
I
WineDXGIAdapter
*
iface
,
REFIID
r
iid
,
void
**
parent
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetParent
(
I
DXGIAdapter1
*
iface
,
REFIID
iid
,
void
**
parent
)
{
struct
dxgi_adapter
*
This
=
impl_from_IWineDXGIAdapter
(
iface
);
struct
dxgi_adapter
*
adapter
=
impl_from_IDXGIAdapter1
(
iface
);
TRACE
(
"iface %p,
riid %s, parent %p
\n
"
,
iface
,
debugstr_guid
(
r
iid
),
parent
);
TRACE
(
"iface %p,
iid %s, parent %p
\n
"
,
iface
,
debugstr_guid
(
iid
),
parent
);
return
IWineDXGIFactory_QueryInterface
(
This
->
parent
,
r
iid
,
parent
);
return
IWineDXGIFactory_QueryInterface
(
adapter
->
parent
,
iid
,
parent
);
}
/* IDXGIAdapter methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_EnumOutputs
(
IWineDXGIAdapter
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_EnumOutputs
(
IDXGIAdapter1
*
iface
,
UINT
output_idx
,
IDXGIOutput
**
output
)
{
struct
dxgi_adapter
*
This
=
impl_from_IWineDXGIAdapter
(
iface
);
struct
dxgi_adapter
*
adapter
=
impl_from_IDXGIAdapter1
(
iface
);
TRACE
(
"iface %p, output_idx %u, output %p.
\n
"
,
iface
,
output_idx
,
output
);
...
...
@@ -128,7 +121,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac
return
DXGI_ERROR_NOT_FOUND
;
}
*
output
=
This
->
output
;
*
output
=
adapter
->
output
;
IDXGIOutput_AddRef
(
*
output
);
TRACE
(
"Returning output %p.
\n
"
,
output
);
...
...
@@ -136,9 +129,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetDesc1
(
I
WineDXGIAdapter
*
iface
,
DXGI_ADAPTER_DESC1
*
desc
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetDesc1
(
I
DXGIAdapter1
*
iface
,
DXGI_ADAPTER_DESC1
*
desc
)
{
struct
dxgi_adapter
*
adapter
=
impl_from_I
WineDXGIAdapter
(
iface
);
struct
dxgi_adapter
*
adapter
=
impl_from_I
DXGIAdapter1
(
iface
);
struct
wined3d_adapter_identifier
adapter_id
;
char
description
[
128
];
struct
wined3d
*
wined3d
;
...
...
@@ -183,7 +176,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc1(IWineDXGIAdapter *iface,
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetDesc
(
I
WineDXGIAdapter
*
iface
,
DXGI_ADAPTER_DESC
*
desc
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_GetDesc
(
I
DXGIAdapter1
*
iface
,
DXGI_ADAPTER_DESC
*
desc
)
{
DXGI_ADAPTER_DESC1
desc1
;
HRESULT
hr
;
...
...
@@ -200,7 +193,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IWineDXGIAdapter *iface, D
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_CheckInterfaceSupport
(
I
WineDXGIAdapter
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_CheckInterfaceSupport
(
I
DXGIAdapter1
*
iface
,
REFGUID
guid
,
LARGE_INTEGER
*
umd_version
)
{
FIXME
(
"iface %p, guid %s, umd_version %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
umd_version
);
...
...
@@ -208,43 +201,34 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IWineDXGIAda
return
E_NOTIMPL
;
}
/* IWineDXGIAdapter methods */
static
UINT
STDMETHODCALLTYPE
dxgi_adapter_get_ordinal
(
IWineDXGIAdapter
*
iface
)
{
struct
dxgi_adapter
*
This
=
impl_from_IWineDXGIAdapter
(
iface
);
TRACE
(
"iface %p, returning %u
\n
"
,
iface
,
This
->
ordinal
);
return
This
->
ordinal
;
}
static
const
struct
IWineDXGIAdapterVtbl
dxgi_adapter_vtbl
=
static
const
struct
IDXGIAdapter1Vtbl
dxgi_adapter_vtbl
=
{
/* IUnknown methods */
dxgi_adapter_QueryInterface
,
dxgi_adapter_AddRef
,
dxgi_adapter_Release
,
/* IDXGIObject methods */
dxgi_adapter_SetPrivateData
,
dxgi_adapter_SetPrivateDataInterface
,
dxgi_adapter_GetPrivateData
,
dxgi_adapter_GetParent
,
/* IDXGIAdapter methods */
dxgi_adapter_EnumOutputs
,
dxgi_adapter_GetDesc
,
dxgi_adapter_CheckInterfaceSupport
,
/* IDXGIAdapter1 methods */
dxgi_adapter_GetDesc1
,
/* IWineDXGIAdapter methods */
dxgi_adapter_get_ordinal
,
};
struct
dxgi_adapter
*
unsafe_impl_from_IDXGIAdapter1
(
IDXGIAdapter1
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
dxgi_adapter_vtbl
);
return
CONTAINING_RECORD
(
iface
,
struct
dxgi_adapter
,
IDXGIAdapter1_iface
);
}
HRESULT
dxgi_adapter_init
(
struct
dxgi_adapter
*
adapter
,
IWineDXGIFactory
*
parent
,
UINT
ordinal
)
{
struct
dxgi_output
*
output
;
adapter
->
I
WineDXGIAdapter
_iface
.
lpVtbl
=
&
dxgi_adapter_vtbl
;
adapter
->
I
DXGIAdapter1
_iface
.
lpVtbl
=
&
dxgi_adapter_vtbl
;
adapter
->
parent
=
parent
;
adapter
->
refcount
=
1
;
adapter
->
ordinal
=
ordinal
;
...
...
dlls/dxgi/device.c
View file @
22abd896
...
...
@@ -348,13 +348,18 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
{
struct
wined3d_device_parent
*
wined3d_device_parent
;
IWineDXGIDeviceParent
*
dxgi_device_parent
;
IWineDXGIAdapter
*
wine_adapter
;
UINT
adapter_ordinal
;
struct
dxgi_adapter
*
dxgi_adapter
;
struct
wined3d
*
wined3d
;
void
*
layer_base
;
HRESULT
hr
;
WINED3DCAPS
caps
;
if
(
!
(
dxgi_adapter
=
unsafe_impl_from_IDXGIAdapter1
((
IDXGIAdapter1
*
)
adapter
)))
{
WARN
(
"This is not the adapter we're looking for.
\n
"
);
return
E_FAIL
;
}
device
->
IWineDXGIDevice_iface
.
lpVtbl
=
&
dxgi_device_vtbl
;
device
->
refcount
=
1
;
...
...
@@ -376,18 +381,6 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
}
wined3d
=
IWineDXGIFactory_get_wined3d
(
device
->
factory
);
hr
=
IDXGIAdapter_QueryInterface
(
adapter
,
&
IID_IWineDXGIAdapter
,
(
void
**
)
&
wine_adapter
);
if
(
FAILED
(
hr
))
{
WARN
(
"This is not the adapter we're looking for, returning %#x.
\n
"
,
hr
);
EnterCriticalSection
(
&
dxgi_cs
);
wined3d_decref
(
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
goto
fail
;
}
adapter_ordinal
=
IWineDXGIAdapter_get_ordinal
(
wine_adapter
);
IWineDXGIAdapter_Release
(
wine_adapter
);
hr
=
IWineDXGIDevice_QueryInterface
(
&
device
->
IWineDXGIDevice_iface
,
&
IID_IWineDXGIDeviceParent
,
(
void
**
)
&
dxgi_device_parent
);
if
(
FAILED
(
hr
))
...
...
@@ -400,7 +393,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
FIXME
(
"Ignoring adapter type.
\n
"
);
hr
=
wined3d_get_device_caps
(
wined3d
,
adapter_
ordinal
,
WINED3D_DEVICE_TYPE_HAL
,
&
caps
);
hr
=
wined3d_get_device_caps
(
wined3d
,
dxgi_adapter
->
ordinal
,
WINED3D_DEVICE_TYPE_HAL
,
&
caps
);
if
(
FAILED
(
hr
)
||
caps
.
VertexShaderVersion
<
4
||
caps
.
PixelShaderVersion
<
4
)
{
WARN
(
"Direct3D 10 is not supported on this GPU with the current shader backend.
\n
"
);
...
...
@@ -410,7 +403,7 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
}
EnterCriticalSection
(
&
dxgi_cs
);
hr
=
wined3d_device_create
(
wined3d
,
adapter_
ordinal
,
WINED3D_DEVICE_TYPE_HAL
,
NULL
,
0
,
4
,
hr
=
wined3d_device_create
(
wined3d
,
dxgi_adapter
->
ordinal
,
WINED3D_DEVICE_TYPE_HAL
,
NULL
,
0
,
4
,
wined3d_device_parent
,
&
device
->
wined3d_device
);
IWineDXGIDeviceParent_Release
(
dxgi_device_parent
);
wined3d_decref
(
wined3d
);
...
...
dlls/dxgi/dxgi_private.h
View file @
22abd896
...
...
@@ -21,6 +21,8 @@
#include "wine/debug.h"
#include <assert.h>
#define COBJMACROS
#include "winbase.h"
#include "wingdi.h"
...
...
@@ -82,7 +84,7 @@ struct dxgi_factory
LONG
refcount
;
struct
wined3d
*
wined3d
;
UINT
adapter_count
;
I
WineDXGIAdapter
**
adapters
;
I
DXGIAdapter1
**
adapters
;
BOOL
extended
;
};
...
...
@@ -114,7 +116,7 @@ void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter)
/* IDXGIAdapter */
struct
dxgi_adapter
{
I
WineDXGIAdapter
IWineDXGIAdapter
_iface
;
I
DXGIAdapter1
IDXGIAdapter1
_iface
;
IWineDXGIFactory
*
parent
;
LONG
refcount
;
UINT
ordinal
;
...
...
@@ -122,6 +124,7 @@ struct dxgi_adapter
};
HRESULT
dxgi_adapter_init
(
struct
dxgi_adapter
*
adapter
,
IWineDXGIFactory
*
parent
,
UINT
ordinal
)
DECLSPEC_HIDDEN
;
struct
dxgi_adapter
*
unsafe_impl_from_IDXGIAdapter1
(
IDXGIAdapter1
*
iface
)
DECLSPEC_HIDDEN
;
/* IDXGISwapChain */
struct
dxgi_swapchain
...
...
dlls/dxgi/factory.c
View file @
22abd896
...
...
@@ -77,7 +77,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IWineDXGIFactory *iface)
for
(
i
=
0
;
i
<
This
->
adapter_count
;
++
i
)
{
I
WineDXGIAdapter
_Release
(
This
->
adapters
[
i
]);
I
DXGIAdapter1
_Release
(
This
->
adapters
[
i
]);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
adapters
);
...
...
@@ -357,7 +357,7 @@ static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended)
for
(
j
=
0
;
j
<
i
;
++
j
)
{
I
WineDXGIAdapter
_Release
(
factory
->
adapters
[
j
]);
I
DXGIAdapter1
_Release
(
factory
->
adapters
[
j
]);
}
hr
=
E_OUTOFMEMORY
;
goto
fail
;
...
...
@@ -373,12 +373,12 @@ static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended)
HeapFree
(
GetProcessHeap
(),
0
,
adapter
);
for
(
j
=
0
;
j
<
i
;
++
j
)
{
I
WineDXGIAdapter
_Release
(
factory
->
adapters
[
j
]);
I
DXGIAdapter1
_Release
(
factory
->
adapters
[
j
]);
}
goto
fail
;
}
factory
->
adapters
[
i
]
=
&
adapter
->
I
WineDXGIAdapter
_iface
;
factory
->
adapters
[
i
]
=
&
adapter
->
I
DXGIAdapter1
_iface
;
}
factory
->
extended
=
extended
;
...
...
include/wine/winedxgi.idl
View file @
22abd896
...
...
@@ -31,16 +31,6 @@ interface IWineDXGIFactory : IDXGIFactory1
[
object
,
local
,
uuid
(
ab1de34c
-
2963
-
4
ffd
-
8493
-
40
f580e510e5
)
]
interface
IWineDXGIAdapter
:
IDXGIAdapter1
{
UINT
get_ordinal
()
;
}
[
object
,
local
,
uuid
(
3
e1ff30b
-
c951
-
48
c3
-
b010
-
0
fb49f3dca71
)
]
interface
IWineDXGIDevice
:
IDXGIDevice
...
...
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