add playgo hack

This commit is contained in:
nmzik
2026-08-18 03:53:44 +02:00
parent 5a32e270ad
commit 5ea92d95a7
4 changed files with 19 additions and 0 deletions
+4
View File
@@ -101,6 +101,10 @@ bool ReadbackLinearImagesEnabled() {
return g_config->readback_linear_images;
}
bool PlayGoHackEnabled() {
return g_config->playgo_hack_enabled;
}
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
bool RedZoneProtectionEnabled() {
return g_config->red_zone_protection_enabled;
+2
View File
@@ -51,6 +51,7 @@ struct ConfigOptions {
bool spirv_debug_printf_enabled = false;
bool renderdoc_enabled = false;
bool readback_linear_images = false;
bool playgo_hack_enabled = false;
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
bool red_zone_protection_enabled = false;
#endif
@@ -85,6 +86,7 @@ bool SpirvDebugPrintfEnabled();
bool RenderDocEnabled();
bool ReadbackLinearImagesEnabled();
bool PlayGoHackEnabled();
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
bool RedZoneProtectionEnabled();
#endif
+7
View File
@@ -1,6 +1,7 @@
#include "common/abi.h"
#include "common/assert.h"
#include "common/common.h"
#include "common/emulatorConfig.h"
#include "common/logging/log.h"
#include "common/stringUtils.h"
#include "libs/errno.h"
@@ -23,6 +24,7 @@ static constexpr int8_t PLAYGO_LOCUS_LOCAL_FAST = 3;
static constexpr int32_t PLAYGO_INSTALL_SPEED_FULL = 2;
static constexpr int32_t PLAYGO_OPTIONAL_TYPE_LANGUAGE = 0;
static constexpr int32_t PLAYGO_OPTIONAL_TYPE_SCENARIO = 1;
static constexpr uint32_t PLAYGO_DEFAULT_CHUNKS_NUM = 1000;
static constexpr uint64_t PLAYGO_LANGUAGE_MASK_ALL = 0xffffffffffffffffull;
static constexpr uint64_t PLAYGO_SCENARIO_MASK_ALL = 0x1full;
@@ -96,6 +98,11 @@ int KYTY_SYSV_ABI PlayGoInitialize(const PlayGoInitParams* init) {
"\t reserved = %" PRId32 "\n",
reinterpret_cast<uint64_t>(init->buf_addr), init->buf_size, init->reserved);
if (Config::PlayGoHackEnabled() && !ensure_chunks_loaded()) {
g_chunks_num = PLAYGO_DEFAULT_CHUNKS_NUM;
LOGF("\t playgo_hack chunks = %" PRIu32 "\n", g_chunks_num);
}
return OK;
}
+6
View File
@@ -64,6 +64,7 @@ static void PrintUsage() {
::printf(" --spirv-debug-printf <true|false> Enable SPIR-V debug printf.\n");
::printf(
" --readback-linear-images <true|false> Read back writable linear images on submit.\n");
::printf(" --playgo-hack Use the supplied PlayGo stub fallback.\n");
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
::printf(" --redzone Protect the guest SysV red zone.\n");
#endif
@@ -141,6 +142,11 @@ static bool ParseArgs(int argc, char* argv[], RunOptions& options, bool& show_he
continue;
}
if (arg == "--playgo-hack") {
options.config.playgo_hack_enabled = true;
continue;
}
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
if (arg == "--redzone") {
options.config.red_zone_protection_enabled = true;