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
e441e7b4
Commit
e441e7b4
authored
Sep 16, 2015
by
Józef Kucia
Committed by
Alexandre Julliard
Sep 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d11: Implement D3D11CreateDeviceAndSwapChain().
parent
aacc7b39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
6 deletions
+80
-6
d3d11_main.c
dlls/d3d11/d3d11_main.c
+79
-5
d3d11_private.h
dlls/d3d11/d3d11_private.h
+1
-1
No files found.
dlls/d3d11/d3d11_main.c
View file @
e441e7b4
...
...
@@ -273,11 +273,85 @@ HRESULT WINAPI D3D11CreateDevice(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_t
HRESULT
WINAPI
D3D11CreateDeviceAndSwapChain
(
IDXGIAdapter
*
adapter
,
D3D_DRIVER_TYPE
driver_type
,
HMODULE
swrast
,
UINT
flags
,
const
D3D_FEATURE_LEVEL
*
feature_levels
,
UINT
levels
,
UINT
sdk_version
,
const
DXGI_SWAP_CHAIN_DESC
*
swapchain_desc
,
IDXGISwapChain
**
swapchain
,
ID3D11Device
**
device
,
D3D_FEATURE_LEVEL
*
feature_level
,
ID3D11DeviceContext
**
immediate_context
)
ID3D11Device
**
device
_out
,
D3D_FEATURE_LEVEL
*
obtained_
feature_level
,
ID3D11DeviceContext
**
immediate_context
)
{
FIXME
(
"adapter %p, driver_type %s, swrast %p, flags %#x, feature_levels %p, levels %#x, sdk_version %u, "
"swapchain_desc %p, swapchain %p, device %p, feature_level %p, immediate_context %p stub!
\n
"
,
DXGI_SWAP_CHAIN_DESC
desc
;
IDXGIDevice
*
dxgi_device
;
IDXGIFactory
*
factory
;
ID3D11Device
*
device
;
HRESULT
hr
;
TRACE
(
"adapter %p, driver_type %s, swrast %p, flags %#x, feature_levels %p, levels %u, sdk_version %u, "
"swapchain_desc %p, swapchain %p, device %p, obtained_feature_level %p, immediate_context %p.
\n
"
,
adapter
,
debug_d3d_driver_type
(
driver_type
),
swrast
,
flags
,
feature_levels
,
levels
,
sdk_version
,
swapchain_desc
,
swapchain
,
device
,
feature_level
,
immediate_context
);
return
E_NOTIMPL
;
swapchain_desc
,
swapchain
,
device_out
,
obtained_feature_level
,
immediate_context
);
if
(
swapchain
)
*
swapchain
=
NULL
;
if
(
device_out
)
*
device_out
=
NULL
;
if
(
FAILED
(
hr
=
D3D11CreateDevice
(
adapter
,
driver_type
,
swrast
,
flags
,
feature_levels
,
levels
,
sdk_version
,
&
device
,
obtained_feature_level
,
immediate_context
)))
{
WARN
(
"Failed to create a device, returning %#x.
\n
"
,
hr
);
return
hr
;
}
if
(
swapchain
)
{
if
(
FAILED
(
hr
=
ID3D11Device_QueryInterface
(
device
,
&
IID_IDXGIDevice
,
(
void
**
)
&
dxgi_device
)))
{
ERR
(
"Failed to get a dxgi device from the d3d11 device, returning %#x.
\n
"
,
hr
);
goto
cleanup
;
}
hr
=
IDXGIDevice_GetAdapter
(
dxgi_device
,
&
adapter
);
IDXGIDevice_Release
(
dxgi_device
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to get the device adapter, returning %#x.
\n
"
,
hr
);
goto
cleanup
;
}
hr
=
IDXGIAdapter_GetParent
(
adapter
,
&
IID_IDXGIFactory
,
(
void
**
)
&
factory
);
IDXGIAdapter_Release
(
adapter
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to get the adapter factory, returning %#x.
\n
"
,
hr
);
goto
cleanup
;
}
desc
=
*
swapchain_desc
;
hr
=
IDXGIFactory_CreateSwapChain
(
factory
,
(
IUnknown
*
)
device
,
&
desc
,
swapchain
);
IDXGIFactory_Release
(
factory
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create a swapchain, returning %#x.
\n
"
,
hr
);
goto
cleanup
;
}
TRACE
(
"Created IDXGISwapChain %p.
\n
"
,
swapchain
);
}
if
(
device_out
)
*
device_out
=
device
;
else
ID3D11Device_Release
(
device
);
return
S_OK
;
cleanup:
if
(
device
)
ID3D11Device_Release
(
device
);
if
(
obtained_feature_level
)
*
obtained_feature_level
=
0
;
if
(
immediate_context
)
{
/* FIXME: Remove the following NULL check once the d3d11_device_GetImmediateContext() is implemented. */
if
(
*
immediate_context
)
ID3D11DeviceContext_Release
(
*
immediate_context
);
*
immediate_context
=
NULL
;
}
return
hr
;
}
dlls/d3d11/d3d11_private.h
View file @
e441e7b4
...
...
@@ -353,7 +353,7 @@ HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d_device *device,
const
D3D10_QUERY_DESC
*
desc
,
BOOL
predicate
)
DECLSPEC_HIDDEN
;
struct
d3d10_query
*
unsafe_impl_from_ID3D10Query
(
ID3D10Query
*
iface
)
DECLSPEC_HIDDEN
;
/* ID
irect
3D10Device1 */
/* ID
3D11Device, ID
3D10Device1 */
struct
d3d_device
{
IUnknown
IUnknown_inner
;
...
...
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