aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Shader/CachedShaderProgram.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2022-12-04 17:18:40 +0000
committerGitHub <noreply@github.com>2022-12-04 18:18:40 +0100
commit4965681e069eeedc5272030b131c2a45e6131e61 (patch)
tree050a6596728c6a040c5c17fd21339c913b97ee8f /Ryujinx.Graphics.Gpu/Shader/CachedShaderProgram.cs
parent3868a0020611491e30db19e5b27d33a7559c7071 (diff)
GPU: Swap bindings array instead of copying (#4003)1.1.418
* GPU: Swap bindings array instead of copying Reduces work on UpdateShaderState. Now the cost is a few reference moves for arrays, rather than copying data. Downside: bindings arrays are no longer readonly. * Micro optimisation * Add missing docs * Address Feedback
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Shader/CachedShaderProgram.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Shader/CachedShaderProgram.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Shader/CachedShaderProgram.cs b/Ryujinx.Graphics.Gpu/Shader/CachedShaderProgram.cs
index 69fcb278..ff9c39a1 100644
--- a/Ryujinx.Graphics.Gpu/Shader/CachedShaderProgram.cs
+++ b/Ryujinx.Graphics.Gpu/Shader/CachedShaderProgram.cs
@@ -25,6 +25,11 @@ namespace Ryujinx.Graphics.Gpu.Shader
public CachedShaderStage[] Shaders { get; }
/// <summary>
+ /// Cached shader bindings, ready for placing into the bindings manager.
+ /// </summary>
+ public CachedShaderBindings Bindings { get; }
+
+ /// <summary>
/// Creates a new instance of the shader bundle.
/// </summary>
/// <param name="hostProgram">Host program with all the shader stages</param>
@@ -37,6 +42,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
Shaders = shaders;
SpecializationState.Prepare(shaders);
+ Bindings = new CachedShaderBindings(shaders.Length == 1, shaders);
}
/// <summary>