Skip to content

GraphicsAPI reference

Class ReadbackRequest

Namespace: MicroEngine.Graphics.Devices
Assembly: MicroEngine.Graphics.dll
Guide: The graphics device

An asynchronous read of a render target region, completed by a fence. The data are the pixels of every command list submitted before ReadPixels: rows top to bottom, tightly packed, in the target’s colour format.

C#
public abstract class ReadbackRequest

Inheritance

object ← ReadbackRequest

Derived

CompletedReadback

Constructors

ReadbackRequest(RectI, TextureFormat)

Creates the request.

C#
protected ReadbackRequest(RectI region, TextureFormat format)

Parameters

region RectI

format TextureFormat

Properties

Format

The pixel format of Pixels.

C#
public TextureFormat Format { get; }

Property Value

TextureFormat

IsCompleted

True once the GPU finished the copy (polls the fence; never blocks).

C#
public abstract bool IsCompleted { get; }

Property Value

bool

Pixels

The pixels; InvalidOperationException before IsCompleted.

C#
public ReadOnlySpan<byte> Pixels { get; }

Property Value

ReadOnlySpan<byte>

Region

The region read.

C#
public RectI Region { get; }

Property Value

RectI

Methods

Collect()

Backend: copies the completed data out and releases the staging memory (called once).

C#
protected abstract byte[] Collect()

Returns

byte[]

Wait()

Blocks until the copy finished.

C#
public abstract void Wait()