Skip to content

GraphicsAPI reference

Class GraphicsContract

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

The graphics device contract this assembly implements. The contract text is the XML documentation of the types in MicroEngine.Graphics.Devices; every rule it states is checked by the device conformance suite. A change to a rule or to the shape of a type is a contract revision: it raises Version and records its evidence.

C#
public static class GraphicsContract

Inheritance

object ← GraphicsContract

Remarks

Written rules (each is repeated on the member it governs):

  • Colours are premultiplied ([ColorF](/docs/api/microengine.colorf/) channels already multiplied by alpha) and stored as written: the device applies no transfer function to Rgba8Unorm data.
  • Built-in vertices ([Vertex2D](/docs/api/microengine.graphics.devices.vertex2d/)) are target pixels relative to the viewport origin, y down; pixel (x, y) is the square [x, x + 1) × [y, y + 1) with its centre at (x + 0.5, y + 0.5).
  • Coverage: a triangle covers exactly the pixels whose centre lies inside it; a centre on an edge belongs to the triangle when the edge is a top or a left edge (the top-left rule of Direct3D, Vulkan, Metal and WebGPU).
  • Clears ([Clear](/docs/api/microengine.graphics.devices.loadop/)) ignore viewport and scissor; scissor is absolute in target pixels.
  • Bindings, pipeline, viewport and scissor are pass-scoped; uniform data persist for the rest of the list.
  • Command lists execute in [Submit](/docs/api/microengine.graphics.devices.igraphicsdevice/#MicroEngine_Graphics_Devices_IGraphicsDevice_Submit_MicroEngine_Graphics_Devices_CommandList_) order and, within a list, in recording order (updates included); [ReadPixels](/docs/api/microengine.graphics.devices.igraphicsdevice/#MicroEngine_Graphics_Devices_IGraphicsDevice_ReadPixels_MicroEngine_Graphics_Devices_RenderTarget_MicroEngine_Graphics_Devices_RectI_) observes every list submitted before it.
  • Surface targets expire at [Present](/docs/api/microengine.graphics.devices.igraphicsdevice/#MicroEngine_Graphics_Devices_IGraphicsDevice_Present) and cannot be sampled or read back.
  • Numeric conventions: System.Numerics right-handed matrices uploaded as-is, mul(M, v) in HLSL, counter-clockwise front faces, depth 0 (near) .. 1 (far), NDC y up, row 0 of a target at the top.

Fields

Version

The contract version: 1 (frozen; the built-in pipeline is Textured).

C#
public const int Version = 1

Field Value

int