Skip to content

GraphicsAPI reference

Struct GraphicsCounters

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

Deterministic counts of the work a device received (Counters): the same calls give the same counts on every backend and every run, so tests can assert draw calls, passes and uploads exactly as a performance budget. Every count is cumulative since the device was created; subtract two readings to measure a span.

C#
public readonly struct GraphicsCounters : IEquatable<GraphicsCounters>

Implements

IEquatable<GraphicsCounters>

Constructors

GraphicsCounters(long, long, long, long, long, long, long, long, long, long, int)

Deterministic counts of the work a device received (Counters): the same calls give the same counts on every backend and every run, so tests can assert draw calls, passes and uploads exactly as a performance budget. Every count is cumulative since the device was created; subtract two readings to measure a span.

C#
public GraphicsCounters(long Submissions = 0, long Passes = 0, long DrawCalls = 0, long PipelineChanges = 0, long TextureBindings = 0, long BufferUpdates = 0, long TextureUpdates = 0, long BytesUploaded = 0, long Presents = 0, long ResourcesCreated = 0, int LiveResources = 0)

Parameters

Submissions long

Command lists submitted.

Passes long

Render passes in the submitted lists.

DrawCalls long

Draw and DrawIndexed commands in the submitted lists.

PipelineChanges long

SetPipeline commands in the submitted lists.

TextureBindings long

SetTexture commands in the submitted lists.

BufferUpdates long

UpdateBuffer commands in the submitted lists.

TextureUpdates long

UpdateTexture commands in the submitted lists.

BytesUploaded long

Bytes carried by the buffer and texture updates.

Presents long

Frames presented (a Present with an acquired surface target).

ResourcesCreated long

Resources the device created (device-owned ones included).

LiveResources int

Resources alive now (created and not disposed or expired).

Properties

BufferUpdates

UpdateBuffer commands in the submitted lists.

C#
public long BufferUpdates { get; init; }

Property Value

long

BytesUploaded

Bytes carried by the buffer and texture updates.

C#
public long BytesUploaded { get; init; }

Property Value

long

DrawCalls

Draw and DrawIndexed commands in the submitted lists.

C#
public long DrawCalls { get; init; }

Property Value

long

LiveResources

Resources alive now (created and not disposed or expired).

C#
public int LiveResources { get; init; }

Property Value

int

Passes

Render passes in the submitted lists.

C#
public long Passes { get; init; }

Property Value

long

PipelineChanges

SetPipeline commands in the submitted lists.

C#
public long PipelineChanges { get; init; }

Property Value

long

Presents

Frames presented (a Present with an acquired surface target).

C#
public long Presents { get; init; }

Property Value

long

ResourcesCreated

Resources the device created (device-owned ones included).

C#
public long ResourcesCreated { get; init; }

Property Value

long

Submissions

Command lists submitted.

C#
public long Submissions { get; init; }

Property Value

long

TextureBindings

SetTexture commands in the submitted lists.

C#
public long TextureBindings { get; init; }

Property Value

long

TextureUpdates

UpdateTexture commands in the submitted lists.

C#
public long TextureUpdates { get; init; }

Property Value

long

Methods

Deconstruct(out long, out long, out long, out long, out long, out long, out long, out long, out long, out long, out int)

C#
public void Deconstruct(out long Submissions, out long Passes, out long DrawCalls, out long PipelineChanges, out long TextureBindings, out long BufferUpdates, out long TextureUpdates, out long BytesUploaded, out long Presents, out long ResourcesCreated, out int LiveResources)

Parameters

Submissions long

Passes long

DrawCalls long

PipelineChanges long

TextureBindings long

BufferUpdates long

TextureUpdates long

BytesUploaded long

Presents long

ResourcesCreated long

LiveResources int

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(GraphicsCounters)

C#
public bool Equals(GraphicsCounters other)

Parameters

other GraphicsCounters

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(GraphicsCounters, GraphicsCounters)

C#
public static bool operator ==(GraphicsCounters left, GraphicsCounters right)

Parameters

left GraphicsCounters

right GraphicsCounters

Returns

bool

operator !=(GraphicsCounters, GraphicsCounters)

C#
public static bool operator !=(GraphicsCounters left, GraphicsCounters right)

Parameters

left GraphicsCounters

right GraphicsCounters

Returns

bool

operator -(GraphicsCounters, GraphicsCounters)

The counts accumulated between two readings (LiveResources is the later reading’s).

C#
public static GraphicsCounters operator -(GraphicsCounters later, GraphicsCounters earlier)

Parameters

later GraphicsCounters

earlier GraphicsCounters

Returns

GraphicsCounters