Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Laszlo Agocs
qtrhi
Commits
085a3bfe
Commit
085a3bfe
authored
Nov 29, 2018
by
Laszlo Agocs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d: prevent pch breaks caused by including com stuff in public header
parent
c07c86df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
src/rhi/qrhid3d11.cpp
src/rhi/qrhid3d11.cpp
+5
-3
src/rhi/qrhid3d11.h
src/rhi/qrhid3d11.h
+4
-6
src/rhi/qrhid3d11_p.h
src/rhi/qrhid3d11_p.h
+1
-0
No files found.
src/rhi/qrhid3d11.cpp
View file @
085a3bfe
...
...
@@ -61,9 +61,11 @@ QRhiD3D11::QRhiD3D11(QRhiInitParams *params)
debugLayer
=
d3dparams
->
enableDebugLayer
;
importedDevice
=
d3dparams
->
importExistingDevice
;
if
(
importedDevice
)
{
dev
=
d3dparams
->
dev
;
if
(
SUCCEEDED
(
d3dparams
->
context
->
QueryInterface
(
IID_ID3D11DeviceContext1
,
reinterpret_cast
<
void
**>
(
&
context
))))
{
d3dparams
->
context
->
Release
();
dev
=
reinterpret_cast
<
ID3D11Device
*>
(
d3dparams
->
dev
);
ID3D11DeviceContext
*
ctx
=
reinterpret_cast
<
ID3D11DeviceContext
*>
(
d3dparams
->
context
);
if
(
SUCCEEDED
(
ctx
->
QueryInterface
(
IID_ID3D11DeviceContext1
,
reinterpret_cast
<
void
**>
(
&
context
))))
{
// get rid of the ref added by QueryInterface
ctx
->
Release
();
}
else
{
qWarning
(
"ID3D11DeviceContext1 not supported by context, cannot import"
);
importedDevice
=
false
;
...
...
src/rhi/qrhid3d11.h
View file @
085a3bfe
...
...
@@ -39,8 +39,8 @@
#include <QtRhi/qrhi.h>
#ifdef Q_OS_WIN
#include <d3d11_1.h>
// no d3d includes here, to prevent precompiled header mess (due to this being
// a public header)
QT_BEGIN_NAMESPACE
...
...
@@ -51,12 +51,10 @@ struct Q_RHI_EXPORT QRhiD3D11InitParams : public QRhiInitParams
bool
importExistingDevice
=
false
;
// both must be given when importExistingDevice is true. ownership not taken.
// leave them unset otherwise.
ID3D11Device
*
dev
=
nullptr
;
ID3D11DeviceContext
*
context
=
nullptr
;
void
*
dev
=
nullptr
;
void
*
context
=
nullptr
;
};
QT_END_NAMESPACE
#endif // Q_OS_WIN
#endif
src/rhi/qrhid3d11_p.h
View file @
085a3bfe
...
...
@@ -46,6 +46,7 @@
#include <QShaderDescription>
#include <QWindow>
#include <d3d11_1.h>
#include <dxgi1_3.h>
QT_BEGIN_NAMESPACE
...
...
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