1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-18 06:26:40 +00:00
Ryujinx/src/Ryujinx.Graphics.GAL
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
..
Multithreading Vulkan: Buffer Mirrors for MacOS performance (#4899) 2023-08-14 14:18:47 -03:00
AddressMode.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
AdvancedBlendDescriptor.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
AdvancedBlendOp.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
AdvancedBlendOverlap.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
AntiAliasing.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
BlendDescriptor.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
BlendFactor.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
BlendOp.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
BufferAccess.cs Vulkan: Buffer Mirrors for MacOS performance (#4899) 2023-08-14 14:18:47 -03:00
BufferAssignment.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
BufferHandle.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
BufferRange.cs Vulkan: Buffer Mirrors for MacOS performance (#4899) 2023-08-14 14:18:47 -03:00
Capabilities.cs GPU: Add fallback when textureGatherOffsets is not supported (#5792) 2023-10-20 15:05:09 +02:00
ColorF.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
CompareMode.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
CompareOp.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
CounterType.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
DepthMode.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
DepthStencilMode.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
DepthTestDescriptor.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
DeviceInfo.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
Extents2D.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
Extents2DF.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
Face.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
Format.cs GPU: Discard data when getting texture before full clear (#5719) 2023-09-25 23:07:03 +02:00
FrontFace.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
HardwareInfo.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
ICounterEvent.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
ImageCrop.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
IndexType.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
IPipeline.cs Move support buffer update out of the backends (#5411) 2023-07-11 14:07:41 -03:00
IProgram.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
IRenderer.cs Move support buffer update out of the backends (#5411) 2023-07-11 14:07:41 -03:00
ISampler.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
ITexture.cs Move support buffer update out of the backends (#5411) 2023-07-11 14:07:41 -03:00
IWindow.cs Implement color space passthrough option (#5531) 2023-08-07 18:54:05 +01:00
LogicalOp.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
MagFilter.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
MinFilter.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
MultisampleDescriptor.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
Origin.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
PinnedSpan.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
PolygonMode.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
PolygonModeMask.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
PrimitiveTopology.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
ProgramLinkStatus.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
ProgramPipelineState.cs Vulkan: Include DepthMode in ProgramPipelineState (#5185) 2023-06-01 09:05:39 +02:00
Rectangle.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
ResourceLayout.cs Delete ResourceAccess (#5626) 2023-09-05 22:59:21 +02:00
Ryujinx.Graphics.GAL.csproj Move solution and projects to src 2023-04-27 23:51:14 +02:00
SamplerCreateInfo.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
ScreenCaptureImageInfo.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
ShaderInfo.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
ShaderSource.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
StencilOp.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
StencilTestDescriptor.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
SwizzleComponent.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
Target.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
TextureCreateInfo.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
TextureReleaseCallback.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
UpscaleType.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
VertexAttribDescriptor.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
VertexBufferDescriptor.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
Viewport.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00
ViewportSwizzle.cs [Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366) 2023-06-28 20:20:10 +02:00