mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
Refactor all std::lock_guard usages to std::scoped_lock
This commit is contained in:
@ -21,11 +21,11 @@ namespace skyline::gpu {
|
||||
mirror = alignedMirror.subspan(static_cast<size_t>(guest->data() - alignedData), guest->size());
|
||||
|
||||
trapHandle = gpu.state.nce->TrapRegions(*guest, true, [this] {
|
||||
std::lock_guard lock(*this);
|
||||
std::scoped_lock lock{*this};
|
||||
SynchronizeGuest(true); // We can skip trapping since the caller will do it
|
||||
WaitOnFence();
|
||||
}, [this] {
|
||||
std::lock_guard lock(*this);
|
||||
std::scoped_lock lock{*this};
|
||||
SynchronizeGuest(true);
|
||||
dirtyState = DirtyState::CpuDirty; // We need to assume the buffer is dirty since we don't know what the guest is writing
|
||||
WaitOnFence();
|
||||
@ -95,7 +95,7 @@ namespace skyline::gpu {
|
||||
}
|
||||
|
||||
Buffer::~Buffer() {
|
||||
std::lock_guard lock(*this);
|
||||
std::scoped_lock lock{*this};
|
||||
if (trapHandle)
|
||||
gpu.state.nce->DeleteTrap(*trapHandle);
|
||||
SynchronizeGuest(true);
|
||||
|
@ -514,7 +514,7 @@ namespace skyline::gpu::interconnect {
|
||||
}
|
||||
|
||||
void ClearColorRt(TextureView *renderTarget, vk::Rect2D scissor, u32 layerIndex) {
|
||||
std::lock_guard lock(*renderTarget);
|
||||
std::scoped_lock lock{*renderTarget};
|
||||
executor.AttachTexture(renderTarget);
|
||||
|
||||
scissor.extent.width = static_cast<u32>(std::min(static_cast<i32>(renderTarget->texture->dimensions.width) - scissor.offset.x,
|
||||
@ -546,7 +546,7 @@ namespace skyline::gpu::interconnect {
|
||||
}
|
||||
|
||||
void ClearDepthStencilRt(TextureView *renderTarget, vk::ImageAspectFlags aspect, u32 layerIndex) {
|
||||
std::lock_guard lock(*renderTarget);
|
||||
std::scoped_lock lock{*renderTarget};
|
||||
executor.AttachTexture(renderTarget);
|
||||
|
||||
if (renderTarget->range.layerCount == 1 && layerIndex == 0) {
|
||||
|
@ -172,7 +172,7 @@ namespace skyline::gpu {
|
||||
}
|
||||
|
||||
void PresentationEngine::UpdateSurface(jobject newSurface) {
|
||||
std::lock_guard guard(mutex);
|
||||
std::scoped_lock guard{mutex};
|
||||
|
||||
auto env{state.jvm->GetEnv()};
|
||||
if (!env->IsSameObject(jSurface, nullptr)) {
|
||||
@ -295,7 +295,7 @@ namespace skyline::gpu {
|
||||
throw exception("Retrieving the next frame's ID failed with {}", result);
|
||||
|
||||
{
|
||||
std::lock_guard queueLock(gpu.queueMutex);
|
||||
std::scoped_lock queueLock{gpu.queueMutex};
|
||||
std::ignore = gpu.vkQueue.presentKHR(vk::PresentInfoKHR{
|
||||
.swapchainCount = 1,
|
||||
.pSwapchains = &**vkSwapchain,
|
||||
|
@ -106,11 +106,11 @@ namespace skyline::gpu {
|
||||
}
|
||||
|
||||
trapHandle = gpu.state.nce->TrapRegions(mappings, true, [this] {
|
||||
std::lock_guard lock(*this);
|
||||
std::scoped_lock lock{*this};
|
||||
SynchronizeGuest(true); // We can skip trapping since the caller will do it
|
||||
WaitOnFence();
|
||||
}, [this] {
|
||||
std::lock_guard lock(*this);
|
||||
std::scoped_lock lock{*this};
|
||||
SynchronizeGuest(true);
|
||||
dirtyState = DirtyState::CpuDirty; // We need to assume the texture is dirty since we don't know what the guest is writing
|
||||
WaitOnFence();
|
||||
@ -339,7 +339,7 @@ namespace skyline::gpu {
|
||||
}
|
||||
|
||||
Texture::~Texture() {
|
||||
std::lock_guard lock(*this);
|
||||
std::scoped_lock lock{*this};
|
||||
if (trapHandle)
|
||||
gpu.state.nce->DeleteTrap(*trapHandle);
|
||||
SynchronizeGuest(true);
|
||||
|
Reference in New Issue
Block a user