Implement clear buffer (fast path) (#1902)
* Implement clear buffer (fast path) * Remove blank line
This commit is contained in:
parent
68f6b79fd3
commit
df820a72de
8 changed files with 125 additions and 5 deletions
|
@ -6,6 +6,27 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
{
|
||||
static class Buffer
|
||||
{
|
||||
public static void Clear(BufferHandle destination, int offset, int size, uint value)
|
||||
{
|
||||
GL.BindBuffer(BufferTarget.CopyWriteBuffer, destination.ToInt32());
|
||||
|
||||
unsafe
|
||||
{
|
||||
uint* valueArr = stackalloc uint[1];
|
||||
|
||||
valueArr[0] = value;
|
||||
|
||||
GL.ClearBufferSubData(
|
||||
BufferTarget.CopyWriteBuffer,
|
||||
PixelInternalFormat.Rgba8ui,
|
||||
(IntPtr)offset,
|
||||
(IntPtr)size,
|
||||
PixelFormat.RgbaInteger,
|
||||
PixelType.UnsignedByte,
|
||||
(IntPtr)valueArr);
|
||||
}
|
||||
}
|
||||
|
||||
public static BufferHandle Create()
|
||||
{
|
||||
return Handle.FromInt32<BufferHandle>(GL.GenBuffer());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue