diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2022-06-17 17:09:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-17 13:09:14 -0300 |
| commit | 99ffc061d30c92f224c6b839290e181b6179893d (patch) | |
| tree | f25bd915077d9ce1844c4efcb38e59c96ee5f70e /Ryujinx.Graphics.Gpu/Engine/Compute | |
| parent | d987cacfb720f2f4bc18958fc26ac0893903c090 (diff) | |
Optimize Texture Binding and Shader Specialization Checks (#3399)
* Changes 1
* Changes 2
* Better ModifiedSequence handling
This should handle PreciseEvents properly, and simplifies a few things.
* Minor changes, remove debug log
* Handle stage.Info being null
Hopefully fixes Catherine crash
* Fix shader specialization fast texture lookup
* Fix some things.
* Address Feedback Part 1
* Make method static.
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Compute')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs b/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs index 87c14da8..a1a9b481 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs @@ -188,6 +188,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Compute _channel.BufferManager.SetComputeStorageBufferBindings(info.SBuffers); _channel.BufferManager.SetComputeUniformBufferBindings(info.CBuffers); + int maxTextureBinding = -1; + int maxImageBinding = -1; + TextureBindingInfo[] textureBindings = _channel.TextureManager.RentComputeTextureBindings(info.Textures.Count); for (int index = 0; index < info.Textures.Count; index++) @@ -202,6 +205,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Compute descriptor.CbufSlot, descriptor.HandleIndex, descriptor.Flags); + + if (descriptor.Binding > maxTextureBinding) + { + maxTextureBinding = descriptor.Binding; + } } TextureBindingInfo[] imageBindings = _channel.TextureManager.RentComputeImageBindings(info.Images.Count); @@ -220,9 +228,18 @@ namespace Ryujinx.Graphics.Gpu.Engine.Compute descriptor.CbufSlot, descriptor.HandleIndex, descriptor.Flags); + + if (descriptor.Binding > maxImageBinding) + { + maxImageBinding = descriptor.Binding; + } } - _channel.TextureManager.CommitComputeBindings(); + _channel.TextureManager.SetComputeMaxBindings(maxTextureBinding, maxImageBinding); + + // Should never return false for mismatching spec state, since the shader was fetched above. + _channel.TextureManager.CommitComputeBindings(cs.SpecializationState); + _channel.BufferManager.CommitComputeBindings(); _context.Renderer.Pipeline.DispatchCompute(qmd.CtaRasterWidth, qmd.CtaRasterHeight, qmd.CtaRasterDepth); |
