diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt index 90d6110a62..f06c5139bb 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt @@ -29,6 +29,7 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { SYNC_MEMORY_OPERATIONS("sync_memory_operations"), BUFFER_REORDER_DISABLE("disable_buffer_reorder"), RENDERER_DEBUG("debug"), + RENDERER_VERTEX_INPUT_DYNAMIC_STATE("vertex_input_dynamic_state"), RENDERER_PROVOKING_VERTEX("provoking_vertex"), RENDERER_DESCRIPTOR_INDEXING("descriptor_indexing"), RENDERER_SAMPLE_SHADING("sample_shading"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 716d3aae56..f6f5ede224 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -146,6 +146,13 @@ abstract class SettingsItem( descriptionId = R.string.provoking_vertex_description ) ) + put( + SwitchSetting( + BooleanSetting.RENDERER_VERTEX_INPUT_DYNAMIC_STATE, + titleId = R.string.vertex_input_dynamic_state, + descriptionId = R.string.vertex_input_dynamic_state_description + ) + ) put( SwitchSetting( BooleanSetting.RENDERER_DESCRIPTOR_INDEXING, diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt index b495206bb2..bb05c19b5e 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt @@ -453,6 +453,7 @@ class SettingsFragmentPresenter( sl.apply { add(HeaderSetting(R.string.veil_extensions)) add(ByteSetting.RENDERER_DYNA_STATE.key) + add(BooleanSetting.RENDERER_VERTEX_INPUT_DYNAMIC_STATE.key) add(BooleanSetting.RENDERER_PROVOKING_VERTEX.key) add(BooleanSetting.RENDERER_DESCRIPTOR_INDEXING.key) add(BooleanSetting.RENDERER_SAMPLE_SHADING.key) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 7d0579155e..233e5afd43 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -94,6 +94,8 @@ Extended Dynamic State Controls the number of features that can be used in Extended Dynamic State. Higher numbers allow for more features and can increase performance, but may cause issues with some drivers and vendors. The default value may vary depending on your system and hardware capabilities. This value can be changed until stability and a better visual quality are achieved. Disabled + Vertex Input Dynamic State + Enables vertex input dynamic state feature for better quality and performance. Provoking Vertex Improves lighting and vertex handling in certain games. Only supported on Vulkan 1.0+ GPUs. Descriptor Indexing diff --git a/src/common/settings.h b/src/common/settings.h index 9b3e650564..9af387a40a 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -546,6 +546,7 @@ struct Values { Category::RendererExtensions, Specialization::Scalar}; + SwitchableSetting vertex_input_dynamic_state{linkage, true, "vertex_input_dynamic_state", Category::RendererExtensions}; SwitchableSetting provoking_vertex{linkage, false, "provoking_vertex", Category::RendererExtensions}; SwitchableSetting descriptor_indexing{linkage, false, "descriptor_indexing", Category::RendererExtensions}; SwitchableSetting sample_shading{linkage, false, "sample_shading", Category::RendererExtensions, Specialization::Paired}; diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index 44fcfd8a8d..d3026e6dec 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -20,773 +20,713 @@ #include namespace ConfigurationShared { - std::unique_ptr InitializeTranslations(QObject *parent) { - std::unique_ptr translations = std::make_unique(); - const auto &tr = [parent](const char *text) -> QString { return parent->tr(text); }; + +std::unique_ptr InitializeTranslations(QObject* parent) +{ + std::unique_ptr translations = std::make_unique(); + const auto& tr = [parent](const char* text) -> QString { return parent->tr(text); }; #define INSERT(SETTINGS, ID, NAME, TOOLTIP) \ translations->insert(std::pair{SETTINGS::values.ID.Id(), std::pair{(NAME), (TOOLTIP)}}) - // A setting can be ignored by giving it a blank name - - // Applets - INSERT(Settings, cabinet_applet_mode, tr("Amiibo editor"), QString()); - INSERT(Settings, controller_applet_mode, tr("Controller configuration"), QString()); - INSERT(Settings, data_erase_applet_mode, tr("Data erase"), QString()); - INSERT(Settings, error_applet_mode, tr("Error"), QString()); - INSERT(Settings, net_connect_applet_mode, tr("Net connect"), QString()); - INSERT(Settings, player_select_applet_mode, tr("Player select"), QString()); - INSERT(Settings, swkbd_applet_mode, tr("Software keyboard"), QString()); - INSERT(Settings, mii_edit_applet_mode, tr("Mii Edit"), QString()); - INSERT(Settings, web_applet_mode, tr("Online web"), QString()); - INSERT(Settings, shop_applet_mode, tr("Shop"), QString()); - INSERT(Settings, photo_viewer_applet_mode, tr("Photo viewer"), QString()); - INSERT(Settings, offline_web_applet_mode, tr("Offline web"), QString()); - INSERT(Settings, login_share_applet_mode, tr("Login share"), QString()); - INSERT(Settings, wifi_web_auth_applet_mode, tr("Wifi web auth"), QString()); - INSERT(Settings, my_page_applet_mode, tr("My page"), QString()); - INSERT(Settings, enable_overlay, QString(), QString()); - - // Audio - INSERT(Settings, sink_id, tr("Output Engine:"), QString()); - INSERT(Settings, audio_output_device_id, tr("Output Device:"), QString()); - INSERT(Settings, audio_input_device_id, tr("Input Device:"), QString()); - INSERT(Settings, audio_muted, tr("Mute audio"), QString()); - INSERT(Settings, volume, tr("Volume:"), QString()); - INSERT(Settings, dump_audio_commands, QString(), QString()); - INSERT(UISettings, mute_when_in_background, tr("Mute audio when in background"), QString()); - - // Core - INSERT( - Settings, - use_multi_core, - tr("Multicore CPU Emulation"), - tr("This option increases CPU emulation thread use from 1 to the maximum of 4.\n" - "This is mainly a debug option and shouldn't be disabled.")); - INSERT( - Settings, - memory_layout_mode, - tr("Memory Layout"), - tr("Increases the amount of emulated RAM from 4GB of the board to the " - "devkit 8/6GB.\nDoesn't affect performance/stability but may allow HD texture " - "mods to load.")); - INSERT(Settings, use_speed_limit, QString(), QString()); - INSERT(Settings, - speed_limit, - tr("Limit Speed Percent"), - tr("Controls the game's maximum rendering speed, but it's up to each game if it runs " - "faster or not.\n200% for a 30 FPS game is 60 FPS, and for a " - "60 FPS game it will be 120 FPS.\nDisabling it means unlocking the framerate to the " - "maximum your PC can reach.")); - INSERT(Settings, - sync_core_speed, - tr("Synchronize Core Speed"), - tr("Synchronizes CPU core speed with the game's maximum rendering speed to boost FPS " - "without affecting game speed (animations, physics, etc.).\n" - "Can help reduce stuttering at lower framerates.")); - - // Cpu - INSERT(Settings, - cpu_accuracy, - tr("Accuracy:"), - tr("Change the accuracy of the emulated CPU (for debugging only).")); - INSERT(Settings, cpu_backend, tr("Backend:"), QString()); - - INSERT(Settings, use_fast_cpu_time, QString(), QString()); - INSERT(Settings, - fast_cpu_time, - tr("Fast CPU Time"), - tr("Overclocks the emulated CPU to remove some FPS limiters. Weaker CPUs may see reduced performance, " - "and certain games may behave improperly.\nUse Boost (1700MHz) to run at the Switch's highest native " - "clock, or Fast (2000MHz) to run at 2x clock.")); - - INSERT(Settings, use_custom_cpu_ticks, QString(), QString()); - INSERT(Settings, - cpu_ticks, - tr("Custom CPU Ticks"), - tr("Set a custom value of CPU ticks. Higher values can increase performance, but may " - "cause deadlocks. A range of 77-21000 is recommended.")); - INSERT(Settings, cpu_backend, tr("Backend:"), QString()); - - INSERT(Settings, vtable_bouncing, - tr("Virtual Table Bouncing"), - tr("Bounces (by emulating a 0-valued return) any functions that triggers a prefetch abort")); - - // Cpu Debug - - // Cpu Unsafe - INSERT(Settings, cpuopt_unsafe_host_mmu, tr("Enable Host MMU Emulation (fastmem)"), - tr( - "This optimization speeds up memory accesses by the guest program.\nEnabling it causes guest memory reads/writes to be done directly into memory and make use of Host's MMU.\nDisabling this forces all memory accesses to use Software MMU Emulation." - )); - INSERT( - Settings, - cpuopt_unsafe_unfuse_fma, - tr("Unfuse FMA (improve performance on CPUs without FMA)"), - tr("This option improves speed by reducing accuracy of fused-multiply-add instructions on " - "CPUs without native FMA support.")); - INSERT( - Settings, - cpuopt_unsafe_reduce_fp_error, - tr("Faster FRSQRTE and FRECPE"), - tr("This option improves the speed of some approximate floating-point functions by using " - "less accurate native approximations.")); - INSERT(Settings, - cpuopt_unsafe_ignore_standard_fpcr, - tr("Faster ASIMD instructions (32 bits only)"), - tr("This option improves the speed of 32 bits ASIMD floating-point functions by running " - "with incorrect rounding modes.")); - INSERT(Settings, - cpuopt_unsafe_inaccurate_nan, - tr("Inaccurate NaN handling"), - tr("This option improves speed by removing NaN checking.\nPlease note this also reduces " - "accuracy of certain floating-point instructions.")); - INSERT(Settings, - cpuopt_unsafe_fastmem_check, - tr("Disable address space checks"), - tr("This option improves speed by eliminating a safety check before every memory " - "operation.\nDisabling it may allow arbitrary code execution.")); - INSERT( - Settings, - cpuopt_unsafe_ignore_global_monitor, - tr("Ignore global monitor"), - tr("This option improves speed by relying only on the semantics of cmpxchg to ensure " - "safety of exclusive access instructions.\nPlease note this may result in deadlocks and " - "other race conditions.")); - - // Renderer - INSERT( - Settings, - renderer_backend, - tr("API:"), - tr("Changes the output graphics API.\nVulkan is recommended.")); - INSERT(Settings, - vulkan_device, - tr("Device:"), - tr("This setting selects the GPU to use (Vulkan only).")); - INSERT(Settings, - shader_backend, - tr("Shader Backend:"), - tr("The shader backend to use with OpenGL.\nGLSL is recommended.")); - INSERT(Settings, - resolution_setup, - tr("Resolution:"), - tr("Forces to render at a different resolution.\n" - "Higher resolutions require more VRAM and bandwidth.\n" - "Options lower than 1X can cause artifacts.")); - INSERT(Settings, scaling_filter, tr("Window Adapting Filter:"), QString()); - INSERT(Settings, - fsr_sharpening_slider, - tr("FSR Sharpness:"), - tr("Determines how sharpened the image will look using FSR's dynamic contrast.")); - INSERT(Settings, - anti_aliasing, - tr("Anti-Aliasing Method:"), - tr("The anti-aliasing method to use.\nSMAA offers the best quality.\nFXAA " - "can produce a more stable picture in lower resolutions.")); - INSERT(Settings, - fullscreen_mode, - tr("Fullscreen Mode:"), - tr("The method used to render the window in fullscreen.\nBorderless offers the best " - "compatibility with the on-screen keyboard that some games request for " - "input.\nExclusive " - "fullscreen may offer better performance and better Freesync/Gsync support.")); - INSERT(Settings, - aspect_ratio, - tr("Aspect Ratio:"), - tr("Stretches the renderer to fit the specified aspect ratio.\nMost games only support " - "16:9, so modifications are required to get other ratios.\nAlso controls the " - "aspect ratio of captured screenshots.")); - INSERT(Settings, - use_disk_shader_cache, - tr("Use persistent pipeline cache"), - tr("Allows saving shaders to storage for faster loading on following game " - "boots.\nDisabling it is only intended for debugging.")); - INSERT(Settings, - optimize_spirv_output, - tr("Optimize SPIRV output"), - tr("Runs an additional optimization pass over generated SPIRV shaders.\n" - "Will increase time required for shader compilation.\nMay slightly improve " - "performance.\nThis feature is experimental.")); - INSERT( - Settings, - use_asynchronous_gpu_emulation, - tr("Use asynchronous GPU emulation"), - tr("Uses an extra CPU thread for rendering.\nThis option should always remain enabled.")); - INSERT(Settings, - nvdec_emulation, - tr("NVDEC emulation:"), - tr("Specifies how videos should be decoded.\nIt can either use the CPU or the GPU for " - "decoding, or perform no decoding at all (black screen on videos).\n" - "In most cases, GPU decoding provides the best performance.")); - INSERT(Settings, - accelerate_astc, - tr("ASTC Decoding Method:"), - tr("This option controls how ASTC textures should be decoded.\n" - "CPU: Use the CPU for decoding.\n" - "GPU: Use the GPU's compute shaders to decode ASTC textures (recommended).\n" - "CPU Asynchronously: Use the CPU to decode ASTC textures on demand. Eliminates" - "ASTC decoding\nstuttering but may present artifacts.")); - INSERT( - Settings, - astc_recompression, - tr("ASTC Recompression Method:"), - tr("Most GPUs lack support for ASTC textures and must decompress to an" - "intermediate format: RGBA8.\n" - "BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format,\n" - " saving VRAM but degrading image quality.")); - INSERT(Settings, - vram_usage_mode, - tr("VRAM Usage Mode:"), - tr( - "Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.\nAggressive mode may impact performance of other applications such as recording software." - )); - INSERT(Settings, - skip_cpu_inner_invalidation, - tr("Skip CPU Inner Invalidation"), - tr("Skips certain cache invalidations during memory updates, reducing CPU usage and " - "improving latency. This may cause soft-crashes.")); - INSERT( - Settings, - vsync_mode, - tr("VSync Mode:"), - tr("FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen " - "refresh rate.\nFIFO Relaxed allows tearing as it recovers from a slow down.\n" - "Mailbox can have lower latency than FIFO and does not tear but may drop " - "frames.\nImmediate (no synchronization) presents whatever is available and can " - "exhibit tearing.")); - INSERT(Settings, bg_red, QString(), QString()); - INSERT(Settings, bg_green, QString(), QString()); - INSERT(Settings, bg_blue, QString(), QString()); - - // Renderer (Advanced Graphics) - INSERT(Settings, sync_memory_operations, tr("Sync Memory Operations"), - tr( - "Ensures data consistency between compute and memory operations.\nThis option fixes issues in games, but may degrade performance.\nUnreal Engine 4 games often see the most significant changes thereof." - )); - INSERT(Settings, - async_presentation, - tr("Enable asynchronous presentation (Vulkan only)"), - tr("Slightly improves performance by moving presentation to a separate CPU thread.")); - INSERT( - Settings, - renderer_force_max_clock, - tr("Force maximum clocks (Vulkan only)"), - tr("Runs work in the background while waiting for graphics commands to keep the GPU from " - "lowering its clock speed.")); - INSERT(Settings, - max_anisotropy, - tr("Anisotropic Filtering:"), - tr("Controls the quality of texture rendering at oblique angles.\nSafe to set at 16x on most GPUs.")); - INSERT(Settings, - gpu_accuracy, - tr("GPU Accuracy:"), - tr("Controls the GPU emulation accuracy.\nMost games render fine with Normal, but High is still " - "required for some.\nParticles tend to only render correctly with High " - "accuracy.\nExtreme should only be used as a last resort.")); - INSERT(Settings, - dma_accuracy, - tr("DMA Accuracy:"), - tr( - "Controls the DMA precision accuracy. Safe precision fixes issues in some games but may degrade performance." - )); - INSERT(Settings, - use_asynchronous_shaders, - tr("Enable asynchronous shader compilation (Hack)"), - tr("May reduce shader stutter.")); - INSERT(Settings, use_fast_gpu_time, QString(), QString()); - INSERT(Settings, - fast_gpu_time, - tr("Fast GPU Time (Hack)"), - tr("Overclocks the emulated GPU to increase dynamic resolution and render " - "distance.\nUse 128 for maximal performance and 512 for maximal graphics fidelity.")); - - INSERT(Settings, - use_vulkan_driver_pipeline_cache, - tr("Use Vulkan pipeline cache"), - tr("Enables GPU vendor-specific pipeline cache.\nThis option can improve shader loading " - "time significantly in cases where the Vulkan driver does not store pipeline cache " - "files internally.")); - INSERT( - Settings, - enable_compute_pipelines, - tr("Enable Compute Pipelines (Intel Vulkan Only)"), - tr("Required by some games.\nThis setting only exists for Intel " - "proprietary drivers and may crash if enabled.\nCompute pipelines are always enabled " - "on all other drivers.")); - INSERT( - Settings, - use_reactive_flushing, - tr("Enable Reactive Flushing"), - tr("Uses reactive flushing instead of predictive flushing, allowing more accurate memory " - "syncing.")); - INSERT(Settings, - use_video_framerate, - tr("Sync to framerate of video playback"), - tr("Run the game at normal speed during video playback, even when the framerate is " - "unlocked.")); - INSERT(Settings, - barrier_feedback_loops, - tr("Barrier feedback loops"), - tr("Improves rendering of transparency effects in specific games.")); - - // Renderer (Extensions) - INSERT(Settings, - dyna_state, - tr("Extended Dynamic State"), - tr( - "Controls the number of features that can be used in Extended Dynamic State.\nHigher numbers allow for more features and can increase performance, but may cause issues.\nThe default value is per-system." - )); - - INSERT(Settings, - provoking_vertex, - tr("Provoking Vertex"), - tr("Improves lighting and vertex handling in some games.\n" - "Only Vulkan 1.0+ devices support this extension.")); - - INSERT(Settings, - descriptor_indexing, - tr("Descriptor Indexing"), - tr("Improves texture & buffer handling and the Maxwell translation layer.\n" - "Some Vulkan 1.1+ and all 1.2+ devices support this extension.")); - - INSERT(Settings, sample_shading, QString(), QString()); - - INSERT(Settings, - sample_shading_fraction, - tr("Sample Shading"), - tr("Allows the fragment shader to execute per sample in a multi-sampled fragment " - "instead of once per fragment. Improves graphics quality at the cost of performance.\n" - "Higher values improve quality but degrade performance.")); - - // Renderer (Debug) - - // System - INSERT(Settings, - rng_seed, - tr("RNG Seed"), - tr("Controls the seed of the random number generator.\nMainly used for speedrunning.")); - INSERT(Settings, rng_seed_enabled, QString(), QString()); - INSERT(Settings, device_name, tr("Device Name"), tr("The name of the console.")); - INSERT(Settings, - custom_rtc, - tr("Custom RTC Date:"), - tr("This option allows to change the clock of the console.\n" - "Can be used to manipulate time in games.")); - INSERT(Settings, custom_rtc_enabled, QString(), QString()); - INSERT(Settings, - custom_rtc_offset, - QStringLiteral(" "), - tr("The number of seconds from the current unix time")); - INSERT(Settings, - language_index, - tr("Language:"), - tr("This option can be overridden when region setting is auto-select")); - INSERT(Settings, region_index, tr("Region:"), tr("The region of the console.")); - INSERT(Settings, time_zone_index, tr("Time Zone:"), tr("The time zone of the console.")); - INSERT(Settings, sound_index, tr("Sound Output Mode:"), QString()); - INSERT(Settings, - use_docked_mode, - tr("Console Mode:"), - tr("Selects if the console is in Docked or Handheld mode.\nGames will change " - "their resolution, details and supported controllers and depending on this setting.\n" - "Setting to Handheld can help improve performance for low end systems.")); - INSERT(Settings, current_user, QString(), QString()); - - // Controls - - // Data Storage - - // Debugging - - // Debugging Graphics - - // Network - - // Web Service - - // Ui - - // Ui General - INSERT(UISettings, - select_user_on_boot, - tr("Prompt for user profile on boot"), - tr("Useful if multiple people use the same PC.")); - INSERT(UISettings, - pause_when_in_background, - tr("Pause when not in focus"), - tr("Pauses emulation when focusing on other windows.")); - INSERT(UISettings, - confirm_before_stopping, - tr("Confirm before stopping emulation"), - tr("Overrides prompts asking to confirm stopping the emulation.\nEnabling " - "it bypasses such prompts and directly exits the emulation.")); - INSERT(UISettings, - hide_mouse, - tr("Hide mouse on inactivity"), - tr("Hides the mouse after 2.5s of inactivity.")); - INSERT(UISettings, - controller_applet_disabled, - tr("Disable controller applet"), - tr("Forcibly disables the use of the controller applet in emulated programs.\n" - "When a program attempts to open the controller applet, it is immediately closed.")); - INSERT(UISettings, - check_for_updates, - tr("Check for updates"), - tr("Whether or not to check for updates upon startup.")); - - // Linux - INSERT(Settings, enable_gamemode, tr("Enable Gamemode"), QString()); + // A setting can be ignored by giving it a blank name + + // Applets + INSERT(Settings, cabinet_applet_mode, tr("Amiibo editor"), QString()); + INSERT(Settings, controller_applet_mode, tr("Controller configuration"), QString()); + INSERT(Settings, data_erase_applet_mode, tr("Data erase"), QString()); + INSERT(Settings, error_applet_mode, tr("Error"), QString()); + INSERT(Settings, net_connect_applet_mode, tr("Net connect"), QString()); + INSERT(Settings, player_select_applet_mode, tr("Player select"), QString()); + INSERT(Settings, swkbd_applet_mode, tr("Software keyboard"), QString()); + INSERT(Settings, mii_edit_applet_mode, tr("Mii Edit"), QString()); + INSERT(Settings, web_applet_mode, tr("Online web"), QString()); + INSERT(Settings, shop_applet_mode, tr("Shop"), QString()); + INSERT(Settings, photo_viewer_applet_mode, tr("Photo viewer"), QString()); + INSERT(Settings, offline_web_applet_mode, tr("Offline web"), QString()); + INSERT(Settings, login_share_applet_mode, tr("Login share"), QString()); + INSERT(Settings, wifi_web_auth_applet_mode, tr("Wifi web auth"), QString()); + INSERT(Settings, my_page_applet_mode, tr("My page"), QString()); + INSERT(Settings, enable_overlay, QString(), QString()); + + // Audio + INSERT(Settings, sink_id, tr("Output Engine:"), QString()); + INSERT(Settings, audio_output_device_id, tr("Output Device:"), QString()); + INSERT(Settings, audio_input_device_id, tr("Input Device:"), QString()); + INSERT(Settings, audio_muted, tr("Mute audio"), QString()); + INSERT(Settings, volume, tr("Volume:"), QString()); + INSERT(Settings, dump_audio_commands, QString(), QString()); + INSERT(UISettings, mute_when_in_background, tr("Mute audio when in background"), QString()); + + // Core + INSERT( + Settings, + use_multi_core, + tr("Multicore CPU Emulation"), + tr("This option increases CPU emulation thread use from 1 to the maximum of 4.\n" + "This is mainly a debug option and shouldn't be disabled.")); + INSERT( + Settings, + memory_layout_mode, + tr("Memory Layout"), + tr("Increases the amount of emulated RAM from 4GB of the board to the " + "devkit 8/6GB.\nDoesn't affect performance/stability but may allow HD texture " + "mods to load.")); + INSERT(Settings, use_speed_limit, QString(), QString()); + INSERT(Settings, + speed_limit, + tr("Limit Speed Percent"), + tr("Controls the game's maximum rendering speed, but it's up to each game if it runs " + "faster or not.\n200% for a 30 FPS game is 60 FPS, and for a " + "60 FPS game it will be 120 FPS.\nDisabling it means unlocking the framerate to the " + "maximum your PC can reach.")); + INSERT(Settings, + sync_core_speed, + tr("Synchronize Core Speed"), + tr("Synchronizes CPU core speed with the game's maximum rendering speed to boost FPS " + "without affecting game speed (animations, physics, etc.).\n" + "Can help reduce stuttering at lower framerates.")); + + // Cpu + INSERT(Settings, + cpu_accuracy, + tr("Accuracy:"), + tr("Change the accuracy of the emulated CPU (for debugging only).")); + INSERT(Settings, cpu_backend, tr("Backend:"), QString()); + + INSERT(Settings, use_fast_cpu_time, QString(), QString()); + INSERT(Settings, + fast_cpu_time, + tr("Fast CPU Time"), + tr("Overclocks the emulated CPU to remove some FPS limiters. Weaker CPUs may see reduced performance, " + "and certain games may behave improperly.\nUse Boost (1700MHz) to run at the Switch's highest native " + "clock, or Fast (2000MHz) to run at 2x clock.")); + + INSERT(Settings, use_custom_cpu_ticks, QString(), QString()); + INSERT(Settings, + cpu_ticks, + tr("Custom CPU Ticks"), + tr("Set a custom value of CPU ticks. Higher values can increase performance, but may " + "cause deadlocks. A range of 77-21000 is recommended.")); + INSERT(Settings, cpu_backend, tr("Backend:"), QString()); + + INSERT(Settings, vtable_bouncing, + tr("Virtual Table Bouncing"), + tr("Bounces (by emulating a 0-valued return) any functions that triggers a prefetch abort")); + + // Cpu Debug + + // Cpu Unsafe + INSERT(Settings, cpuopt_unsafe_host_mmu, tr("Enable Host MMU Emulation (fastmem)"), + tr("This optimization speeds up memory accesses by the guest program.\nEnabling it causes guest memory reads/writes to be done directly into memory and make use of Host's MMU.\nDisabling this forces all memory accesses to use Software MMU Emulation.")); + INSERT( + Settings, + cpuopt_unsafe_unfuse_fma, + tr("Unfuse FMA (improve performance on CPUs without FMA)"), + tr("This option improves speed by reducing accuracy of fused-multiply-add instructions on " + "CPUs without native FMA support.")); + INSERT( + Settings, + cpuopt_unsafe_reduce_fp_error, + tr("Faster FRSQRTE and FRECPE"), + tr("This option improves the speed of some approximate floating-point functions by using " + "less accurate native approximations.")); + INSERT(Settings, + cpuopt_unsafe_ignore_standard_fpcr, + tr("Faster ASIMD instructions (32 bits only)"), + tr("This option improves the speed of 32 bits ASIMD floating-point functions by running " + "with incorrect rounding modes.")); + INSERT(Settings, + cpuopt_unsafe_inaccurate_nan, + tr("Inaccurate NaN handling"), + tr("This option improves speed by removing NaN checking.\nPlease note this also reduces " + "accuracy of certain floating-point instructions.")); + INSERT(Settings, + cpuopt_unsafe_fastmem_check, + tr("Disable address space checks"), + tr("This option improves speed by eliminating a safety check before every memory " + "operation.\nDisabling it may allow arbitrary code execution.")); + INSERT( + Settings, + cpuopt_unsafe_ignore_global_monitor, + tr("Ignore global monitor"), + tr("This option improves speed by relying only on the semantics of cmpxchg to ensure " + "safety of exclusive access instructions.\nPlease note this may result in deadlocks and " + "other race conditions.")); + + // Renderer + INSERT( + Settings, + renderer_backend, + tr("API:"), + tr("Changes the output graphics API.\nVulkan is recommended.")); + INSERT(Settings, + vulkan_device, + tr("Device:"), + tr("This setting selects the GPU to use (Vulkan only).")); + INSERT(Settings, + shader_backend, + tr("Shader Backend:"), + tr("The shader backend to use with OpenGL.\nGLSL is recommended.")); + INSERT(Settings, + resolution_setup, + tr("Resolution:"), + tr("Forces to render at a different resolution.\n" + "Higher resolutions require more VRAM and bandwidth.\n" + "Options lower than 1X can cause artifacts.")); + INSERT(Settings, scaling_filter, tr("Window Adapting Filter:"), QString()); + INSERT(Settings, + fsr_sharpening_slider, + tr("FSR Sharpness:"), + tr("Determines how sharpened the image will look using FSR's dynamic contrast.")); + INSERT(Settings, + anti_aliasing, + tr("Anti-Aliasing Method:"), + tr("The anti-aliasing method to use.\nSMAA offers the best quality.\nFXAA " + "can produce a more stable picture in lower resolutions.")); + INSERT(Settings, + fullscreen_mode, + tr("Fullscreen Mode:"), + tr("The method used to render the window in fullscreen.\nBorderless offers the best " + "compatibility with the on-screen keyboard that some games request for " + "input.\nExclusive " + "fullscreen may offer better performance and better Freesync/Gsync support.")); + INSERT(Settings, + aspect_ratio, + tr("Aspect Ratio:"), + tr("Stretches the renderer to fit the specified aspect ratio.\nMost games only support " + "16:9, so modifications are required to get other ratios.\nAlso controls the " + "aspect ratio of captured screenshots.")); + INSERT(Settings, + use_disk_shader_cache, + tr("Use persistent pipeline cache"), + tr("Allows saving shaders to storage for faster loading on following game " + "boots.\nDisabling it is only intended for debugging.")); + INSERT(Settings, + optimize_spirv_output, + tr("Optimize SPIRV output"), + tr("Runs an additional optimization pass over generated SPIRV shaders.\n" + "Will increase time required for shader compilation.\nMay slightly improve " + "performance.\nThis feature is experimental.")); + INSERT( + Settings, + use_asynchronous_gpu_emulation, + tr("Use asynchronous GPU emulation"), + tr("Uses an extra CPU thread for rendering.\nThis option should always remain enabled.")); + INSERT(Settings, + nvdec_emulation, + tr("NVDEC emulation:"), + tr("Specifies how videos should be decoded.\nIt can either use the CPU or the GPU for " + "decoding, or perform no decoding at all (black screen on videos).\n" + "In most cases, GPU decoding provides the best performance.")); + INSERT(Settings, + accelerate_astc, + tr("ASTC Decoding Method:"), + tr("This option controls how ASTC textures should be decoded.\n" + "CPU: Use the CPU for decoding.\n" + "GPU: Use the GPU's compute shaders to decode ASTC textures (recommended).\n" + "CPU Asynchronously: Use the CPU to decode ASTC textures on demand. Eliminates" + "ASTC decoding\nstuttering but may present artifacts.")); + INSERT( + Settings, + astc_recompression, + tr("ASTC Recompression Method:"), + tr("Most GPUs lack support for ASTC textures and must decompress to an" + "intermediate format: RGBA8.\n" + "BC1/BC3: The intermediate format will be recompressed to BC1 or BC3 format,\n" + " saving VRAM but degrading image quality.")); + INSERT(Settings, + vram_usage_mode, + tr("VRAM Usage Mode:"), + tr("Selects whether the emulator should prefer to conserve memory or make maximum usage of available video memory for performance.\nAggressive mode may impact performance of other applications such as recording software.")); + INSERT(Settings, + skip_cpu_inner_invalidation, + tr("Skip CPU Inner Invalidation"), + tr("Skips certain cache invalidations during memory updates, reducing CPU usage and " + "improving latency. This may cause soft-crashes.")); + INSERT( + Settings, + vsync_mode, + tr("VSync Mode:"), + tr("FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen " + "refresh rate.\nFIFO Relaxed allows tearing as it recovers from a slow down.\n" + "Mailbox can have lower latency than FIFO and does not tear but may drop " + "frames.\nImmediate (no synchronization) presents whatever is available and can " + "exhibit tearing.")); + INSERT(Settings, bg_red, QString(), QString()); + INSERT(Settings, bg_green, QString(), QString()); + INSERT(Settings, bg_blue, QString(), QString()); + + // Renderer (Advanced Graphics) + INSERT(Settings, sync_memory_operations, tr("Sync Memory Operations"), + tr("Ensures data consistency between compute and memory operations.\nThis option fixes issues in games, but may degrade performance.\nUnreal Engine 4 games often see the most significant changes thereof.")); + INSERT(Settings, + async_presentation, + tr("Enable asynchronous presentation (Vulkan only)"), + tr("Slightly improves performance by moving presentation to a separate CPU thread.")); + INSERT( + Settings, + renderer_force_max_clock, + tr("Force maximum clocks (Vulkan only)"), + tr("Runs work in the background while waiting for graphics commands to keep the GPU from " + "lowering its clock speed.")); + INSERT(Settings, + max_anisotropy, + tr("Anisotropic Filtering:"), + tr("Controls the quality of texture rendering at oblique angles.\nSafe to set at 16x on most GPUs.")); + INSERT(Settings, + gpu_accuracy, + tr("GPU Accuracy:"), + tr("Controls the GPU emulation accuracy.\nMost games render fine with Normal, but High is still " + "required for some.\nParticles tend to only render correctly with High " + "accuracy.\nExtreme should only be used as a last resort.")); + INSERT(Settings, + dma_accuracy, + tr("DMA Accuracy:"), + tr("Controls the DMA precision accuracy. Safe precision fixes issues in some games but may degrade performance.")); + INSERT(Settings, + use_asynchronous_shaders, + tr("Enable asynchronous shader compilation (Hack)"), + tr("May reduce shader stutter.")); + INSERT(Settings, use_fast_gpu_time, QString(), QString()); + INSERT(Settings, + fast_gpu_time, + tr("Fast GPU Time (Hack)"), + tr("Overclocks the emulated GPU to increase dynamic resolution and render " + "distance.\nUse 128 for maximal performance and 512 for maximal graphics fidelity.")); + + INSERT(Settings, + use_vulkan_driver_pipeline_cache, + tr("Use Vulkan pipeline cache"), + tr("Enables GPU vendor-specific pipeline cache.\nThis option can improve shader loading " + "time significantly in cases where the Vulkan driver does not store pipeline cache " + "files internally.")); + INSERT( + Settings, + enable_compute_pipelines, + tr("Enable Compute Pipelines (Intel Vulkan Only)"), + tr("Required by some games.\nThis setting only exists for Intel " + "proprietary drivers and may crash if enabled.\nCompute pipelines are always enabled " + "on all other drivers.")); + INSERT( + Settings, + use_reactive_flushing, + tr("Enable Reactive Flushing"), + tr("Uses reactive flushing instead of predictive flushing, allowing more accurate memory " + "syncing.")); + INSERT(Settings, + use_video_framerate, + tr("Sync to framerate of video playback"), + tr("Run the game at normal speed during video playback, even when the framerate is " + "unlocked.")); + INSERT(Settings, + barrier_feedback_loops, + tr("Barrier feedback loops"), + tr("Improves rendering of transparency effects in specific games.")); + + // Renderer (Extensions) + INSERT(Settings, + dyna_state, + tr("Extended Dynamic State"), + tr("Controls the number of features that can be used in Extended Dynamic State.\nHigher numbers allow for more features and can increase performance, but may cause issues.\nThe default value is per-system.")); + + INSERT(Settings, + vertex_input_dynamic_state, + tr("Vertex Input Dynamic State"), + tr("Enables vertex input dynamic state feature for better quality and performance.")); + + INSERT(Settings, + provoking_vertex, + tr("Provoking Vertex"), + tr("Improves lighting and vertex handling in some games.\n" + "Only Vulkan 1.0+ devices support this extension.")); + + INSERT(Settings, + descriptor_indexing, + tr("Descriptor Indexing"), + tr("Improves texture & buffer handling and the Maxwell translation layer.\n" + "Some Vulkan 1.1+ and all 1.2+ devices support this extension.")); + + INSERT(Settings, sample_shading, QString(), QString()); + + INSERT(Settings, + sample_shading_fraction, + tr("Sample Shading"), + tr("Allows the fragment shader to execute per sample in a multi-sampled fragment " + "instead of once per fragment. Improves graphics quality at the cost of performance.\n" + "Higher values improve quality but degrade performance.")); + + // Renderer (Debug) + + // System + INSERT(Settings, + rng_seed, + tr("RNG Seed"), + tr("Controls the seed of the random number generator.\nMainly used for speedrunning.")); + INSERT(Settings, rng_seed_enabled, QString(), QString()); + INSERT(Settings, device_name, tr("Device Name"), tr("The name of the console.")); + INSERT(Settings, + custom_rtc, + tr("Custom RTC Date:"), + tr("This option allows to change the clock of the console.\n" + "Can be used to manipulate time in games.")); + INSERT(Settings, custom_rtc_enabled, QString(), QString()); + INSERT(Settings, + custom_rtc_offset, + QStringLiteral(" "), + tr("The number of seconds from the current unix time")); + INSERT(Settings, + language_index, + tr("Language:"), + tr("This option can be overridden when region setting is auto-select")); + INSERT(Settings, region_index, tr("Region:"), tr("The region of the console.")); + INSERT(Settings, time_zone_index, tr("Time Zone:"), tr("The time zone of the console.")); + INSERT(Settings, sound_index, tr("Sound Output Mode:"), QString()); + INSERT(Settings, + use_docked_mode, + tr("Console Mode:"), + tr("Selects if the console is in Docked or Handheld mode.\nGames will change " + "their resolution, details and supported controllers and depending on this setting.\n" + "Setting to Handheld can help improve performance for low end systems.")); + INSERT(Settings, current_user, QString(), QString()); + + // Controls + + // Data Storage + + // Debugging + + // Debugging Graphics + + // Network + + // Web Service + + // Ui + + // Ui General + INSERT(UISettings, + select_user_on_boot, + tr("Prompt for user profile on boot"), + tr("Useful if multiple people use the same PC.")); + INSERT(UISettings, + pause_when_in_background, + tr("Pause when not in focus"), + tr("Pauses emulation when focusing on other windows.")); + INSERT(UISettings, + confirm_before_stopping, + tr("Confirm before stopping emulation"), + tr("Overrides prompts asking to confirm stopping the emulation.\nEnabling " + "it bypasses such prompts and directly exits the emulation.")); + INSERT(UISettings, + hide_mouse, + tr("Hide mouse on inactivity"), + tr("Hides the mouse after 2.5s of inactivity.")); + INSERT(UISettings, + controller_applet_disabled, + tr("Disable controller applet"), + tr("Forcibly disables the use of the controller applet in emulated programs.\n" + "When a program attempts to open the controller applet, it is immediately closed.")); + INSERT(UISettings, + check_for_updates, + tr("Check for updates"), + tr("Whether or not to check for updates upon startup.")); + + // Linux + INSERT(Settings, enable_gamemode, tr("Enable Gamemode"), QString()); #ifdef __unix__ - INSERT(Settings, gui_force_x11, tr("Force X11 as Graphics Backend"), QString()); - INSERT(Settings, gui_hide_backend_warning, QString(), QString()); + INSERT(Settings, gui_force_x11, tr("Force X11 as Graphics Backend"), QString()); + INSERT(Settings, gui_hide_backend_warning, QString(), QString()); #endif - // Ui Debugging + // Ui Debugging - // Ui Multiplayer + // Ui Multiplayer - // Ui Games list + // Ui Games list #undef INSERT - return translations; - } + return translations; +} - std::unique_ptr ComboboxEnumeration(QObject *parent) { - std::unique_ptr translations = std::make_unique(); - const auto &tr = [&](const char *text, const char *context = "") { - return parent->tr(text, context); - }; +std::unique_ptr ComboboxEnumeration(QObject* parent) +{ + std::unique_ptr translations = std::make_unique(); + const auto& tr = [&](const char* text, const char* context = "") { + return parent->tr(text, context); + }; #define PAIR(ENUM, VALUE, TRANSLATION) {static_cast(Settings::ENUM::VALUE), (TRANSLATION)} - // Intentionally skipping VSyncMode to let the UI fill that one out - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(AppletMode, HLE, tr("Custom frontend")), - PAIR(AppletMode, LLE, tr("Real applet")), - } - }); - - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(SpirvOptimizeMode, Never, tr("Never")), - PAIR(SpirvOptimizeMode, OnLoad, tr("On Load")), - PAIR(SpirvOptimizeMode, Always, tr("Always")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(AstcDecodeMode, Cpu, tr("CPU")), - PAIR(AstcDecodeMode, Gpu, tr("GPU")), - PAIR(AstcDecodeMode, CpuAsynchronous, tr("CPU Asynchronous")), - } - }); - translations->insert( - { - Settings::EnumMetadata::Index(), - { - PAIR(AstcRecompression, Uncompressed, tr("Uncompressed (Best quality)")), - PAIR(AstcRecompression, Bc1, tr("BC1 (Low quality)")), - PAIR(AstcRecompression, Bc3, tr("BC3 (Medium quality)")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(VramUsageMode, Conservative, tr("Conservative")), - PAIR(VramUsageMode, Aggressive, tr("Aggressive")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { + // Intentionally skipping VSyncMode to let the UI fill that one out + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(AppletMode, HLE, tr("Custom frontend")), + PAIR(AppletMode, LLE, tr("Real applet")), + }}); + + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(SpirvOptimizeMode, Never, tr("Never")), + PAIR(SpirvOptimizeMode, OnLoad, tr("On Load")), + PAIR(SpirvOptimizeMode, Always, tr("Always")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(AstcDecodeMode, Cpu, tr("CPU")), + PAIR(AstcDecodeMode, Gpu, tr("GPU")), + PAIR(AstcDecodeMode, CpuAsynchronous, tr("CPU Asynchronous")), + }}); + translations->insert( + {Settings::EnumMetadata::Index(), + { + PAIR(AstcRecompression, Uncompressed, tr("Uncompressed (Best quality)")), + PAIR(AstcRecompression, Bc1, tr("BC1 (Low quality)")), + PAIR(AstcRecompression, Bc3, tr("BC3 (Medium quality)")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(VramUsageMode, Conservative, tr("Conservative")), + PAIR(VramUsageMode, Aggressive, tr("Aggressive")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { #ifdef HAS_OPENGL - PAIR(RendererBackend, OpenGL, tr("OpenGL")), + PAIR(RendererBackend, OpenGL, tr("OpenGL")), #endif - PAIR(RendererBackend, Vulkan, tr("Vulkan")), - PAIR(RendererBackend, Null, tr("Null")), - } - }); - translations->insert( - { - Settings::EnumMetadata::Index(), - { - PAIR(ShaderBackend, Glsl, tr("GLSL")), - PAIR(ShaderBackend, Glasm, tr("GLASM (Assembly Shaders, NVIDIA Only)")), - PAIR(ShaderBackend, SpirV, tr("SPIR-V (Experimental, AMD/Mesa Only)")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(GpuAccuracy, Normal, tr("Normal")), - PAIR(GpuAccuracy, High, tr("High")), - PAIR(GpuAccuracy, Extreme, tr("Extreme")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(DmaAccuracy, Default, tr("Default")), - PAIR(DmaAccuracy, Unsafe, tr("Unsafe (fast)")), - PAIR(DmaAccuracy, Safe, tr("Safe (stable)")), - } - }); - translations->insert( - { - Settings::EnumMetadata::Index(), - { - PAIR(CpuAccuracy, Auto, tr("Auto")), - PAIR(CpuAccuracy, Accurate, tr("Accurate")), - PAIR(CpuAccuracy, Unsafe, tr("Unsafe")), - PAIR(CpuAccuracy, Paranoid, tr("Paranoid (disables most optimizations)")), - PAIR(CpuAccuracy, Debugging, tr("Debugging")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(CpuBackend, Dynarmic, tr("Dynarmic")), - PAIR(CpuBackend, Nce, tr("NCE")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(FullscreenMode, Borderless, tr("Borderless Windowed")), - PAIR(FullscreenMode, Exclusive, tr("Exclusive Fullscreen")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(NvdecEmulation, Off, tr("No Video Output")), - PAIR(NvdecEmulation, Cpu, tr("CPU Video Decoding")), - PAIR(NvdecEmulation, Gpu, tr("GPU Video Decoding (Default)")), - } - }); - translations->insert( - { - Settings::EnumMetadata::Index(), - { - PAIR(ResolutionSetup, Res1_4X, tr("0.25X (180p/270p) [EXPERIMENTAL]")), - PAIR(ResolutionSetup, Res1_2X, tr("0.5X (360p/540p) [EXPERIMENTAL]")), - PAIR(ResolutionSetup, Res3_4X, tr("0.75X (540p/810p) [EXPERIMENTAL]")), - PAIR(ResolutionSetup, Res1X, tr("1X (720p/1080p)")), - PAIR(ResolutionSetup, Res5_4X, tr("1.25X (900p/1350p) [EXPERIMENTAL]")), - PAIR(ResolutionSetup, Res3_2X, tr("1.5X (1080p/1620p) [EXPERIMENTAL]")), - PAIR(ResolutionSetup, Res2X, tr("2X (1440p/2160p)")), - PAIR(ResolutionSetup, Res3X, tr("3X (2160p/3240p)")), - PAIR(ResolutionSetup, Res4X, tr("4X (2880p/4320p)")), - PAIR(ResolutionSetup, Res5X, tr("5X (3600p/5400p)")), - PAIR(ResolutionSetup, Res6X, tr("6X (4320p/6480p)")), - PAIR(ResolutionSetup, Res7X, tr("7X (5040p/7560p)")), - PAIR(ResolutionSetup, Res8X, tr("8X (5760p/8640p)")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(ScalingFilter, NearestNeighbor, tr("Nearest Neighbor")), - PAIR(ScalingFilter, Bilinear, tr("Bilinear")), - PAIR(ScalingFilter, Bicubic, tr("Bicubic")), - PAIR(ScalingFilter, Gaussian, tr("Gaussian")), - PAIR(ScalingFilter, Lanczos, tr("Lanczos")), - PAIR(ScalingFilter, ScaleForce, tr("ScaleForce")), - PAIR(ScalingFilter, Fsr, tr("AMD FidelityFX Super Resolution")), - PAIR(ScalingFilter, Area, tr("Area")), - PAIR(ScalingFilter, Mmpx, tr("MMPX")), - PAIR(ScalingFilter, ZeroTangent, tr("Zero-Tangent")), - PAIR(ScalingFilter, BSpline, tr("B-Spline")), - PAIR(ScalingFilter, Mitchell, tr("Mitchell")), - PAIR(ScalingFilter, Spline1, tr("Spline-1")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(AntiAliasing, None, tr("None")), - PAIR(AntiAliasing, Fxaa, tr("FXAA")), - PAIR(AntiAliasing, Smaa, tr("SMAA")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(AspectRatio, R16_9, tr("Default (16:9)")), - PAIR(AspectRatio, R4_3, tr("Force 4:3")), - PAIR(AspectRatio, R21_9, tr("Force 21:9")), - PAIR(AspectRatio, R16_10, tr("Force 16:10")), - PAIR(AspectRatio, Stretch, tr("Stretch to Window")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(AnisotropyMode, Automatic, tr("Automatic")), - PAIR(AnisotropyMode, Default, tr("Default")), - PAIR(AnisotropyMode, X2, tr("2x")), - PAIR(AnisotropyMode, X4, tr("4x")), - PAIR(AnisotropyMode, X8, tr("8x")), - PAIR(AnisotropyMode, X16, tr("16x")), - } - }); - translations->insert( - { - Settings::EnumMetadata::Index(), - { - PAIR(Language, Japanese, tr("Japanese (日本語)")), - PAIR(Language, EnglishAmerican, tr("American English")), - PAIR(Language, French, tr("French (français)")), - PAIR(Language, German, tr("German (Deutsch)")), - PAIR(Language, Italian, tr("Italian (italiano)")), - PAIR(Language, Spanish, tr("Spanish (español)")), - PAIR(Language, Chinese, tr("Chinese")), - PAIR(Language, Korean, tr("Korean (한국어)")), - PAIR(Language, Dutch, tr("Dutch (Nederlands)")), - PAIR(Language, Portuguese, tr("Portuguese (português)")), - PAIR(Language, Russian, tr("Russian (Русский)")), - PAIR(Language, Taiwanese, tr("Taiwanese")), - PAIR(Language, EnglishBritish, tr("British English")), - PAIR(Language, FrenchCanadian, tr("Canadian French")), - PAIR(Language, SpanishLatin, tr("Latin American Spanish")), - PAIR(Language, ChineseSimplified, tr("Simplified Chinese")), - PAIR(Language, ChineseTraditional, tr("Traditional Chinese (正體中文)")), - PAIR(Language, PortugueseBrazilian, tr("Brazilian Portuguese (português do Brasil)")), - PAIR(Language, Serbian, tr("Serbian (српски)")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(Region, Japan, tr("Japan")), - PAIR(Region, Usa, tr("USA")), - PAIR(Region, Europe, tr("Europe")), - PAIR(Region, Australia, tr("Australia")), - PAIR(Region, China, tr("China")), - PAIR(Region, Korea, tr("Korea")), - PAIR(Region, Taiwan, tr("Taiwan")), - } - }); - translations->insert( - { - Settings::EnumMetadata::Index(), - { - { - static_cast(Settings::TimeZone::Auto), - tr("Auto (%1)", "Auto select time zone") - .arg(QString::fromStdString( - Settings::GetTimeZoneString(Settings::TimeZone::Auto))) - }, - { - static_cast(Settings::TimeZone::Default), - tr("Default (%1)", "Default time zone") - .arg(QString::fromStdString(Common::TimeZone::GetDefaultTimeZone())) - }, - PAIR(TimeZone, Cet, tr("CET")), - PAIR(TimeZone, Cst6Cdt, tr("CST6CDT")), - PAIR(TimeZone, Cuba, tr("Cuba")), - PAIR(TimeZone, Eet, tr("EET")), - PAIR(TimeZone, Egypt, tr("Egypt")), - PAIR(TimeZone, Eire, tr("Eire")), - PAIR(TimeZone, Est, tr("EST")), - PAIR(TimeZone, Est5Edt, tr("EST5EDT")), - PAIR(TimeZone, Gb, tr("GB")), - PAIR(TimeZone, GbEire, tr("GB-Eire")), - PAIR(TimeZone, Gmt, tr("GMT")), - PAIR(TimeZone, GmtPlusZero, tr("GMT+0")), - PAIR(TimeZone, GmtMinusZero, tr("GMT-0")), - PAIR(TimeZone, GmtZero, tr("GMT0")), - PAIR(TimeZone, Greenwich, tr("Greenwich")), - PAIR(TimeZone, Hongkong, tr("Hongkong")), - PAIR(TimeZone, Hst, tr("HST")), - PAIR(TimeZone, Iceland, tr("Iceland")), - PAIR(TimeZone, Iran, tr("Iran")), - PAIR(TimeZone, Israel, tr("Israel")), - PAIR(TimeZone, Jamaica, tr("Jamaica")), - PAIR(TimeZone, Japan, tr("Japan")), - PAIR(TimeZone, Kwajalein, tr("Kwajalein")), - PAIR(TimeZone, Libya, tr("Libya")), - PAIR(TimeZone, Met, tr("MET")), - PAIR(TimeZone, Mst, tr("MST")), - PAIR(TimeZone, Mst7Mdt, tr("MST7MDT")), - PAIR(TimeZone, Navajo, tr("Navajo")), - PAIR(TimeZone, Nz, tr("NZ")), - PAIR(TimeZone, NzChat, tr("NZ-CHAT")), - PAIR(TimeZone, Poland, tr("Poland")), - PAIR(TimeZone, Portugal, tr("Portugal")), - PAIR(TimeZone, Prc, tr("PRC")), - PAIR(TimeZone, Pst8Pdt, tr("PST8PDT")), - PAIR(TimeZone, Roc, tr("ROC")), - PAIR(TimeZone, Rok, tr("ROK")), - PAIR(TimeZone, Singapore, tr("Singapore")), - PAIR(TimeZone, Turkey, tr("Turkey")), - PAIR(TimeZone, Uct, tr("UCT")), - PAIR(TimeZone, Universal, tr("Universal")), - PAIR(TimeZone, Utc, tr("UTC")), - PAIR(TimeZone, WSu, tr("W-SU")), - PAIR(TimeZone, Wet, tr("WET")), - PAIR(TimeZone, Zulu, tr("Zulu")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(AudioMode, Mono, tr("Mono")), - PAIR(AudioMode, Stereo, tr("Stereo")), - PAIR(AudioMode, Surround, tr("Surround")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(MemoryLayout, Memory_4Gb, tr("4GB DRAM (Default)")), - PAIR(MemoryLayout, Memory_6Gb, tr("6GB DRAM (Unsafe)")), - PAIR(MemoryLayout, Memory_8Gb, tr("8GB DRAM")), - PAIR(MemoryLayout, Memory_10Gb, tr("10GB DRAM (Unsafe)")), - PAIR(MemoryLayout, Memory_12Gb, tr("12GB DRAM (Unsafe)")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(ConsoleMode, Docked, tr("Docked")), - PAIR(ConsoleMode, Handheld, tr("Handheld")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(CpuClock, Boost, tr("Boost (1700MHz)")), - PAIR(CpuClock, Fast, tr("Fast (2000MHz)")), - } - }); - translations->insert( - { - Settings::EnumMetadata::Index(), - { - PAIR(ConfirmStop, Ask_Always, tr("Always ask (Default)")), - PAIR(ConfirmStop, Ask_Based_On_Game, tr("Only if game specifies not to stop")), - PAIR(ConfirmStop, Ask_Never, tr("Never ask")), - } - }); - translations->insert({ - Settings::EnumMetadata::Index(), - { - PAIR(GpuOverclock, Low, tr("Low (128)")), - PAIR(GpuOverclock, Medium, tr("Medium (256)")), - PAIR(GpuOverclock, High, tr("High (512)")), - } - }); + PAIR(RendererBackend, Vulkan, tr("Vulkan")), + PAIR(RendererBackend, Null, tr("Null")), + }}); + translations->insert( + {Settings::EnumMetadata::Index(), + { + PAIR(ShaderBackend, Glsl, tr("GLSL")), + PAIR(ShaderBackend, Glasm, tr("GLASM (Assembly Shaders, NVIDIA Only)")), + PAIR(ShaderBackend, SpirV, tr("SPIR-V (Experimental, AMD/Mesa Only)")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(GpuAccuracy, Normal, tr("Normal")), + PAIR(GpuAccuracy, High, tr("High")), + PAIR(GpuAccuracy, Extreme, tr("Extreme")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(DmaAccuracy, Default, tr("Default")), + PAIR(DmaAccuracy, Unsafe, tr("Unsafe (fast)")), + PAIR(DmaAccuracy, Safe, tr("Safe (stable)")), + }}); + translations->insert( + {Settings::EnumMetadata::Index(), + { + PAIR(CpuAccuracy, Auto, tr("Auto")), + PAIR(CpuAccuracy, Accurate, tr("Accurate")), + PAIR(CpuAccuracy, Unsafe, tr("Unsafe")), + PAIR(CpuAccuracy, Paranoid, tr("Paranoid (disables most optimizations)")), + PAIR(CpuAccuracy, Debugging, tr("Debugging")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(CpuBackend, Dynarmic, tr("Dynarmic")), + PAIR(CpuBackend, Nce, tr("NCE")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(FullscreenMode, Borderless, tr("Borderless Windowed")), + PAIR(FullscreenMode, Exclusive, tr("Exclusive Fullscreen")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(NvdecEmulation, Off, tr("No Video Output")), + PAIR(NvdecEmulation, Cpu, tr("CPU Video Decoding")), + PAIR(NvdecEmulation, Gpu, tr("GPU Video Decoding (Default)")), + }}); + translations->insert( + {Settings::EnumMetadata::Index(), + { + PAIR(ResolutionSetup, Res1_4X, tr("0.25X (180p/270p) [EXPERIMENTAL]")), + PAIR(ResolutionSetup, Res1_2X, tr("0.5X (360p/540p) [EXPERIMENTAL]")), + PAIR(ResolutionSetup, Res3_4X, tr("0.75X (540p/810p) [EXPERIMENTAL]")), + PAIR(ResolutionSetup, Res1X, tr("1X (720p/1080p)")), + PAIR(ResolutionSetup, Res5_4X, tr("1.25X (900p/1350p) [EXPERIMENTAL]")), + PAIR(ResolutionSetup, Res3_2X, tr("1.5X (1080p/1620p) [EXPERIMENTAL]")), + PAIR(ResolutionSetup, Res2X, tr("2X (1440p/2160p)")), + PAIR(ResolutionSetup, Res3X, tr("3X (2160p/3240p)")), + PAIR(ResolutionSetup, Res4X, tr("4X (2880p/4320p)")), + PAIR(ResolutionSetup, Res5X, tr("5X (3600p/5400p)")), + PAIR(ResolutionSetup, Res6X, tr("6X (4320p/6480p)")), + PAIR(ResolutionSetup, Res7X, tr("7X (5040p/7560p)")), + PAIR(ResolutionSetup, Res8X, tr("8X (5760p/8640p)")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(ScalingFilter, NearestNeighbor, tr("Nearest Neighbor")), + PAIR(ScalingFilter, Bilinear, tr("Bilinear")), + PAIR(ScalingFilter, Bicubic, tr("Bicubic")), + PAIR(ScalingFilter, Gaussian, tr("Gaussian")), + PAIR(ScalingFilter, Lanczos, tr("Lanczos")), + PAIR(ScalingFilter, ScaleForce, tr("ScaleForce")), + PAIR(ScalingFilter, Fsr, tr("AMD FidelityFX Super Resolution")), + PAIR(ScalingFilter, Area, tr("Area")), + PAIR(ScalingFilter, Mmpx, tr("MMPX")), + PAIR(ScalingFilter, ZeroTangent, tr("Zero-Tangent")), + PAIR(ScalingFilter, BSpline, tr("B-Spline")), + PAIR(ScalingFilter, Mitchell, tr("Mitchell")), + PAIR(ScalingFilter, Spline1, tr("Spline-1")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(AntiAliasing, None, tr("None")), + PAIR(AntiAliasing, Fxaa, tr("FXAA")), + PAIR(AntiAliasing, Smaa, tr("SMAA")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(AspectRatio, R16_9, tr("Default (16:9)")), + PAIR(AspectRatio, R4_3, tr("Force 4:3")), + PAIR(AspectRatio, R21_9, tr("Force 21:9")), + PAIR(AspectRatio, R16_10, tr("Force 16:10")), + PAIR(AspectRatio, Stretch, tr("Stretch to Window")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(AnisotropyMode, Automatic, tr("Automatic")), + PAIR(AnisotropyMode, Default, tr("Default")), + PAIR(AnisotropyMode, X2, tr("2x")), + PAIR(AnisotropyMode, X4, tr("4x")), + PAIR(AnisotropyMode, X8, tr("8x")), + PAIR(AnisotropyMode, X16, tr("16x")), + }}); + translations->insert( + {Settings::EnumMetadata::Index(), + { + PAIR(Language, Japanese, tr("Japanese (日本語)")), + PAIR(Language, EnglishAmerican, tr("American English")), + PAIR(Language, French, tr("French (français)")), + PAIR(Language, German, tr("German (Deutsch)")), + PAIR(Language, Italian, tr("Italian (italiano)")), + PAIR(Language, Spanish, tr("Spanish (español)")), + PAIR(Language, Chinese, tr("Chinese")), + PAIR(Language, Korean, tr("Korean (한국어)")), + PAIR(Language, Dutch, tr("Dutch (Nederlands)")), + PAIR(Language, Portuguese, tr("Portuguese (português)")), + PAIR(Language, Russian, tr("Russian (Русский)")), + PAIR(Language, Taiwanese, tr("Taiwanese")), + PAIR(Language, EnglishBritish, tr("British English")), + PAIR(Language, FrenchCanadian, tr("Canadian French")), + PAIR(Language, SpanishLatin, tr("Latin American Spanish")), + PAIR(Language, ChineseSimplified, tr("Simplified Chinese")), + PAIR(Language, ChineseTraditional, tr("Traditional Chinese (正體中文)")), + PAIR(Language, PortugueseBrazilian, tr("Brazilian Portuguese (português do Brasil)")), + PAIR(Language, Serbian, tr("Serbian (српски)")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(Region, Japan, tr("Japan")), + PAIR(Region, Usa, tr("USA")), + PAIR(Region, Europe, tr("Europe")), + PAIR(Region, Australia, tr("Australia")), + PAIR(Region, China, tr("China")), + PAIR(Region, Korea, tr("Korea")), + PAIR(Region, Taiwan, tr("Taiwan")), + }}); + translations->insert( + {Settings::EnumMetadata::Index(), + { + {static_cast(Settings::TimeZone::Auto), + tr("Auto (%1)", "Auto select time zone") + .arg(QString::fromStdString( + Settings::GetTimeZoneString(Settings::TimeZone::Auto)))}, + {static_cast(Settings::TimeZone::Default), + tr("Default (%1)", "Default time zone") + .arg(QString::fromStdString(Common::TimeZone::GetDefaultTimeZone()))}, + PAIR(TimeZone, Cet, tr("CET")), + PAIR(TimeZone, Cst6Cdt, tr("CST6CDT")), + PAIR(TimeZone, Cuba, tr("Cuba")), + PAIR(TimeZone, Eet, tr("EET")), + PAIR(TimeZone, Egypt, tr("Egypt")), + PAIR(TimeZone, Eire, tr("Eire")), + PAIR(TimeZone, Est, tr("EST")), + PAIR(TimeZone, Est5Edt, tr("EST5EDT")), + PAIR(TimeZone, Gb, tr("GB")), + PAIR(TimeZone, GbEire, tr("GB-Eire")), + PAIR(TimeZone, Gmt, tr("GMT")), + PAIR(TimeZone, GmtPlusZero, tr("GMT+0")), + PAIR(TimeZone, GmtMinusZero, tr("GMT-0")), + PAIR(TimeZone, GmtZero, tr("GMT0")), + PAIR(TimeZone, Greenwich, tr("Greenwich")), + PAIR(TimeZone, Hongkong, tr("Hongkong")), + PAIR(TimeZone, Hst, tr("HST")), + PAIR(TimeZone, Iceland, tr("Iceland")), + PAIR(TimeZone, Iran, tr("Iran")), + PAIR(TimeZone, Israel, tr("Israel")), + PAIR(TimeZone, Jamaica, tr("Jamaica")), + PAIR(TimeZone, Japan, tr("Japan")), + PAIR(TimeZone, Kwajalein, tr("Kwajalein")), + PAIR(TimeZone, Libya, tr("Libya")), + PAIR(TimeZone, Met, tr("MET")), + PAIR(TimeZone, Mst, tr("MST")), + PAIR(TimeZone, Mst7Mdt, tr("MST7MDT")), + PAIR(TimeZone, Navajo, tr("Navajo")), + PAIR(TimeZone, Nz, tr("NZ")), + PAIR(TimeZone, NzChat, tr("NZ-CHAT")), + PAIR(TimeZone, Poland, tr("Poland")), + PAIR(TimeZone, Portugal, tr("Portugal")), + PAIR(TimeZone, Prc, tr("PRC")), + PAIR(TimeZone, Pst8Pdt, tr("PST8PDT")), + PAIR(TimeZone, Roc, tr("ROC")), + PAIR(TimeZone, Rok, tr("ROK")), + PAIR(TimeZone, Singapore, tr("Singapore")), + PAIR(TimeZone, Turkey, tr("Turkey")), + PAIR(TimeZone, Uct, tr("UCT")), + PAIR(TimeZone, Universal, tr("Universal")), + PAIR(TimeZone, Utc, tr("UTC")), + PAIR(TimeZone, WSu, tr("W-SU")), + PAIR(TimeZone, Wet, tr("WET")), + PAIR(TimeZone, Zulu, tr("Zulu")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(AudioMode, Mono, tr("Mono")), + PAIR(AudioMode, Stereo, tr("Stereo")), + PAIR(AudioMode, Surround, tr("Surround")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(MemoryLayout, Memory_4Gb, tr("4GB DRAM (Default)")), + PAIR(MemoryLayout, Memory_6Gb, tr("6GB DRAM (Unsafe)")), + PAIR(MemoryLayout, Memory_8Gb, tr("8GB DRAM")), + PAIR(MemoryLayout, Memory_10Gb, tr("10GB DRAM (Unsafe)")), + PAIR(MemoryLayout, Memory_12Gb, tr("12GB DRAM (Unsafe)")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(ConsoleMode, Docked, tr("Docked")), + PAIR(ConsoleMode, Handheld, tr("Handheld")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(CpuClock, Boost, tr("Boost (1700MHz)")), + PAIR(CpuClock, Fast, tr("Fast (2000MHz)")), + }}); + translations->insert( + {Settings::EnumMetadata::Index(), + { + PAIR(ConfirmStop, Ask_Always, tr("Always ask (Default)")), + PAIR(ConfirmStop, Ask_Based_On_Game, tr("Only if game specifies not to stop")), + PAIR(ConfirmStop, Ask_Never, tr("Never ask")), + }}); + translations->insert({Settings::EnumMetadata::Index(), + { + PAIR(GpuOverclock, Low, tr("Low (128)")), + PAIR(GpuOverclock, Medium, tr("Medium (256)")), + PAIR(GpuOverclock, High, tr("High (512)")), + }}); #undef PAIR #undef CTX_PAIR - return translations; - } + return translations; +} } // namespace ConfigurationShared diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 6f25267a8f..d5ad363a5b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1196,17 +1196,15 @@ void RasterizerOpenGL::SyncLogicOpState() { if (device.IsAmd()) { using namespace Tegra::Engines; - struct In { - const Maxwell3D::Regs::VertexAttribute::Type d; - In(Maxwell3D::Regs::VertexAttribute::Type n) : d(n) {} - bool operator()(Maxwell3D::Regs::VertexAttribute n) const { - return n.type == d; + + bool has_float = std::any_of( + regs.vertex_attrib_format.begin(), + regs.vertex_attrib_format.end(), + [](const auto& n) { + return n.type == Maxwell3D::Regs::VertexAttribute::Type::Float; } - }; + ); - bool has_float = - std::any_of(regs.vertex_attrib_format.begin(), regs.vertex_attrib_format.end(), - In(Maxwell3D::Regs::VertexAttribute::Type::Float)); regs.logic_op.enable = static_cast(!has_float); } diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp index 00f2decba4..afda81250a 100644 --- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp @@ -579,8 +579,7 @@ void BufferCacheRuntime::BindQuadIndexBuffer(PrimitiveTopology topology, u32 fir } } -void BufferCacheRuntime::BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset, u32 size, - u32 stride) { +void BufferCacheRuntime::BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset, u32 size, u32 stride) { if (index >= device.GetMaxVertexInputBindings()) { return; } diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 13ed1b585e..d2f314995e 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -848,7 +848,7 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) { static constexpr std::array extended{ VK_DYNAMIC_STATE_CULL_MODE_EXT, VK_DYNAMIC_STATE_FRONT_FACE_EXT, - //VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT, //Disabled for VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME + VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT, VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT, VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT, VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT, diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 14a4fee69b..f71d5300da 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -404,17 +404,13 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, device.GetMaxVertexInputBindings(), Maxwell::NumVertexArrays); } - const u8 dynamic_state = Settings::values.dyna_state.GetValue(); - - LOG_INFO(Render_Vulkan, "DynamicState value is set to {}", (u32) dynamic_state); - dynamic_features = DynamicFeatures{ - .has_extended_dynamic_state = device.IsExtExtendedDynamicStateSupported() && dynamic_state > 0, - .has_extended_dynamic_state_2 = device.IsExtExtendedDynamicState2Supported() && dynamic_state > 1, - .has_extended_dynamic_state_2_extra = device.IsExtExtendedDynamicState2ExtrasSupported() && dynamic_state > 1, - .has_extended_dynamic_state_3_blend = device.IsExtExtendedDynamicState3BlendingSupported() && dynamic_state > 2, - .has_extended_dynamic_state_3_enables = device.IsExtExtendedDynamicState3EnablesSupported() && dynamic_state > 2, - .has_dynamic_vertex_input = device.IsExtVertexInputDynamicStateSupported() && dynamic_state > 0, + .has_extended_dynamic_state = device.IsExtExtendedDynamicStateSupported(), + .has_extended_dynamic_state_2 = device.IsExtExtendedDynamicState2Supported(), + .has_extended_dynamic_state_2_extra = device.IsExtExtendedDynamicState2ExtrasSupported(), + .has_extended_dynamic_state_3_blend = device.IsExtExtendedDynamicState3BlendingSupported(), + .has_extended_dynamic_state_3_enables = device.IsExtExtendedDynamicState3EnablesSupported(), + .has_dynamic_vertex_input = device.IsExtVertexInputDynamicStateSupported(), }; } diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 59af3f33b6..c1a105ef36 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -945,7 +945,6 @@ bool AccelerateDMA::BufferToImage(const Tegra::DMA::ImageCopy& copy_info, void RasterizerVulkan::UpdateDynamicStates() { auto& regs = maxwell3d->regs; - UpdateViewportsState(regs); UpdateScissorsState(regs); UpdateDepthBias(regs); @@ -953,10 +952,7 @@ void RasterizerVulkan::UpdateDynamicStates() { UpdateDepthBounds(regs); UpdateStencilFaces(regs); UpdateLineWidth(regs); - - const u8 dynamic_state = Settings::values.dyna_state.GetValue(); - - if (device.IsExtExtendedDynamicStateSupported() && dynamic_state > 0) { + if (device.IsExtExtendedDynamicStateSupported()) { UpdateCullMode(regs); UpdateDepthCompareOp(regs); UpdateFrontFace(regs); @@ -966,22 +962,21 @@ void RasterizerVulkan::UpdateDynamicStates() { UpdateDepthTestEnable(regs); UpdateDepthWriteEnable(regs); UpdateStencilTestEnable(regs); - if (device.IsExtExtendedDynamicState2Supported() && dynamic_state > 1) { + if (device.IsExtExtendedDynamicState2Supported()) { UpdatePrimitiveRestartEnable(regs); UpdateRasterizerDiscardEnable(regs); UpdateDepthBiasEnable(regs); } - if (device.IsExtExtendedDynamicState3EnablesSupported() && dynamic_state > 2) { + if (device.IsExtExtendedDynamicState3EnablesSupported()) { using namespace Tegra::Engines; if (device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_OPEN_SOURCE || device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_PROPRIETARY) { - struct In { - const Maxwell3D::Regs::VertexAttribute::Type d; - In(Maxwell3D::Regs::VertexAttribute::Type n) : d(n) {} - bool operator()(Maxwell3D::Regs::VertexAttribute n) const { - return n.type == d; + const auto has_float = std::any_of( + regs.vertex_attrib_format.begin(), + regs.vertex_attrib_format.end(), + [](const auto& attrib) { + return attrib.type == Maxwell3D::Regs::VertexAttribute::Type::Float; } - }; - auto has_float = std::any_of(regs.vertex_attrib_format.begin(), regs.vertex_attrib_format.end(), In(Maxwell3D::Regs::VertexAttribute::Type::Float)); + ); if (regs.logic_op.enable) { regs.logic_op.enable = static_cast(!has_float); } @@ -992,16 +987,18 @@ void RasterizerVulkan::UpdateDynamicStates() { UpdateConservativeRasterizationMode(regs); } } - if (device.IsExtExtendedDynamicState2ExtrasSupported() && dynamic_state > 1) { + if (device.IsExtExtendedDynamicState2ExtrasSupported()) { UpdateLogicOp(regs); } - if (device.IsExtExtendedDynamicState3BlendingSupported() && dynamic_state > 2) { + if (device.IsExtExtendedDynamicState3BlendingSupported()) { UpdateBlending(regs); } } - if (device.IsExtVertexInputDynamicStateSupported() && dynamic_state > 0) - if (auto* gp = pipeline_cache.CurrentGraphicsPipeline(); gp && gp->HasDynamicVertexInput()) + if (device.IsExtVertexInputDynamicStateSupported()) { + if (auto* gp = pipeline_cache.CurrentGraphicsPipeline(); gp && gp->HasDynamicVertexInput()) { UpdateVertexInput(regs); + } + } } void RasterizerVulkan::HandleTransformFeedback() { diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 81e60f1c6a..93a87e1956 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -494,18 +494,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR CollectPhysicalMemoryInfo(); CollectToolingInfo(); - if (is_qualcomm || is_turnip) { - LOG_WARNING(Render_Vulkan, - "Qualcomm and Turnip drivers have broken VK_EXT_custom_border_color"); - //RemoveExtensionFeature(extensions.custom_border_color, features.custom_border_color, - //VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); - } - if (is_qualcomm) { - LOG_WARNING(Render_Vulkan, - "Qualcomm drivers have a slow VK_KHR_push_descriptor implementation"); - //RemoveExtension(extensions.push_descriptor, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); - LOG_WARNING(Render_Vulkan, "Disabling shader float controls and 64-bit integer features on Qualcomm proprietary drivers"); RemoveExtension(extensions.shader_float_controls, VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME); @@ -544,93 +533,36 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR if (arch >= NvidiaArchitecture::Arch_AmpereOrNewer) { LOG_WARNING(Render_Vulkan, "Ampere and newer have broken float16 math"); features.shader_float16_int8.shaderFloat16 = false; - } else if (arch <= NvidiaArchitecture::Arch_Volta) { - if (nv_major_version < 527) { - LOG_WARNING(Render_Vulkan, "Volta and older have broken VK_KHR_push_descriptor"); - //RemoveExtension(extensions.push_descriptor, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); - } } + if (nv_major_version >= 510) { LOG_WARNING(Render_Vulkan, "NVIDIA Drivers >= 510 do not support MSAA image blits"); cant_blit_msaa = true; } } - if (extensions.extended_dynamic_state && is_radv) { - // Mask driver version variant - const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version < VK_MAKE_API_VERSION(0, 21, 2, 0)) { - LOG_WARNING(Render_Vulkan, - "RADV versions older than 21.2 have broken VK_EXT_extended_dynamic_state"); - //RemoveExtensionFeature(extensions.extended_dynamic_state, - //features.extended_dynamic_state, - //VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); - } - } - if (extensions.extended_dynamic_state2 && is_radv) { - const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version < VK_MAKE_API_VERSION(0, 22, 3, 1)) { - LOG_WARNING( - Render_Vulkan, - "RADV versions older than 22.3.1 have broken VK_EXT_extended_dynamic_state2"); - // RemoveExtensionFeature(extensions.extended_dynamic_state2, - // features.extended_dynamic_state2, - // VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME); - } - } - if (extensions.extended_dynamic_state2 && is_qualcomm) { - const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0) && - version < VK_MAKE_API_VERSION(0, 0, 680, 0)) { - // Qualcomm Adreno 7xx drivers do not properly support extended_dynamic_state2. - LOG_WARNING(Render_Vulkan, - "Qualcomm Adreno 7xx drivers have broken VK_EXT_extended_dynamic_state2"); - //RemoveExtensionFeature(extensions.extended_dynamic_state2, - //features.extended_dynamic_state2, - //VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME); - } - } + if (extensions.extended_dynamic_state3 && is_radv) { LOG_WARNING(Render_Vulkan, "RADV has broken extendedDynamicState3ColorBlendEquation"); - features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable = true; - features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation = true; - dynamic_state3_blending = true; + features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable = false; + features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation = false; + dynamic_state3_blending = false; const u32 version = (properties.properties.driverVersion << 3) >> 3; if (version < VK_MAKE_API_VERSION(0, 23, 1, 0)) { LOG_WARNING(Render_Vulkan, "RADV versions older than 23.1.0 have broken depth clamp dynamic state"); - features.extended_dynamic_state3.extendedDynamicState3DepthClampEnable = true; - dynamic_state3_enables = true; + features.extended_dynamic_state3.extendedDynamicState3DepthClampEnable = false; + dynamic_state3_enables = false; } } + if (extensions.extended_dynamic_state3 && (is_amd_driver || driver_id == VK_DRIVER_ID_SAMSUNG_PROPRIETARY)) { // AMD and Samsung drivers have broken extendedDynamicState3ColorBlendEquation LOG_WARNING(Render_Vulkan, "AMD and Samsung drivers have broken extendedDynamicState3ColorBlendEquation"); - features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable = true; - features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation = true; - dynamic_state3_blending = true; - } - if (extensions.vertex_input_dynamic_state && is_radv) { - // TODO(ameerj): Blacklist only offending driver versions - // TODO(ameerj): Confirm if RDNA1 is affected - const bool is_rdna2 = - supported_extensions.contains(VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME); - if (is_rdna2) { - LOG_WARNING(Render_Vulkan, - "RADV has broken VK_EXT_vertex_input_dynamic_state on RDNA2 hardware"); - // RemoveExtensionFeature(extensions.vertex_input_dynamic_state, - // features.vertex_input_dynamic_state, - // VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); - } - } - if (extensions.vertex_input_dynamic_state && is_qualcomm) { - // Qualcomm drivers do not properly support vertex_input_dynamic_state. - LOG_WARNING(Render_Vulkan, - "Qualcomm drivers have broken VK_EXT_vertex_input_dynamic_state"); - //RemoveExtensionFeature(extensions.vertex_input_dynamic_state, - // features.vertex_input_dynamic_state, - // VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); + features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable = false; + features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation = false; + dynamic_state3_blending = false; } sets_per_pool = 64; @@ -644,12 +576,14 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR has_broken_cube_compatibility = true; } } + if (is_qualcomm) { const u32 version = (properties.properties.driverVersion << 3) >> 3; if (version < VK_MAKE_API_VERSION(0, 255, 615, 512)) { has_broken_parallel_compiling = true; } } + if (extensions.sampler_filter_minmax && is_amd) { // Disable ext_sampler_filter_minmax on AMD GCN4 and lower as it is broken. if (!features.shader_float16_int8.shaderFloat16) { @@ -660,24 +594,17 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR } } - if (extensions.vertex_input_dynamic_state && is_intel_windows) { - const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version < VK_MAKE_API_VERSION(27, 20, 100, 0)) { - LOG_WARNING(Render_Vulkan, "Intel has broken VK_EXT_vertex_input_dynamic_state"); - //RemoveExtensionFeature(extensions.vertex_input_dynamic_state, - //features.vertex_input_dynamic_state, - //VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); - } - } if (features.shader_float16_int8.shaderFloat16 && is_intel_windows) { // Intel's compiler crashes when using fp16 on Astral Chain, disable it for the time being. LOG_WARNING(Render_Vulkan, "Intel has broken float16 math"); features.shader_float16_int8.shaderFloat16 = false; } + if (is_intel_windows) { LOG_WARNING(Render_Vulkan, "Intel proprietary drivers do not support MSAA image blits"); cant_blit_msaa = true; } + has_broken_compute = CheckBrokenCompute(properties.driver.driverID, properties.properties.driverVersion) && !Settings::values.enable_compute_pipelines.GetValue(); @@ -685,24 +612,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR LOG_WARNING(Render_Vulkan, "Driver does not support native BGR format"); must_emulate_bgr565 = true; } - if (extensions.push_descriptor && is_intel_anv) { - const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version >= VK_MAKE_API_VERSION(0, 22, 3, 0) && - version < VK_MAKE_API_VERSION(0, 23, 2, 0)) { - // Disable VK_KHR_push_descriptor due to - // mesa/mesa/-/commit/ff91c5ca42bc80aa411cb3fd8f550aa6fdd16bdc - LOG_WARNING(Render_Vulkan, - "ANV drivers 22.3.0 to 23.1.0 have broken VK_KHR_push_descriptor"); - //RemoveExtension(extensions.push_descriptor, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); - } - } else if (extensions.push_descriptor && is_nvidia) { - const auto arch = GetNvidiaArch(); - if (arch <= NvidiaArchitecture::Arch_Pascal) { - LOG_WARNING(Render_Vulkan, - "Pascal and older architectures have broken VK_KHR_push_descriptor"); - //RemoveExtension(extensions.push_descriptor, VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); - } - } if (is_mvk) { LOG_WARNING(Render_Vulkan, @@ -730,8 +639,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR "Removing extendedDynamicState3 due to missing extendedDynamicState2"); RemoveExtensionFeature(extensions.extended_dynamic_state3, features.extended_dynamic_state3, VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME); - dynamic_state3_blending = true; - dynamic_state3_enables = true; + dynamic_state3_blending = false; + dynamic_state3_enables = false; } // Mesa Intel drivers on UHD 620 have broken EDS causing extreme flickering - unknown if it affects other iGPUs @@ -743,22 +652,26 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR Settings::values.dyna_state.SetValue(0); } - if (Settings::values.dyna_state.GetValue() == 0) { - must_emulate_scaled_formats = true; - LOG_INFO(Render_Vulkan, "Extended dynamic state is fully disabled, scaled format emulation is ON"); - - RemoveExtensionFeature(extensions.custom_border_color, features.custom_border_color, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); + switch (Settings::values.dyna_state.GetValue()) { + case 0: RemoveExtensionFeature(extensions.extended_dynamic_state, features.extended_dynamic_state, VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); + [[fallthrough]]; + case 1: RemoveExtensionFeature(extensions.extended_dynamic_state2, features.extended_dynamic_state2, VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME); + [[fallthrough]]; + case 2: RemoveExtensionFeature(extensions.extended_dynamic_state3, features.extended_dynamic_state3, VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME); - RemoveExtensionFeature(extensions.vertex_input_dynamic_state, features.vertex_input_dynamic_state, VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); dynamic_state3_blending = false; dynamic_state3_enables = false; + break; + } - LOG_INFO(Render_Vulkan, "All dynamic state extensions and features have been disabled"); - } else { - must_emulate_scaled_formats = false; - LOG_INFO(Render_Vulkan, "Extended dynamic state is enabled, scaled format emulation is OFF"); + if (!extensions.extended_dynamic_state) { + Settings::values.vertex_input_dynamic_state.SetValue(false); + } + + if (!Settings::values.vertex_input_dynamic_state.GetValue()) { + RemoveExtensionFeature(extensions.vertex_input_dynamic_state, features.vertex_input_dynamic_state, VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); } logical = vk::Device::Create(physical, queue_cis, ExtensionListForVulkan(loaded_extensions), first_next, dld);