aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-05-14 11:47:16 -0300
committerGitHub <noreply@github.com>2024-05-14 16:47:16 +0200
commit3a3b51893ee272af49d762387da5b27743786d56 (patch)
treee37f41f9a6cd65f8c9f53359b378740b6fbe00af /src/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs
parent44dbab3848c8831d27e50f7252d759a2494ad556 (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/GpuAccessor.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs b/src/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs
index 04949690..1be75f24 100644
--- a/src/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs
+++ b/src/Ryujinx.Graphics.Gpu/Shader/GpuAccessor.cs
@@ -17,6 +17,8 @@ namespace Ryujinx.Graphics.Gpu.Shader
private readonly int _stageIndex;
private readonly bool _compute;
private readonly bool _isVulkan;
+ private readonly bool _hasGeometryShader;
+ private readonly bool _supportsQuads;
/// <summary>
/// Creates a new instance of the GPU state accessor for graphics shader translation.
@@ -25,12 +27,20 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <param name="channel">GPU channel</param>
/// <param name="state">Current GPU state</param>
/// <param name="stageIndex">Graphics shader stage index (0 = Vertex, 4 = Fragment)</param>
- public GpuAccessor(GpuContext context, GpuChannel channel, GpuAccessorState state, int stageIndex) : base(context, state.ResourceCounts, stageIndex)
+ /// <param name="hasGeometryShader">Indicates if a geometry shader is present</param>
+ public GpuAccessor(
+ GpuContext context,
+ GpuChannel channel,
+ GpuAccessorState state,
+ int stageIndex,
+ bool hasGeometryShader) : base(context, state.ResourceCounts, stageIndex)
{
- _isVulkan = context.Capabilities.Api == TargetApi.Vulkan;
_channel = channel;
_state = state;
_stageIndex = stageIndex;
+ _isVulkan = context.Capabilities.Api == TargetApi.Vulkan;
+ _hasGeometryShader = hasGeometryShader;
+ _supportsQuads = context.Capabilities.SupportsQuads;
if (stageIndex == (int)ShaderStage.Geometry - 1)
{
@@ -105,7 +115,11 @@ namespace Ryujinx.Graphics.Gpu.Shader
/// <inheritdoc/>
public GpuGraphicsState QueryGraphicsState()
{
- return _state.GraphicsState.CreateShaderGraphicsState(!_isVulkan, _isVulkan || _state.GraphicsState.YNegateEnabled);
+ return _state.GraphicsState.CreateShaderGraphicsState(
+ !_isVulkan,
+ _supportsQuads,
+ _hasGeometryShader,
+ _isVulkan || _state.GraphicsState.YNegateEnabled);
}
/// <inheritdoc/>