ryujinx/src
riperiperi 76b53e018a
GPU: Add fallback when textureGatherOffsets is not supported (#5792)
* GPU: Add fallback when textureGatherOffsets is not supported.

This PR adds a fallback for GPUs or APIs that don't support an equivalent to the method `textureGatherOffsets`, where each of the 4 gathered texels has an individual offset. This is done by reusing the existing code to handle non-const offsets for texture instructions, though it has also been corrected as there were a few implementation issues.

MoltenVK reports support for this capability, and it didn't error when we initially released the MacOS build, but that has since changed. MVK still reports support, but spirv-cross has been fixed in a way that it _attempts_ to use this capability, but the metal compiler errors since it doesn't exist.

Some other fixes:
- textureGatherOffsets emulation has been changed significantly. It now uses 4 texture sample instructions (not gather), calculates a base texel (i=0 j=0) and adds the offsets onto it before converting into a tex coord. The final result is offset into a texel center, so it shouldn't be subject to interpolation, though this isn't perfect and could have some error with floating point formats with linear sampling. It is subject to texture wrap mode as it should be, which is why texelFetch was not used.
  - Maybe gather should be used here with component `w` (i=0, j=0), though this multiplies number of texels fetched by 4... The way it was doing this before _was_ wrong_, but doing it right would avoid issues with texel center precision.
- textureGatherOffset (singular) now performs textureGather with the offset applied to the coords, rather than the slower fallback where each texel is fetched individually.

* Increment shader cache version, remove unused arg

* Use base texture size for gather coord offset.

Implicit LOD for gather is not supported.

* Use 4 texture gathers for offsets emulation

Avoids issues with interpolation at cost of performance

(not sure how bad this is)

* Address Feedback
2023-10-20 15:05:09 +02:00
..
ARMeilleure Replace ReaderWriterLock with ReaderWriterLockSlim (#5785) 2023-10-12 18:11:15 +02:00
Ryujinx Add ldn:u implementation, INetworkClient interface and DisabledLdnClient (#5652) 2023-09-25 23:50:43 +02:00
Ryujinx.Audio Fix audio renderer compressor effect (#5742) 2023-09-29 10:48:49 +00:00
Ryujinx.Audio.Backends.OpenAL Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Audio.Backends.SDL2 Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Audio.Backends.SoundIo Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Ava Avalonia: Show aspect ratio popup options in status bar (#5780) 2023-10-08 11:04:41 +02:00
Ryujinx.Common Replace ReaderWriterLock with ReaderWriterLockSlim (#5785) 2023-10-12 18:11:15 +02:00
Ryujinx.Cpu Add VTimer as alternative interrupt method on Apple Hypervisor (#5663) 2023-09-26 01:18:32 +02:00
Ryujinx.Graphics.Device Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Graphics.GAL GPU: Add fallback when textureGatherOffsets is not supported (#5792) 2023-10-20 15:05:09 +02:00
Ryujinx.Graphics.Gpu GPU: Add fallback when textureGatherOffsets is not supported (#5792) 2023-10-20 15:05:09 +02:00
Ryujinx.Graphics.Host1x Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Graphics.Nvdec Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Graphics.Nvdec.FFmpeg Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Graphics.Nvdec.Vp9 [Ryujinx.Graphics.Nvdec.Vp9] Address dotnet-format issues (#5371) 2023-06-28 09:26:39 +02:00
Ryujinx.Graphics.OpenGL GPU: Add fallback when textureGatherOffsets is not supported (#5792) 2023-10-20 15:05:09 +02:00
Ryujinx.Graphics.Shader GPU: Add fallback when textureGatherOffsets is not supported (#5792) 2023-10-20 15:05:09 +02:00
Ryujinx.Graphics.Texture Fix layer size for 3D textures with NPOT depth (#5640) 2023-09-04 20:14:08 -03:00
Ryujinx.Graphics.Vic Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Graphics.Video Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Graphics.Vulkan GPU: Add fallback when textureGatherOffsets is not supported (#5792) 2023-10-20 15:05:09 +02:00
Ryujinx.Headless.SDL2 Add ldn:u implementation, INetworkClient interface and DisabledLdnClient (#5652) 2023-09-25 23:50:43 +02:00
Ryujinx.HLE Horizon: Migrate usb and psc services (#5800) 2023-10-13 23:13:15 -03:00
Ryujinx.Horizon Horizon: Migrate usb and psc services (#5800) 2023-10-13 23:13:15 -03:00
Ryujinx.Horizon.Common Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Horizon.Generators Horizon: Migrate usb and psc services (#5800) 2023-10-13 23:13:15 -03:00
Ryujinx.Horizon.Kernel.Generators Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Input [Ryujinx.Input] Address dotnet-format issues (#5384) 2023-06-28 18:23:00 +02:00
Ryujinx.Input.SDL2 [Ryujinx.Input.SDL2] Address dotnet-format issues (#5385) 2023-06-26 01:55:25 +00:00
Ryujinx.Memory [Ryujinx.Memory] Address dotnet-format issues (#5386) 2023-06-28 18:34:00 +02:00
Ryujinx.SDL2.Common Revert "sdl: set SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS to 0 (#5433)" (#5439) 2023-07-06 18:08:14 +02:00
Ryujinx.ShaderTools Geometry shader emulation for macOS (#5551) 2023-08-29 21:10:34 -03:00
Ryujinx.Tests [Hotfix] hid: Prevent out of bounds array access (#5547) 2023-08-10 00:29:15 -03:00
Ryujinx.Tests.Memory Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Tests.Unicorn Add workflow to automatically check code style issues for PRs (#4670) 2023-07-24 18:35:04 +02:00
Ryujinx.Ui.Common Add ldn:u implementation, INetworkClient interface and DisabledLdnClient (#5652) 2023-09-25 23:50:43 +02:00
Ryujinx.Ui.LocaleGenerator Strings should not be concatenated using '+' in a loop (#5664) 2023-10-05 12:41:00 +02:00
Spv.Generator Declare and use gl_PerVertex block for VTG per-vertex built-ins (#5576) 2023-08-16 23:16:25 +02:00