GPU: Swap bindings array instead of copying (#4003)
* 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
This commit is contained in:
parent
3868a00206
commit
4965681e06
7 changed files with 162 additions and 252 deletions
|
@ -24,6 +24,11 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
|||
/// </summary>
|
||||
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>
|
||||
|
@ -37,6 +42,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
|||
Shaders = shaders;
|
||||
|
||||
SpecializationState.Prepare(shaders);
|
||||
Bindings = new CachedShaderBindings(shaders.Length == 1, shaders);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue