mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-20 12:41:40 +00:00
b29950dbd6
Also fix IShopServiceAccessSystemInterface being in the wrong namespace.
37 lines
No EOL
1.1 KiB
C#
37 lines
No EOL
1.1 KiB
C#
using Ryujinx.Common;
|
|
using System;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
|
{
|
|
struct GbpBuffer
|
|
{
|
|
public GraphicBufferHeader Header { get; private set; }
|
|
public NvGraphicBuffer Buffer { get; private set; }
|
|
|
|
public int Size => Marshal.SizeOf<NvGraphicBuffer>() + Marshal.SizeOf<GraphicBufferHeader>();
|
|
|
|
public GbpBuffer(BinaryReader reader)
|
|
{
|
|
Header = reader.ReadStruct<GraphicBufferHeader>();
|
|
|
|
// ignore fds
|
|
// TODO: check if that is used in official implementation
|
|
reader.BaseStream.Position += Header.FdsCount * 4;
|
|
|
|
if (Header.IntsCount != 0x51)
|
|
{
|
|
throw new NotImplementedException($"Unexpected Graphic Buffer ints count (expected 0x51, found 0x{Header.IntsCount:x}");
|
|
}
|
|
|
|
Buffer = reader.ReadStruct<NvGraphicBuffer>();
|
|
}
|
|
|
|
public void Write(BinaryWriter writer)
|
|
{
|
|
writer.WriteStruct(Header);
|
|
writer.WriteStruct(Buffer);
|
|
}
|
|
}
|
|
} |