Class MetalDevice¶
Namespace: Apogee.Graphics.Metal
Assembly: Apogee.Graphics.dll
The Metal implementation of
public sealed class MetalDevice : GraphicsDevice, IDisposable
Inheritance¶
object ← GraphicsDevice ← MetalDevice
Implements¶
Inherited Members¶
GraphicsDevice.Backend, GraphicsDevice.ShaderBackend, GraphicsDevice.Name, GraphicsDevice.Kind, GraphicsDevice.Immediate, GraphicsDevice.Bindless, GraphicsDevice.TimestampPeriod, GraphicsDevice.SupportsTimestamps, GraphicsDevice.MinUniformBufferOffsetAlignment, GraphicsDevice.MaxSamplerAnisotropy, GraphicsDevice.SupportsBc, GraphicsDevice.SupportsAstc, GraphicsDevice.SupportsAnisotropy, GraphicsDevice.SupportsDrawIndirectCount, GraphicsDevice.SupportsSamplerFilterMinMax, GraphicsDevice.ValidationErrorCount, GraphicsDevice.TakeValidationErrors(), GraphicsDevice.DefaultBackend, GraphicsDevice.RequiredWindowOptions(GraphicsBackend?), GraphicsDevice.Create(GraphicsDeviceOptions?), GraphicsDevice.TryCreate(GraphicsDeviceOptions?, out GraphicsDevice?, out string?), GraphicsDevice.EnumerateDevices(GraphicsDeviceOptions?), GraphicsDevice.CreateBuffer(ulong, BufferUsage, MemoryKind, string?), GraphicsDevice.CreateImage(in ImageDescription, string?), GraphicsDevice.CreateSampler(in SamplerDescription, string?), GraphicsDevice.CreateComputePipeline(in ShaderCode, string?), GraphicsDevice.CreateGraphicsPipeline(GraphicsPipelineDescription, string?), GraphicsDevice.CreateSwapchain(bool), GraphicsDevice.CreateFrameLoop(Swapchain?, int, int), GraphicsDevice.WaitIdle(), GraphicsDevice.Dispose(), GraphicsDevice.CreateBuffer(ReadOnlySpan<byte>, BufferUsage, string?), GraphicsDevice.UploadBuffer(GpuBuffer, ReadOnlySpan<byte>, ulong), GraphicsDevice.UploadImage(GpuImage, ReadOnlySpan<byte>, ReadOnlySpan<ImageRegion>, ImageState), GraphicsDevice.ReadBuffer(GpuBuffer, ulong, int), GraphicsDevice.ReadImage(GpuImage, ImageState, uint, uint), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties¶
Backend¶
public override GraphicsBackend Backend { get; }
Property Value¶
Kind¶
public override GpuKind Kind { get; }
Property Value¶
MaxSamplerAnisotropy¶
public override float MaxSamplerAnisotropy { get; }
Property Value¶
MetalBindless¶
The bindless heap as a Metal one: the argument buffer.
public MetalBindlessHeap MetalBindless { get; }
Property Value¶
MinUniformBufferOffsetAlignment¶
Constant buffers are bound at offsets that are a multiple of this on macOS.
public override ulong MinUniformBufferOffsetAlignment { get; }
Property Value¶
Name¶
public override string Name { get; }
Property Value¶
ShaderBackend¶
The kind of shader code this device runs: pass it to
public override ShaderBackend ShaderBackend { get; }
Property Value¶
SupportsAnisotropy¶
public override bool SupportsAnisotropy { get; }
Property Value¶
SupportsAstc¶
ASTC LDR textures can be sampled (mobile and Apple GPUs).
public override bool SupportsAstc { get; }
Property Value¶
SupportsBc¶
BC1-7 textures can be sampled (desktop GPUs); otherwise transcode Basis textures to ASTC or RGBA8.
public override bool SupportsBc { get; }
Property Value¶
SupportsDrawIndirectCount¶
drawIndirectCount). Metal has no such draw; use
public override bool SupportsDrawIndirectCount { get; }
Property Value¶
SupportsSamplerFilterMinMax¶
Samplers can return the minimum or maximum of their footprint (
public override bool SupportsSamplerFilterMinMax { get; }
Property Value¶
SupportsTimestamps¶
The queue writes timestamps (all of graphics and compute can).
public override bool SupportsTimestamps { get; }
Property Value¶
TimestampPeriod¶
Nanoseconds per timestamp tick, for GPU timings.
public override float TimestampPeriod { get; }
Property Value¶
ValidationErrorCount¶
How many warnings and errors the API's validation layer has reported; tests fail on any.
public override int ValidationErrorCount { get; }
Property Value¶
Methods¶
CreateBuffer(ulong, BufferUsage, MemoryKind, string?)¶
public override GpuBuffer CreateBuffer(ulong size, BufferUsage usage, MemoryKind kind = MemoryKind.DeviceLocal, string? name = null)
Parameters¶
size ulong
usage BufferUsage
kind MemoryKind
name string?
Returns¶
CreateComputePipeline(in ShaderCode, string?)¶
public override Pipeline CreateComputePipeline(in ShaderCode shader, string? name = null)
Parameters¶
shader ShaderCode
name string?
Returns¶
CreateFrameLoop(Swapchain?, int, int)¶
The loop that records and submits frames, to swapchain or headless.
public override FrameLoop CreateFrameLoop(Swapchain? swapchain = null, int framesInFlight = 2, int arenaBytes = 4194304)
Parameters¶
swapchain Swapchain?
framesInFlight int
arenaBytes int
Returns¶
CreateGraphicsPipeline(GraphicsPipelineDescription, string?)¶
public override Pipeline CreateGraphicsPipeline(GraphicsPipelineDescription description, string? name = null)
Parameters¶
description GraphicsPipelineDescription
name string?
Returns¶
CreateImage(in ImageDescription, string?)¶
public override GpuImage CreateImage(in ImageDescription description, string? name = null)
Parameters¶
description ImageDescription
name string?
Returns¶
CreateSampler(in SamplerDescription, string?)¶
public override GpuSampler CreateSampler(in SamplerDescription description, string? name = null)
Parameters¶
description SamplerDescription
name string?
Returns¶
CreateSwapchain(bool)¶
A swapchain for the window the device was created for (
public override Swapchain CreateSwapchain(bool vsync = true)
Parameters¶
vsync bool
Returns¶
Dispose()¶
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
TakeValidationErrors()¶
Takes the validation messages reported so far.
public override string[] TakeValidationErrors()
Returns¶
string[]
WaitIdle()¶
public override void WaitIdle()