Commit graph

61 commits

Author SHA1 Message Date
GPUCode
26d6f9d1c6
Rasterizer cache refactor (#6375)
* 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>
2023-04-21 10:14:55 +03:00
Charles Lombardo
2e23a75fac citra_android: Fix top app bar color in cheats activity 2023-04-14 21:12:34 -04:00
Charles Lombardo
9aed0a14c7 citra_android: Reduce the primary color's influence on the surface color in dark mode 2023-04-14 21:08:15 -04:00
Charles Lombardo
8a3afaf9e6 citra_android: Fix background color on first launch
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.
2023-04-14 20:49:47 -04:00
Charles Lombardo
1adf631725 citra_android: Use primary color for FAB 2023-04-14 20:46:48 -04:00
Charles Lombardo
cdb157f58a
citra_android: Night mode fixes (#6416) 2023-04-09 21:18:28 +02:00
Narr the Reg
90bcf49db0
android: Clean up overlay controls and avoid triggering touch screen when a button is pressed (#6391) 2023-04-09 10:58:42 +05:30
Jake Downs
bc5b065abe
android: replace jcenter with mavenCentral (#6417)
* replace jcenter with mavenCentral https://github.com/citra-emu/citra/issues/6232

* add back jcenter as fallback for billing
2023-04-09 10:55:37 +05:30
hank121314
495e5dadd7
citra_android: fix config is getting overwritten by default (#6408) 2023-04-05 18:51:05 +02:00
hank121314
7d64c654cc
citra_android: fix select root as citra directory cause crash (#6400) 2023-04-05 18:50:53 +02:00
SachinVin
f96047f182
PlatformGamesFragment.java: Run PullToRefresh on a background thread (#6372)
* android: bump gradle to 7.4.2

* PlatformGamesFragment.java: Run `PullToRefresh` on a background thread
2023-03-30 15:13:40 +03:00
hank121314
979c6d9c55
citra_android: fix crash while load amiibo (#6373) 2023-03-30 15:13:20 +03:00
GPUCode
b5d6f645bd
Prepare frontend for multiple graphics APIs (#6347)
* externals: Update dynarmic

* settings: Introduce GraphicsAPI enum

* For now it's OpenGL only but will be expanded upon later

* citra_qt: Introduce backend agnostic context management

* Mostly a direct port from yuzu

* core: Simplify context acquire

* settings: Add option to create debug contexts

* renderer_opengl: Abstract initialization to Driver

* This commit also updates glad and adds some useful extensions which we will use in part 2

* Rasterizer construction is moved to the specific renderer instead of RendererBase.
  Software rendering has been disable to achieve this but will be brought back in the next commit.

* video_core: Remove Init/Shutdown methods from renderer

* The constructor and destructor can do the same job

* In addition move opengl function loading to Qt since SDL already does this. Also remove ErrorVideoCore which is never reached

* citra_qt: Decouple software renderer from opengl part 1

* citra: Decouple software renderer from opengl part 2

* android: Decouple software renderer from opengl part 3

* swrasterizer: Decouple software renderer from opengl part 4

* This commit simply enforces the renderer naming conventions in the software renderer

* video_core: Move RendererBase to VideoCore

* video_core: De-globalize screenshot state

* video_core: Pass system to the renderers

* video_core: Commonize shader uniform data

* video_core: Abstract backend agnostic rasterizer operations

* bootmanager: Remove references to OpenGL for macOS

OpenGL macOS headers definitions clash heavily with each other

* citra_qt: Proper title for api settings

* video_core: Reduce boost usage

* bootmanager: Fix hide mouse option

Remove event handlers from RenderWidget for events that are
already handled by the parent GRenderWindow.
Also enable mouse tracking on the RenderWidget.

* android: Remove software from graphics api list

* code: Address review comments

* citra: Port per-game settings read

* Having to update the default value for all backends is a pain so lets centralize it

* android: Rename to OpenGLES

---------

Co-authored-by: MerryMage <MerryMage@users.noreply.github.com>
Co-authored-by: Vitor Kiguchi <vitor-kiguchi@hotmail.com>
2023-03-27 14:29:17 +03:00
SachinVin
9ef42040af
GameDatabase.java: Fix file exists check on SAF (#6374)
Doesn't really do much other than reduce log spam
2023-03-26 21:24:44 +03:00
Charles Lombardo
343717e683
citra_android: Implement edge-to-edge (#6349) 2023-03-23 19:36:54 +01:00
hank121314
8d563d37b4
citra_android: Storage Access Framework implementation (#6313) 2023-03-23 14:30:52 +01:00
Charles Lombardo
359a1b3296
citra_android: Fix input shifting in emulation activity (#6352) 2023-03-21 17:05:42 +01:00
GPUCode
a2fd43deab
Revert "citra_android: Use androidx splash screen (#6355)" (#6357)
This reverts commit 27c280534d.
2023-03-17 10:34:00 +02:00
Charles Lombardo
27c280534d
citra_android: Use androidx splash screen (#6355) 2023-03-16 08:30:47 +02:00
Charles Lombardo
e18e30a8cc
citra_android: Enable themed icon (#6351) 2023-03-15 09:21:54 +02:00
Vitor K
6fbc54b0c5
citra-qt: fixes to per game settings (#6298)
* citra-qt config: small misc changes

Remove unused ReadSettingGlobal

Remove unused WriteSetting overload

ReadGlobalSetting: rename default value variable

* qt config: fix u16 values being written as QMetaType

* qt config: rework post processing shader setting

handles post processing setting properly when per-game settings are used.
the anaglyph shader is given its own setting, separate from the post
processing name.

* qt config: use u32 instead of unsigned int when casting
2023-03-13 23:02:07 +02:00
Charles Lombardo
49acfe428a
citra_android: Bundle speex by default (#6348)
Without this, builds will fail on linux
2023-03-13 22:46:22 +02:00
hank121314
aa8df317af
citra_android: fix DiskShaderCacheProgress crash (#6346) 2023-03-13 11:16:38 +05:30
DRayX
27be16ee31
Update AndroidManifest for Android TV (#6330) 2023-03-10 00:44:45 +01:00
Charles Lombardo
d2caf2d386
citra_android: Start material 3 migration (#6335) 2023-03-09 23:22:11 +01:00
Charles Lombardo
1cca713e3b
citra_android: New settings fragment animations (#6332) 2023-03-09 21:54:32 +05:30
SachinVin
c961ecb9a4
jni\native.cpp: Log g_build_fullname on Android (#6318) 2023-02-28 21:59:30 +05:30
JosJuice
9b20bcea0f
android: Allow opening in-emulation menu by pressing Back (#6248)
It seems like the menu isn't showing up for users on Android 13.
We're not sure what's wrong, and the approach we've been using for the
menu hasn't been entirely reliable in the past either (in particular
not on non-mobile form factors like Chromebooks and VR devices),
so let's make it possible to open the menu by pressing Back,
an action that works reliably on most kinds of Android devices.
(Not sure if there's an equivalent of Back on devices like watches,
but I think we can pretty safely ignore those for now.)
2023-01-22 13:12:27 +05:30
Steveice10
a298e4969b
externals: Switch to newer cryptopp-cmake. (#6242) 2023-01-15 21:45:42 +05:30
JosJuice
f18437e59f
android: Close soft keyboard on panel close in cheats activity (#6234)
This prevents the keyboard from being stuck in an open state if the user
slides the panel while focused on a text box. Now it closes gracefully.

Co-authored-by: Charles Lombardo <clombardo169@gmail.com>
2023-01-01 16:55:05 +05:30
PabloMK7
016ce6c286
Add 3GX plugin loader (#6172)
* Initial plugin loader support

* More plugin loader progress

* Organize code and more plugin features

* Fix clang-format

* Fix compilation and add android gui

* Fix clang-format

* Fix macos build

* Fix copy-paste bug and clang-format

* More merge fixes

* Make suggestions

* Move global variable to static member

* Fix typo

* Apply suggestions

* Proper initialization order

* Allocate plugin memory from SYSTEM instead of APPLICATION

* Do not mark free pages as RWX

* Fix plugins in old 3DS mode.

* Implement KernelSetState and notif 0x203

* Apply changes

* Remove unused variable

* Fix dynarmic commit

* Sublicense files with MIT License

* Remove non-ascii characters from license
2022-12-11 10:08:58 +02:00
GPUCode
48ee112ceb
Add per game configuration options (#6187)
* common: Move settings to common from core.

- Removes a dependency on core and input_common from common.

* code: Wrap settings values

* Port from yuzu to allow per game settings

* citra_qt: Initial per-game settings dialog

* citra_qt: Use new API for read/save of config values

* citra_qt: Per game audio settings

* citra_qt: Per game graphics settings

* citra_qt: Per game system settings

* citra_qt: Per game general settings

* citra_qt: Document and run clang format

* citra_qt: Make icon smaller and centered

* citra_qt: Remove version number

* Not sure how to extract that, can always add it back later

* citra_qt: Wrap UISettings

* citra_qt: Fix unthottled fps setting

* citra_qt: Remove margin in emulation tab

* citra_qt: Implement some suggestions

* Bring back speed switch hotkey

* Allow configuration when game is running

* Rename/adjust UI stuff

* citra_qt: Fix build with separate windows

* citra_qt: Address feedback

* citra_qt: Log per-game settings before launching games

* citra_qt: Add shader cache options

* Also fix android build

* citra_qt: Add DLC menu option

* citra_qt: Run clang-format

* citra_qt: Adjust for time offset

* citra_qt: Implement suggestions

* Run clang-format

Co-authored-by: bunnei <bunneidev@gmail.com>
2022-12-08 13:27:25 +02:00
PabloMK7
67c4b87184
Add internet permission to android build (#6167) 2022-10-20 07:18:32 +05:30
厄災ガノンの史家
2c40b2aa72
Android: Add support for custom textures and texture dumping (#6144)
* Android: add app UI settings for custom textures and texture dumping.

* Android: Bring lodepng_image_interface into jni directory, include it, and add lodepng to CMAKE for linker (Android version doesn't use the src/citra folder)

* Android: Add custom texture and texture dumping config.ini settings

* Register image interface line added.

* Update src/android/app/src/main/res/values/strings.xml

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>

* Update src/android/app/src/main/jni/lodepng_image_interface.cpp

Whoops

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>

* clang-format attempt #1

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>
2022-10-09 10:49:00 +05:30
liushuyu
6f9586a1fe
android: upgrade SDK and NDK versions (#6152) 2022-10-07 20:09:12 +05:30
GPUCode
cbd5d1c15c
Upgrade codebase to C++ 20 + fix warnings + update submodules (#6115) 2022-09-21 18:36:12 +02:00
SachinVin
ddc802d2b4 android: add canary and nightly flavours + fix git version tags 2022-08-24 22:01:33 +05:30
JosJuice
5180122506 android: Add cheat GUI
Based on https://github.com/dolphin-emu/dolphin/pull/10092,
with adaptations made for differences in how Citra handles cheats.

You can access the cheat GUI while a game is running.
2022-08-06 08:19:18 +02:00
JosJuice
ce07ef1821 android: Use correct encoding when converting strings
The JNI functions that have "UTF" their name use "modified UTF-8"
rather than the standard UTF-8 that Citra uses, at least according
to Oracle's documentation, so it is incorrect for us to use them.
This change fixes the problem by converting between UTF-8 and
UTF-16 manually instead of letting JNI do it for us.
2022-08-03 15:54:15 +02:00
JosJuice
87677be921 android: Create utility function for converting strings to Java 2022-08-03 15:45:11 +02:00
JosJuice
e65ca8b907 android: Deduplicate GetJString 2022-08-03 15:45:11 +02:00
Vitor Kiguchi
bc5bf28333 webservice: change naming on android as well 2022-06-11 11:44:49 +02:00
SachinVin
c86c96467a jni\CMakeLists.txt: Sort library list 2022-04-18 23:40:54 +05:30
SachinVin
9c695c8324 Android: rename android JNI from main to citra-android 2022-04-18 13:10:25 +05:30
SachinVin
46880e8d54 Android : Bump gradle version 2022-04-16 13:05:50 +05:30
SachinVin
5681e91cf7 Android: remove async GPU until it is fixed on desktop 2022-04-14 20:44:59 +05:30
SachinVin
cd4ef8611c build.gradle: Bump Cmake version and NDK version 2022-04-14 20:44:58 +05:30
SachinVin
0e347605e1 Android: log device info and settings 2022-04-14 20:44:58 +05:30
SachinVin
f1c2f63aa1 Android: Java + JNI dump
CmakeLists

Jni Fix
2022-04-14 20:44:57 +05:30
bunnei
7b82883767 android: Update .gitignore for CXX compile cache. 2021-09-29 22:51:15 +05:30