mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-22 20:39:20 +01:00
Attach Texture to Cycle in Texture::TransitionLayout
Not doing so could result in the texture being destroyed before the completion of a transition and lead to undefined behavior.
This commit is contained in:
parent
3268b3779a
commit
7532eaf050
@ -377,8 +377,8 @@ namespace skyline::gpu {
|
|||||||
|
|
||||||
TRACE_EVENT("gpu", "Texture::TransitionLayout");
|
TRACE_EVENT("gpu", "Texture::TransitionLayout");
|
||||||
|
|
||||||
if (layout != pLayout)
|
if (layout != pLayout) {
|
||||||
cycle = gpu.scheduler.Submit([&](vk::raii::CommandBuffer &commandBuffer) {
|
auto lCycle{gpu.scheduler.Submit([&](vk::raii::CommandBuffer &commandBuffer) {
|
||||||
commandBuffer.pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eBottomOfPipe, {}, {}, {}, vk::ImageMemoryBarrier{
|
commandBuffer.pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eBottomOfPipe, {}, {}, {}, vk::ImageMemoryBarrier{
|
||||||
.image = GetBacking(),
|
.image = GetBacking(),
|
||||||
.srcAccessMask = vk::AccessFlagBits::eNoneKHR,
|
.srcAccessMask = vk::AccessFlagBits::eNoneKHR,
|
||||||
@ -393,7 +393,10 @@ namespace skyline::gpu {
|
|||||||
.layerCount = layerCount,
|
.layerCount = layerCount,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
})};
|
||||||
|
lCycle->AttachObject(shared_from_this());
|
||||||
|
cycle = lCycle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Texture::SynchronizeHost(bool rwTrap) {
|
void Texture::SynchronizeHost(bool rwTrap) {
|
||||||
|
Loading…
Reference in New Issue
Block a user