Commit graph

1022 commits

Author SHA1 Message Date
SachinVin
7197367040
assert.h: add [[unlikely]] (#6454)
clang format assert
2023-04-22 14:36:27 +05:30
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
SachinVin
a94acde519
core\frontend\framebuffer_layout: GetCardboardSettings: clean up floa… (#6399)
* core\frontend\framebuffer_layout: GetCardboardSettings: clean up float to u32 conversion warnings + style fixes

* clang format

* fix signedness
2023-04-09 10:59:25 +05:30
Vitor K
8b93db0841
Updates to github actions (#6358) 2023-04-06 14:34:35 +02:00
Cameron Cawley
387cf15719
Remove unused includes (#6405) 2023-04-02 06:24:59 +05:30
GPUCode
ffc95eb59b
Frontend PR fixes (#6378)
* citra_qt: Check if renderer is null

* core: Fix dynarmic use-after-free error

* bootmanager: Add current context check in DoneCurrent

* Loading a save state would destroy the frame dumper class, which contains a shared context. That context would call DoneCurrent without checking if it was actually bound or not, resulting in crashes when calling opengl functions

* externals: Correct glad readme

* common: Log renderer debug setting

* citra: Make lambda lower case

* Consistency with review comments on the PR

* video_core: Kill more global state

* GetResolutionScaleFactor would be called somewhere in the renderer constructor chain but it relies on the yet unitialized g_renderer, resulting in crashes when the resolution scale is set to auto. Rather than adding a workaround, let's kill this global state to fix this for good
2023-03-30 14:24:49 +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
GPUCode
c7f8bc5582 file_util: Check fd before using dup 2023-03-24 16:56:31 +02:00
hank121314
8d563d37b4
citra_android: Storage Access Framework implementation (#6313) 2023-03-23 14:30:52 +01:00
Mai
8c12eb4905
Merge pull request #6360 from SachinVin/b
common\common_funcs.h:  use __builtin_trap for Crash()
2023-03-21 21:55:35 -04:00
GPUCode
0c3fe272b6
citra_qt: Add enhancement options to per-game (#6308)
Co-authored-by: Tobias <thm.frey@gmail.com>
2023-03-21 22:12:13 +01:00
SachinVin
8434d30768 common\common_funcs.h: use __builtin_trap for Crash() 2023-03-21 22:34:06 +05:30
SachinVin
794d051f0c
common\CMakeLists.txt: add missing arch.h (#6359) 2023-03-21 17:06:28 +01: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
Steveice10
c96f54f022
Implement app management support (suspend, resume, close, etc) (#6322) 2023-03-10 00:44:26 +01:00
komasanzura
9eb1cd2875
Added an option to set the proportion of the screens when using layout "Large Screen Small Screen", to allow the user to define how much bigger the large screen should be with respect to the smaller screen. Currently the value must be between 1 and 16, but I could set a different maximum value if that would be desired. Thank you very much! (#6252) 2023-02-17 16:19:52 +02:00
SachinVin
5215468ff6
core\file_sys\archive_sdmc.cpp: Log error message if file failed to open. (#6284) 2023-02-14 22:19:45 +01:00
SomeDudeOnDiscord
a8e4e11cd5
Better Support for Picture-in-Picture Custom Layouts (Based on #6127) (#6247) 2023-02-14 22:06:11 +01:00
Steveice10
78cb48b23c
common: Make TrimSourcePath constexpr (#6279) 2023-02-03 19:01:10 +01:00
Steveice10
d704c6a3ac
common: Support macOS application data path conventions. (#6258) 2023-01-23 15:20:50 +05:30
Steveice10
a8848cce43 build: Update to support multi-arch builds. 2023-01-07 01:09:32 -08:00
Vitor K
c8ff1d744a
Change Monoscopic Render mode to a dropdown (#6215) 2022-12-24 03:17:49 +01:00
Tobias
ccb50e7f2c
Port yuzu-emu/yuzu#9300: "CMake: Use precompiled headers to improve compile times" (#6213)
Co-authored-by: Ameer J <52414509+ameerj@users.noreply.github.com>
2022-12-17 16:06:38 +01:00
Vitor K
84eada8c50
Fix "auto" resolution factor (#6218) 2022-12-13 01:05:08 +01:00
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
Merry
7cae35024f common: Add StringLiteral 2022-11-22 22:52:37 +00:00
merry
2967068b87
Merge pull request #5380 from FearlessTobi/port-3954
Port yuzu-emu/yuzu#3954: "main: Log host system memory parameters"
2022-11-15 11:31:59 +00:00
Lioncash
81bf21283f common/color: Migrate code over to the Common namespace
No external code makes use of this header, so we can freely change the
namespace.
2022-11-15 11:25:51 +01:00
FearlessTobi
de1fe7e6e3 Address review comments 2022-11-15 11:20:35 +01:00
Jan Beich
35f7f5e3e3 common: switch to nullptr for sysctl's empty new value 2022-11-15 10:34:56 +01:00
Jan Beich
6dabf10009 common: add sysconf() fallback
src/common/memory_detect.cpp:15:10: fatal error: 'sys/sysinfo.h' file not found
 #include <sys/sysinfo.h>
          ^~~~~~~~~~~~~~~
2022-11-15 10:34:56 +01:00
Morph
cb8b72069f Fix macOS code and change "Swapfile" to "Swap" 2022-11-15 10:34:56 +01:00
Morph
a67f205cfe main: Log host system memory parameters
Logs both physical memory and swapfile sizes, this is useful for support.
2022-11-15 10:34:56 +01:00
Tobias
bb05d8c12a
src/CMakeLists: Enforce multiple warnings on MSVC (#5692) 2022-11-09 23:14:28 +01:00
Tobias
1ddea27ac8
code: Cleanup and warning fixes from the Vulkan PR (#6163)
Co-authored-by: emufan4568 <geoster3d@gmail.com>
Co-authored-by: Kyle Kienapfel <Docteh@users.noreply.github.com>
2022-11-04 23:32:57 +01:00
SachinVin
fbe06234b1 Core: Port Exclusive memory impl from yuzu
core\arm\dynarmic\arm_dynarmic.cpp: fix build

core\arm\dynarmic\arm_dynarmic.cpp: Fixes

CPP 20
2022-10-23 13:19:33 +05:30
SachinVin
4a590d1fcb xbyak: Correct xbyak include directory
xbyak is intended to be installed in /usr/local/include/xbyak.
Since we desire not to install xbyak before using it, we copy the headers
to the appropriate directory structure and use that instead
Co-authored-by: merry <git@mary.rs>
2022-10-23 13:19:32 +05:30
Vitor K
9626bdf385
Gate use of custom directories behind a variable (#6157)
previous changes had forced every single user to use custom
directories for NAND and SDMC. Those paths were saved to the
config file and would interact badly with portable builds.
2022-10-22 19:09:47 +05:30
liushuyu
c6153bb32e
CI: fix recent build issues (#6148)
Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
2022-10-05 18:43:07 +02:00
Vitor K
6a9d36608f
Allow GetPhysicalRef to hold a past-the-end offset (#6141)
Games will sometimes use these when representing open right bounds
and so disallowing it caused regressions, with a notable example
being when MemoryFill is called to the end of vram, causing an
"invalid end address" error.
This had been noted on a comment in GetPhysicalRef prior to the
regression.
2022-10-01 16:07:27 +05:30
GPUCode
cbd5d1c15c
Upgrade codebase to C++ 20 + fix warnings + update submodules (#6115) 2022-09-21 18:36:12 +02:00
Vitor Kiguchi
a8d82a2a04 Include gl_shader_util in shader cache version hash calculation 2022-09-03 14:44:40 +02:00
emufan4568
e6137d7874 renderer_opengl: Remove GLvec* types
* The common types already exist and provide all the functionality required, why invent new types?
2022-08-21 12:22:58 +03: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
SachinVin
d84b3d9330
Merge pull request #6053 from Morph1984/assert-noinline
common/assert: Use noinline lambda instead of a wrapper template
2022-07-03 11:50:50 +05:30
Morph
edbe7600f5 common/assert: Use noinline lambda instead of a wrapper template
MSVC now supports specifying __declspec on lambda functions
2022-06-30 08:58:36 -04:00
Morph
49c0ed297f common_funcs: Add CITRA_NO_INLINE 2022-06-14 07:18:12 -04:00
Morph
1cc1c33a15 common: Resolve C4267 warning on MSVC
Also removes Timer::GetDoubleTime() as it is unused.
2022-05-18 00:05:40 -04:00
SachinVin
b6ff58a9d6 FileUtil, Frontends: Fix updating custom NAND/SDMC path 2022-04-30 15:53:45 +05:30
SachinVin
0af8406e44 Common: Add CPU feature detection for ARM64 2022-04-14 20:44:57 +05:30
bunnei
6dfb74a8b9
Merge pull request #5906 from SachinVin/android2
Backport some more stuff from android
2022-01-04 17:40:33 -08:00
SachinVin
1079f61260 Android:file_util.cpp: remove unnecessary ROOT_DIR 2021-12-18 16:52:24 +05:30
Carloschi7
0126ecb3e2
added std::vector<V> instead of V* (#5902) 2021-12-18 12:01:09 +05:30
SachinVin
6183b5d76c
Merge pull request #5823 from SachinVin/dyn
Android: Backport easy stuff
2021-10-03 18:58:20 +05:30
SachinVin
9ad6bc29b5 common/logging: Create a new backed for android's logcat
logging
2021-10-02 16:38:18 +05:30
bunnei
4cc8d43fa1 android: log: TrimSourcePath: Cannot be constexpr. 2021-09-29 22:51:14 +05:30
James Rowe
9f4501aceb Perf: Remove more breakpoint checking in the interpreter. Move filtering earlier in the logging chain 2021-07-24 23:36:56 +05:30
Pengfei
f85bde3ca3
Replace &vec[0] with vec.data()
When the vector is empty, using `&vec[0]` involves undefined behaviour. While that works fine most of the time, Flatpak builds aborted on a failed `__builtin_expect`.

I searched for such occurences across the codebase with the regex `(?<!&)&\w+\[0\]` and fixed those that would potentially cause issues.
2021-07-14 17:01:14 +08:00
Max Fedotov
a2f34ea82b
gcc 11 compatibility fix (suggestion) (#5778)
Fixes missing include and runtime variable in offsetof

* gcc 11 compatibility fix

* Revert "gcc 11 compatibility fix"

This reverts commit bf5711d944.

* gcc 11 compatibility fix (with pointer math)

* Don't require pointers for framebuffer field math

* Code style fix (clang-format)
2021-05-10 22:10:29 -05:00
bunnei
9ff97270cf
Merge pull request #5501 from FearlessTobi/port-1064-3948
Port yuzu-emu/yuzu#1064 and yuzu-emu/yuzu#3948: Changes to Telemetry and CPU feature detection
2021-04-23 22:58:08 -07:00
Daniel Méndez
3be52f818a file_util: Add a function to update the user path
Added a default value when sdmc and nand are empty
2021-04-17 23:48:30 +02:00
Morph
7806206e90 string_util: Remove MSVC workaround for converting between UTF8/UTF16
This has been fixed as of Visual Studio 2019 Version 16.2
2021-02-11 00:16:33 +01:00
Marshall Mohror
5776bdda82
Merge pull request #5546 from FearlessTobi/port-5524
Port yuzu-emu/yuzu#4086 and yuzu-emu/yuzu#4611: Xbyak cleanups
2021-02-08 16:00:18 -06:00
Pengfei Zhu
7c6d7905a4
Merge pull request #5670 from FearlessTobi/port-5277
Port yuzu-emu/yuzu#5277: "general: Fix various spelling errors"
2021-01-09 22:10:27 +08:00
Lioncash
10f440cb59 common/telemetry: Migrate namespace into the Common namespace
Migrates the Telemetry namespace into the Common namespace to make the
code consistent with the rest of our common code.
2021-01-04 05:17:13 +01:00
Lioncash
9c08409e0e externals: Update Xbyak to 5.96
I made a request on the Xbyak issue tracker to allow some constructors
to be constexpr in order to avoid static constructors from needing to
execute for some of our register constants.

This request was implemented, so this updates Xbyak so that we can make
use of it.
2021-01-04 05:11:18 +01:00
FearlessTobi
ddb4135dea main/common: Log/append AVX/FMA to the Host CPU string if available and add AVX512 detection
Co-Authored-By: Morph <morph1984@users.noreply.github.com>
2021-01-04 04:25:03 +01:00
Lioncash
52fe6daa53 common/telemetry: Migrate core-independent info gathering to common
Previously core itself was the library containing the code to gather
common information (build info, CPU info, and OS info), however all of
this isn't core-dependent and can be moved to the common code and use
the common interfaces. We can then just call those functions from the
core instead.

This will allow replacing our CPU detection with Xbyak's which has
better detection facilities than ours. It also keeps more
architecture-dependent code in common instead of core.
2021-01-04 04:25:03 +01:00
MerryMage
045d20e076 xbyak_abi: Prefer returning a struct to using out parameters in ABI_CalculateFrameSize 2021-01-04 04:07:11 +01:00
MerryMage
a841ce6451 xbyak_abi: Register indexes should be unsigned 2021-01-04 04:07:10 +01:00
xperia64
c1d7ba4d60
Delete the old log file before rotating (#5675) 2021-01-03 14:53:23 -05:00
FearlessTobi
1653ebaa45 general: Fix various spelling errors
Co-Authored-By: Morph <39850852+Morph1984@users.noreply.github.com>
2021-01-03 02:39:41 +01:00
bunnei
9c76120a13
Fix the old log file to work with the log parser. 2021-01-01 03:17:20 -08:00
xperia64
b4a6763484 Rotate previous log file to '.old' if it exists 2020-12-31 16:10:01 -05:00
Vitor Kiguchi
fb49ce462f Revert #5530 "Port yuzu-emu/yuzu#4539"
There is currently no such warning and the solution proposed
omits the call instead of the warning.
2020-12-30 14:49:40 -03:00
bunnei
987f910a86
Merge pull request #5530 from FearlessTobi/port-4539
Port yuzu-emu/yuzu#4539: "common: Silence two discarded result warnings"
2020-12-30 01:55:33 -08:00
Vitor K
4888a14c12
Make UNIMPLEMENTED_MSG consistent with UNIMPLEMENTED (#5631)
The current inconsistency can result in a developer unintentionally
creating a crash when using UNIMPLEMENTED_MSG, if they're only
familiar with UNIMPLEMENTED. The two macros shouldn't have such
wildly different behaviors.
2020-12-06 23:36:04 +01:00
Tobias
017631e51b
Port yuzu-emu/yuzu#4587 and yuzu-emu/yuzu#4588: Fix data races (#5545)
Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
2020-09-19 18:42:21 +02:00
comex
2ba35cab73 Fix thread naming on Linux, which limits names to 15 bytes.
- In `SetCurrentThreadName`, when on Linux, truncate to 15 bytes, as (at
  least on glibc) `pthread_set_name_np` will otherwise return `ERANGE` and
  do nothing.
- Also, add logging in case `pthread_set_name_np` returns an error
  anyway.  This is Linux-specific, as the Apple and BSD versions of
  `pthread_set_name_np return `void`.
- Change the name for CPU threads in multi-core mode from
  "yuzu:CoreCPUThread_N" (19 bytes) to "yuzu:CPUCore_N" (14 bytes) so it
  fits into the Linux limit.  Some other thread names are also cut off,
  but I didn't bother addressing them as you can guess them from the
  truncated versions.  For a CPU thread, truncation means you can't see
  which core it is!
2020-09-03 03:15:14 +02:00
Tobias
66846836bc
Port yuzu-emu/yuzu#4577: "common/assert: Make use of C++ attribute syntax" (#5529)
Co-authored-by: Lioncash <mathew1800@gmail.com>
2020-09-02 17:25:31 +02:00
Tobias
f6b543886c
Port yuzu-emu/yuzu#4528: "common: Make use of [[nodiscard]] where applicable" (#5535)
Co-authored-by: LC <712067+lioncash@users.noreply.github.com>
2020-08-31 21:06:16 +02:00
Lioncash
41f42d8df3 common: Silence two discarded result warnings
These are intentionally discarded internally, since the rest of the
public API allows querying success. We want all non-internal uses of
these functions to be explicitly checked, so we can signify that we
intentionally want to discard the return values here.
2020-08-28 16:32:13 +02:00
Marshall Mohror
bd7ee8c315
Common: remove a mod from AlignUp (#5441)
In cases where the size is not a known constant when inlining, AlignUp<std::size_t> currently generates two 64-bit div instructions.
This generates one div and a cmov which is significantly cheaper.
2020-07-07 16:39:23 -05:00
LC
8ce81b19be
General: Remove usages of ARRAY_SIZE where applicable. (#5392)
Same behavior, but without our own boilerplate function.
2020-06-19 09:10:45 -05:00
Ben
307b8f923b
Merge pull request #5224 from FearlessTobi/port-3630
Port yuzu-emu/yuzu#3630: "common/file_util: Allow access to files on network shares"
2020-05-13 18:28:01 +02:00
Ben
d11d600b61
Merge pull request #5225 from FearlessTobi/port-3672
Port yuzu-emu/yuzu#3672: "file_util: Early-exit in Write/ReadArray if specified lengths are zero"
2020-05-11 09:45:39 +02:00
Lioncash
6ed4431d8b file_util: Early-exit in WriteArray and ReadArray if specified lengths are zero
It's undefined behavior to pass a null pointer to std::fread and
std::fwrite, even if the length passed in is zero, so we must perform
the precondition checking ourselves.

A common case where this can occur is when passing in the data of an
empty std::vector and size, as an empty vector will typically have a
null internal buffer.

While we're at it, we can move the implementation out of line and add
debug checks against passing in nullptr to std::fread and std::fwrite.
2020-05-11 01:58:13 +02:00
Valentin Vanelslande
41abdb505c
common/logging/log: Add LLE in Audio_DSP comment (#5327)
@wwylele forgot to add it in https://github.com/citra-emu/citra/pull/4490.
2020-05-04 12:20:56 +02:00
Pengfei Zhu
017f0c469e
Merge pull request #5301 from lioncash/chunk
common: Remove chunk_file.h
2020-05-01 23:02:47 +08:00
Lioncash
246cea229c common: Remove chunk_file.h
This is part of Dolphin's serialization code, which isn't used and
probably never will be, considering that savestates are implemented with
boost.
2020-05-01 08:23:59 -04:00
Lioncash
f20120e5a7 gl_shader_gen: Mark hash implementations as noexcept
These shouldn't throw at all, so we can mark the interface as such.
2020-04-30 22:57:36 -04:00
Ben Russell
fb941c56d8 common/file_util: Allow access to files on network shares
On Windows, network shares use paths like \\server\share\file which were
being broken by FileUtil::SanitizePath() removing double slashes.

Changed the code in SanitizePath to permit a double-backslash if it
occurs at the start of a filepath (on Windows only).
2020-04-18 04:36:12 +02:00
Ben
c605bb42db
Merge pull request #4908 from hamish-milne/feature/savestates-2
Save states
2020-04-17 21:52:51 +02:00
Tobias
32cbb1bc77
input_common/udp: Port various changes from yuzu (#5133) 2020-04-17 02:50:28 +02:00
Hamish Milne
915c426dc9 Merge remote-tracking branch 'upstream/master' into feature/savestates-2 2020-04-12 22:26:24 +01:00
Hamish Milne
828f88d20a Merge branch 'master' into feature/savestates-2 2020-04-12 11:24:06 +01:00
Hamish Milne
e9ab8f82d4 Add disk archive serialization (fix crash in driver renegade etc.) 2020-04-11 11:52:11 +01:00
Hamish Milne
432ac24503 Fix memory region serialization (OSK crash) 2020-04-10 16:51:01 +01:00
MerryMage
f2499953c0 travis: Update xcode
Update to 10.2 (required for CTAD to work correctly)
2020-04-07 22:07:06 +01:00