diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2024-05-14 11:47:16 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-14 16:47:16 +0200 |
| commit | 3a3b51893ee272af49d762387da5b27743786d56 (patch) | |
| tree | e37f41f9a6cd65f8c9f53359b378740b6fbe00af /src/Ryujinx.Graphics.Gpu/Shader/GpuChannelGraphicsState.cs | |
| parent | 44dbab3848c8831d27e50f7252d759a2494ad556 (diff) | |
Add support for bindless textures from storage buffer on Vulkan (#6721)
* Halve primitive ID when converting quads to triangles
* Shader cache version bump
* Add support for bindless textures from storage buffer on Vulkan
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Shader/GpuChannelGraphicsState.cs')
| -rw-r--r-- | src/Ryujinx.Graphics.Gpu/Shader/GpuChannelGraphicsState.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Shader/GpuChannelGraphicsState.cs b/src/Ryujinx.Graphics.Gpu/Shader/GpuChannelGraphicsState.cs index b5bc4df3..765bef7d 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/GpuChannelGraphicsState.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/GpuChannelGraphicsState.cs @@ -106,8 +106,11 @@ namespace Ryujinx.Graphics.Gpu.Shader /// Creates a new graphics state from this state that can be used for shader generation. /// </summary> /// <param name="hostSupportsAlphaTest">Indicates if the host API supports alpha test operations</param> + /// <param name="hostSupportsQuads">Indicates if the host API supports quad primitives</param> + /// <param name="hasGeometryShader">Indicates if a geometry shader is used</param> + /// <param name="originUpperLeft">If true, indicates that the fragment origin is the upper left corner of the viewport, otherwise it is the lower left corner</param> /// <returns>GPU graphics state that can be used for shader translation</returns> - public readonly GpuGraphicsState CreateShaderGraphicsState(bool hostSupportsAlphaTest, bool originUpperLeft) + public readonly GpuGraphicsState CreateShaderGraphicsState(bool hostSupportsAlphaTest, bool hostSupportsQuads, bool hasGeometryShader, bool originUpperLeft) { AlphaTestOp alphaTestOp; @@ -130,6 +133,9 @@ namespace Ryujinx.Graphics.Gpu.Shader }; } + bool isQuad = Topology == PrimitiveTopology.Quads || Topology == PrimitiveTopology.QuadStrip; + bool halvePrimitiveId = !hostSupportsQuads && !hasGeometryShader && isQuad; + return new GpuGraphicsState( EarlyZForce, ConvertToInputTopology(Topology, TessellationMode), @@ -149,7 +155,8 @@ namespace Ryujinx.Graphics.Gpu.Shader in FragmentOutputTypes, DualSourceBlendEnable, YNegateEnabled, - originUpperLeft); + originUpperLeft, + halvePrimitiveId); } /// <summary> |
