Commit graph

703 commits

Author SHA1 Message Date
Isaac Marovitz
db9de66437 Set Vertex Descriptor properly 2024-09-28 19:03:01 -04:00
Isaac Marovitz
5c9d1bd0da Start vertex descriptor work 2024-09-28 19:03:01 -04:00
Isaac Marovitz
fb5402ce81 Implement CreateProgram 2024-09-28 19:03:01 -04:00
Isaac Marovitz
ed11cdda8d Fix fragment output color 2024-09-28 19:03:01 -04:00
Isaac Marovitz
6017c225b2 Set TargetLanguage for Metal to MSL 2024-09-28 19:03:01 -04:00
Isaac Marovitz
98e2ab5a49 Fix IoMap variable names
Output struct

Lazy Vertex IO

Output fixes

Fix output struct definition

MSL Binding Model description

Might need tweaks/adjustments

Cleanup

Typo + Format
2024-09-28 19:03:01 -04:00
Isaac Marovitz
d5758cb310 Fix ETC2 PTA formats
Format
2024-09-28 19:03:01 -04:00
Isaac Marovitz
81b1ae4bcf Partial TextureQuerySamples 2024-09-28 19:03:01 -04:00
Isaac Marovitz
ce5f383f5d Fix instructions 2024-09-28 19:03:01 -04:00
Isaac Marovitz
d2ec22a01b LDR ASTC 2024-09-28 19:03:01 -04:00
Isaac Marovitz
53b886d893 Get build working again (values likely wrong) 2024-09-28 19:03:01 -04:00
Isaac Marovitz
29ef76f153 dotnet format 2024-09-28 19:03:01 -04:00
Isaac Marovitz
a1b314acd2 Back to where we were
First special instruction

Start Load/Store implementation

Start TextureSample

Sample progress

I/O Load/Store Progress

Rest of load/store

TODO: Currently, the generator still assumes the GLSL style of I/O attributres. On MSL, the vertex function should output a struct which contains a float4 with the required position attribute.

TextureSize and VectorExtract

Fix UserDefined IO Vars

Fix stage input struct names
2024-09-28 19:03:01 -04:00
Isaac Marovitz
5198fcb881 Boot TOTK 2024-09-28 19:03:01 -04:00
Isaac Marovitz
b37c109673 Boot Sonic Mania 2024-09-28 19:03:01 -04:00
Isaac Marovitz
163be0a159 Update for new Shader IR format 2024-09-28 19:03:01 -04:00
Isaac Marovitz
1f8ae7e5b1 Update src/Ryujinx.Graphics.Metal/Pipeline.cs
Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2024-09-28 19:03:01 -04:00
Isaac Marovitz
bbc2ac2e9b Vertex Input Attributes 2024-09-28 19:03:01 -04:00
Isaac Marovitz
f07327166c More Shader Gen Stuff
Mostly copied from GLSL since in terms of syntax within blocks they’re pretty similar. Likely the result will need tweaking…

Isn’t that conveniant?

“Do the simd_shuffle”

atomics

Remaining instructions

Remove removed special instructions

