aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2018-07-19 16:02:51 -0300
committergdkchan <gab.dark.100@gmail.com>2018-07-19 16:02:51 -0300
commit5fe0bc584b21c660e083a9cb37aa0a8be4719f95 (patch)
tree1d8a1e44d379d03a0d967a92475756d05a9e62e2 /Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
parent45bb24dbae7b4fb4118036aa74024605995510fd (diff)
Send data to OpenGL host without client-side copies (#285)
* Directly send host address to buffer data * Cleanup OGLShader * Directly copy vertex and index data too * Revert shader bind "cache" * Address feedback
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
index 0dc56966..f2e5859e 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
@@ -211,28 +211,28 @@ namespace Ryujinx.Graphics.Gal.OpenGL
GL.PrimitiveRestartIndex(Index);
}
- public void CreateVbo(long Key, byte[] Buffer)
+ public void CreateVbo(long Key, int DataSize, IntPtr HostAddress)
{
int Handle = GL.GenBuffer();
- VboCache.AddOrUpdate(Key, Handle, (uint)Buffer.Length);
+ VboCache.AddOrUpdate(Key, Handle, (uint)DataSize);
- IntPtr Length = new IntPtr(Buffer.Length);
+ IntPtr Length = new IntPtr(DataSize);
GL.BindBuffer(BufferTarget.ArrayBuffer, Handle);
- GL.BufferData(BufferTarget.ArrayBuffer, Length, Buffer, BufferUsageHint.StreamDraw);
+ GL.BufferData(BufferTarget.ArrayBuffer, Length, HostAddress, BufferUsageHint.StreamDraw);
}
- public void CreateIbo(long Key, byte[] Buffer)
+ public void CreateIbo(long Key, int DataSize, IntPtr HostAddress)
{
int Handle = GL.GenBuffer();
- IboCache.AddOrUpdate(Key, Handle, (uint)Buffer.Length);
+ IboCache.AddOrUpdate(Key, Handle, (uint)DataSize);
- IntPtr Length = new IntPtr(Buffer.Length);
+ IntPtr Length = new IntPtr(DataSize);
GL.BindBuffer(BufferTarget.ElementArrayBuffer, Handle);
- GL.BufferData(BufferTarget.ElementArrayBuffer, Length, Buffer, BufferUsageHint.StreamDraw);
+ GL.BufferData(BufferTarget.ElementArrayBuffer, Length, HostAddress, BufferUsageHint.StreamDraw);
}
public void SetVertexArray(int Stride, long VboKey, GalVertexAttrib[] Attribs)