예제 #1
0
파일: Buffer.cs 프로젝트: Ryujinx/Ryujinx
        public static unsafe ReadOnlySpan <byte> GetData(OpenGLRenderer renderer, BufferHandle buffer, int offset, int size)
        {
            if (HwCapabilities.UsePersistentBufferForFlush)
            {
                return(renderer.PersistentBuffers.Default.GetBufferData(buffer, offset, size));
            }
            else
            {
                IntPtr target = renderer.PersistentBuffers.Default.GetHostArray(size);

                GL.BindBuffer(BufferTarget.CopyReadBuffer, buffer.ToInt32());

                GL.GetBufferSubData(BufferTarget.CopyReadBuffer, (IntPtr)offset, size, target);

                return(new ReadOnlySpan <byte>(target.ToPointer(), size));
            }
        }
예제 #2
0
 public Window(OpenGLRenderer renderer)
 {
     _renderer        = renderer;
     _stagingTextures = new int[TextureCount];
 }