mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-11-29 18:48:57 -08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce87d20f25 |
No files matched your search
@@ -1,7 +1,4 @@
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
on: [push, pull_request]
|
||||
name: Continuous Integration
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "hooks/devicehook.h"
|
||||
#include "hooks/libraryhook.h"
|
||||
#ifdef SPICE64
|
||||
#include <mutex>
|
||||
#include <psapi.h>
|
||||
#include "hooks/graphics/nvapi_impl.h"
|
||||
#endif
|
||||
@@ -216,10 +217,16 @@ namespace games::sdvx {
|
||||
}
|
||||
|
||||
// store a cached copy of the first successful call to K32GetPerformanceInfo
|
||||
static std::mutex cache_mutex;
|
||||
static PERFORMANCE_INFORMATION cached {};
|
||||
static const BOOL cached_valid = K32GetPerformanceInfo_orig(&cached, sizeof(cached));
|
||||
static bool cached_valid = false;
|
||||
std::lock_guard<std::mutex> lock(cache_mutex);
|
||||
if (!cached_valid) {
|
||||
return K32GetPerformanceInfo_orig(info, cb);
|
||||
if (!K32GetPerformanceInfo_orig(info, cb)) {
|
||||
return FALSE;
|
||||
}
|
||||
cached = *info;
|
||||
cached_valid = true;
|
||||
}
|
||||
|
||||
// return the cached copy to avoid performance issues with the game calling this every frame
|
||||
|
||||
Reference in new issue
Block a user