Improve shader sending method to GAL, use a memory interface instead of reading a fixed array size and sending every time

This commit is contained in:
gdkchan 2018-05-22 22:43:31 -03:00
parent 84996ccd36
commit 79e0070363
12 changed files with 72 additions and 63 deletions

26
Ryushader/Memory.cs Normal file
View file

@ -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();
}
}
}