early-access version 2535

This commit is contained in:
pineappleEA 2022-03-09 03:48:53 +01:00
parent b4dd8f6d3e
commit 870c5bbb4e
5 changed files with 16 additions and 4 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2533. This is the source code for early-access 2535.
## Legal Notice ## Legal Notice

View file

@ -326,7 +326,9 @@ struct System::Impl {
is_powered_on = false; is_powered_on = false;
exit_lock = false; exit_lock = false;
if (gpu_core != nullptr) {
gpu_core->NotifyShutdown(); gpu_core->NotifyShutdown();
}
services.reset(); services.reset();
service_manager.reset(); service_manager.reset();

View file

@ -42,11 +42,20 @@ public:
context.MakeCurrent(); context.MakeCurrent();
} }
~Scoped() { ~Scoped() {
if (active) {
context.DoneCurrent(); context.DoneCurrent();
} }
}
/// In the event that context was destroyed before the Scoped is destroyed, this provides a
/// mechanism to prevent calling a destroyed object's method during the deconstructor
void Cancel() {
active = false;
}
private: private:
GraphicsContext& context; GraphicsContext& context;
bool active{true};
}; };
/// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value /// Calls MakeCurrent on the context and calls DoneCurrent when the scope for the returned value

View file

@ -312,7 +312,7 @@ public:
size = Common::AlignUp(size, Kernel::PageSize); size = Common::AlignUp(size, Kernel::PageSize);
size += page_table.GetNumGuardPages() * Kernel::PageSize * 4; size += page_table.GetNumGuardPages() * Kernel::PageSize * 4;
auto is_region_available = [&](VAddr addr) { const auto is_region_available = [&](VAddr addr) {
const auto end_addr = addr + size; const auto end_addr = addr + size;
while (addr < end_addr) { while (addr < end_addr) {
if (system.Memory().IsValidVirtualAddress(addr)) { if (system.Memory().IsValidVirtualAddress(addr)) {

View file

@ -50,6 +50,7 @@ std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Cor
gpu->BindRenderer(std::move(renderer)); gpu->BindRenderer(std::move(renderer));
return gpu; return gpu;
} catch (const std::runtime_error& exception) { } catch (const std::runtime_error& exception) {
scope.Cancel();
LOG_ERROR(HW_GPU, "Failed to initialize GPU: {}", exception.what()); LOG_ERROR(HW_GPU, "Failed to initialize GPU: {}", exception.what());
return nullptr; return nullptr;
} }