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
Expand all
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
This diff is collapsed.
Click to expand it.
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