SetImageCommand.cs
1 using Ryujinx.Graphics.GAL.Multithreading.Model; 2 using Ryujinx.Graphics.GAL.Multithreading.Resources; 3 using Ryujinx.Graphics.Shader; 4 5 namespace Ryujinx.Graphics.GAL.Multithreading.Commands 6 { 7 struct SetImageCommand : IGALCommand, IGALCommand<SetImageCommand> 8 { 9 public readonly CommandType CommandType => CommandType.SetImage; 10 private ShaderStage _stage; 11 private int _binding; 12 private TableRef<ITexture> _texture; 13 14 public void Set(ShaderStage stage, int binding, TableRef<ITexture> texture) 15 { 16 _stage = stage; 17 _binding = binding; 18 _texture = texture; 19 } 20 21 public static void Run(ref SetImageCommand command, ThreadedRenderer threaded, IRenderer renderer) 22 { 23 renderer.Pipeline.SetImage(command._stage, command._binding, command._texture.GetAs<ThreadedTexture>(threaded)?.Base); 24 } 25 } 26 }