Commit graph

2882 commits

Author SHA1 Message Date
gdkchan
9e4f9faf84 Allow loading NSPs without a NCA inside (#3364)
* Allow loading NSPs without a NCA inside

* Set isHomebrew as true
2024-02-22 19:16:25 -05:00
riperiperi
6c4278d2bd Don't force DPI aware on Avalonia - it already has it covered. (#3354) 2024-02-22 19:16:25 -05:00
gdkchan
18c36be63d Fix audio renderer error message result code base (#3348) 2024-02-22 19:16:25 -05:00
Emmanuel Hansen
a339695f84 UI - Scale end framebuffer blit (#3342)
* Scale end framebuffer blit

* fix

* fix

* apply changes to avalonia
2024-02-22 19:16:25 -05:00
Mary
8c2a883e61 Fix Avalonia updater 2024-02-22 19:16:25 -05:00
Emmanuel Hansen
0610eed551 fix amiibo image path (#3345) 2024-02-22 19:16:25 -05:00
Mary
45e4e908d3 gh-actions: Prefix Avalonia builds with test- and disable prerelease.
As GitHub sort our builds in an alphanumeric way, we abuse that to fix
both new and old updater behaviour.

This should fix all our issues.

Avalonia updater will be broken between version 1.1.122 to 1.1.126, and
will need manual intervention.
2024-02-22 19:16:25 -05:00
Mary
9dd894dc0c gh-actions: Attempt to fix the whole mess up with Avalonia changes
Marked as prerelease just in case it break even more
2024-02-22 19:16:25 -05:00
Emmanuel Hansen
b60e174a42 add avalonia builds to release (#3339) 2024-02-22 19:16:25 -05:00
Mary
630fb24a60 misc: Clean up of CS project after Avalonia merge (#3340)
This reformat Avalonia csproj file, remove unused deps and reajust
Ryujinx csproj a bit after some other changes

Also updated OpenTK.Graphics
2024-02-22 19:16:25 -05:00
Mary
3d4ba895c8 sdl2: Update to Ryujinx.SDL2-CS 2.0.22 (#3317)
Update to latest SDL2 release

Fix #2905, #2837 and #2767.
2024-02-22 19:16:25 -05:00
Emmanuel Hansen
fdce1ab83c Avalonia UI - Part 1 (#3270)
* avalonia part 1

* remove vulkan ui backend

* move ui common files to ui common project

* get name for oading screen from device

* rebase.

* review 1

* review 1.1

* review

* cleanup

* addressed review

* use cancellation token

* review

* review

* rebased

* cancel library loading when closing window

* remove star  image, use fonticon instead

* delete render control frame buffer when game ends. change position of fav star

* addressed @Thog review

* ensure the right ui is downloaded in updates

* fix crash when showing not supported dialog during controller request

* add prefix to artifact names

* Auto-format Avalonia project

* Fix input

* Fix build, simplify app disposal

* remove nv stutter thread

* addressed review

* add missing change

* maintain window size if new size is zero length

* add game, handheld, docked to local

* reverse scale main window

* Update de_DE.json

* Update de_DE.json

* Update de_DE.json

* Update italian json

* Update it_IT.json

* let render timer poll with no wait

* remove unused code

* more unused code

* enabled tiered compilation and trimming

* check if window event is not closed before signaling

* fix atmospher case

* locale fix

* locale fix

* remove explicit tiered compilation declarations

* Remove ) it_IT.json

* Remove ) de_DE.json

* Update it_IT.json

* Update pt_BR locale with latest strings

* Remove ')'

* add more strings to locale

* update locale

* remove extra slash

* remove extra slash

* set firmware version to 0 if key's not found

* fix

* revert timer changes

* lock  on object instead

* Update it_IT.json

* remove unused method

* add load screen text to locale

* drop swap event

* Update de_DE.json

* Update de_DE.json

* do null check when stopping emulator

* Update de_DE.json

* Create tr_TR.json

* Add tr_TR

* Add tr_TR + Turkish

* Update it_IT.json

* Update Ryujinx.Ava/Input/AvaloniaMappingHelper.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Apply suggestions from code review

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* Apply suggestions from code review

Co-authored-by: Ac_K <Acoustik666@gmail.com>

* addressed review

* Update Ryujinx.Ava/Ui/Backend/OpenGl/OpenGlRenderTarget.cs

Co-authored-by: gdkchan <gab.dark.100@gmail.com>

* use avalonia's inbuilt renderer on linux

* removed whitespace

* workaround for queue render crash with vsync off

* drop custom backend

* format files

* fix not closing issue

* remove warnings

* rebase

* update avalonia library

* Reposition the Text and Button on About Page

* Assign build version

* Remove appveyor text

Co-authored-by: gdk <gab.dark.100@gmail.com>
Co-authored-by: Niwu34 <67392333+Niwu34@users.noreply.github.com>
Co-authored-by: Antonio Brugnolo <36473846+AntoSkate@users.noreply.github.com>
Co-authored-by: aegiff <99728970+aegiff@users.noreply.github.com>
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Co-authored-by: MostlyWhat <78652091+MostlyWhat@users.noreply.github.com>
2024-02-22 19:16:24 -05:00
riperiperi
fadf9c1a13 Prefetch capabilities before spawning translation threads. (#3338)
* Prefetch capabilities before spawning translation threads.

The Backend Multithreading only expects one thread to submit commands at a time. When compiling shaders, the translator may request the host GPU capabilities from the backend. It's possible for a bunch of translators to do this at the same time.

There's a caching mechanism in place so that the capabilities are only fetched once. By triggering this before spawning the thread, the async translation threads no longer try to queue onto the backend queue all at the same time.

The Capabilities do need to be checked from the GPU thread, due to OpenGL needing a context to check them, so it's not possible to call the underlying backend directly.

* Initialize the capabilities when setting the GPU thread + missing call in headless

* Remove private variables
2024-02-22 19:16:23 -05:00
riperiperi
c2c4558796 Implement Viewport Transform Disable (#3328)
* Initial implementation (no specialization)

* Use specialization

* Fix render scale, increase code gen version

* Revert accidental change

* Address Feedback
2024-02-22 19:16:23 -05:00
Ac_K
dd10397a05 hid: Various fixes and cleanup (#3326)
* hid: Various fix and cleanup

* Add IsValidNpadIdType

* remove ()
2024-02-22 19:16:23 -05:00
riperiperi
67ef09ab7d Add alternative "GL" enum values for StencilOp (#3321)
This PR adds the alternative enum values for StencilOp. Similar to the other enums, I added these with the same names but with Gl added to the end. These are used by homebrew using Nouveau, though they might be used by games with the official Vulkan driver.

39d90be897/rnndb/graph/nv_3ddefs.xml (L77)

Fixes some broken graphics in Citra, such as missing shadows in Mario Kart 7. Likely fixes other homebrew.
2024-02-22 19:16:23 -05:00
gdkchan
d500e99108 Enable JIT service LLE (#2959)
* Enable JIT service LLE

* Force disable PPTC when using the JIT service

PPTC does not support multiple guest processes

* Fix build

* Make SM service registration per emulation context rather than global

* Address PR feedback
2024-02-22 19:16:23 -05:00
gdkchan
7268aac33e Fix shared memory leak on Windows (#3319)
* Fix shared memory leak on Windows

* Fix memory leak caused by RO session disposal not decrementing the memory manager ref count

* Fix UnmapViewInternal deadlock

* Was not supposed to add those back
2024-02-22 19:16:23 -05:00
Mary
1b95e84dc9 infra: Warn about support drop of old Windows versions (#3299)
* infra: Warn about support drop of old Windows versions

See #3298.

* Address comment
2024-02-22 19:16:23 -05:00
gdkchan
e4bd45cabe Remove AddProtection count > 0 assert (#3315) 2024-02-22 19:16:23 -05:00
voldemort2826
4cbce7fc1e Update the artifact build's version number (#3297) 2024-02-22 19:16:22 -05:00
gdkchan
44fe10241b Implement PM GetProcessInfo atmosphere extension (partially) (#2966) 2024-02-22 19:16:22 -05:00
gdkchan
f147cf3507 Implement code memory syscalls (#2958)
* Implement code memory syscalls

* Remove owner process validation

* Add 32-bit code memory syscalls

* Remove unused field
2024-02-22 19:16:22 -05:00
gdkchan
c76876bd74 Support memory aliasing (#2954)
* Back to the origins: Make memory manager take guest PA rather than host address once again

* Direct mapping with alias support on Windows

* Fixes and remove more of the emulated shared memory

* Linux support

* Make shared and transfer memory not depend on SharedMemoryStorage

* More efficient view mapping on Windows (no more restricted to 4KB pages at a time)

* Handle potential access violations caused by partial unmap

* Implement host mapping using shared memory on Linux

* Add new GetPhysicalAddressChecked method, used to ensure the virtual address is mapped before address translation

Also align GetRef behaviour with software memory manager

* We don't need a mirrorable memory block for software memory manager mode

* Disable memory aliasing tests while we don't have shared memory support on Mac

* Shared memory & SIGBUS handler for macOS

* Fix typo + nits + re-enable memory tests

* Set MAP_JIT_DARWIN on x86 Mac too

* Add back the address space mirror

* Only set MAP_JIT_DARWIN if we are mapping as executable

* Disable aliasing tests again (still fails on Mac)

* Fix UnmapView4KB (by not casting size to int)

* Use ref counting on memory blocks to delay closing the shared memory handle until all blocks using it are disposed

* Address PR feedback

* Make RO hold a reference to the guest process memory manager to avoid early disposal

Co-authored-by: nastys <nastys@users.noreply.github.com>
2024-02-22 19:16:22 -05:00
riperiperi
013a36522b Fix flush action from multiple threads regression (#3311)
If two or more threads encounter a region of memory where a read action has been registered, then they must _both_ wait on the data.

Clearing the action before it completed was causing the null check above to fail, so the action would only be run on the first thread, and the second would end up continuing without waiting. Depending on what the game does, this could be disasterous.

This fixes a regression introduced by #3302 with Pokemon Legends Arceus, and possibly Catherine. There are likely other affected games. What is fixed in that PR should still be fixed.
2024-02-22 19:16:22 -05:00
gdkchan
ed3d81da5f Restrict cases where vertex buffer size from index buffer type is used (#3304) 2024-02-22 19:16:22 -05:00
riperiperi
00731d3826 Fix various issues with texture sync (#3302)
* Fix various issues with texture sync

A variable called _actionRegistered is used to keep track of whether a tracking action has been registered for a given texture group handle. This variable is set when the action is registered, and should be unset when it is consumed. This is used to skip registering the tracking action if it's already registered, saving some time for render targets that are modified very often.

There were two issues with this. The worst issue was that the tracking action handler exits early if the handle's modified flag is false... which means that it never reset _actionRegistered, as that was done within the Sync() method called later. The second issue was that this variable was set true after the sync action was registered, so it was technically possible for the action to run immediately, set the flag to false, then set it to true.

Both situations would lead to the action never being registered again, as the texture group handle would be sure the action is already registered. This breaks the texture for the remaining runtime, or until it is disposed.

It was also possible for a texture to register sync once, then on future frames the last modified sync number did not update. This may have caused some more minor issues.

Seems to fix the Xenoblade flashing bug. Obviously this needs a lot of testing, since it was random chance. I typically had the most luck getting it to happen by switching time of day on the event theatre screen for a while, then entering the equipment screen by pressing X on an event.

May also fix weird things like random chance air swimming in BOTW, maybe a few texture streaming bugs.

* Exchange rather than CompareExchange
2024-02-22 19:16:22 -05:00
merry
a26c53991d T32: Implement load/store single (immediate) (#3186)
* T32: Implement load/store single (immediate)

* tests

* tidy formatting

* address comments
2024-02-22 19:16:22 -05:00
Harone
f7684ac933 Update NpadController.cs (#3284) 2024-02-22 19:16:22 -05:00
gdkchan
3ceb5883b7 Implement HwOpus multistream functions (#3275)
* Implement HwOpus multistream functions

* Avoid one copy
2024-02-22 19:16:22 -05:00
merry
358abcb016 ReactiveObject: Handle case when oldValue is null (#3268) 2024-02-22 19:16:22 -05:00
merry
66df9d2c73 ForceDpiAware: X11 implementation (#3269)
* ForceDpiAware: X11 implementation

* address comments
2024-02-22 19:16:22 -05:00
gdkchan
c947a7431f New shader cache implementation (#3194)
* New shader cache implementation

* Remove some debug code

* Take transform feedback varying count into account

* Create shader cache directory if it does not exist + fragment output map related fixes

* Remove debug code

* Only check texture descriptors if the constant buffer is bound

* Also check CPU VA on GetSpanMapped

* Remove more unused code and move cache related code

* XML docs + remove more unused methods

* Better codegen for TransformFeedbackDescriptor.AsSpan

* Support migration from old cache format, remove more unused code

Shader cache rebuild now also rewrites the shared toc and data files

* Fix migration error with BRX shaders

* Add a limit to the async translation queue

 Avoid async translation threads not being able to keep up and the queue growing very large

* Re-create specialization state on recompile

This might be required if a new version of the shader translator requires more or less state, or if there is a bug related to the GPU state access

* Make shader cache more error resilient

* Add some missing XML docs and move GpuAccessor docs to the interface/use inheritdoc

* Address early PR feedback

* Fix rebase

* Remove IRenderer.CompileShader and IShader interface, replace with new ShaderSource struct passed to CreateProgram directly

* Handle some missing exceptions

* Make shader cache purge delete both old and new shader caches

* Register textures on new specialization state

* Translate and compile shaders in forward order (eliminates diffs due to different binding numbers)

* Limit in-flight shader compilation to the maximum number of compilation threads

* Replace ParallelDiskCacheLoader state changed event with a callback function

* Better handling for invalid constant buffer 1 data length

* Do not create the old cache directory structure if the old cache does not exist

* Constant buffer use should be per-stage. This change will invalidate existing new caches (file format version was incremented)

* Replace rectangle texture with just coordinate normalization

* Skip incompatible shaders that are missing texture information, instead of crashing

This is required if we, for example, support new texture instruction to the shader translator, and then they allow access to textures that were not accessed before. In this scenario, the old cache entry is no longer usable

* Fix coordinates normalization on cubemap textures

* Check if title ID is null before combining shader cache path

* More robust constant buffer address validation on spec state

* More robust constant buffer address validation on spec state (2)

* Regenerate shader cache with one stream, rather than one per shader.

* Only create shader cache directory during initialization

* Logging improvements

* Proper shader program disposal

* PR feedback, and add a comment on serialized structs

* XML docs for RegisterTexture

Co-authored-by: riperiperi <rhy3756547@hotmail.com>
2024-02-22 19:16:21 -05:00
gdkchan
39af54c0d8 Fix tail merge from block with conditional jump to multiple returns (#3267)
* Fix tail merge from block with conditional jump to multiple returns

* PPTC version bump
2024-02-22 19:16:21 -05:00
gdkchan
e83b55a88c Implement VMAD shader instruction and improve InvocationInfo and ISBERD handling (#3251)
* Implement VMAD shader instruction and improve InvocationInfo and ISBERD handling

* Shader cache version bump

* Fix typo
2024-02-22 19:16:21 -05:00
gdkchan
2552612d8c Allow copy texture views to have mismatching multisample state (#3152) 2024-02-22 19:16:21 -05:00
merry
dc8abff436 Lop3Expression: Optimize expressions (#3184)
* lut3

* bugfixes

* TruthTable

* false/true -> 0/-1

* add or to expressions

* fix inversions

* increment cache version
2024-02-22 19:16:21 -05:00
MutantAura
f8f13ddeb1 Remove save data creation prompt (#3252)
* begone

* review

* mods directory update
2024-02-22 19:16:21 -05:00
gdkchan
9b4762bef9 Calculate vertex buffer size from index buffer type (#3253)
* Calculate vertex buffer size from index buffer type

* We also need to update the size if first vertex changes
2024-02-22 19:16:21 -05:00
Mary
44d316c690 amadeus: Improve and fix delay effect processing (#3205)
* amadeus: Improve and fix delay effect processing

This rework the delay effect processing by representing calculation with the appropriate matrix and by unrolling some loop in the code.
This allows better optimization by the JIT while making it more readeable.

Also fix a bug in the Surround code path found while looking back at my notes.

* Remove useless GetHashCode

* Address gdkchan's comments
2024-02-22 19:16:21 -05:00
Narr the Reg
3ddfe77458 service: hid: Signal event on AcquireNpadStyleSetUpdateEventHandle (#3247) 2024-02-22 19:16:21 -05:00
Alex Barney
7a55c7061d Update to LibHac 0.16.1 (#3263) 2024-02-22 19:16:21 -05:00
Mary
0231d27281 amadeus: Update to REV11 (#3230)
This should implement all ABI changes from REV11 on 14.0.0

As Nintendo changed the channel disposition for "legacy" effects (Delay, Reverb and Reverb 3D) to match the standard channel mapping, I took the liberty to just remap to the old disposition for now.
The proper changes will be handled at a later date with a complete rewriting of those 3 effects to be more readable (see https://github.com/Ryujinx/Ryujinx/pull/3205 for the first iteration of it).
2024-02-22 19:16:21 -05:00
gdkchan
19c13baebd Do not clamp SNorm outputs to the [0, 1] range on OpenGL (#3260) 2024-02-22 19:16:21 -05:00
gdkchan
7e862aff8c Implement primitive restart draw arrays properly on OpenGL (#3256) 2024-02-22 19:16:21 -05:00
gdkchan
6f8b70734b Do not force scissor on clear if scissor is disabled (#3258) 2024-02-22 19:16:21 -05:00
gdkchan
c6b8a7e466 Small graphics abstraction layer cleanup (#3257) 2024-02-22 19:16:21 -05:00
gdkchan
443eb48dec Fix shader textureSize with multisample and buffer textures (#3240)
* Fix shader textureSize with multisample and buffer textures

* Replace out param with tuple return value
2024-02-22 19:16:20 -05:00
Mary
01db897300 infra: Put SDL2 headless release inside a GUI-less block in PR (#3218)
As title say.
2024-02-22 19:16:20 -05:00
gdkchan
c378fcb460 Support NVDEC H264 interlaced video decoding and VIC deinterlacing (#3225)
* Support NVDEC H264 interlaced video decoding and VIC deinterlacing

* Remove unused code
2024-02-22 19:16:20 -05:00