diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-05-22 22:43:31 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-05-22 22:43:31 -0300 |
| commit | 79e007036383b11cd53c2563fbb7f139a02c90ec (patch) | |
| tree | c7ddfc097282b98afd16f08cc5042636f9283224 /Ryushader/Memory.cs | |
| parent | 84996ccd36a5fa13892c1f02acb1c79031c35aa5 (diff) | |
Improve shader sending method to GAL, use a memory interface instead of reading a fixed array size and sending every time
Diffstat (limited to 'Ryushader/Memory.cs')
| -rw-r--r-- | Ryushader/Memory.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Ryushader/Memory.cs b/Ryushader/Memory.cs new file mode 100644 index 00000000..ae336e72 --- /dev/null +++ b/Ryushader/Memory.cs @@ -0,0 +1,26 @@ +using Ryujinx.Graphics.Gal; +using System.IO; + +namespace Ryushader +{ + class Memory : IGalMemory + { + private Stream BaseStream; + + private BinaryReader Reader; + + public Memory(Stream BaseStream) + { + this.BaseStream = BaseStream; + + Reader = new BinaryReader(BaseStream); + } + + public int ReadInt32(long Position) + { + BaseStream.Seek(Position, SeekOrigin.Begin); + + return Reader.ReadInt32(); + } + } +} |
