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
a42b7568
Commit
a42b7568
authored
Nov 17, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Add a wined3d device to dxgi_device.
parent
20b04202
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
3 deletions
+55
-3
device.c
dlls/dxgi/device.c
+4
-0
dxgi_main.c
dlls/dxgi/dxgi_main.c
+49
-3
dxgi_private.h
dlls/dxgi/dxgi_private.h
+2
-0
No files found.
dlls/dxgi/device.c
View file @
a42b7568
...
...
@@ -73,6 +73,10 @@ static ULONG STDMETHODCALLTYPE dxgi_device_Release(IDXGIDevice *iface)
if
(
!
refcount
)
{
if
(
This
->
child_layer
)
IUnknown_Release
(
This
->
child_layer
);
EnterCriticalSection
(
&
dxgi_cs
);
IWineD3DDevice_Release
(
This
->
wined3d_device
);
LeaveCriticalSection
(
&
dxgi_cs
);
IWineDXGIFactory_Release
(
This
->
factory
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
dlls/dxgi/dxgi_main.c
View file @
a42b7568
...
...
@@ -166,6 +166,9 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
struct
layer_get_size_args
get_size_args
;
struct
dxgi_device
*
dxgi_device
;
struct
dxgi_device_layer
d3d10_layer
;
IWineDXGIAdapter
*
wine_adapter
;
UINT
adapter_ordinal
;
IWineD3D
*
wined3d
;
void
*
layer_base
;
UINT
device_size
;
DWORD
count
;
...
...
@@ -217,6 +220,39 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
dxgi_device
->
vtbl
=
&
dxgi_device_vtbl
;
dxgi_device
->
refcount
=
1
;
hr
=
IDXGIFactory_QueryInterface
(
factory
,
&
IID_IWineDXGIFactory
,
(
void
**
)
&
dxgi_device
->
factory
);
if
(
FAILED
(
hr
))
{
WARN
(
"This is not the factory we're looking for, returning %#x
\n
"
,
hr
);
goto
fail
;
}
wined3d
=
IWineDXGIFactory_get_wined3d
(
dxgi_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
);
IWineD3D_Release
(
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
goto
fail
;
}
adapter_ordinal
=
IWineDXGIAdapter_get_ordinal
(
wine_adapter
);
IWineDXGIAdapter_Release
(
wine_adapter
);
FIXME
(
"Ignoring adapter type
\n
"
);
EnterCriticalSection
(
&
dxgi_cs
);
hr
=
IWineD3D_CreateDevice
(
wined3d
,
adapter_ordinal
,
WINED3DDEVTYPE_HAL
,
NULL
,
0
,
&
dxgi_device
->
wined3d_device
,
(
IUnknown
*
)
dxgi_device
);
IWineD3D_Release
(
wined3d
);
LeaveCriticalSection
(
&
dxgi_cs
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create a WineD3D device, returning %#x
\n
"
,
hr
);
goto
fail
;
}
layer_base
=
dxgi_device
+
1
;
hr
=
d3d10_layer
.
create
(
d3d10_layer
.
id
,
&
layer_base
,
0
,
...
...
@@ -224,14 +260,24 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create device, returning %#x
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
dxgi_device
);
*
device
=
NULL
;
return
hr
;
goto
fail
;
}
*
device
=
(
IUnknown
*
)
dxgi_device
;
return
hr
;
fail:
if
(
dxgi_device
->
wined3d_device
)
{
EnterCriticalSection
(
&
dxgi_cs
);
IWineD3DDevice_Release
(
dxgi_device
->
wined3d_device
);
LeaveCriticalSection
(
&
dxgi_cs
);
}
if
(
dxgi_device
->
factory
)
IWineDXGIFactory_Release
(
dxgi_device
->
factory
);
HeapFree
(
GetProcessHeap
(),
0
,
dxgi_device
);
*
device
=
NULL
;
return
hr
;
}
HRESULT
WINAPI
DXGID3D10RegisterLayers
(
const
struct
dxgi_device_layer
*
layers
,
UINT
layer_count
)
...
...
dlls/dxgi/dxgi_private.h
View file @
a42b7568
...
...
@@ -55,6 +55,8 @@ struct dxgi_device
const
struct
IDXGIDeviceVtbl
*
vtbl
;
IUnknown
*
child_layer
;
LONG
refcount
;
IWineD3DDevice
*
wined3d_device
;
IWineDXGIFactory
*
factory
;
};
/* IDXGIAdapter */
...
...
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