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
72aaaac4
Commit
72aaaac4
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 IWineDXGIFactory.
parent
22abd896
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
137 deletions
+90
-137
adapter.c
dlls/dxgi/adapter.c
+3
-6
device.c
dlls/dxgi/device.c
+27
-38
dxgi_private.h
dlls/dxgi/dxgi_private.h
+5
-4
factory.c
dlls/dxgi/factory.c
+54
-74
output.c
dlls/dxgi/output.c
+1
-5
winedxgi.idl
include/wine/winedxgi.idl
+0
-10
No files found.
dlls/dxgi/adapter.c
View file @
72aaaac4
...
...
@@ -105,7 +105,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter1 *iface, RE
TRACE
(
"iface %p, iid %s, parent %p
\n
"
,
iface
,
debugstr_guid
(
iid
),
parent
);
return
I
WineDXGIFactory_QueryInterface
(
adapter
->
parent
,
iid
,
parent
);
return
I
DXGIFactory1_QueryInterface
(
&
adapter
->
parent
->
IDXGIFactory1_iface
,
iid
,
parent
);
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_adapter_EnumOutputs
(
IDXGIAdapter1
*
iface
,
...
...
@@ -134,7 +134,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc1(IDXGIAdapter1 *iface, DXG
struct
dxgi_adapter
*
adapter
=
impl_from_IDXGIAdapter1
(
iface
);
struct
wined3d_adapter_identifier
adapter_id
;
char
description
[
128
];
struct
wined3d
*
wined3d
;
HRESULT
hr
;
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
desc
);
...
...
@@ -142,15 +141,13 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc1(IDXGIAdapter1 *iface, DXG
if
(
!
desc
)
return
E_INVALIDARG
;
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
,
adapter
->
ordinal
,
0
,
&
adapter_id
);
wined3d_decref
(
wined3d
);
hr
=
wined3d_get_adapter_identifier
(
adapter
->
parent
->
wined3d
,
adapter
->
ordinal
,
0
,
&
adapter_id
);
LeaveCriticalSection
(
&
dxgi_cs
);
if
(
FAILED
(
hr
))
...
...
@@ -224,7 +221,7 @@ struct dxgi_adapter *unsafe_impl_from_IDXGIAdapter1(IDXGIAdapter1 *iface)
return
CONTAINING_RECORD
(
iface
,
struct
dxgi_adapter
,
IDXGIAdapter1_iface
);
}
HRESULT
dxgi_adapter_init
(
struct
dxgi_adapter
*
adapter
,
IWineDXGIF
actory
*
parent
,
UINT
ordinal
)
HRESULT
dxgi_adapter_init
(
struct
dxgi_adapter
*
adapter
,
struct
dxgi_f
actory
*
parent
,
UINT
ordinal
)
{
struct
dxgi_output
*
output
;
...
...
dlls/dxgi/device.c
View file @
72aaaac4
...
...
@@ -82,7 +82,7 @@ static ULONG STDMETHODCALLTYPE dxgi_device_Release(IWineDXGIDevice *iface)
EnterCriticalSection
(
&
dxgi_cs
);
wined3d_device_decref
(
This
->
wined3d_device
);
LeaveCriticalSection
(
&
dxgi_cs
);
I
WineDXGIFactory
_Release
(
This
->
factory
);
I
DXGIFactory1
_Release
(
This
->
factory
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -148,7 +148,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_GetAdapter(IWineDXGIDevice *iface,
wined3d_device_get_creation_parameters
(
This
->
wined3d_device
,
&
create_parameters
);
LeaveCriticalSection
(
&
dxgi_cs
);
return
I
WineDXGIFactory
_EnumAdapters
(
This
->
factory
,
create_parameters
.
adapter_idx
,
adapter
);
return
I
DXGIFactory1
_EnumAdapters
(
This
->
factory
,
create_parameters
.
adapter_idx
,
adapter
);
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_CreateSurface
(
IWineDXGIDevice
*
iface
,
...
...
@@ -349,11 +349,17 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
struct
wined3d_device_parent
*
wined3d_device_parent
;
IWineDXGIDeviceParent
*
dxgi_device_parent
;
struct
dxgi_adapter
*
dxgi_adapter
;
struct
wined3d
*
wined3d
;
struct
dxgi_factory
*
dxgi_factory
;
void
*
layer_base
;
HRESULT
hr
;
WINED3DCAPS
caps
;
if
(
!
(
dxgi_factory
=
unsafe_impl_from_IDXGIFactory1
((
IDXGIFactory1
*
)
factory
)))
{
WARN
(
"This is not the factory we're looking for.
\n
"
);
return
E_FAIL
;
}
if
(
!
(
dxgi_adapter
=
unsafe_impl_from_IDXGIAdapter1
((
IDXGIAdapter1
*
)
adapter
)))
{
WARN
(
"This is not the adapter we're looking for.
\n
"
);
...
...
@@ -365,65 +371,48 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l
layer_base
=
device
+
1
;
hr
=
layer
->
create
(
layer
->
id
,
&
layer_base
,
0
,
device
,
&
IID_IUnknown
,
(
void
**
)
&
device
->
child_layer
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
layer
->
create
(
layer
->
id
,
&
layer_base
,
0
,
device
,
&
IID_IUnknown
,
(
void
**
)
&
device
->
child_layer
)))
{
WARN
(
"Failed to create device, returning %#x.
\n
"
,
hr
);
goto
fail
;
}
hr
=
IDXGIFactory_QueryInterface
(
factory
,
&
IID_IWineDXGIFactory
,
(
void
**
)
&
device
->
factory
);
if
(
FAILED
(
hr
))
{
WARN
(
"This is not the factory we're looking for, returning %#x.
\n
"
,
hr
);
goto
fail
;
return
hr
;
}
wined3d
=
IWineDXGIFactory_get_wined3d
(
device
->
factory
);
hr
=
IWineDXGIDevice_QueryInterface
(
&
device
->
IWineDXGIDevice_iface
,
&
IID_IWineDXGIDeviceParent
,
(
void
**
)
&
dxgi_device_parent
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
IWineDXGIDevice_QueryInterface
(
&
device
->
IWineDXGIDevice_iface
,
&
IID_IWineDXGIDeviceParent
,
(
void
**
)
&
dxgi_device_parent
)))
{
ERR
(
"DXGI device should implement IWineD3DDeviceParent.
\n
"
);
goto
fail
;
IUnknown_Release
(
device
->
child_layer
);
return
hr
;
}
wined3d_device_parent
=
IWineDXGIDeviceParent_get_wined3d_device_parent
(
dxgi_device_parent
);
IWineDXGIDeviceParent_Release
(
dxgi_device_parent
);
FIXME
(
"Ignoring adapter type.
\n
"
);
hr
=
wined3d_get_device_caps
(
wined3d
,
dxgi_adapter
->
ordinal
,
WINED3D_DEVICE_TYPE_HAL
,
&
caps
);
hr
=
wined3d_get_device_caps
(
dxgi_factory
->
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
"
);
if
(
SUCCEEDED
(
hr
))
hr
=
E_FAIL
;
goto
fail
;
IUnknown_Release
(
device
->
child_layer
);
return
hr
;
}
EnterCriticalSection
(
&
dxgi_cs
);
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
);
hr
=
wined3d_device_create
(
dxgi_factory
->
wined3d
,
dxgi_adapter
->
ordinal
,
WINED3D_DEVICE_TYPE_HAL
,
NULL
,
0
,
4
,
wined3d_device_parent
,
&
device
->
wined3d_device
);
LeaveCriticalSection
(
&
dxgi_cs
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create a wined3d device, returning %#x.
\n
"
,
hr
);
goto
fail
;
IUnknown_Release
(
device
->
child_layer
);
return
hr
;
}
return
S_OK
;
device
->
factory
=
&
dxgi_factory
->
IDXGIFactory1_iface
;
IDXGIFactory1_AddRef
(
device
->
factory
);
fail:
if
(
device
->
wined3d_device
)
{
EnterCriticalSection
(
&
dxgi_cs
);
wined3d_device_decref
(
device
->
wined3d_device
);
LeaveCriticalSection
(
&
dxgi_cs
);
}
if
(
device
->
factory
)
IWineDXGIFactory_Release
(
device
->
factory
);
if
(
device
->
child_layer
)
IUnknown_Release
(
device
->
child_layer
);
return
hr
;
return
S_OK
;
}
dlls/dxgi/dxgi_private.h
View file @
72aaaac4
...
...
@@ -80,7 +80,7 @@ enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSP
/* IDXGIFactory */
struct
dxgi_factory
{
I
WineDXGIFactory
IWineDXGIFactory
_iface
;
I
DXGIFactory1
IDXGIFactory1
_iface
;
LONG
refcount
;
struct
wined3d
*
wined3d
;
UINT
adapter_count
;
...
...
@@ -89,6 +89,7 @@ struct dxgi_factory
};
HRESULT
dxgi_factory_create
(
REFIID
riid
,
void
**
factory
,
BOOL
extended
)
DECLSPEC_HIDDEN
;
struct
dxgi_factory
*
unsafe_impl_from_IDXGIFactory1
(
IDXGIFactory1
*
iface
)
DECLSPEC_HIDDEN
;
/* IDXGIDevice */
struct
dxgi_device
...
...
@@ -97,7 +98,7 @@ struct dxgi_device
IUnknown
*
child_layer
;
LONG
refcount
;
struct
wined3d_device
*
wined3d_device
;
I
WineDXGIFactory
*
factory
;
I
DXGIFactory1
*
factory
;
};
HRESULT
dxgi_device_init
(
struct
dxgi_device
*
device
,
struct
dxgi_device_layer
*
layer
,
...
...
@@ -117,13 +118,13 @@ void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter)
struct
dxgi_adapter
{
IDXGIAdapter1
IDXGIAdapter1_iface
;
IWineDXGIF
actory
*
parent
;
struct
dxgi_f
actory
*
parent
;
LONG
refcount
;
UINT
ordinal
;
IDXGIOutput
*
output
;
};
HRESULT
dxgi_adapter_init
(
struct
dxgi_adapter
*
adapter
,
IWineDXGIF
actory
*
parent
,
UINT
ordinal
)
DECLSPEC_HIDDEN
;
HRESULT
dxgi_adapter_init
(
struct
dxgi_adapter
*
adapter
,
struct
dxgi_f
actory
*
parent
,
UINT
ordinal
)
DECLSPEC_HIDDEN
;
struct
dxgi_adapter
*
unsafe_impl_from_IDXGIAdapter1
(
IDXGIAdapter1
*
iface
)
DECLSPEC_HIDDEN
;
/* IDXGISwapChain */
...
...
dlls/dxgi/factory.c
View file @
72aaaac4
...
...
@@ -24,75 +24,70 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dxgi
);
static
inline
struct
dxgi_factory
*
impl_from_I
WineDXGIFactory
(
IWineDXGIFactory
*
iface
)
static
inline
struct
dxgi_factory
*
impl_from_I
DXGIFactory1
(
IDXGIFactory1
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dxgi_factory
,
I
WineDXGIFactory
_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
dxgi_factory
,
I
DXGIFactory1
_iface
);
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_QueryInterface
(
IWineDXGIFactory
*
iface
,
REFIID
riid
,
void
**
object
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_QueryInterface
(
IDXGIFactory1
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
dxgi_factory
*
factory
=
impl_from_I
WineDXGIFactory
(
iface
);
struct
dxgi_factory
*
factory
=
impl_from_I
DXGIFactory1
(
iface
);
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_IDXGIFactory
)
||
(
factory
->
extended
&&
IsEqualGUID
(
riid
,
&
IID_IDXGIFactory1
))
||
IsEqualGUID
(
riid
,
&
IID_IWineDXGIFactory
))
if
((
factory
->
extended
&&
IsEqualGUID
(
iid
,
&
IID_IDXGIFactory1
))
||
IsEqualGUID
(
iid
,
&
IID_IDXGIFactory
)
||
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_factory_AddRef
(
I
WineDXGIFactory
*
iface
)
static
ULONG
STDMETHODCALLTYPE
dxgi_factory_AddRef
(
I
DXGIFactory1
*
iface
)
{
struct
dxgi_factory
*
This
=
impl_from_IWineDXGIFactory
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
struct
dxgi_factory
*
factory
=
impl_from_IDXGIFactory1
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
factory
->
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_factory_Release
(
I
WineDXGIFactory
*
iface
)
static
ULONG
STDMETHODCALLTYPE
dxgi_factory_Release
(
I
DXGIFactory1
*
iface
)
{
struct
dxgi_factory
*
This
=
impl_from_IWineDXGIFactory
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
refcount
);
struct
dxgi_factory
*
factory
=
impl_from_IDXGIFactory1
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
factory
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p decreasing refcount to %u
.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
{
UINT
i
;
for
(
i
=
0
;
i
<
This
->
adapter_count
;
++
i
)
for
(
i
=
0
;
i
<
factory
->
adapter_count
;
++
i
)
{
IDXGIAdapter1_Release
(
This
->
adapters
[
i
]);
IDXGIAdapter1_Release
(
factory
->
adapters
[
i
]);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
adapters
);
HeapFree
(
GetProcessHeap
(),
0
,
factory
->
adapters
);
EnterCriticalSection
(
&
dxgi_cs
);
wined3d_decref
(
This
->
wined3d
);
wined3d_decref
(
factory
->
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
factory
);
}
return
refcount
;
}
/* IDXGIObject methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_SetPrivateData
(
IWineDXGIFactory
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_SetPrivateData
(
IDXGIFactory1
*
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
);
...
...
@@ -100,7 +95,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IWineDXGIFactory *i
return
E_NOTIMPL
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_SetPrivateDataInterface
(
I
WineDXGIFactory
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_SetPrivateDataInterface
(
I
DXGIFactory1
*
iface
,
REFGUID
guid
,
const
IUnknown
*
object
)
{
FIXME
(
"iface %p, guid %s, object %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
object
);
...
...
@@ -108,7 +103,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IWineDXGIF
return
E_NOTIMPL
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_GetPrivateData
(
I
WineDXGIFactory
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_GetPrivateData
(
I
DXGIFactory1
*
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
);
...
...
@@ -116,23 +111,21 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IWineDXGIFactory *i
return
E_NOTIMPL
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_GetParent
(
I
WineDXGIFactory
*
iface
,
REFIID
r
iid
,
void
**
parent
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_GetParent
(
I
DXGIFactory1
*
iface
,
REFIID
iid
,
void
**
parent
)
{
WARN
(
"iface %p,
riid %s, parent %p.
\n
"
,
iface
,
debugstr_guid
(
r
iid
),
parent
);
WARN
(
"iface %p,
iid %s, parent %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
parent
);
*
parent
=
NULL
;
return
E_NOINTERFACE
;
}
/* IDXGIFactory methods */
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_EnumAdapters1
(
IWineDXGIFactory
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_EnumAdapters1
(
IDXGIFactory1
*
iface
,
UINT
adapter_idx
,
IDXGIAdapter1
**
adapter
)
{
struct
dxgi_factory
*
factory
=
impl_from_I
WineDXGIFactory
(
iface
);
struct
dxgi_factory
*
factory
=
impl_from_I
DXGIFactory1
(
iface
);
TRACE
(
"iface %p, adapter_idx %u, adapter %p
\n
"
,
iface
,
adapter_idx
,
adapter
);
TRACE
(
"iface %p, adapter_idx %u, adapter %p
.
\n
"
,
iface
,
adapter_idx
,
adapter
);
if
(
!
adapter
)
return
DXGI_ERROR_INVALID_CALL
;
...
...
@@ -146,27 +139,27 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters1(IWineDXGIFactory *if
*
adapter
=
(
IDXGIAdapter1
*
)
factory
->
adapters
[
adapter_idx
];
IDXGIAdapter1_AddRef
(
*
adapter
);
TRACE
(
"Returning adapter %p
\n
"
,
*
adapter
);
TRACE
(
"Returning adapter %p
.
\n
"
,
*
adapter
);
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_EnumAdapters
(
I
WineDXGIFactory
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_EnumAdapters
(
I
DXGIFactory1
*
iface
,
UINT
adapter_idx
,
IDXGIAdapter
**
adapter
)
{
TRACE
(
"iface %p, adapter_idx %u, adapter %p
\n
"
,
iface
,
adapter_idx
,
adapter
);
TRACE
(
"iface %p, adapter_idx %u, adapter %p
.
\n
"
,
iface
,
adapter_idx
,
adapter
);
return
dxgi_factory_EnumAdapters1
(
iface
,
adapter_idx
,
(
IDXGIAdapter1
**
)
adapter
);
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_MakeWindowAssociation
(
I
WineDXGIFactory
*
iface
,
HWND
window
,
UINT
flags
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_MakeWindowAssociation
(
I
DXGIFactory1
*
iface
,
HWND
window
,
UINT
flags
)
{
FIXME
(
"iface %p, window %p, flags %#x stub!
\n
"
,
iface
,
window
,
flags
);
return
E_NOTIMPL
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_GetWindowAssociation
(
I
WineDXGIFactory
*
iface
,
HWND
*
window
)
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_GetWindowAssociation
(
I
DXGIFactory1
*
iface
,
HWND
*
window
)
{
FIXME
(
"iface %p, window %p stub!
\n
"
,
iface
,
window
);
...
...
@@ -181,7 +174,7 @@ static UINT dxgi_rational_to_uint(const DXGI_RATIONAL *rational)
return
rational
->
Numerator
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_CreateSwapChain
(
I
WineDXGIFactory
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_CreateSwapChain
(
I
DXGIFactory1
*
iface
,
IUnknown
*
device
,
DXGI_SWAP_CHAIN_DESC
*
desc
,
IDXGISwapChain
**
swapchain
)
{
struct
wined3d_swapchain
*
wined3d_swapchain
;
...
...
@@ -267,7 +260,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IWineDXGIFactory *
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_CreateSoftwareAdapter
(
I
WineDXGIFactory
*
iface
,
static
HRESULT
STDMETHODCALLTYPE
dxgi_factory_CreateSoftwareAdapter
(
I
DXGIFactory1
*
iface
,
HMODULE
swrast
,
IDXGIAdapter
**
adapter
)
{
FIXME
(
"iface %p, swrast %p, adapter %p stub!
\n
"
,
iface
,
swrast
,
adapter
);
...
...
@@ -275,57 +268,45 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IWineDXGIFac
return
E_NOTIMPL
;
}
static
BOOL
STDMETHODCALLTYPE
dxgi_factory_IsCurrent
(
I
WineDXGIFactory
*
iface
)
static
BOOL
STDMETHODCALLTYPE
dxgi_factory_IsCurrent
(
I
DXGIFactory1
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
TRUE
;
}
/* IWineDXGIFactory methods */
static
struct
wined3d
*
STDMETHODCALLTYPE
dxgi_factory_get_wined3d
(
IWineDXGIFactory
*
iface
)
{
struct
dxgi_factory
*
This
=
impl_from_IWineDXGIFactory
(
iface
);
TRACE
(
"iface %p
\n
"
,
iface
);
EnterCriticalSection
(
&
dxgi_cs
);
wined3d_incref
(
This
->
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
return
This
->
wined3d
;
}
static
const
struct
IWineDXGIFactoryVtbl
dxgi_factory_vtbl
=
static
const
struct
IDXGIFactory1Vtbl
dxgi_factory_vtbl
=
{
/* IUnknown methods */
dxgi_factory_QueryInterface
,
dxgi_factory_AddRef
,
dxgi_factory_Release
,
/* IDXGIObject methods */
dxgi_factory_SetPrivateData
,
dxgi_factory_SetPrivateDataInterface
,
dxgi_factory_GetPrivateData
,
dxgi_factory_GetParent
,
/* IDXGIFactory methods */
dxgi_factory_EnumAdapters
,
dxgi_factory_MakeWindowAssociation
,
dxgi_factory_GetWindowAssociation
,
dxgi_factory_CreateSwapChain
,
dxgi_factory_CreateSoftwareAdapter
,
/* IDXGIFactory1 methods */
dxgi_factory_EnumAdapters1
,
dxgi_factory_IsCurrent
,
/* IWineDXGIFactory methods */
dxgi_factory_get_wined3d
,
};
struct
dxgi_factory
*
unsafe_impl_from_IDXGIFactory1
(
IDXGIFactory1
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
dxgi_factory_vtbl
);
return
CONTAINING_RECORD
(
iface
,
struct
dxgi_factory
,
IDXGIFactory1_iface
);
}
static
HRESULT
dxgi_factory_init
(
struct
dxgi_factory
*
factory
,
BOOL
extended
)
{
HRESULT
hr
;
UINT
i
;
factory
->
I
WineDXGIFactory
_iface
.
lpVtbl
=
&
dxgi_factory_vtbl
;
factory
->
I
DXGIFactory1
_iface
.
lpVtbl
=
&
dxgi_factory_vtbl
;
factory
->
refcount
=
1
;
EnterCriticalSection
(
&
dxgi_cs
);
...
...
@@ -363,8 +344,7 @@ static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended)
goto
fail
;
}
hr
=
dxgi_adapter_init
(
adapter
,
&
factory
->
IWineDXGIFactory_iface
,
i
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
dxgi_adapter_init
(
adapter
,
factory
,
i
)))
{
UINT
j
;
...
...
@@ -410,8 +390,8 @@ HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended)
TRACE
(
"Created factory %p.
\n
"
,
object
);
hr
=
I
WineDXGIFactory_QueryInterface
(
&
object
->
IWineDXGIFactory
_iface
,
riid
,
factory
);
I
WineDXGIFactory_Release
(
&
object
->
IWineDXGIFactory
_iface
);
hr
=
I
DXGIFactory1_QueryInterface
(
&
object
->
IDXGIFactory1
_iface
,
riid
,
factory
);
I
DXGIFactory1_Release
(
&
object
->
IDXGIFactory1
_iface
);
return
hr
;
}
dlls/dxgi/output.c
View file @
72aaaac4
...
...
@@ -140,7 +140,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
return
S_OK
;
}
wined3d
=
IWineDXGIFactory_get_wined3d
(
This
->
adapter
->
parent
)
;
wined3d
=
This
->
adapter
->
parent
->
wined3d
;
wined3d_format
=
wined3dformat_from_dxgi_format
(
format
);
EnterCriticalSection
(
&
dxgi_cs
);
...
...
@@ -149,7 +149,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
if
(
!
desc
)
{
wined3d_decref
(
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
*
mode_count
=
max_count
;
return
S_OK
;
...
...
@@ -157,7 +156,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
if
(
max_count
>
*
mode_count
)
{
wined3d_decref
(
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
return
DXGI_ERROR_MORE_DATA
;
}
...
...
@@ -174,7 +172,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
if
(
FAILED
(
hr
))
{
WARN
(
"EnumAdapterModes failed, hr %#x.
\n
"
,
hr
);
wined3d_decref
(
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
return
hr
;
}
...
...
@@ -187,7 +184,6 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa
desc
[
i
].
ScanlineOrdering
=
mode
.
scanline_ordering
;
desc
[
i
].
Scaling
=
DXGI_MODE_SCALING_UNSPECIFIED
;
/* FIXME */
}
wined3d_decref
(
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
return
S_OK
;
...
...
include/wine/winedxgi.idl
View file @
72aaaac4
...
...
@@ -21,16 +21,6 @@ import "dxgi.idl";
[
object
,
local
,
uuid
(
a07ad9ab
-
fb01
-
4574
-
8b
fb
-
0
a70a7373f04
)
]
interface
IWineDXGIFactory
:
IDXGIFactory1
{
struct
wined3d
*
get_wined3d
()
;
}
[
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