aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Renderer.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-05-23 06:46:09 -0300
committerGitHub <noreply@github.com>2020-05-23 11:46:09 +0200
commit5011640b3086b86b0f0b39b60fdb2aa946d4f5c8 (patch)
tree1bd60b7714886dfe282ca1e52cfa6fca97912cdf /Ryujinx.Graphics.OpenGL/Renderer.cs
parentcc8dbdd3fb58a02e1c3fc3b9d0b1c35bc7b9d00f (diff)
Spanify Graphics Abstraction Layer (#1226)
* Spanify Graphics Abstraction Layer * Be explicit about BufferHandle size
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Renderer.cs')
-rw-r--r--Ryujinx.Graphics.OpenGL/Renderer.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Renderer.cs b/Ryujinx.Graphics.OpenGL/Renderer.cs
index b3ae8c33..15b223f5 100644
--- a/Ryujinx.Graphics.OpenGL/Renderer.cs
+++ b/Ryujinx.Graphics.OpenGL/Renderer.cs
@@ -1,6 +1,7 @@
using OpenTK.Graphics.OpenGL;
using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL;
+using Ryujinx.Graphics.OpenGL.Image;
using Ryujinx.Graphics.OpenGL.Queries;
using Ryujinx.Graphics.Shader;
using System;
@@ -38,9 +39,9 @@ namespace Ryujinx.Graphics.OpenGL
return new Shader(shader);
}
- public IBuffer CreateBuffer(int size)
+ public BufferHandle CreateBuffer(int size)
{
- return new Buffer(size);
+ return Buffer.Create(size);
}
public IProgram CreateProgram(IShader[] shaders)
@@ -58,6 +59,16 @@ namespace Ryujinx.Graphics.OpenGL
return info.Target == Target.TextureBuffer ? new TextureBuffer(info) : new TextureStorage(this, info).CreateDefaultView();
}
+ public void DeleteBuffer(BufferHandle buffer)
+ {
+ Buffer.Delete(buffer);
+ }
+
+ public byte[] GetBufferData(BufferHandle buffer, int offset, int size)
+ {
+ return Buffer.GetData(buffer, offset, size);
+ }
+
public Capabilities GetCapabilities()
{
return new Capabilities(
@@ -68,6 +79,11 @@ namespace Ryujinx.Graphics.OpenGL
HwCapabilities.MaxSupportedAnisotropy);
}
+ public void SetBufferData(BufferHandle buffer, int offset, ReadOnlySpan<byte> data)
+ {
+ Buffer.SetData(buffer, offset, data);
+ }
+
public void UpdateCounters()
{
_counters.Update();