SetSamplerCommand.cs 748 B

1234567891011121314151617181920212223
  1. using Ryujinx.Graphics.GAL.Multithreading.Model;
  2. using Ryujinx.Graphics.GAL.Multithreading.Resources;
  3. namespace Ryujinx.Graphics.GAL.Multithreading.Commands
  4. {
  5. struct SetSamplerCommand : IGALCommand
  6. {
  7. public CommandType CommandType => CommandType.SetSampler;
  8. private int _index;
  9. private TableRef<ISampler> _sampler;
  10. public void Set(int index, TableRef<ISampler> sampler)
  11. {
  12. _index = index;
  13. _sampler = sampler;
  14. }
  15. public static void Run(ref SetSamplerCommand command, ThreadedRenderer threaded, IRenderer renderer)
  16. {
  17. renderer.Pipeline.SetSampler(command._index, command._sampler.GetAs<ThreadedSampler>(threaded)?.Base);
  18. }
  19. }
  20. }