Skip to content

Commit 33489e6

Browse files
committed
handle vulkan unloading
1 parent e75f404 commit 33489e6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Diff for: ares/n64/system/system.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ auto System::game() -> string {
7777
}
7878

7979
auto System::run() -> void {
80-
//todo: terrible; fix; remove
80+
// not ideal
8181
if(!vulkanLoaded) {
8282
vulkan.load(node);
8383
vulkanLoaded = true;
@@ -139,9 +139,6 @@ auto System::load(Node::System& root, string name) -> bool {
139139
rdp.load(node);
140140
if(_DD()) dd.load(node);
141141
if(model() == Model::Aleck64) aleck64.load(node);
142-
#if defined(VULKAN)
143-
//vulkan.load(node);
144-
#endif
145142

146143
initDebugHooks();
147144

@@ -313,6 +310,7 @@ auto System::unload() -> void {
313310
if(vi.screen) vi.screen->quit(); //stop video thread
314311
#if defined(VULKAN)
315312
vulkan.unload();
313+
vulkanLoaded = false;
316314
#endif
317315
cartridgeSlot.unload();
318316
controllerPort1.unload();

Diff for: ares/n64/system/system.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ struct System {
55
bool expansionPak = true;
66
u8 configuredControllerPakBankCount = 1;
77
u8 controllerPakBankCount = 1;
8-
bool vulkanLoaded = false;
98

109
enum class Model : u32 { Nintendo64, Aleck64 };
1110
enum class Region : u32 { NTSC, PAL };
@@ -38,6 +37,8 @@ struct System {
3837
u32 videoFrequency = 48'681'818;
3938
bool dd = false;
4039
} information;
40+
41+
bool vulkanLoaded = false;
4142

4243
auto initDebugHooks() -> void;
4344

0 commit comments

Comments
 (0)