mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 04:01:51 +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");
|
||||
|
||||
if (layout != pLayout)
|
||||
cycle = gpu.scheduler.Submit([&](vk::raii::CommandBuffer &commandBuffer) {
|
||||
if (layout != pLayout) {
|
||||
auto lCycle{gpu.scheduler.Submit([&](vk::raii::CommandBuffer &commandBuffer) {
|
||||
commandBuffer.pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eBottomOfPipe, {}, {}, {}, vk::ImageMemoryBarrier{
|
||||
.image = GetBacking(),
|
||||
.srcAccessMask = vk::AccessFlagBits::eNoneKHR,
|
||||
@ -393,7 +393,10 @@ namespace skyline::gpu {
|
||||
.layerCount = layerCount,
|
||||
},
|
||||
});
|
||||
});
|
||||
})};
|
||||
lCycle->AttachObject(shared_from_this());
|
||||
cycle = lCycle;
|
||||
}
|
||||
}
|
||||
|
||||
void Texture::SynchronizeHost(bool rwTrap) {
|
||||
|
Loading…
Reference in New Issue
Block a user