Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Laszlo Agocs
qtrhi
Commits
eba81cf0
Commit
eba81cf0
authored
Mar 04, 2019
by
Laszlo Agocs
Browse files
vk, mtl: Track resources correctly in copy, readback and mip.gen.
parent
b06128e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/rhi/qrhimetal.mm
View file @
eba81cf0
...
...
@@ -1374,6 +1374,8 @@ void QRhiMetal::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate
destinationSlice:
u
.
desc
.
destinationLayer
()
destinationLevel:
u
.
desc
.
destinationLevel
()
destinationOrigin:
MTLOriginMake
(
dp
.
x
(),
dp
.
y
(),
0
)];
srcD
->
lastActiveFrameSlot
=
dstD
->
lastActiveFrameSlot
=
currentFrameSlot
;
}
for
(
const
QRhiResourceUpdateBatchPrivate
::
TextureRead
&
u
:
ud
->
textureReadbacks
)
{
...
...
@@ -1396,6 +1398,7 @@ void QRhiMetal::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate
aRb
.
format
=
texD
->
m_format
;
src
=
texD
->
d
->
tex
;
srcSize
=
texD
->
m_pixelSize
;
texD
->
lastActiveFrameSlot
=
currentFrameSlot
;
}
else
{
Q_ASSERT
(
currentSwapChain
);
swapChainD
=
QRHI_RES
(
QMetalSwapChain
,
currentSwapChain
);
...
...
@@ -1432,8 +1435,10 @@ void QRhiMetal::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdate
}
for
(
const
QRhiResourceUpdateBatchPrivate
::
TextureMipGen
&
u
:
ud
->
textureMipGens
)
{
QMetalTexture
*
utexD
=
QRHI_RES
(
QMetalTexture
,
u
.
tex
);
ensureBlit
();
[
blitEnc
generateMipmapsForTexture
:
QRHI_RES
(
QMetalTexture
,
u
.
tex
)
->
d
->
tex
];
[
blitEnc
generateMipmapsForTexture
:
utexD
->
d
->
tex
];
utexD
->
lastActiveFrameSlot
=
currentFrameSlot
;
}
if
(
blitEnc
)
{
...
...
src/rhi/qrhivulkan.cpp
View file @
eba81cf0
...
...
@@ -2555,6 +2555,8 @@ void QRhiVulkan::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdat
finishTransferSrc
(
cb
,
srcD
);
finishTransferDest
(
cb
,
dstD
);
srcD
->
lastActiveFrameSlot
=
dstD
->
lastActiveFrameSlot
=
currentFrameSlot
;
}
for
(
const
QRhiResourceUpdateBatchPrivate
::
TextureRead
&
u
:
ud
->
textureReadbacks
)
{
...
...
@@ -2573,6 +2575,7 @@ void QRhiVulkan::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdat
aRb
.
pixelSize
=
u
.
rb
.
level
()
>
0
?
q
->
sizeForMipLevel
(
u
.
rb
.
level
(),
texD
->
m_pixelSize
)
:
texD
->
m_pixelSize
;
aRb
.
format
=
texD
->
m_format
;
texD
->
lastActiveFrameSlot
=
currentFrameSlot
;
}
else
{
Q_ASSERT
(
currentSwapChain
);
swapChainD
=
QRHI_RES
(
QVkSwapChain
,
currentSwapChain
);
...
...
@@ -2718,6 +2721,8 @@ void QRhiVulkan::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdat
}
finishTransferDest
(
cb
,
utexD
);
utexD
->
lastActiveFrameSlot
=
currentFrameSlot
;
}
ud
->
free
();
...
...
Write
Preview
Supports
Markdown
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