/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / TextureArray / TextureArraySetSamplersCommand.cs
TextureArraySetSamplersCommand.cs
1 using Ryujinx.Graphics.GAL.Multithreading.Model; 2 using Ryujinx.Graphics.GAL.Multithreading.Resources; 3 using System.Linq; 4 5 namespace Ryujinx.Graphics.GAL.Multithreading.Commands.TextureArray 6 { 7 struct TextureArraySetSamplersCommand : IGALCommand, IGALCommand<TextureArraySetSamplersCommand> 8 { 9 public readonly CommandType CommandType => CommandType.TextureArraySetSamplers; 10 private TableRef<ThreadedTextureArray> _textureArray; 11 private int _index; 12 private TableRef<ISampler[]> _samplers; 13 14 public void Set(TableRef<ThreadedTextureArray> textureArray, int index, TableRef<ISampler[]> samplers) 15 { 16 _textureArray = textureArray; 17 _index = index; 18 _samplers = samplers; 19 } 20 21 public static void Run(ref TextureArraySetSamplersCommand command, ThreadedRenderer threaded, IRenderer renderer) 22 { 23 ThreadedTextureArray textureArray = command._textureArray.Get(threaded); 24 textureArray.Base.SetSamplers(command._index, command._samplers.Get(threaded).Select(sampler => ((ThreadedSampler)sampler)?.Base).ToArray()); 25 } 26 } 27 }