Commit graph

2110 commits

Author SHA1 Message Date
gdkchan
3873e2fbd4 Bindless elimination for constant sampler handle (#3424)
* Bindless elimination for constant sampler handle

* Shader cache version bump

* Update TextureHandle.ReadPackedId for new bindless elimination
2024-02-22 19:16:28 -05:00
Mary
7907828122 ui: Fix timezone abbreviation since #3361 (#3430)
As title say
2024-02-22 19:16:28 -05:00
Narugakuruga
0f5a08c499 Add Simplified Chinese to Avalonia (V2) (#3416)
* Add files via upload

* Update Ryujinx.Ava.csproj

* Update MainWindow.axaml
2024-02-22 19:16:28 -05:00
gdkchan
fadec80890 Account for pool change on texture bindings cache (#3420)
* Account for pool change on texture bindings cache

* Reduce the number of checks needed
2024-02-22 19:16:28 -05:00
Mary
786ab19fa6 timezone: Fix regression caused by #3361 (#3418)
Because of that PR, TimeZoneRule was bigger than 0x4000 thanks to a
misuse of a constant.

This commit address this issue and add a new unit test to ensure the size of
TimeZoneRule is 0x4000 bytes.

Also address suggestions that were lost on the original PR.
2024-02-22 19:16:28 -05:00
Mary
7e403da216 time: Make TimeZoneRule blittable and avoid copies (#3361)
* time: Make TimeZoneRule blittable and avoid copies

This drastically reduce overhead of using TimeZoneRule around the
codebase.

Effect on games is unknown

* Add missing Box type

* Ensure we clean the structure still

This doesn't perform any copies

* Address gdkchan's comments

* Simplify Box
2024-02-22 19:16:28 -05:00
gdkchan
d33a8375b9 Fix ThreadingLock deadlock on invalid access and TerminateProcess (#3407) 2024-02-22 19:16:28 -05:00
gdkchan
b1022c7320 Ensure texture ID is valid before getting texture descriptor (#3406) 2024-02-22 19:16:28 -05:00
Ac_K
7fa1869d7a UI: Some Avalonia cleanup (#3358) 2024-02-22 19:16:28 -05:00
gdkchan
28332dd189 Rewrite kernel memory allocator (#3316)
* Rewrite kernel memory allocator

* Remove unused using

* Adjust private static field naming

* Change UlongBitSize to UInt64BitSize

* Fix unused argument, change argument order to be inline with official code and disable random allocation
2024-02-22 19:16:28 -05:00
RhavoX
b0254abb08 Fix doubling of detected gamepads on program start (#3398)
* Fix doubling of detected gamepads (sometimes the connected event is fired when the app starts even though the pad was connected for some time now).

The fix rejects the gamepad if one with the same ID is already present.

* Fixed review findings
2024-02-22 19:16:28 -05:00
riperiperi
ea8b1461ca Account for res scale changes when updating bindings (#3403)
Fixes a regression introduced by the texture bindings PR.

Also renames TextureStatePerStage, as it's no longer per stage.
2024-02-22 19:16:28 -05:00
riperiperi
675ff6400e Optimize Texture Binding and Shader Specialization Checks (#3399)
* Changes 1

* Changes 2

* Better ModifiedSequence handling

This should handle PreciseEvents properly, and simplifies a few things.

* Minor changes, remove debug log

* Handle stage.Info being null

Hopefully fixes Catherine crash

* Fix shader specialization fast texture lookup

* Fix some things.

* Address Feedback Part 1

* Make method static.
2024-02-22 19:16:28 -05:00
gdkchan
3e32d4f956 Fix VIC out of bounds copy (#3386)
* Fix VIC out of bounds copy

* Update the assert
2024-02-22 19:16:28 -05:00
gdkchan
89cadccd9b Support Array/3D depth-stencil render target, and single layer clears (#3400)
* Support Array/3D depth-stencil render target, and single layer clears

* Alignment
2024-02-22 19:16:27 -05:00
gdkchan
9681899704 Less invasive fix for EventFd blocking operations (#3394) 2024-02-22 19:16:26 -05:00
gdkchan
8644495505 Allow concurrent BSD EventFd read/write (#3385) 2024-02-22 19:16:26 -05:00
gdkchan
fc4d592117 Ignore ClipControl on draw texture fallback (#3388) 2024-02-22 19:16:26 -05:00
gdkchan
c8fcd39751 Fix instanced indexed inline draw index count (#3389) 2024-02-22 19:16:26 -05:00
gdkchan
3c48f0dd00 Fix instanced indexed inline draws (#3383) 2024-02-22 19:16:26 -05:00
gdkchan
c874827afb Remove freed memory range from tree on memory block disposal (#3347)
* Remove freed memory range from tree on memory block disposal

* PR feedback
2024-02-22 19:16:26 -05:00
gdkchan
572c28817c Extend uses count from ushort to uint on Operand Data structure (#3374) 2024-02-22 19:16:26 -05:00
gdkchan
a3cb5f949f Copy dependency for multisample and non-multisample textures (#3382)
* Use copy dependency for textures that differs in multisample but are otherwise compatible

* Remove allowMs flag as it's no longer required for correctness, it's just an optimization now

* Dispose intermmediate pool
2024-02-22 19:16:26 -05:00
Billy Laws
01413b347c Fix a potential GPFIFO submission race (#3378)
The syncpoint maximum value represents the maximum possible syncpt value at a given time, however due to PBs being submitted before max was incremented, for a brief moment of time this is not the case which could lead to invalid behaviour if a game waits on the fence at that specific time.
2024-02-22 19:16:26 -05:00
Billy Laws
c2453728cc Fix 3D semaphore counter type 0 handling (#3380)
Counter type 0 actually releases the semaphore payload rather than a constant zero as was previously thought. This is required by Skyrim.
2024-02-22 19:16:26 -05:00
Mary
3dc80333d6 infra: Switch to win10-x64 RID and fix PR comment for Avalonia and SDL2 artifact rename (#3375)
* infra: Switch to win10-x64 RID and fix PR comment for Avalonia and SDL2 artifact rename

* Address gdkchan's comments
2024-02-22 19:16:25 -05:00
gdkchan
62de21124d Rewrite SVC handler using source generators rather than IL emit (#3371)
* Implement syscall handlers using a source generator

* Copy FlushProcessDataCache implementation to Syscall since it was only implemented on Syscall32

* Fix wrong argument order in some syscalls

* Delete old Reflection.Emit based syscall handling code

* Improvements to the code generation

* ControlCodeMemory address and size is always 64-bit
2024-02-22 19:16:25 -05:00
gdkchan
2759186860 Refactor CPU interface to allow the implementation of other CPU emulators (#3362)
* Refactor CPU interface

* Use IExecutionContext interface on SVC handler, change how CPU interrupts invokes the handlers

* Make CpuEngine take a ITickSource rather than returning one

The previous implementation had the scenario where the CPU engine had to implement the tick source in mind, like for example, when we have a hypervisor and the game can read CNTPCT on the host directly. However given that we need to do conversion due to different frequencies anyway, it's not worth it. It's better to just let the user pass the tick source and redirect any reads to CNTPCT to the user tick source

* XML docs for the public interfaces

* PPTC invalidation due to NativeInterface function name changes

* Fix build of the CPU tests

* PR feedback
2024-02-22 19:16:25 -05:00
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