Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion game/game/compatibility/cpu32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void Cpu32::callFunction(ptr32_t func) {

std::string Cpu32::popString() {
if(stack.size()==0)
return 0;
return "";
auto ptr = stack.back();
stack.pop_back();

Expand Down
17 changes: 9 additions & 8 deletions game/graphics/instancestorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,10 @@ bool InstanceStorage::commit(Encoder<CommandBuffer>& cmd, uint8_t fId) {
}

void InstanceStorage::join() {
while(true) {
std::unique_lock<std::mutex> lck(sync);
if(uploadFId<0)
break;
}
std::unique_lock<std::mutex> lck(sync);
uploadCnd.wait(lck, [this] {
return uploadFId < 0;
});
}

InstanceStorage::Id InstanceStorage::alloc(const size_t size) {
Expand Down Expand Up @@ -307,13 +306,15 @@ void InstanceStorage::uploadMain() {
Workers::setThreadName("InstanceStorage upload");
while(true) {
std::unique_lock<std::mutex> lck(sync);
uploadCnd.wait(lck);
uploadCnd.wait(lck, [this] {
return uploadFId >= 0;
});
if(uploadFId==Resources::MaxFramesInFlight)
break;
if(uploadFId<0)
continue;

patchGpu[uploadFId].update(patchCpu);
uploadFId = -1;
lck.unlock();
uploadCnd.notify_all();
}
}