* vk_platform: Add `SetObjectName`
Creates a name-info struct and automatically deduces the object handle type using vulkan-hpp's handle trait data.
Supports `string_view` and `fmt` arguments.
* vk_texture_runtime: Use `SetObjectName` for surface handles
Names both the image handle and the image-view.
* vk_stream_buffer: Add debug object names
Names the buffer and its device memory based on its size and type.
* vk_swapchain: Set swapchain handle debug names
Identifies the swapchain images themselves as well as the semaphores
* vk_present_window: Set handle debug names
* vk_resource_pool: Set debug handle names
* vk_blit_helper: Set debug handle names
* vk_platform: Use `VulkanHandleType` concept
Use a new `concept`-type rather than `enable_if`-patterns to restrict
this function to Vulkan handle-types only.
* android: Rework Emulation Activity's UI
- New in-game menu
- Ability to open games from file manager
- New shader loading UI
- Fixes an issue where the system bars would stay visible during emulation
* android: Port yuzu's foreground service logic
Fixes an issue where the foreground service notification would be stuck with no way to dismiss it
This fixes a compile-error with gcc I was getting from
`LOG_TRACE`(`error: ‘LOG_TRACE’ was not declared in this scope`) and
`u32`(`error: ‘u32’ was not declared in this scope`) being used without
their header-files being included.
Not sure how `romfs_reader.cpp` is even compiling when nothing in its
include-tree is refers to those macros.
For each draw, Citra will rebind all descriptor set slots and may redundantly re-bind descriptor-sets that were already bound. Instead it should only bind the descriptor-sets that have either changed or have had their buffer-offsets changed. This also allows entire calls to `vkCmdBindDescriptorSets` to be removed in the case that nothing has changed between draw calls.
* android: Android 14 support
* android: New home UI flow
Port of the yuzu-android home UI with a few Citra specific tweaks.
A few important things to note
- New and existing Citra users will be guided through the new setup flow
- Existing game directory location is discarded and will have to be reselected
- Protections around making sure the user has selected a user directory were reworked to fit this new UI. I removed async directory init and DirectoryStateReceivers and check during MainActivity's onResume callback.
- Removed Citra premium. The light/dark theme is now available for everyone.
* android: New blue app theme
* android: Extend UI into status/navigation bar area
* android: Remove yellow theme specific styles
* android: Disable status/navigation bar contrast enforcement
We handle it ourselves so there's no need to use a contrasty background on the system bars
* android: GPU Driver Manager
Includes a rewrite of FileUtil with some helper functions for the manager
* android: Rework NativeLibrary in Kotlin
Besides the rewrite this cleans up the alert dialogs that are used for system errors. Generally removes unused JNI code and makes things a little more consistent.
* android: Home menu support + downloader
* android: Enable minify and resource shrinking
* android: Remove premium page and expose texture filtering modes
* android: Update AGP to 8.1.2
* android: Don't display emulation in cutout area
We don't currently handle the notch properly in the emulation fragment so just don't render under it for now.
* android: native.cpp ClangFormat fixes
* core: SystemTitles: Include std::optional
Without it, the android build would fail
* vk: android: Properly override GetDriverLibrary
* vk_instance: Blacklist timeline semaphore ext on turnip
* vk_platform: Hardcode apiVersion to VK_API_VERSION_1_3
* android: native: Use const where applicable
* android: native: Array pointer access style fix
* android: Share relevant log
Shares the old log if it exists and you haven't booted a game yet and shares the current log if you have booted a game.
* android: Apply dark theme color for software keyboard text
---------
Co-authored-by: GPUCode <geoster3d@gmail.com>
* android: Unify DocumentNode's `key` and `name`
They're effectively the same data, just obtained in different ways.
* android: Remove getFilenameWithExtensions method
After the previous commit, there's only one remaining use of
getFilenameWithExtensions. Let's get rid of that one in favor of
DocumentFile.getName so we no longer need to do manual URI parsing.
* android: Use case insensitivity in DocumentsTree
External storage on Android is case insensitive. This is still the case
when accessing it through SAF. (Of course, SAF makes no guarantees about
whether the storage location picked by the user is backed by external
storage or whether it's case insensitive, but I'm just going to ignore
that for now because I am *so tired of SAF*)
Because the underlying file system is case insensitive, Citra's caching
layer that had to be implemented because SAF's performance is atrocious
also needs to be case insensitive. Otherwise, we get a problem in the
following scenario:
1. Citra wants to check if a particular folder exists in sdmc, and if
not, create it.
2. The folder does exist, but it has a different capitalization than
Citra expects, due to a mismatch between Citra's code and (typically)
files dumped from a real 3DS using ThreeSD.
3. Citra tries to open the folder, but DocumentsTree fails to find it,
because the case doesn't match.
4. Citra then tries to create the folder, but creating the folder fails,
because the underlying filesystem considers the folder to exist.
5. The game fails to start.
(Sorry, did I say creating the folder fails? Actually, a new folder does
get created, with " (1)" appended to the end of the name. SAF makes no
guarantees whatsoever about what happens in this situation – it's all
determined by the storage provider!)
This commit makes the caching layer case insensitive so that the
described scenario will work better.
* externals: Add oaksim submodule
Used for emitting ARM64 assembly
* common: Implement aarch64 ABI
Utilize oaknut to implement a stack frame.
* tests: Allow shader-jit tests for x64 and a64
Run the shader-jit tests for both x86_64 and arm64 targets
* video_core: Initialize arm64 shader-jit backend
Passes all current unit tests!
* shader_jit_a64: protect/unprotect memory when jit-ing
Required on MacOS. Memory needs to be fully unprotected and then
re-protected when writing or there will be memory access errors on
MacOS.
* shader_jit_a64: Fix ARM64-Imm overflow
These conditionals were throwing exceptions since the immediate values
were overflowing the available space in the `EOR` instructions. Instead
they are generated from `MOV` and then `EOR`-ed after.
* shader_jit_a64: Fix Geometry shader conditional
* shader_jit_a64: Replace `ADRL` with `MOVP2R`
Fixes some immediate-generation exceptions.
* common/aarch64: Fix CallFarFunction
* shader_jit_a64: Optimize `SantitizedMul`
Co-authored-by: merryhime <merryhime@users.noreply.github.com>
* shader_jit_a64: Fix address register offset behavior
Based on https://github.com/citra-emu/citra/pull/6942
Passes unit tests.
* shader_jit_a64: Fix `RET` address offset
A64 stack is 16-byte aligned rather than 8. So a direct port of the x64
code won't work. Fixes weird branches into invalid memory for any
shaders with subroutines.
* shader_jit_a64: Increase max program size
Tuned for A64 program size.
* shader_jit_a64: Use `UBFX` for extracting loop-state
Co-authored-by: JosJuice <JosJuice@users.noreply.github.com>
* shader_jit_a64: Optimize `SUB+CMP` to `SUBS`
Co-authored-by: JosJuice <JosJuice@users.noreply.github.com>
* shader_jit_a64: Optimize `CMP+B` to `CBNZ`
Co-authored-by: JosJuice <JosJuice@users.noreply.github.com>
* shader_jit_a64: Use `FMOV` for `ONE` vector
Co-authored-by: JosJuice <JosJuice@users.noreply.github.com>
* shader_jit_a64: Remove x86-specific documentation
* shader_jit_a64: Use `UBFX` to extract exponent
Co-authored-by: JosJuice <JosJuice@users.noreply.github.com>
* shader_jit_a64: Remove redundant MIN/MAX `SRC2`-NaN check
Special handling only needs to check SRC1 for NaN, not SRC2.
It would work as follows in the four possible cases:
No NaN: No special handling needed.
Only SRC1 is NaN: The special handling is triggered because SRC1 is NaN, and SRC2 is picked.
Only SRC2 is NaN: FMAX automatically picks SRC2 because it always picks the NaN if there is one.
Both SRC1 and SRC2 are NaN: The special handling is triggered because SRC1 is NaN, and SRC2 is picked.
Co-authored-by: JosJuice <JosJuice@users.noreply.github.com>
* shader_jit/tests:: Add catch-stringifier for vec2f/vec3f
* shader_jit/tests: Add Dest Mask unit test
* shader_jit_a64: Fix Dest-Mask `BSL` operand order
Passes the dest-mask unit tests now.
* shader_jit_a64: Use `MOVI` for DestEnable mask
Accelerate certain cases of masking with MOVI as well
Co-authored-by: JosJuice <JosJuice@users.noreply.github.com>
* shader_jit/tests: Add source-swizzle unit test
This is not expansive. Generating all `4^4` cases seems to make Catch2
crash. So I've added some component-masking(non-reordering) tests based
on the Dest-Mask unit-test and some additional ones to test
broadcasts/splats and component re-ordering.
* shader_jit_a64: Fix swizzle index generation
This was still generating `SHUFPS` indices and not the ones that we wanted for the `TBL` instruction. Passes all unit tests now.
* shader_jit/tests: Add `ShaderSetup` constructor to `ShaderTest`
Rather than using the direct output of `CompileShaderSetup` allow a
`ShaderSetup` object to be passed in directly. This enabled the ability
emit assembly that is not directly supported by nihstro.
* shader_jit/tests: Add `CALL` unit-test
Tests nested `CALL` instructions to eventually reach an `EX2`
instruction.
EX2 is picked in particular since it is implemented as an even deeper
dispatch and ensures subroutines are properly implemented between `CALL`
instructions and implementation-calls.
* shader_jit_a64: Fix nested `BL` subroutines
`lr` was getting writen over by nested calls to `BL`, causing undefined
behavior with mixtures of `CALL`, `EX2`, and `LG2` instructions.
Each usage of `BL` is now protected with a stach push/pop to preserve
and restore teh `lr` register to allow nested subroutines to work
properly.
* shader_jit/tests: Allocate generated tests on heap
Each of these generated shader-test objects were causing the stack to
overflow. Allocate each of the generated tests on the heap and use
unique_ptr so they only exist within the life-time of the `REQUIRE`
statement.
* shader_jit_a64: Preserve `lr` register from external function calls
`EMIT` makes an external function call, and should be preserving `lr`
* shader_jit/tests: Add `MAD` unit-test
The Inline Asm version requires an upstream fix:
https://github.com/neobrain/nihstro/issues/68
Instead, the program code is manually configured and added.
* shader_jit/tests: Fix uninitialized instructions
These `union`-type instruction-types were uninitialized, causing tests
to indeterminantly fail at times.
* shader_jit_a64: Remove unneeded `MOV`
Residue from the direct-port of x64 code.
* shader_jit_a64: Use `std::array` for `instr_table`
Add some type-safety and const-correctness around this type as well.
* shader_jit_a64: Avoid c-style offset casting
Add some more const-correctness to this function as well.
* video_core: Add arch preprocessor comments
* common/aarch64: Use X16 as the veneer register
https://developer.arm.com/documentation/102374/0101/Procedure-Call-Standard
* shader_jit/tests: Add uniform reading unit-test
Particularly to ensure that addresses are being properly truncated
* common/aarch64: Use `X0` as `ABI_RETURN`
`X8` is used as the indirect return result value in the case that the
result is bigger than 128-bits. Principally `X0` is the general-case
return register though.
* common/aarch64: Add veneer register note
`LR` is generally overwritten by `BLR` anyways, and would also be a safe
veneer to utilize for far-calls.
* shader_jit_a64: Remove unneeded scratch register from `SanitizedMul`
* shader_jit_a64: Fix CALLU condition
Should be `EQ` not `NE`. Fixes the regression on Kid Icarus.
No known regressions anymore!
---------
Co-authored-by: merryhime <merryhime@users.noreply.github.com>
Co-authored-by: JosJuice <JosJuice@users.noreply.github.com>
Adds the current viewport and scissor to the dynamic pipeline state to
reduce redundant viewport/scissor assignments in the command buffer.
This greatly reduces the amount of API calls to `vkCmdSetViewport` and
`vkCmdSetScissor` by only emitting the API call when the state actually
changes.
* vk_stream_buf: Avoid protected memory heaps
* Add an "Exclude" argument when finding a memory-type that avoids
`VK_MEMORY_PROPERTY_PROTECTED_BIT` by default
* vk_stream_buf: Utilize dedicated allocations when preferred by driver
`VK_KHR_dedicated_allocation` is part of the core Vulkan 1.1
specification and should be utilized when `prefersDedicatedAllocation`
is set.
* game_list: Treat demos as applications
Allows the dumping of RomFS from demos.
* game_list: Add TODO about using bitmasks for title ID high checks.
---------
Co-authored-by: Steveice10 <1269164+Steveice10@users.noreply.github.com>
`DebugScope` was capturing a `string_view` in a lambda which is only
valid during the scope of this ctor. When the lambda gets invoked at a
later time, it will read undefined garbage. The lambda needs to make a
deep copy of this `string_view` into a `string` so that it is valid by
the time the scheduler invokes this lambda.
* Implement missing http:c functionality.
* More implementation details and cleanup.
* Organize code
* Disable treat errors as warnings for httplib
* Fix defines
* Remove pragmas that do nothing and mark as SYSTEM
* Make httplib system
* Try to fix issue from httplib
* Apply suggestions
* Fix header ordering
* Fix compilation issue
* Create and use ctx.CommandID()
* Add and use Common::TruncateString
* Apply more suggestions
* Apply suggestions
* Fix compilation
* Apply suggestions
* Fix format
* Revert SplitURL to previous version
* Apply suggestions
* qt: Partially fix Wayland on NVIDIA.
* qt: Fix Vulkan under Wayland.
Showing and hiding the window here messes up the surface,
causing an instant crash on load.
* qt: Properly set up GLES context when requested.
* video_core: Abstract shader generators.
* shader: Extract common generator structures and move generators to specific namespaces.
* shader: Minor fixes and clean-up.
* code: Prepare frontend for vulkan support
* citra_qt: Add vulkan options to the GUI
* vk_instance: Collect tooling info
* renderer_vulkan: Add vulkan backend
* qt: Fix fullscreen and resize issues on macOS. (#47)
* qt: Fix bugged macOS full screen transition.
* renderer/vulkan: Fix swapchain recreation destroying in-use semaphore.
* renderer/vulkan: Make gl_Position invariant. (#48)
This fixes an issue with black artifacts in Pokemon games on Apple GPUs.
If the vertex calculations differ slightly between render passes, it can
cause parts of model faces to fail depth test.
* vk_renderpass_cache: Bump pixel format count
* android: Custom driver code
* vk_instance: Set moltenvk configuration
* rasterizer_cache: Proper surface unregister
* citra_qt: Fix invalid characters
* vk_rasterizer: Correct special unbind
* android: Allow async presentation toggle
* vk_graphics_pipeline: Fix async shader compilation
* We were actually waiting for the pipelines regardless of the setting, oops
* vk_rasterizer: More robust attribute loading
* android: Move PollEvents to OpenGL window
* Vulkan does not need this and it causes problems
* vk_instance: Enable robust buffer access
* Improves stability on mali devices
* vk_renderpass_cache: Bring back renderpass flushing
* externals: Update vulkan-headers
* gl_rasterizer: Separable shaders for everyone
* vk_blit_helper: Corect depth to color convertion
* renderer_vulkan: Implement reinterpretation with copy
* Allows reinterpreteration with simply copy on AMD
* vk_graphics_pipeline: Only fast compile if no shaders are pending
* With this shaders weren't being compiled in parallel
* vk_swapchain: Ensure vsync doesn't lock framerate
* vk_present_window: Match guest swapchain size to vulkan image count
* Less latency and fixes crashes that were caused by images being deleted before free
* vk_instance: Blacklist VK_EXT_pipeline_creation_cache_control with nvidia gpus
* Resolves crashes when async shader compilation is enabled
* vk_rasterizer: Bump async threshold to 6
* Many games have fullscreen quads with 6 vertices. Fixes pokemon textures missing with async shaders
* android: More robust surface recreation
* renderer_vulkan: Fix dynamic state being lost
* vk_pipeline_cache: Skip cache save when no pipeline cache exists
* This is the cache when loading a save state
* sdl: Fix surface initialization on macOS. (#49)
* sdl: Fix surface initialization on macOS.
* sdl: Fix render window events not being handled under Vulkan.
* renderer/vulkan: Fix binding/unbinding of shadow rendering buffer.
* vk_stream_buffer: Respect non coherent access alignment
* Required by nvidia GPUs on MacOS
* renderer/vulkan: Support VK_EXT_fragment_shader_interlock for shadow rendering. (#51)
* renderer_vulkan: Port some recent shader fixes
* vk_pipeline_cache: Improve shadow detection
* vk_swapchain: Add missing check
* renderer_vulkan: Fix hybrid screen
* Revert "gl_rasterizer: Separable shaders for everyone"
Causes crashes on mali GPUs, will need separate PR
This reverts commit d22d556d30ff641b62dfece85738c96b7fbf7061.
* renderer_vulkan: Fix flipped screenshot
---------
Co-authored-by: Steveice10 <1269164+Steveice10@users.noreply.github.com>
* sw_framebuffer: Take factors into account for min/max blending
* renderer_gl: Take factors into account for min/max blending
* Address review comments
* gl_shader_gen: Fix frambuffer fetch on qcom and mali
* renderer_opengl: Add fallback path for mesa
* gl_shader_gen: Avoid emitting blend emulation if minmax_factor is present
* renderer_software: Multi-thread processing
* Doubles the performance in most cases
* renderer_software: Move memory access out of the raster loop
* Profiling shows this has a significant impact
* savestates: add a build_name field to the header
* savestates: display build name on save/load menu
* savestates: add zero member to header just in case of UB from an older save state
* savestates: add legacy hash lookup
* savestate_data: update hash database
* rasterizer_cache: Dont consider res_scale during recycle
* rasterizer_cache: Switch to plain erase loop
* rasterizer_cache: Fix crash due to memory corruption
* renderer_gl: Make rasterizer normal class member
* It doesn't need to be heap allocated anymore
* gl_rasterizer: Remove default_texture
* It's unused
* gl_rasterizer: General cleanup
* gl_rasterizer: Lower case lambdas
* Match style with review comments from vulkan backend
* rasterizer_cache: Prevent memory leak
* Since the switch from shared_ptr these surfaces were no longer being destroyed properly. Use our garbage collector for that purpose to destroy it safely for both backends
* rasterizer_cache: Make temp copy of old surface
* The custom surface would override the memory region of the old region resulting in garbage data, this ensures the custom surface is constructed correctly
* citra_qt: Manually create dialog tabs
* Allows for custom constructors which is very useful. While at it, global state is now eliminated from configuration
* citra_qt: Eliminate global system usage
* core: Remove global system usage in memory and HIO
* citra_qt: Use qOverload
* tests: Run clang format
* gl_texture_runtime: Fix surface scaling
* Move mii to own namespace and add checksummed mii data
* Fix compile issues
* Make mii classes trivial and add cast operator
* Fix Android side
* Add new line at the end of files.
* Make miidata a struct and crc16 a u32_be as per switch code.
* Apply suggestions
* Change back crc to u16 and set padding to 0.
* rasterizer_cache: Sentence surfaces
* gl_texture_runtime: Remove runtime side allocation cache
* rasterizer_cache: Adjust surface scale during reinterpreration
* Fixes pixelated outlines. Also allows to remove the d24s8 specific hack and is more generic in general
* rasterizer_cache: Remove Expand flag
* Begone!
* rasterizer_cache: Cache framebuffers with surface id
* rasterizer_cache: Sentence texture cubes
* renderer_opengl: Move texture mailbox to separate file
* Makes renderer_opengl cleaner overall and allows to report removal threshold from runtime instead of hardcoding. Vulkan requires this
* rasterizer_cache: Dont flush cache on layout change
* rasterizer_cache: Overhaul framebuffer management
* video_core: Remove duplicate
* rasterizer_cache: Sentence custom surfaces
* Vulkan cannot destroy images immediately so this ensures we use our garbage collector for that purpose
* service/gsp: Implement saving of framebuffers in SaveVramSysArea.
* Address review comments.
* service/apt: Separate capture info and capture buffer info.
The former is used with the RequestForSysApplet message and GetCaptureInfo.
The latter is used with SendCaptureBufferInfo and ReceiveCaptureBufferInfo.
* service/apt: Add and implement more service commands.
* service/apt: Implement power button.
* Address review comments and fix GetApplicationRunningMode bug.
* kernel: Properly clean up process threads on exit.
* kernel: Track process-owned memory and free on destruction.
* apt: Implement DoApplicationJump via home menu when available.
* kernel: Move TLS allocation management to owning process.
When we targeted API <32, the notification permission would automatically be requested on startup. This restores that behavior temporarily while we work on new UX.
* shader_jit/tests: Add support for multiple inputs
Allows for multiple `Vec4f` inputs for each run
* shader_jit/tests: Add additional shader-jit tests
Add some more expansive tests for each of the shader-instructions for
regression-testing. `MAD`/`MADI` is not added due to an upstream bug in
nihstro:
https://github.com/neobrain/nihstro/issues/68
* android: Migrate to Kotlin DSL
Includes updates to all android dependencies/ndk (minus billing) and adds support for Kotlin, Android 13, and view binding.
* android: Remove unused tests
* android: Remove unused dependencies
Xbyak has a complete utility-class for determining the host-processor's
ISA-features such as SSE4.1, AVX, AVX2, AVX512{F,VL,DQ,VBMI,etc}, and so
on for further potential optimizations.
Was getting an unhandled `invalid_argument` [exception](https://en.cppreference.com/w/cpp/thread/thread/join) during
shutdown on my linux machine. This removes the need for a `StopBackendThread` function entirely since `jthread`
[automatically handles both checking if the thread is joinable and stopping the token before attempting to join](https://en.cppreference.com/w/cpp/thread/jthread/~jthread) in the case that `StartBackendThread` was never called.
Loop on stop_token and remove final_entry in Entry.
Move Backend thread out of Impl Constructor to its own function.
Add Start function for backend thread.
Use stop token in PopWait and check if entry filename is nullptr before logging.
This fixes a lost wakeup in SPSCQueue. If the reader is in just the right position, the writer's notification will be lost and this will be a problem if the writer then does something to wait on the reader.
This was discovered to affect my upcoming stacktrace PR. I don't think any performance decrease will be noticeable because an uncontended mutex is smart enough to skip the syscall. This PR might also resolve some rare deadlocks but I don't know of any examples.
The log filter was being ignored on initialization due to the logging instance being initialized before the config instance, so the log filter was set to its default value.
This fixes that oversight, along with using descriptive exceptions instead of abort() calls.
This implements backtraces so we don't have to tell users how to use gdb anymore.
This prints a backtrace after abort or segfault is detected. It also fixes the log getting cut off with the last line containing only a bracket. This change lets us know what caused a crash not just what happened the few seconds before it.
I only know how to add support for Linux with GCC. Also this doesn't work outside of C/C++ such as in dynarmic or certain parts of graphics drivers. The good thing is that it'll try and just crash again but the stack frames are still there so the core dump will work just like before.
This simplifies the logging system.
This also fixes some lost messages on startup.
The simplification is simple. I removed unused functions and moved most things in the .h to the .cpp. I replaced the unnecessary linked list with its contents laid out as three member variables. Anything that went through the linked list now directly accesses the backends. Generic functions are replaced with those for each specific use case and there aren't many. This change increases coupling but we gain back more KISS and encapsulation.
With those changes it was easy to make it thread-safe. I just removed the mutex and turned a boolean atomic. I was planning to use this thread-safety in my next PR about stacktraces. It was actually async-signal-safety at first but I ended up using a different approach. Anyway getting rid of the linked list is important for that because have the list of backends constantly changing complicates things.
There's no point in keeping the file open after the write limit is exceeded. This allows the file to be committed to the disk shortly after it is closed and avoids redundantly checking whether or not the write limit is exceeded.
* build: Rework CI and move all bundling into new build target.
* ci: Use "mingw" in msys2 release names for compatibility.
* ci: Use "osx" in macOS release names for compatibility.
* ci: Disable macOS upload.
Will be moved to a separate PR for canary merge.
* android: Update UI strings to reflect desktop counterpart
Quick edit to the UI strings to bring the text up to parity with Citra desktop, plus some small QoL changes.
* Update strings.xml
* update graphics api button indicator
This tiny pull request
* update the graphics button indicator when launching or closing a game (graphics button doesn't update with per game configuration)
* Disable graphics button indicator click while in game
* fix crash
* It fixed crash when opening configure dialog in game if the graphics api for the game is different of the global graphics api
* common: Move dynamic library to common
* This is so that video_core can use it
* logging: Add vulkan log target
* common: Allow defered library loading
* Also add some comments to the functions
* renderer_vulkan: Add vulkan initialization code
* renderer_vulkan: Address feedback
* citra_qt: Remove global state usage in GMainWindow
* citra_qt: Add warning when loadings saves for the first time
* citra_qt: Focus window when launching game from cmdline
* citra_qt: Cleanup nullptr checks
* citra_qt: Move setting to UISettings
* renderer_opengl: Remove header
* Enable web services in android
* Fix web services build on android
* clang-format
* Remove unnecessary line
* Set telemetry to be disabled by default on all platforms
* dumping/ffmpeg_backend: Add FPS filter
So that the recorded video can be at 60FPS (which is supported by most encoders) while still maintaining correct speed.
* dumping/ffmpeg_backend: Add HW context support
Required for some HW acceled encoders. Not tested as my devices don't seem to require this.
* CMake: Copy avfilter dll for MSVC
* CMakeLists: Require FFmpeg 4.0
* ffmpeg: Fix dumper compile error on MSVC.
* ffmpeg: Address review comments.
---------
Co-authored-by: zhupengfei <zhupf321@gmail.com>
* rasterizer_cache: Switch to template
* Eliminates all opengl references in the rasterizer cache headers
thus completing the backend abstraction
* rasterizer_cache: Switch to page table
* Surface storage isn't particularly interval sensitive so we can use a page table to make it faster
* rasterizer_cache: Move sampler management out of rasterizer cache
* rasterizer_cache: Remove shared_ptr usage
* Switches to yuzu's slot vector for improved memory locality.
* rasterizer_cache: Rework reinterpretation lookup
* citra_qt: Per game texture filter
* rasterizer_cache: Log additional settings
* gl_texture_runtime: Resolve shadow map comment
* rasterizer_cache: Don't use float for viewport
* gl_texture_runtime: Fix custom allocation recycling
* rasterizer_cache: Minor cleanups
* Cleanup texture cubes when all the faces have been unregistered from the cache
* custom_tex_manager: Allow multiple hash mappings per texture
* code: Move slot vector to common
* rasterizer_cache: Prevent texture cube crashes
* rasterizer_cache: Improve mipmap validation
* CanSubRect now works properly when validating multi-level surfaces, for example Dark Moon validates a 4 level surface from a 3 level one and it works
* gl_blit_handler: Unbind sampler on reinterpretation
* Add a loading screen for the preloading textures
*The PreloadTextures() function is called from the EmuThread to prevent citra to freezing
*Add a the preloading textures loadingscreen in loading_screen.cpp
*Add custom_tex_manager.reset() in core.cpp to release ram memory after exiting a game
* Add custom textures loading in EmuThread
* Remove useless variable
* Revert "Add custom textures loading in EmuThread"
This reverts commit 45ed46fa09159f782c5d20a4330b4eb7cfcdc253.
* Moved include from bootmanager.h to bootmanager.cpp
By only loading data from disk when creating an instance of this new
class instead of on every method call, we save a lot of file open
operations, which due to SAF are very expensive. This should noticeably
speed up game list scanning.
No intended change in what metadata is shown.
* tests: add Sanity test for SplitFilename83
fix test
fix test
* disable `C4715:not all control paths return a value` for nihstro includes
nihstro: no warn
* Chore: Enable warnings as errors on msvc + fix warnings
fixes
some more warnings
clang-format
* more fixes
* Externals: Add target_compile_options `/W0` nihstro-headers and ...
Revert "disable `C4715:not all control paths return a value` for nihstro includes"
This reverts commit 606d79b55d3044b744fb835025b8eb0f4ea5b757.
* src\citra\config.cpp: ReadSetting: simplify type casting
* settings.cpp: Get*Name: remove superflous logs
* Use IPC:MakeHeader instead of hardcoded values for IPC command tables.
* Use u32 instead of unsigned int in MakeHeader function
Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>
* Fix clang format
---------
Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>
* common: Add thread pool from yuzu
* Is really useful for asynchronous operations like shader compilation and custom textures, will be used in following PRs
* core: Improve ImageInterface
* Provide a default implementation so frontends don't have to duplicate code registering the lodepng version
* Add a dds version too which we will use in the next commit
* rasterizer_cache: Rewrite custom textures
* There's just too much to talk about here, look at the PR description for more details
* rasterizer_cache: Implement basic pack configuration file
* custom_tex_manager: Flip dumped textures
* custom_tex_manager: Optimize custom texture hashing
* If no convertions are needed then we can hash the decoded data directly removing the needed for duplicate decode
* custom_tex_manager: Implement asynchronous texture loading
* The file loading and decoding is offloaded into worker threads, while the upload itself still occurs in the main thread to avoid having to manage shared contexts
* Address review comments
* custom_tex_manager: Introduce custom material support
* video_core: Move custom textures to separate directory
* Also split the files to make the code cleaner
* gl_texture_runtime: Generate mipmaps for material
* custom_tex_manager: Prevent memory overflow when preloading
* externals: Add dds-ktx as submodule
* string_util: Return vector from SplitString
* No code benefits from passing it as an argument
* custom_textures: Use json config file
* gl_rasterizer: Only bind material for unit 0
* Address review comments
* texture_codec: Clamp buffer end to tiled buffer size
* Fixes crash on Pokemon Super Mystery Dungeon
* rasterizer_cache: Use rect for duplicate surface
* Fixes broken bloom in fire emblem
* surface_params: Check levels for exact match
* It was removed previously to prevent copies when games used the base level of a multi level surface. FE on the other hand will first use the base level and then use it as a face of a cubemap with many levels. So instead check if the surface equal or more levels and consider it an exact match in that case
* gl_texture_runtime: Bind old tex to 2D target
* Fixes a small error opengl would print when creating texture cubes
* gl_blit_helper: Fix nearest filter
* Use texture unit 2 which has the nearest sampler bound
* rasterizer_cache: Remove custom texture code
* It's a hacky buggy mess, will be reimplemented later when the cache is in a better state
* rasterizer_cache: Refactor surface upload/download
* Switch to the texture_codec header which was written as part of the vulkan backend by steveice and me
* Move most of the upload logic to the rasterizer cache and out of the surface object
* Scaled uploads/downloads have been disabled for now since they require more runtime infrastructure
* rasterizer_cache: Refactor runtime interface
* Remove aspect enum which is the same as SurfaceType
* Replace Subresource with specific structures for each operation (blit/copy/clear). This mimics moderns APIs vulkan much better
* Pass the surface to the runtime instead of the texture
* Implement CopyTextures with glCopyImageSubData which is available on 4.3 and gles.
This function also has an overload for cubes which will be removed later.
* rasterizer_cache: Move texture allocation to the runtime
* renderer_opengl: Remove TextureDownloaderES
* It's overly compilcated and unused at the moment. Will be replaced with a simple compute shader in a later commit
* rasterizer_cache: Split CachedSurface
* This commit splits CachedSurface into two classes, SurfaceBase which contains the backend agnostic functions and Surface which is the opengl specific part
* For now the cache uses the opengl surface directly and there are a few ugly casts with watchers, those will be taken care of when the template convertion and watcher removal are added respectively
* rasterizer_cache: Move reinterpreters to the runtime
* rasterizer_cache: Move some pixel format function to the cpp file
* rasterizer_cache: Common texture acceleration functions
* They don't contain any backend specific code so they shouldn't be duplicated
* rasterizer_cache: Remove BlitSurfaces
* It's better to prefer copy/blit in the caller anyway
* rasterizer_cache: Only allocate needed levels
* rasterizer_cache: Move texture runtime out of common dir
* Also shorten the util header filename
* surface_params: Cleanup code
* Add more comments, organize it a bit etc
* rasterizer_cache: Move texture filtering to the runtime
* rasterizer_cache: Move to VideoCore
* renderer_opengl: Reimplement scaled uploads/downloads
* Instead of looking up for temporary textures, each allocation now contains both a scaled and unscaled handle
This allows the scale operations to be done inside the surface object itself and improves performance in general
* In particular the scaled download code has been expanded to use ARB_get_texture_sub_image when possible
which is faster and more convenient than glReadPixels. The latter is still relevant for OpenGLES though.
* Finally allocations are now given a handy debug name that can be viewed from renderdoc.
* rasterizer_cache: Remove global state
* gl_rasterizer: Abstract common draw operations to Framebuffer
* This also allows to cache framebuffer objects instead of always swapping the textures, something that particularly benefits mali gpus
* rasterizer_cache: Implement multi-level surfaces
* With this commit the cache can now directly upload and use mipmaps
without needing to sync them with watchers. By using native mimaps
directly this also adds support for mipmap for cube
* Texture cubes have also been updated to drop the watcher requirement
* host_shaders: Add CMake integration for string shaders
* Improves build time shader generation making it much less prone to errors.
Also moves the presentation shaders here to avoid embedding them to the cpp file.
* Texture filter shaders now make explicit use of uniform bindings for better vulkan compatibility
* renderer_opengl: Emulate lod bias in the shader
* This way opengles can emulate it correctly
* gl_rasterizer: Respect GL_MAX_TEXTURE_BUFFER_SIZE
* Older Bifrost Mali GPUs only support up to 64kb texture buffers. Citra would try to allocate a much larger buffer the first 64kb of which would work fine but after that the driver starts misbehaving and showing various graphical glitches
* rasterizer_cache: Cleanup CopySurface
* renderer_opengl: Keep frames synchronized when using a GPU debugger
* rasterizer_cache: Rename Surface to SurfaceRef
* Makes it clear that surface is a shared_ptr and not an object
* rasterizer_cache: Cleanup
* Move constructor to the top of the file
* Move FindMatch to the top as well and remove the Invalid flag which was redudant;
all FindMatch calls used it expect from MatchFlags::Copy which ignores it anyway
* gl_texture_runtime: Make driver const
* gl_texture_runtime: Fix RGB8 format handling
* The texture_codec header, being written with vulkan in mind converts RGB8 to RGBA8. The backend wasn't adjusted to account for this though and treated the data as RGB8.
* Also remove D16 convertions, both opengl and vulkan are required to support this format so these are not needed
* gl_texture_runtime: Reduce state switches during FBO blits
* glBlitFramebuffer is only affected by the scissor rectangle so just disable scissor testing instead of resetting our entire state
* surface_params: Prevent texcopy that spans multiple levels
* It would have failed before as well, with multi-level surfaces it triggers the assert though
* renderer_opengl: Centralize texture filters
* A lot of code is shared between the filters thus is makes it sense to centralize them
* Also fix an issue with partial texture uploads
* Address review comments
* rasterizer_cache: Use leading return types
* rasterizer_cache: Cleanup null checks
* renderer_opengl: Add additional logging
* externals: Actually downgrade glad
* For some reason I missed adding the files to git
* surface_params: Do not check for levels in exact match
* Some games will try to use the base level of a multi level surface. Checking for levels forces another surface to be created and a copy to be made which is both unncessary and breaks custom textures
---------
Co-authored-by: bunnei <bunneidev@gmail.com>
The incorrect background color could appear when the games fragment is not initialized as it is during first boot. Now it appears correctly as colorSurface.
Some versions of clang 14 (macOS+android) don't implement
`string_view(It first, It last)`, so let's use
`string_view(const CharT*, size_type)` instead.
Also remove unused header leftover from old code that uses std::string.