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)); } }
public Window(OpenGLRenderer renderer) { _renderer = renderer; _stagingTextures = new int[TextureCount]; }