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