Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qtrhi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Laszlo Agocs
qtrhi
Commits
7fa0a9bc
Commit
7fa0a9bc
authored
Jan 25, 2019
by
Laszlo Agocs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtl: do not reuse the command queue with rsh
parent
b20d9229
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
src/rhi/qrhimetal.mm
src/rhi/qrhimetal.mm
+8
-12
src/rhi/qrhirsh_p.h
src/rhi/qrhirsh_p.h
+3
-1
No files found.
src/rhi/qrhimetal.mm
View file @
7fa0a9bc
...
...
@@ -327,20 +327,18 @@ bool QRhiMetal::create(QRhi::Flags flags)
if
(
importedCmdQueue
)
{
[
d
->
cmdQueue
retain
];
}
else
{
if
(
!
rsh
||
!
rsh
->
d_metal
.
cmdQueue
)
{
d
->
cmdQueue
=
[
d
->
dev
newCommandQueue
];
if
(
rsh
)
{
rsh
->
d_metal
.
cmdQueue
=
d
->
cmdQueue
;
[
d
->
cmdQueue
retain
];
}
}
else
{
d
->
cmdQueue
=
(
id
<
MTLCommandQueue
>
)
rsh
->
d_metal
.
cmdQueue
;
[
d
->
cmdQueue
retain
];
}
// We could use the existing MTLCommandQueue when rsh is enabled. We
// choose not to share the queue however, in order avoid performance
// surprises with multiple windows and QRhis severly limiting each
// other's rendering rate.
d
->
cmdQueue
=
[
d
->
dev
newCommandQueue
];
}
if
(
@available
(
macOS
10.13
,
iOS
11.0
,
*
))
{
d
->
captureMgr
=
[
MTLCaptureManager
sharedCaptureManager
];
// Have a custom capture scope as well which then shows up in XCode as
// an option when capturing, and becomes especially useful when having
// multiple windows with multiple QRhis.
d
->
captureScope
=
[
d
->
captureMgr
newCaptureScopeWithCommandQueue
:
d
->
cmdQueue
];
d
->
captureScope
.
label
=
@"Qt capture scope"
;
}
...
...
@@ -402,8 +400,6 @@ void QRhiMetal::destroy()
if
(
rsh
)
{
if
(
--
rsh
->
rhiCount
==
0
)
{
[(
id
<
MTLCommandQueue
>
)
rsh
->
d_metal
.
cmdQueue
release
];
rsh
->
d_metal
.
cmdQueue
=
nullptr
;
[(
id
<
MTLDevice
>
)
rsh
->
d_metal
.
dev
release
];
rsh
->
d_metal
.
dev
=
nullptr
;
}
...
...
src/rhi/qrhirsh_p.h
View file @
7fa0a9bc
...
...
@@ -89,7 +89,9 @@ public:
QRhiD3D11NativeHandles
d_d3d11
;
#endif
#ifdef Q_OS_DARWIN
QRhiMetalNativeHandles
d_metal
;
struct
{
void
*
dev
=
nullptr
;
}
d_metal
;
#endif
};
...
...
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