diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-01-21 20:37:41 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-01-29 21:53:11 +0100 |
commit | 788d57d723ba7e857b4872d12b698ed5cef45fd7 (patch) | |
tree | 1a2cf5a410e6688d62e3ff3fdf07b5749bd07663 /src | |
parent | core: Only wait for idle on gpu_core when it was initialized (diff) | |
download | yuzu-788d57d723ba7e857b4872d12b698ed5cef45fd7.tar yuzu-788d57d723ba7e857b4872d12b698ed5cef45fd7.tar.gz yuzu-788d57d723ba7e857b4872d12b698ed5cef45fd7.tar.bz2 yuzu-788d57d723ba7e857b4872d12b698ed5cef45fd7.tar.lz yuzu-788d57d723ba7e857b4872d12b698ed5cef45fd7.tar.xz yuzu-788d57d723ba7e857b4872d12b698ed5cef45fd7.tar.zst yuzu-788d57d723ba7e857b4872d12b698ed5cef45fd7.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/settings.h | 9 | ||||
-rw-r--r-- | src/core/telemetry_session.cpp | 12 | ||||
-rw-r--r-- | src/video_core/renderer_vulkan/vk_device.cpp | 6 | ||||
-rw-r--r-- | src/yuzu/configuration/config.cpp | 7 | ||||
-rw-r--r-- | src/yuzu_cmd/config.cpp | 6 | ||||
-rw-r--r-- | src/yuzu_cmd/default_ini.h | 11 |
6 files changed, 48 insertions, 3 deletions
diff --git a/src/core/settings.h b/src/core/settings.h index 421e76f5f..e1a9a0ffa 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -371,6 +371,11 @@ enum class SDMCSize : u64 { S1TB = 0x10000000000ULL, }; +enum class RendererBackend { + OpenGL = 0, + Vulkan = 1, +}; + struct Values { // System bool use_docked_mode; @@ -419,6 +424,10 @@ struct Values { SDMCSize sdmc_size; // Renderer + RendererBackend renderer_backend; + bool renderer_debug; + int vulkan_device; + float resolution_factor; bool use_frame_limit; u16 frame_limit; diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 320e8ad73..0e72d31cd 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -46,6 +46,16 @@ static u64 GenerateTelemetryId() { return telemetry_id; } +static const char* TranslateRenderer(Settings::RendererBackend backend) { + switch (backend) { + case Settings::RendererBackend::OpenGL: + return "OpenGL"; + case Settings::RendererBackend::Vulkan: + return "Vulkan"; + } + return "Unknown"; +} + u64 GetTelemetryId() { u64 telemetry_id{}; const std::string filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + @@ -169,7 +179,7 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) { AddField(field_type, "Audio_SinkId", Settings::values.sink_id); AddField(field_type, "Audio_EnableAudioStretching", Settings::values.enable_audio_stretching); AddField(field_type, "Core_UseMultiCore", Settings::values.use_multi_core); - AddField(field_type, "Renderer_Backend", "OpenGL"); + AddField(field_type, "Renderer_Backend", TranslateRenderer(Settings::values.renderer_backend)); AddField(field_type, "Renderer_ResolutionFactor", Settings::values.resolution_factor); AddField(field_type, "Renderer_UseFrameLimit", Settings::values.use_frame_limit); AddField(field_type, "Renderer_FrameLimit", Settings::values.frame_limit); diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp index 939eebe83..9840f26e5 100644 --- a/src/video_core/renderer_vulkan/vk_device.cpp +++ b/src/video_core/renderer_vulkan/vk_device.cpp @@ -400,8 +400,10 @@ std::vector<const char*> VKDevice::LoadExtensions(const vk::DispatchLoaderDynami VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, true); Test(extension, ext_subgroup_size_control, VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, false); - Test(extension, nv_device_diagnostic_checkpoints, - VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME, true); + if (Settings::values.renderer_debug) { + Test(extension, nv_device_diagnostic_checkpoints, + VK_NV_DEVICE_DIAGNOSTIC_CHECKPOINTS_EXTENSION_NAME, true); + } } if (khr_shader_float16_int8) { diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 59918847a..280d81ba9 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -624,6 +624,10 @@ void Config::ReadPathValues() { void Config::ReadRendererValues() { qt_config->beginGroup(QStringLiteral("Renderer")); + Settings::values.renderer_backend = + static_cast<Settings::RendererBackend>(ReadSetting(QStringLiteral("backend"), 0).toInt()); + Settings::values.renderer_debug = ReadSetting(QStringLiteral("debug"), false).toBool(); + Settings::values.vulkan_device = ReadSetting(QStringLiteral("vulkan_device"), 0).toInt(); Settings::values.resolution_factor = ReadSetting(QStringLiteral("resolution_factor"), 1.0).toFloat(); Settings::values.use_frame_limit = @@ -1056,6 +1060,9 @@ void Config::SavePathValues() { void Config::SaveRendererValues() { qt_config->beginGroup(QStringLiteral("Renderer")); + WriteSetting(QStringLiteral("backend"), static_cast<int>(Settings::values.renderer_backend), 0); + WriteSetting(QStringLiteral("debug"), Settings::values.renderer_debug, false); + WriteSetting(QStringLiteral("vulkan_device"), Settings::values.vulkan_device, 0); WriteSetting(QStringLiteral("resolution_factor"), static_cast<double>(Settings::values.resolution_factor), 1.0); WriteSetting(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true); diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 161583b54..b01a36023 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -371,6 +371,12 @@ void Config::ReadValues() { Settings::values.use_multi_core = sdl2_config->GetBoolean("Core", "use_multi_core", false); // Renderer + const int renderer_backend = sdl2_config->GetInteger( + "Renderer", "backend", static_cast<int>(Settings::RendererBackend::OpenGL)); + Settings::values.renderer_backend = static_cast<Settings::RendererBackend>(renderer_backend); + Settings::values.renderer_debug = sdl2_config->GetBoolean("Renderer", "debug", false); + Settings::values.vulkan_device = sdl2_config->GetInteger("Renderer", "vulkan_device", 0); + Settings::values.resolution_factor = static_cast<float>(sdl2_config->GetReal("Renderer", "resolution_factor", 1.0)); Settings::values.use_frame_limit = sdl2_config->GetBoolean("Renderer", "use_frame_limit", true); diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index e829f8695..00fd88279 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -98,6 +98,17 @@ udp_pad_index= use_multi_core= [Renderer] +# Which backend API to use. +# 0 (default): OpenGL, 1: Vulkan +backend = + +# Enable graphics API debugging mode. +# 0 (default): Disabled, 1: Enabled +debug = + +# Which Vulkan physical device to use (defaults to 0) +vulkan_device = + # Whether to use software or hardware rendering. # 0: Software, 1 (default): Hardware use_hw_renderer = |