* add setting for limiting frames ahead of GPU with INI support
* removing logging
* clang-format
* change default to true
* add setting to android side with UI
* ui for desktop
* license headers
* Adjusted setting title and description
Additionally fixes the Qt frontend having an incorrect description for this setting
* Disable setting by default due to performance regressions
---------
Co-authored-by: OpenSauce04 <opensauce04@gmail.com>
* renderer_vulkan: Update `IsMultiSampleSupported` to check for `shaderStorageImageMultisample`
`shaderStorageImageMultisample` is required for the reinterpretation compute shaders in particular and should be part of the main MSAA requirement for now.
* renderer_vulkan: Conditionally create multisample compute shaders based on MSAA support
These shaders should not be compiled on systems that do not support `shaderStorageImageMultisample`. Some systems, such as newer Intel iGPUs, seem to gracefully handle compiling these compute shaders despite not supporting `shaderStorageImageMultisample`. Other drivers such as Mobile GPUs, will have the entire compute pipeline compilation fail.
* renderer_vulkan: Allow hardware-accelerated reinterpretations to fail
Propagate blit-helper results to `TextureRuntime::Reinterpret` return value. Allows a slow-path reinterpretation to be done in the case of backend failure.
* improve keyboard navigation of game list in three ways:
1) Return key on mac now successfully launches a game
2) up and down arrow keys now move focus out of search field and into game list
3) whenever focus goes into game list it ensures a game is selected
* refactor android input settings completely to enable per-game settings and saving in config.ini, as well as more efficient storage of setting information
# Conflicts:
# src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/CitraSettings.kt
# src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/view/InputBindingSetting.kt
* add migration function
* merge turbo toggle/hold changes into input refactor
* remove extraneous log
* Migration fixes
* move all event handling to GamepadEventHandler
* minor issue fixes
* allow empty mappings for input bindings
* reset on ACTION_CANCEL
* license
* config: Add `sample_count` renderer option
Option is only enabled when the renderer is set to Vulkan, for now.
* vk_blit_helper: Add `d24s8_to_rgba8_ms_comp`
Helper host-shader for blitting multi-sampled DS24S8 textures to multi-sampled RGBA8
* vk_instance: Add detection of MSAA features
Full multi-sample support is when renderpass-2 and depth-stencil-resolve extensions are available and when sample-rate-shading and msaa-storage-images are supported.
* rasterizer_cache: Initial support for multi-sample surfaces
* renderer_vulkan: Implement multisample pipeline/renderpass support
Allows multi-sample render passes and graphics pipelines to be created, using sample-rate shading rather than coverage-based MSAA.
* renderer_vulkan: Implement multisample texture runtime
This seems to be enough for simple programs to render with MSAA enabled!
* renderer_vulkan: Fix multisample texture init barrier
Should address the MultiSampled image directly since the multisampled image is just a transient image and not the leading state of the image.
* renderer_vulkan: Fix `Framebuffer::sample_count` move-operator
`sample_count` needs to be move/copied over.
Also reorder the accessor order to match the declaration of variables.
* renderer_vulkan: Fix dangling surface reference during msaa resolve
These individual parameters need to be copied as the reference to the surface-object only lasts within the scope of this function.
* renderer_vulkan: Derive framebuffer sample-count from attachments
Derive the framebuffer sample-count from the input color and depth operands. Similar to how `res_scale` is determined.
* renderer_vulkan: Fix initialization of image handles
Try to optimally create the new image handles when a change in res scale or sample-count has actually occured. MSAA images need to be updated too in the case that the resolution scale has changed
* renderer_vulkan: Fix cleanup and debug-naming for `d24s8_to_rgba8_ms_comp`
* renderer_vulkan: Add `TextureRuntime::ResolveTexture`
Rather than use a big lambda, just rip this out into a proper function for other blit functions to utilize.
* renderer_vulkan: Fix narrowing byte conversion
Fixes a compilation error on Unix platforms.
* renderer_vulkan: Fix MSAA framebuffer target resolve surface
Use the specified type rather than defaulting to the surface's current one(implicit `ImageView` argument).
* renderer_vulkan: Fix `Surface::ScaleUp` scale/sample increase
This should be checking the _new_ value to possibly cull upscaled texture creation rather than the current value of the surface. Fixes broken up render passes when drawing UI in some games.
* renderer_vulkan: Fix `ConvertDS24S8ToRGBA8` image targets
Ensure that the Multi-Sample texture is used for the destination color image as well. Should the dest image be MSAA too? Or should all the values be resolved into a minimum depth and some combination of stencil-values here?
* renderer_vulkan: Fix multisample `ClearTextureWithRenderpass`
Ensure that the multisample framebuffer is used rather than the usual one when using a render pass to clear the textures.
That way, a MSAA-render AND resolve is used to clear the textures at the same time.
* renderer_vulkan: Fix multisample framebuffer creation
MSAA renderpasses require the "current" image as the main resolve target, and the MSAA image as the second attachment.
* renderer_vulkan: Fix MSAA image debug name
* renderer_vulkan: Fix Multisample `ConvertDS24S8ToRGBA8`
Migrate `ResolveTexture` to `BlitHelper`.
If the conversion was multi-sample, do a final resolve at the end of the conversion to ensure the non-multisample textures are updated as well.
Fixes Pokemon!
* config: Refactor `sample_count` to `antialiasing` setting
Intended to allow for other anti-aliasing methods to be introduced
* renderer_gl: Initial MSAA implementation
Basically copied over some of the paradigms over from Vulkan. Covers most rendering uses-cases except for conversions such as `ConvertDS24S8ToRGBA8` and `ConvertRGBA4ToRGB5A1`
* renderer_gl: Fix surface `ScaleUp` implementation
Should assign the new `res_scale` and `sample_count`
* renderer_gl: Implement multisample `Convert{DS24S8ToRGBA8,RGBA4ToRGB5A1}`
* renderer_gl: Resolve framebuffer after each draw
Brute force approach while trying to determine a better heuristic. Framebuffer changes are not enough to determine the end of a "render pass". An 'msaa dirty flag' is likely the better way here.
* renderer_gl: Implement `TextureRuntime::ClearTexture` MSAA clears
When ArbClearTexture is not available, ensure the fallback implementation also clears the MSAA texture as well.
* renderer_gl: Fix MakeHandle string-view hazard
`glObjectLabel` expects a null-terminated string, but an `std::string_view` is not necessarily null-terminated
* renderer_gl: Add layer/level specifier to MSAA resolves
* renderer_vulkan: Conditionally compile `DS24S8->RGBA8` multisample pipeline
This will crash on apple due to the lack of support for MSAA texture storage operations. This gets MacOS running generally now, but will likely require a refactor of some kind into a fragment shader and graphics pipeline rather than a compute shader for MacOS in particular.
* config: Stub support for up to `MSAAx16`
This is primarily to claim the enum value before other anti-aliasing methods get added. Eventually, support for the RHI device's sample-count will have to be detected and used opportunistically. Maybe "MSAA" is the anti-aliasing method and the actual sample-count comes from someplace else?
* config: Disable `MSAAx{8,16}` options by default
These are not guaranteed to be supported and should be disabled by default for now.
We still want the config options to be allocated. They should just not user-facing until these values can be conditionally enabled with fallbacks.
* renderer_vulkan: Remove unneeded sample-count info from `RasterizerVulkan::AccelerateDisplay`
We're always resolving into the best non-msaa image.
This isnt needed here. OpenGL doesn't need it either.
* core: Fix license headers
Also fix some clang-format formatting
* renderer_vulkan: Disable MSAA functionality from MacOS
The features required to support this at the moment are out of the scope of
this PR, thus MSAA is disabled for now and will be re-enabled in a later PR.
All MSAA anti-aliasing settings are removed when running on MacOS.
The main features holding this back are:
* Dynamically detecting the number of samples that the host GPU
supports(up to x4 is required, but x8 and x16 need to be detected when
initializing the backend)
* Blit-helper needs to have non-compute-shader variants of its MSAA
reinterpretation functions, but Metal(MoltenVK) does not support writing to
individual MSAA samples from a compute shader, and instead must be done from
a regular fragment-shader from within a render-pass.
* renderer_vulkan: Fix recycling of MSAA textures
Fixes an issue where reducing the sample count at run-time was causing
crashes due to previous MSAA textures, with a higher sample count, being
re-used. This also re-orders the criteria for recycling sentenced
textures to allow for better short-circuiting. The criteria for a
texture to be recycled must strictly be the "ScaleUp" case, and not the
case where the sample-count is being _reduced_. This recycling could be
a bit smarter to consider cases where a texture can have its
sample-count reduced but not its resolution scale. But that's an
optimization that is out of the scope of this PR, I feel.
* renderer_vulkan: Fix enabled extension array size
There are 16 total calls to `add_extension` that indicates that the `enabled_extensions` array should be 16 rather than 13.
* renderer_vulkan: Disable MSAA functionality from UI
This reverts commit 26939156c0.
MSAA requires some advanced configuration features that are not quite
ready yet. Currently, `shaderStorageImageMultisample` support needs to
be detected at config-time to allow MSAA to be used. Otherwise, the
reinterpret-passes need to have a non-compute alternative implemented.
Both are pretty larege features that should not increase the scale of
this PR for now.
To mitigate people from interfacing with this feature for
now, anti-aliasing options that involve MSAA will be disabled from the
UI and only operable from editing the ini configurations. This is to
allow for other anti-aliasing methods to be allowed in the team time.
* update About Game dialog on android to use a flexible layout for buttons and show a visible scrollbar in situations where the buttons do not all fit
* move per-app settings before cheats
* implement custom settings fully
fix startup crash
# Conflicts:
# src/android/app/src/main/jni/native.cpp
* Bugfixes - graphics API crash, intent not loading settings, anime4k change happening too late
* fix launch bug when using intent instead of game data
* clang-format, ktlint, license
* incompatible app for per-app settings dialog
* fix issue with global message appearing incorrectly sometimes
* various bugfixes from review
* sync android defaults to native universally
* code cleanup based on review
* add GetSettingFromKey function to read settings using only a string key, honoring per-game settings
* fix typo in SettingsActiityPresenter
* format and license
* remove double game parsing and reorganize
* update use_frame_limit logic
* improve settings activity title code
* config.cpp refactor to reduce repetition
* revert accidental line break in settings.h
* add titleId to Config constructor to remove duplicat ReadValues (+ clangformat)
* add back fallback parsing for emulationfragment in case the game cache gets lost
* Move game from viewmodel to companion object for better reliability
* clean up config
* clean up emulation activity
* Fix bug with strings and hardwired defaults (motion and touch)
* Turbo Hold button for android
quick fix
* Add Turbo (Hold) Hotkey to desktop.
Requred expanding the GApplicationFilter class to contain a set of sequences to filter, a helper method to filter custom sequences, and some new signals and slots. The GApplicationFilter is now a local variable of citra_qt so that sequences can be added by the InitializeHotkeys function.
* refactor to enable controller hotkey support
* update license headers and apply ktlint
* rasterizer_cache: Skip stale async custom texture uploads
A decoded custom texture could be applied after its surface was
unregistered and the slot reused, which aborted in the custom-upload
assert. Confirm the slot, registration, guest parameters, and source
hash before uploading, and reload surface references after the cache
grows.
* just leave this the way it was
* fix clang-format
* fix license-header test failure
* feedback: set iscustom surface flag before uploading and fix slot_vector.h license
* fix: comments
* video_core: Harden stride aliasing validation
Avoid skipping surface validation when an Invalid-format surface overlaps the requested interval or when the dirty region only partially covers it. This prevents stale cached surface contents from being reused through the different-stride aliasing fast path.
* Update license information in rasterizer_cache.h
* update license
* ptm: Add battery charge-level to ptm state
Update enum to be u8 rather than u32
* config: Add battery-level-source and battery-level configs
Allow either a fixed battery level or source the battery-level from the user's system.
* input_common: System battery-state implementation
Use the Input interface to derive the system's battery information. Enable the POWER backend for SDL.
* ptm: Implement configurable system/fixed battery state
Either uses a fixed definition, or a system-derived battery-level and charge-state
* input_common: Refactor battery-state interface
Use a singular function to get the total state of the battery rather than several functions.
* config: Add fixed battery charging state configuration
* input_common: Limit controller `SDL` engine usage with `HAVE_SDL2` preprocessor
Should fix some issues when compiling for libretro-windows.
* chore: Update modified file licenses to gplv3
* cmake: Fix `std::aligned_alloc` compilation error during libretro-android builds
libretro android builds are built using API level 21, which does not support aligned alloc(added in API level 28).
One way to mitigate this seems to be to utilize `BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC` specifically for libretro Android builds to disable usage of `std::aligned_alloc`.