Try to fix the test difference (basically by replicating an old misfeature of headless...)

This commit is contained in:
Henrik Rydgård committed 2026-08-11 22:36:47 +02:00
1 parent 2d0e54f422
commit e062c90bf7
3 files changed
+17 -20

No files matched your search

+3 -3
View File
@@ -479,6 +479,9 @@ void CommandLineOptions::ApplyToConfig() const {
g_Config.iGPUBackend = (int)gpuBackend.value();
g_Config.DoNotSaveSetting(&g_Config.iGPUBackend);
}
if (cpuCore.has_value()) {
g_Config.iCpuCore = (int)cpuCore.value();
}
if (softwareRendering.has_value()) {
g_Config.bSoftwareRendering = softwareRendering.value();
g_Config.DoNotSaveSetting(&g_Config.bSoftwareRendering);
@@ -491,9 +494,6 @@ void CommandLineOptions::ApplyToConfig() const {
g_Config.bAutoRun = false;
g_Config.bSaveSettings = false;
}
if (cpuCore.has_value()) {
g_Config.iCpuCore = (int)cpuCore.value();
}
if (escapeExit.has_value()) {
g_Config.bPauseExitsEmulator = escapeExit.value();
}
+1
View File
@@ -1623,6 +1623,7 @@ VertexDecoderJitCache::VertexDecoderJitCache()
}
void VertexDecoderJitCache::Clear() {
// TODO: These should check CoreParameter instead.
if (g_Config.iCpuCore == (int)CPUCore::JIT || g_Config.iCpuCore == (int)CPUCore::JIT_IR) {
ClearCodeSpace(0);
}
+13 -17
View File
@@ -566,8 +566,6 @@ int main(int argc, const char* argv[]) {
bool fullLog = cmdLineOptions.enableLogging.value_or(false);
const char *stateToLoad = cmdLineOptions.stateToLoad.has_value() ? cmdLineOptions.stateToLoad.value().c_str() : nullptr;
GPUCore gpuCore = GPUCORE_SOFTWARE;
CPUCore cpuCore = CPUCore::JIT;
bool oldAtrac = false;
bool outputDebugStringLog = cmdLineOptions.odsLog.value_or(false);
@@ -576,10 +574,6 @@ int main(int argc, const char* argv[]) {
std::string mountIso = cmdLineOptions.mountIso.value_or("");
std::string mountRoot;
if (cmdLineOptions.cpuCore.has_value()) {
cpuCore = cmdLineOptions.cpuCore.value();
}
if (cmdLineOptions.root.has_value()) {
mountRoot = cmdLineOptions.root.value().c_str();
}
@@ -627,10 +621,10 @@ int main(int argc, const char* argv[]) {
// ApplyToConfig() below, so a matching command line flag can still override any of it -
// ApplyToConfig() always has the final say on the settings in g_Config.
//
// Somehow this affects the test execution of pspautotests/tests/gpu/vertices/morph.prx, even though
// we actually set the cpu core in CoreParameter below. Probably because we end up using the JIT vs non-JIT
// vertex decoder.
g_Config.iCpuCore = (int)cpuCore;
// This affects the test execution of pspautotests/tests/gpu/vertices/morph.prx, even though
// we actually set the cpu core in CoreParameter below.
// The check that decides that is in the DrawEngineCommon constructor.
g_Config.iCpuCore = (int)CPUCore::INTERPRETER;
// NOTE: In headless mode, we never save the config. This is just for this run.
g_Config.iDumpFileTypes = 0;
@@ -676,13 +670,15 @@ int main(int argc, const char* argv[]) {
// overrides above, so a matching command line flag always wins.
cmdLineOptions.ApplyToConfig();
CPUCore cpuCore = CPUCore::INTERPRETER;
if (cmdLineOptions.cpuCore.has_value()) {
cpuCore = cmdLineOptions.cpuCore.value();
}
GPUCore gpuCore = GPUCORE_SOFTWARE;
// Translate backend to core. We probably should consider merging these enums.
if (!g_Config.bSoftwareRendering) {
if (!cmdLineOptions.gpuBackend.has_value()) {
fprintf(stderr, "No graphics backend specified, but software rendering is disabled. Use --graphics=software, gles, directx11, or vulkan.\n");
return 1;
}
switch (cmdLineOptions.gpuBackend.value()) {
switch ((GPUBackend)g_Config.iGPUBackend) {
case GPUBackend::OPENGL:
gpuCore = GPUCORE_GLES;
break;
@@ -727,8 +723,8 @@ int main(int argc, const char* argv[]) {
// TODO: This whole function should be refactored to set up CoreParameter in one place,
// but not now.
CoreParameter coreParameter;
coreParameter.cpuCore = cpuCore; // apprently this gets overwritten somehow by g_Config above.
coreParameter.gpuCore = gpuCore;
coreParameter.cpuCore = (CPUCore)g_Config.iCpuCore;
coreParameter.gpuCore = (GPUCore)gpuCore;
coreParameter.graphicsContext = graphicsContext;
coreParameter.enableSound = false;
coreParameter.mountIso = mountIso.empty() ? Path() : Path(mountIso);