diff --git a/src/common/emulatorConfig.cpp b/src/common/emulatorConfig.cpp
index 5e77e8e6d..762a43b19 100644
--- a/src/common/emulatorConfig.cpp
+++ b/src/common/emulatorConfig.cpp
@@ -75,7 +75,7 @@ ShaderOptimizationType GetShaderOptimizationType() {
return g_config->shader_optimization_type;
}
-ShaderLogDirection GetShaderLogDirection() {
+LogDirection GetShaderLogDirection() {
return g_config->shader_log_direction;
}
@@ -95,7 +95,7 @@ bool GraphicsDebugDumpEnabled() {
return g_config->graphics_debug_dump_enabled;
}
-OutputDirection GetPrintfDirection() {
+LogDirection GetPrintfDirection() {
return g_config->printf_direction;
}
@@ -103,8 +103,8 @@ std::filesystem::path GetPrintfOutputFile() {
return g_config->printf_output_file;
}
-ProfilerDirection GetProfilerDirection() {
- return g_config->profiler_direction;
+bool ProfilerEnabled() {
+ return g_config->profiler_enabled;
}
bool SpirvDebugPrintfEnabled() {
diff --git a/src/common/emulatorConfig.h b/src/common/emulatorConfig.h
index ea2793243..61b26f2d8 100644
--- a/src/common/emulatorConfig.h
+++ b/src/common/emulatorConfig.h
@@ -21,11 +21,7 @@ struct Lifecycle {
enum class ShaderOptimizationType { None, Size, Performance };
-enum class ShaderLogDirection { Silent, Console, File };
-
-enum class ProfilerDirection { None, Network };
-
-enum class OutputDirection { Silent, Console, File };
+enum class LogDirection { Silent, Console, File };
enum class PresentMode { Fifo, Mailbox, Immediate };
@@ -47,7 +43,7 @@ struct ConfigOptions {
uint32_t screen_height = 720;
std::string user_name = "Kyty";
int32_t user_id = DEFAULT_USER_ID;
- PresentMode present_mode = PresentMode::Fifo;
+ PresentMode present_mode = PresentMode::Mailbox;
int32_t gpu_index = -1;
bool fullscreen_enabled = false;
uint32_t vblank_frequency = 60;
@@ -55,14 +51,14 @@ struct ConfigOptions {
bool vulkan_validation_enabled = false;
bool shader_validation_enabled = false;
ShaderOptimizationType shader_optimization_type = ShaderOptimizationType::None;
- ShaderLogDirection shader_log_direction = ShaderLogDirection::Silent;
+ LogDirection shader_log_direction = LogDirection::Silent;
std::filesystem::path shader_log_folder = "_Shaders";
bool command_buffer_dump_enabled = false;
std::filesystem::path command_buffer_dump_folder = "_Buffers";
bool graphics_debug_dump_enabled = false;
- OutputDirection printf_direction = OutputDirection::Silent;
+ LogDirection printf_direction = LogDirection::Silent;
std::filesystem::path printf_output_file = "_kyty.txt";
- ProfilerDirection profiler_direction = ProfilerDirection::None;
+ bool profiler_enabled = false;
bool spirv_debug_printf_enabled = false;
bool gpu_assisted_validation_enabled = false;
bool renderdoc_enabled = false;
@@ -89,7 +85,7 @@ bool VulkanValidationEnabled();
bool ShaderValidationEnabled();
ShaderOptimizationType GetShaderOptimizationType();
-ShaderLogDirection GetShaderLogDirection();
+LogDirection GetShaderLogDirection();
std::filesystem::path GetShaderLogFolder();
bool CommandBufferDumpEnabled();
@@ -97,10 +93,10 @@ std::filesystem::path GetCommandBufferDumpFolder();
bool GraphicsDebugDumpEnabled();
-OutputDirection GetPrintfDirection();
+LogDirection GetPrintfDirection();
std::filesystem::path GetPrintfOutputFile();
-ProfilerDirection GetProfilerDirection();
+bool ProfilerEnabled();
bool SpirvDebugPrintfEnabled();
diff --git a/src/common/logging/log.cpp b/src/common/logging/log.cpp
index a44a6ee06..43264b69d 100644
--- a/src/common/logging/log.cpp
+++ b/src/common/logging/log.cpp
@@ -152,9 +152,9 @@ void WriteFatal(fmt::text_style style, std::string_view text) {
void Initialize() {
g_initialized = true;
switch (Config::GetPrintfDirection()) {
- case Config::OutputDirection::Silent: g_direction = Direction::Silent; break;
- case Config::OutputDirection::Console: g_direction = Direction::Console; break;
- case Config::OutputDirection::File: g_direction = Direction::File; break;
+ case Config::LogDirection::Silent: g_direction = Direction::Silent; break;
+ case Config::LogDirection::Console: g_direction = Direction::Console; break;
+ case Config::LogDirection::File: g_direction = Direction::File; break;
}
g_output_file =
(g_direction == Direction::File ? Config::GetPrintfOutputFile() : std::filesystem::path {});
diff --git a/src/common/profiler.cpp b/src/common/profiler.cpp
index 11a08f452..6eeec0c99 100644
--- a/src/common/profiler.cpp
+++ b/src/common/profiler.cpp
@@ -55,19 +55,13 @@ void SetThreadName(const char* name) {
}
void Initialize() {
- switch (Config::GetProfilerDirection()) {
- case Config::ProfilerDirection::Network:
- if (!tracy::ProfilerAvailable()) {
- tracy::StartupProfiler();
- TracySetProgramName("KytyPS5");
- ::printf("Tracy profiler enabled: client %d.%d.%d, protocol %u, "
- "broadcast %u, connect to 127.0.0.1:8086\n",
- tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch,
- tracy::ProtocolVersion, tracy::BroadcastVersion);
- }
- break;
- case Config::ProfilerDirection::None:
- default: break;
+ if (Config::ProfilerEnabled() && !tracy::ProfilerAvailable()) {
+ tracy::StartupProfiler();
+ TracySetProgramName("KytyPS5");
+ ::printf("Tracy profiler enabled: client %d.%d.%d, protocol %u, "
+ "broadcast %u, connect to 127.0.0.1:8086\n",
+ tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch,
+ tracy::ProtocolVersion, tracy::BroadcastVersion);
}
}
diff --git a/src/graphics/guest_gpu/graphicsRun.cpp b/src/graphics/guest_gpu/graphicsRun.cpp
index f023e4f57..a1e4d95a9 100644
--- a/src/graphics/guest_gpu/graphicsRun.cpp
+++ b/src/graphics/guest_gpu/graphicsRun.cpp
@@ -77,7 +77,7 @@ private:
static bool GraphicsRunDebugDumpEnabled() {
return Config::GraphicsDebugDumpEnabled() &&
- Config::GetPrintfDirection() != Config::OutputDirection::Silent;
+ Config::GetPrintfDirection() != Config::LogDirection::Silent;
}
GuestGpu::GuestGpu(RenderContext& renderer): m_renderer(renderer) {
diff --git a/src/graphics/host_gpu/renderer/debug.cpp b/src/graphics/host_gpu/renderer/debug.cpp
index fe2207070..b1b77819d 100644
--- a/src/graphics/host_gpu/renderer/debug.cpp
+++ b/src/graphics/host_gpu/renderer/debug.cpp
@@ -56,7 +56,7 @@ uint32_t render_target_first_bound_slot(const CommandBuffer& buffer) {
bool graphics_debug_dump_enabled() {
return Config::GraphicsDebugDumpEnabled() &&
- Config::GetPrintfDirection() != Config::OutputDirection::Silent;
+ Config::GetPrintfDirection() != Config::LogDirection::Silent;
}
void uc_print(const char* func, const HW::UserConfig& uc) {
diff --git a/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp b/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
index 4a15411ac..9d68a2e9c 100644
--- a/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
+++ b/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
@@ -334,7 +334,7 @@ struct PipelineCache::ProgramCache {
options.shader_hash = params.hash;
options.user_data = params.user_data;
options.back_code = params.back_code;
- options.dump_ir = Config::GetShaderLogDirection() != Config::ShaderLogDirection::Silent;
+ options.dump_ir = Config::GetShaderLogDirection() != Config::LogDirection::Silent;
options.early_dump = options.dump_ir;
options.dump_label = label;
options.input_info = stage_input;
diff --git a/src/graphics/presentation/videoOut.cpp b/src/graphics/presentation/videoOut.cpp
index 000e61239..69de3068d 100644
--- a/src/graphics/presentation/videoOut.cpp
+++ b/src/graphics/presentation/videoOut.cpp
@@ -1152,7 +1152,7 @@ bool FlipQueue::Flip(uint32_t micros) {
Graphics::RenderDocOnGuestFlip(m_presenter.Renderer());
if (Config::GraphicsDebugDumpEnabled() &&
- Config::GetPrintfDirection() != Config::OutputDirection::Silent) {
+ Config::GetPrintfDirection() != Config::LogDirection::Silent) {
LOGF("Flip done: %d\n", r.index);
}
diff --git a/src/launcher/forms/configuration_edit_dialog.ui b/src/launcher/forms/configuration_edit_dialog.ui
index 6e51c935c..a52388976 100644
--- a/src/launcher/forms/configuration_edit_dialog.ui
+++ b/src/launcher/forms/configuration_edit_dialog.ui
@@ -229,13 +229,9 @@
-
-
- Profiler:
-
-
- -
-
- Enable or disable profiler. If enabled may decrease emulator performance
+
+ Enable the Tracy profiler. Profiling may decrease emulator performance
+ Tracy profiler
-
diff --git a/src/launcher/include/configuration.h b/src/launcher/include/configuration.h
index 21b771ace..5a2ebde05 100644
--- a/src/launcher/include/configuration.h
+++ b/src/launcher/include/configuration.h
@@ -66,12 +66,6 @@ public:
enum class PresentMode { Fifo, Mailbox, Immediate };
Q_ENUM(PresentMode)
- enum class ShaderLogDirection { Silent, Console, File };
- Q_ENUM(ShaderLogDirection)
-
- enum class ProfilerDirection { None, Network };
- Q_ENUM(ProfilerDirection)
-
enum class LogDirection { Silent, Console, File };
Q_ENUM(LogDirection)
@@ -93,7 +87,7 @@ public:
Resolution screen_resolution = Resolution::R1280X720;
QString user_name = "Kyty";
int user_id = Config::DEFAULT_USER_ID;
- PresentMode present_mode = PresentMode::Fifo;
+ PresentMode present_mode = PresentMode::Mailbox;
int gpu_index = -1;
bool fullscreen_enabled = false;
bool readback_linear_images = false;
@@ -102,13 +96,13 @@ public:
bool vulkan_validation_enabled = false;
bool shader_validation_enabled = true;
ShaderOptimizationType shader_optimization_type = ShaderOptimizationType::Performance;
- ShaderLogDirection shader_log_direction = ShaderLogDirection::Silent;
+ LogDirection shader_log_direction = LogDirection::Silent;
QString shader_log_folder = "_Shaders";
bool command_buffer_dump_enabled = false;
QString command_buffer_dump_folder = "_Buffers";
LogDirection printf_direction = LogDirection::Silent;
QString printf_output_file = "_kyty.txt";
- ProfilerDirection profiler_direction = ProfilerDirection::None;
+ bool profiler_enabled = false;
bool renderdoc_enabled = false;
#if defined(_WIN32)
bool red_zone_protection_enabled = false;
@@ -136,7 +130,7 @@ public:
command_buffer_dump_folder = other.command_buffer_dump_folder;
printf_direction = other.printf_direction;
printf_output_file = other.printf_output_file;
- profiler_direction = other.profiler_direction;
+ profiler_enabled = other.profiler_enabled;
renderdoc_enabled = other.renderdoc_enabled;
#if defined(_WIN32)
red_zone_protection_enabled = other.red_zone_protection_enabled;
@@ -181,7 +175,7 @@ public:
KYTY_CFG_SET(command_buffer_dump_folder);
KYTY_CFG_SET(printf_direction);
KYTY_CFG_SET(printf_output_file);
- KYTY_CFG_SET(profiler_direction);
+ KYTY_CFG_SET(profiler_enabled);
KYTY_CFG_SET(renderdoc_enabled);
#if defined(_WIN32)
KYTY_CFG_SET(red_zone_protection_enabled);
@@ -205,7 +199,7 @@ public:
KYTY_CFG_GET(present_mode);
gpu_index = s->value("gpu_index", -1).toInt();
if (EnumToText(present_mode).isEmpty()) {
- present_mode = PresentMode::Fifo;
+ present_mode = PresentMode::Mailbox;
}
KYTY_CFG_GET(fullscreen_enabled);
KYTY_CFG_GET(readback_linear_images);
@@ -223,7 +217,7 @@ public:
KYTY_CFG_GET(command_buffer_dump_folder);
KYTY_CFG_GET(printf_direction);
KYTY_CFG_GET(printf_output_file);
- KYTY_CFG_GET(profiler_direction);
+ KYTY_CFG_GET(profiler_enabled);
KYTY_CFG_GET(renderdoc_enabled);
#if defined(_WIN32)
red_zone_protection_enabled =
diff --git a/src/launcher/src/configurationEditDialog.cpp b/src/launcher/src/configurationEditDialog.cpp
index 91616c7c7..7e69aff2b 100644
--- a/src/launcher/src/configurationEditDialog.cpp
+++ b/src/launcher/src/configurationEditDialog.cpp
@@ -110,9 +110,9 @@ ConfigurationEditDialog::ConfigurationEditDialog(Configuration& info, QWidget* p
connect(m_ui->clear_button, &QPushButton::clicked, this, &ConfigurationEditDialog::clear);
connect(m_ui->comboBox_shader_log_direction, &QComboBox::currentTextChanged, this,
[this](const QString& text) {
- auto log = TextToEnum(text);
+ auto log = TextToEnum(text);
m_ui->lineEdit_shader_log_folder->setEnabled(
- log == Configuration::ShaderLogDirection::File);
+ log == Configuration::LogDirection::File);
});
connect(m_ui->checkBox_cmd_dump, &QCheckBox::toggled, this,
[this](bool flag) { m_ui->lineEdit_cmd_dump_folder->setEnabled(flag); });
@@ -222,7 +222,7 @@ void ConfigurationEditDialog::Init(const Configuration& info) {
ListInit(m_ui->comboBox_shader_log_direction, info.shader_log_direction);
m_ui->lineEdit_shader_log_folder->setText(info.shader_log_folder);
m_ui->lineEdit_shader_log_folder->setEnabled(info.shader_log_direction ==
- Configuration::ShaderLogDirection::File);
+ Configuration::LogDirection::File);
m_ui->checkBox_cmd_dump->setChecked(info.command_buffer_dump_enabled);
m_ui->lineEdit_cmd_dump_folder->setText(info.command_buffer_dump_folder);
m_ui->lineEdit_cmd_dump_folder->setEnabled(info.command_buffer_dump_enabled);
@@ -230,7 +230,7 @@ void ConfigurationEditDialog::Init(const Configuration& info) {
m_ui->lineEdit_printf_file->setText(info.printf_output_file);
m_ui->lineEdit_printf_file->setEnabled(info.printf_direction ==
Configuration::LogDirection::File);
- ListInit(m_ui->comboBox_profiler_direction, info.profiler_direction);
+ m_ui->checkBox_profiler->setChecked(info.profiler_enabled);
}
void ConfigurationEditDialog::InitGameDirectories() {
@@ -357,7 +357,7 @@ static void UpdateInfo(Configuration& info, Ui::ConfigurationEditDialog& ui) {
#endif
info.shader_optimization_type = TextToEnum(
ui.comboBox_shader_optimization_type->currentText());
- info.shader_log_direction = TextToEnum(
+ info.shader_log_direction = TextToEnum(
ui.comboBox_shader_log_direction->currentText());
info.shader_log_folder = ui.lineEdit_shader_log_folder->text();
info.command_buffer_dump_enabled = ui.checkBox_cmd_dump->isChecked();
@@ -365,8 +365,7 @@ static void UpdateInfo(Configuration& info, Ui::ConfigurationEditDialog& ui) {
info.printf_direction =
TextToEnum(ui.comboBox_printf_direction->currentText());
info.printf_output_file = ui.lineEdit_printf_file->text();
- info.profiler_direction =
- TextToEnum(ui.comboBox_profiler_direction->currentText());
+ info.profiler_enabled = ui.checkBox_profiler->isChecked();
}
void ConfigurationEditDialog::update_info() {
diff --git a/src/launcher/src/mainDialog.cpp b/src/launcher/src/mainDialog.cpp
index 7431af357..5a910ef1b 100644
--- a/src/launcher/src/mainDialog.cpp
+++ b/src/launcher/src/mainDialog.cpp
@@ -247,7 +247,9 @@ static QStringList CreateEmulatorArgs(const Configuration& info) {
args << "--command-buffer-dump-folder" << info.command_buffer_dump_folder;
args << "--printf-direction" << EnumToText(info.printf_direction);
args << "--printf-output-file" << info.printf_output_file;
- args << "--profiler-direction" << EnumToText(info.profiler_direction);
+ if (info.profiler_enabled) {
+ args << "--profile";
+ }
args << "--spirv-debug-printf" << "false";
#if defined(_WIN32)
if (info.red_zone_protection_enabled) {
diff --git a/src/libs/agc.cpp b/src/libs/agc.cpp
index 0111f02ea..ed052e0ae 100644
--- a/src/libs/agc.cpp
+++ b/src/libs/agc.cpp
@@ -241,7 +241,7 @@ struct CommandBuffer {
void DbgDump() const {
if (!Config::GraphicsDebugDumpEnabled() ||
- Config::GetPrintfDirection() == Config::OutputDirection::Silent) {
+ Config::GetPrintfDirection() == Config::LogDirection::Silent) {
return;
}
static std::atomic log_count {0};
diff --git a/src/main.cpp b/src/main.cpp
index b800185be..6eb4f055b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -50,7 +50,7 @@ static void PrintUsage() {
::printf(" --user-id Local user ID. Default: %d.\n",
Config::DEFAULT_USER_ID);
::printf(
- " --present-mode Fifo, Mailbox, or Immediate. Default: Fifo.\n");
+ " --present-mode Fifo, Mailbox, or Immediate. Default: Mailbox.\n");
::printf(
" --gpu Vulkan physical device index. Default: auto.\n");
::printf(" --fullscreen Run in borderless desktop fullscreen.\n");
@@ -68,7 +68,7 @@ static void PrintUsage() {
::printf(" --graphics-debug-dump Enable graphics debug dumps.\n");
::printf(" --printf-direction Silent, Console, or File.\n");
::printf(" --printf-output-file Guest printf output file.\n");
- ::printf(" --profiler-direction None or Network.\n");
+ ::printf(" --profile Enable the Tracy profiler.\n");
::printf(" --spirv-debug-printf Enable SPIR-V debug printf.\n");
::printf(
" --readback-linear-images Read back writable linear images on submit.\n");
@@ -166,6 +166,11 @@ static bool ParseArgs(int argc, char* argv[], RunOptions& options, bool& show_he
continue;
}
+ if (arg == "--profile") {
+ options.config.profiler_enabled = true;
+ continue;
+ }
+
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
if (arg == "--redzone") {
options.config.red_zone_protection_enabled = true;
@@ -292,11 +297,6 @@ static bool ParseArgs(int argc, char* argv[], RunOptions& options, bool& show_he
}
} else if (arg == "--printf-output-file") {
options.config.printf_output_file = value;
- } else if (arg == "--profiler-direction") {
- if (!ParseEnum(value, options.config.profiler_direction)) {
- ::printf("invalid profiler direction: %s\n", value.c_str());
- return false;
- }
} else if (arg == "--spirv-debug-printf") {
if (!ParseBool(value, options.config.spirv_debug_printf_enabled)) {
::printf("invalid boolean for %s: %s\n", arg.c_str(), value.c_str());
diff --git a/tests/KernelFileSystemTests.cpp b/tests/KernelFileSystemTests.cpp
index 28b93ec5d..53d490649 100644
--- a/tests/KernelFileSystemTests.cpp
+++ b/tests/KernelFileSystemTests.cpp
@@ -371,7 +371,7 @@ int main() {
Common::Subsystems subsystems;
subsystems.Initialize();
Config::ConfigOptions options;
- options.printf_direction = Config::OutputDirection::Silent;
+ options.printf_direction = Config::LogDirection::Silent;
Config::Load(options);
subsystems.Initialize();
diff --git a/tests/ShaderRecompilerComputeTests.cpp b/tests/ShaderRecompilerComputeTests.cpp
index d6aeab3e1..223278cba 100644
--- a/tests/ShaderRecompilerComputeTests.cpp
+++ b/tests/ShaderRecompilerComputeTests.cpp
@@ -926,7 +926,7 @@ void EnsureConfigInitialized() {
Common::InitializeThreads();
subsystems.Initialize();
Config::ConfigOptions options;
- options.printf_direction = Config::OutputDirection::Silent;
+ options.printf_direction = Config::LogDirection::Silent;
Config::Load(options);
subsystems.Initialize();
subsystems.Initialize();
diff --git a/tests/VirtualMemoryAllocationTests.cpp b/tests/VirtualMemoryAllocationTests.cpp
index 60a42a46a..01b61df9a 100644
--- a/tests/VirtualMemoryAllocationTests.cpp
+++ b/tests/VirtualMemoryAllocationTests.cpp
@@ -102,7 +102,7 @@ void InitSubsystems() {
subsystems.Initialize();
Config::ConfigOptions options;
- options.printf_direction = Config::OutputDirection::Silent;
+ options.printf_direction = Config::LogDirection::Silent;
Config::Load(options);
subsystems.Initialize();
diff --git a/tests/shaderCfgTests.cpp b/tests/shaderCfgTests.cpp
index e07a9c609..8f39e254e 100644
--- a/tests/shaderCfgTests.cpp
+++ b/tests/shaderCfgTests.cpp
@@ -1021,7 +1021,7 @@ void EnsureConfigInitialized() {
Common::InitializeThreads();
subsystems.Initialize();
Config::ConfigOptions options;
- options.printf_direction = Config::OutputDirection::Silent;
+ options.printf_direction = Config::LogDirection::Silent;
Config::Load(options);
subsystems.Initialize();
ShaderInit();