Getting somewhere…
2024-09-28 19:03:01 -04:00
Isaac Marovitz
1790050a14 Fix Metal Validation Error 2024-09-28 19:03:01 -04:00
Isaac Marovitz
f2c090fe55 SDL2 Headless Metal Backend support 2024-09-28 19:03:01 -04:00
Isaac Marovitz
fd0eaaafc1 Easier capture stuff 2024-09-28 19:03:01 -04:00
Isaac Marovitz
0233a0d35a Define MaxFramesPerCapture 2024-09-28 19:03:01 -04:00
Isaac Marovitz
61910fe342 Cleanup encoder getting + Fix capture overflow 2024-09-28 19:03:01 -04:00
Isaac Marovitz
1cb2ec7ebc Formatting 2024-09-28 19:03:01 -04:00
Isaac Marovitz
4ec37d1798 Start of MSL instructions
Remaining functions
2024-09-28 19:03:01 -04:00
Isaac Marovitz
27effab989 Warn when generating unsupported shader 2024-09-28 19:03:01 -04:00
Isaac Marovitz
d0d5c76f06 Pass sampler to Blit shader 2024-09-28 19:03:01 -04:00
Isaac Marovitz
a03471a8ab Shader comments 2024-09-28 19:03:01 -04:00
Isaac Marovitz
93c71110e1 HelperShaders class 2024-09-28 19:03:01 -04:00
Isaac Marovitz
00fce5a51d Undertale boots 2024-09-28 19:03:01 -04:00
Isaac Marovitz
ce5f5a6442 Check if packed depth is supported 2024-09-28 19:03:01 -04:00
Isaac Marovitz
541cdfebb7 Fix RGB Seizure 2024-09-28 19:03:01 -04:00
Isaac Marovitz
07be20c369 Barry is here mashallah 2024-09-28 19:03:01 -04:00
Isaac Marovitz
aaa140e510 Seizure my beloved is working 2024-09-28 19:03:01 -04:00
Isaac Marovitz
6d722d83ba SetData 2024-09-28 19:03:01 -04:00
Isaac Marovitz
6c3435aaac Look ma no crash 2024-09-28 19:03:01 -04:00
Isaac Marovitz
425177a876 Whitespace 2024-09-28 19:03:01 -04:00
Isaac Marovitz
e3da359acf TODO 2024-09-28 19:03:01 -04:00
Isaac Marovitz
96bbc86331 BeginComputePass 2024-09-28 19:03:01 -04:00
Isaac Marovitz
3d42543f03 SetDepthTest 2024-09-28 19:03:01 -04:00
Isaac Marovitz
0f52165e86 SetStencilTest 2024-09-28 19:03:01 -04:00
Isaac Marovitz
628772f685 Forgot depth 2024-09-28 19:03:01 -04:00
Isaac Marovitz
118d10bc32 Texture usage 2024-09-28 19:03:01 -04:00
Isaac Marovitz
33a986317b CopyBuffer to Buffer 2024-09-28 19:03:01 -04:00
Isaac Marovitz
7a2ab77b4d CopyTo Buffer 2024-09-28 19:03:01 -04:00
Isaac Marovitz
08126b26b1 SetData without region 2024-09-28 19:03:01 -04:00
Isaac Marovitz
abcd2b2754 Rewrite SetData for GPU 2024-09-28 19:03:01 -04:00
Isaac Marovitz
d076a70816 Clear Buffer 2024-09-28 19:03:01 -04:00
Isaac Marovitz
28da4248ae Use Ryujinx Logger 2024-09-28 19:03:01 -04:00
Isaac Marovitz
f4aea9b7ec One encoder at a time 2024-09-28 19:03:01 -04:00
Isaac Marovitz
e269d1605d Fix byte alignment 2024-09-28 19:03:01 -04:00
Isaac Marovitz
8b21447018 Finish SetData /w region 2024-09-28 19:03:01 -04:00
Isaac Marovitz
66d575965c Spoof Counters 2024-09-28 19:03:01 -04:00
Isaac Marovitz
4104af65a3 BufferAccess 2024-09-28 19:03:01 -04:00
Isaac Marovitz
8da7c42cf8 Delete and Get Data from Buffer 2024-09-28 19:03:01 -04:00
Isaac Marovitz
5dd444f605 Start Texture region-based CopyTo 2024-09-28 19:03:01 -04:00
Isaac Marovitz
0f3358b931 IoMap 2024-09-28 19:03:01 -04:00
Isaac Marovitz
177303d223 Fix error 2024-09-28 19:03:01 -04:00
Isaac Marovitz
0eaee442c7 Renderer cleanup 2024-09-28 19:03:01 -04:00
Isaac Marovitz
70f54f23c9 Texture Copys 2024-09-28 19:03:01 -04:00
Isaac Marovitz
1e36815713 Texture, Pipeline, Sample, Renderer Improvements 2024-09-28 19:03:01 -04:00
Isaac Marovitz
ebaf1d8258 Start Metal Backend
Revert build yml changes
2024-09-28 19:03:01 -04:00
e2dk4r
5dbba07e33
sdl: set app name (#7370)
Ryujinx was not hinting application name, so on some platforms (e.g.
Linux) volume control shows Ryujinx as 'SDL Application'. This can cause
confusion.

This commit fixes name in volume control applets on some platforms.

see: https://wiki.libsdl.org/SDL2/SDL_HINT_APP_NAME
2024-09-28 10:44:23 +02:00
MaxLastBreath
d86249cb0a
Convert MaxTextureCacheCapacity to Dynamic MaxTextureCacheCapacity for High Resolution Mod support. (#7307)
* Add Texture Size Capacity and 8GB Dram Build

* Update AutoDeleteCache.cs

* Dynamic Texture Cache (WIP)

* Change to float Multiplier, in-case it needs fine-tuning.

* Delete src/src.sln

* Update AutoDeleteCache.cs

* Format

* Fix Formatting

* Add DefaultTextureSizeCapacity and MemoryScaleFactor

- Also remove redundant New Lines

* Fix 4GB dram crashing

* Format newline

* Refractor

- Added Initialize() function to TextureCache and AutoDeleteCache
- Removed GetMaxTextureCapacity() function and instead added _maxCacheMemoryUsage
- Added private const MaxTextureSizeCapacity to AutoDelete Cache
- Added TextureCache.Initialize() to MemoryManager in order to fetch MaxGpuMemory at the right time.
- Moved and Changed Logger.Info for Gpu Memory to Logger.Notice and Moved it to PrintGpuInformation function.
- Opted to use a ternary operator for the Initialize function, I think it looks cleaner than bunch of if statements.

* Update src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs

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

* maxMemory to CacheMemory, use Clamp instead of Ternary. Changed MinTextureCapacity 1GiB to 512 MiB

* Update src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs

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

* Format comment

* comment context

* Increase TextureSize capacity for OpenGL back to 1024

- Added a new const ulong for OpenGLTextureSizeCapacity

* Fix changes from last commit.

* Adjust last OpenGL changes.

* Remove garbage VSC file

* Update src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs

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

* Update src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs

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

* Update src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs

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

---------

Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2024-09-26 14:33:38 -03:00
riperiperi
04d68ca616
GPU: Ensure all clip distances are initialized when used (#7363)
* GPU: Ensure all clip distances are initialized when used

* Shader cache version
2024-09-26 14:19:12 -03:00
gdkchan
319507f2a1
Fix quads draws after DrawTexture on Vulkan (#7336) 2024-09-22 19:36:53 -03:00
gdkchan
d717aef2be
Shader: Assume the only remaining source is the right one when all others are undefined (#7331)
* Shader: Assume the only remaining source is the right one when all other are undefined

* Shader cache version bump

* Improve comment
2024-09-19 21:23:09 -03:00
gdkchan
24ee8c39f1
Add support for sampler sRGB disable (#7312) 2024-09-19 14:38:30 -03:00
jhorv
73f985d27c
Replace passing by IMemoryOwner<byte> with passing by concrete MemoryOwner<byte> (#7171)
* refactor(perf): pass MemoryOwner<byte> around as itself rather than IMemoryOwner<byte>

* fix(perf): get span via MemoryOwner<byte>.Span property instead of through Memory property

* fix: incorrect comment change
2024-09-18 23:00:54 -03:00
gdkchan
ef81658fbd
Implement support for shader ATOM.EXCH instruction (#7320)
* Implement support for shader ATOM.EXCH instruction

* Shader cache version bump

* Check type
2024-09-18 15:48:55 -03:00
gdkchan
062ef43eb4
Revert "Wait for async task to complete (#7122)" (#7318)
This reverts commit ccf96bf5e6.
2024-09-17 16:25:26 -03:00
gdkchan
eb8132b627
Change image format view handling to allow view incompatible formats (#7311)
* Allow creating texture aliases on texture pool

* Delete old image format override code

* New format incompatible alias

* Missing bounds check

* GetForBinding now takes FormatInfo

* Make FormatInfo struct more compact
2024-09-17 15:52:30 -03:00
TSRBerry
ccf96bf5e6
Wait for async task to complete (#7122)
This way exceptions thrown during the execution of CheckLaunchState()
will correctly invoke the unhandled exception handler
and cause Ryujinx to crash.
2024-09-17 15:42:00 -03:00
ZenoArrows
f39e89ece7
Add area sampling scaler to allow for super-sampled anti-aliasing. (#7304)
* Add area sampling scaler to allow for super-sampled anti-aliasing.

* Area scaling filter doesn't have a scaling level.

* Add further clarification to the tooltip on how to achieve supersampling.

* ShaderHelper: Merge the two CompileProgram functions.

* Convert tabs to spaces in area scaling shaders

* Fixup Vulkan and OpenGL project files.

* AreaScaling: Replace texture() by texelFetch() and use integer vectors.

No functional difference, but it cleans up the code a bit.

* AreaScaling: Delete unused sharpening level member.

Also rename _scale to _sharpeningLevel for clarity and consistency.

* AreaScaling: Delete unused scaleX/scaleY uniforms.

* AreaScaling: Force the alpha to 1 when storing the pixel.

* AreaScaling: Remove left-over sharpening buffer.
2024-09-17 15:30:50 -03:00
gdkchan
cf77c011e4
Change 6GB DRAM expansion to 8GB (#7313)
* Change 6GB DRAM expansion to 8GB

* Update texts and tooltips
2024-09-17 15:09:20 -03:00
gdkchan
cd74ae1bbd
Implement fast DMA texture to texture copy (#7299)
* Implement fast DMA texture to texture copy

* PR feedback
2024-09-15 18:12:05 -03:00
Emmanuel Hansen
62216782ca
Make GetFunctionPointerForDelegate as explicit as possible (#7279)
Co-authored-by: gdk <gab.dark.100@gmail.com>
2024-09-15 17:39:10 -03:00
gdkchan
2f36a6665c
Implement Arm32 VSHLL and QADD16 instructions (#7301) 2024-09-12 18:22:30 -03:00
riperiperi
ca59c3f499
Vulkan: Feedback loop detection and barriers (#7226)
* Vulkan: Feedback loop improvements

This PR allows the Vulkan backend to detect attachment feedback loops. These are currently used in the following ways:

- Partial use of VK_EXT_attachment_feedback_loop_layout
  - All renderable textures have AttachmentFeedbackLoopBitExt
  - Compile pipelines with Color/DepthStencil feedback loop flags when present
- Support using FragmentBarrier for feedback loops (fixes regressions from https://github.com/Ryujinx/Ryujinx/pull/7012 )

TODO:
- AMD GPUs may need layout transitions for it to properly allow textures to be used in feedback loops.
- Use dynamic state for feedback loops. The background pipeline will always miss since feedback loop state isn't known on the GPU project.
- How is the barrier dependency flag used? (DXVK just ignores it, there's no vulkan validation...)
- Improve subpass dependencies to fix validation errors

* Mark field readonly

* Add feedback loop dynamic state

* fix: add MoltenVK resolver workaround

fix: add MoltenVK resolver workaround

* Formatting

* Fix more complaints

* RADV dcc workaround

* Use dynamic state properly, cleanup.

* Use aspects flags in more places
2024-09-01 21:28:16 -03:00
gdkchan
fdd7ee791c
Fix incorrect depth texture 3D flag (#7262) 2024-09-01 17:58:01 -03:00
riperiperi
398fa1c238
Vulkan: Update Silk.NET to 2.21 (#7266)
* Update Silk.NET version

* fix: add MoltenVK resolver workaround

fix: add MoltenVK resolver workaround

* Cleanup

* Readonly ref warnings

* Remove driver id todo
2024-09-01 17:33:11 -03:00
Emmanuel Hansen
2c5c0392f9
Make HLE project AOT friendly (#7085)
* add hle service generator

remove usage of reflection in device state

* remove rd.xml generation

* make applet manager reflection free

* fix typos

* fix encoding

* fix style report

* remove rogue generator reference

* remove double assignment
2024-08-31 11:39:26 -03:00
Emmanuel Hansen
e0acde04bb
Replace ImageSharp with SkiaSharp everywhere (#7030)
* replace ImageSharp with SkiaSharp for inline keyboard applet rendering

* fix avalonia inline keyboard input

* remove image sharp from gtk3 project

* add skiasharp linux assets

* fix whitespace

* fix format

* fix ico image offset when saving shortcut to windows
2024-08-31 11:32:53 -03:00
David McFarland
3c61d560c3
Fix deadlock in background translation thread shutdown (#7239)
TryDequeue checks for _disposed before taking the lock.  If another
thread calls Dispose before it takes the lock, it won't get woken up by
the PulseAll call, and will deadlock in Monitor.Wait.

Double-checking _disposed with the lock taken should avoid this.
2024-08-27 19:10:24 +02:00
gdkchan
460f9faf4e
Fix NRE when using buffer image array (#7159) 2024-08-21 00:49:17 +01:00
Tsubasa0504
0137c9e635
nim:eca : Stub CreateServerInterface2 (#7128)
* Add files via upload

* Add files via upload

* Update src/Ryujinx.HLE/HOS/Services/Nim/IShopServiceAccessServerInterface.cs

---------

Co-authored-by: Ac_K <Acoustik666@gmail.com>
2024-08-17 09:57:22 +01:00
Logan Stromberg
23fa5f4c9c
Fix arbitrary game ordering when sorting by Favorites (#7170)
* Fix arbitrary sorting by "Favorite" in the UI by making it the same as sorting alphabetically while giving favorites priority.

* Use a more engineered solution rather than string hacks.

* Address code style warnings. Add null checking. Make title name comparison case insensitive.

* one more style fix

---------

Co-authored-by: Logan Stromberg <lostromb@microsoft.com>
2024-08-13 15:23:11 +02:00
gdkchan
4f75e26ec7
Clamp amount of mipmap levels to max allowed for all backends (#7197)
* Clamp amount of mipmap levels to max allowed for all backends

* XML docs

* Remove using
2024-08-12 17:45:25 -03:00
gdkchan
8d8983049e
Implement UQADD16, UQADD8, UQSUB16, UQSUB8, VQRDMULH, VSLI and VSWP Arm32 instructions (#7174) 2024-08-08 17:07:24 -03:00
jhorv
7969fb6bba
Replace and remove obsolete ByteMemoryPool type (#7155)
* refactor: replace usage of ByteMemoryPool with MemoryOwner<byte>

* refactor: delete unused ByteMemoryPool and ByteMemoryPool.ByteMemoryPoolBuffer types

* refactor: change IMemoryOwner<byte> return types to MemoryOwner<byte>

* fix(perf): get span via `MemoryOwner<T>.Span` directly instead of `MemoryOwner<T>.Memory.Span`

* fix(perf): get span via MemoryOwner<T>.Span directly instead of `MemoryOwner<T>.Memory.Span`

* fix(perf): get span via MemoryOwner<T>.Span directly instead of `MemoryOwner<T>.Memory.Span`
2024-08-05 21:09:08 -03:00
gdkchan
4a4b11871e
Fix same textures with unmapped start being considered different (#7141)
* Fix same textures with unmapped start being considered different

* Consolidate IsInvalid check

* InvalidAddress const

* Fix typo

Co-authored-by: riperiperi <rhy3756547@hotmail.com>

---------

Co-authored-by: riperiperi <rhy3756547@hotmail.com>
2024-08-05 11:00:41 -03:00
Julien Lebosquain
e85ee673b1
Fix LocaleExtension SetRawSource usages + language perf improvement (#7121)
* Avoid Avalonia CompiledBindingPathBuilder.SetRawSource

* Improve UI language change performance
2024-08-04 19:04:12 +01:00
Isaac Marovitz
42f22fe5d7
Infra: Update Microsoft.IdentityModel.JsonWebTokens (#7070)
* Update Microsoft.IdentityModel.JsonWebTokens

* Update
2024-08-04 18:56:27 +01:00
TSRBerry
263eb97f79
Avoid race conditions while launching games directly from the command line (#7116)
* optimization: Load application metadata only for applications with IDs

* Load applications when necessary

This prevents loading applications when launching an application
directly from the command line (or a shortcut).
Instead, applications will be loaded after the emulation was stopped by the user.

* Show the title in the configured language when launching an application

* Rename DesiredTitleLanguage to DesiredLanguage
2024-08-03 22:31:34 +01:00
jhorv
59ddb26628
replace ByteMemoryPool usage in Ryujinx.Graphics (#7129)
* chore: replace `ByteMemoryPool` usage with `MemoryOwner<byte>`

* refactor: `PixelConverter.ConvertR4G4ToR4G4B4A4()` - rename old `outputSpan` to `outputSpanUInt16`, reuse same output `Span<byte>` as newly-freed name `outputSpan`

* eliminate temporary buffer allocations

* chore, perf: use MemoryOwner<byte> instead of IMemoryOwner<byte>
2024-08-03 19:50:53 +01:00
TSRBerry
83fda10f6e
Fix FileNotFoundException in TryGetApplicationsFromFile() and improve loading applications (#7145)
* Don't load files from hidden subdirectories

* Catch FileNotFoundException in TryGetApplicationsFromFile()

* Skip non-existent files and bad symlinks when loading applications
2024-08-03 19:46:59 +02:00
gdkchan
d97e995e59
Fix off-by-one on audio renderer PerformanceManager.GetNextEntry (#7139) 2024-07-31 22:22:11 -03:00
gdkchan
56b2f84702
Fix shader RegisterUsage pass only taking first operation dest into account (#7131)
* Fix shader RegisterUsage pass only taking first operation dest into account

* Shader cache version bump
2024-07-30 21:57:55 -03:00
riperiperi
698e36bbd2
Vulkan: Force topology to PatchList for Tessellation (#7102)
Vulkan spec states that input topology should always be PatchList when a tessellation pipeline is present. The AMD GPU on windows crashes so hard it BSODs the machine if this isn't the case, so it's forced here just in case.

I'm not sure what providing a different topology here would even do, as you'd think it would always be a patch list input.
2024-07-30 21:48:30 -03:00