Skip to content

Class MetalBindlessHeap

Namespace: Apogee.Graphics.Metal
Assembly: Apogee.Graphics.dll

The bindless textures, samplers and storage images as one Metal argument buffer, buffer 1 of every shader that reads them (see ParameterBlock<BindlessResources> in common.slang). In an argument buffer of tier 2 each resource of an array takes one 8-byte slot and a struct's members follow one another, so the buffer is the runs of in the order the shader block declares them: the 16 384 2D textures, the 256 samplers, then the cube, 2D-array, 3D and unsigned-integer texture arrays (16 384 each) and the 256 storage images. A slot holds the resource's GPU resource id. Metal has no aliasing: on Vulkan all the sampled arrays are one descriptor binding, here each is a run of its own, so a sampled texture's id is written into the same index of every sampled run and the shader reads it through the array of its type. The textures and samplers are made resident through the device's residency set.

public sealed class MetalBindlessHeap : BindlessHeap, IDisposable

Inheritance

object ← BindlessHeap ← MetalBindlessHeap

Implements

IDisposable

Inherited Members

BindlessHeap.MaxSampledImages, BindlessHeap.MaxSamplers, BindlessHeap.MaxStorageImages, BindlessHeap.PushConstantBytes, BindlessHeap.AddSampledImage(GpuImage), BindlessHeap.AddSampledImage(ImageView), BindlessHeap.RemoveSampledImage(uint), BindlessHeap.AddSampler(GpuSampler), BindlessHeap.RemoveSampler(uint), BindlessHeap.AddStorageImage(ImageView), BindlessHeap.RemoveStorageImage(uint), BindlessHeap.SampledImageCount, BindlessHeap.Dispose(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Properties

ArgumentBufferBytes

The size of the argument buffer in bytes.

public static ulong ArgumentBufferBytes { get; }

Property Value

ulong

Arguments

The argument buffer to bind at index 1.

public MetalBuffer Arguments { get; }

Property Value

MetalBuffer

Members

The members of BindlessResources in common.slang, in declaration order: the runs of the argument buffer (a test compares them with what Slang writes for Metal).

public static IReadOnlyList<string> Members { get; }

Property Value

IReadOnlyList<string>

SampledImageCount

public override int SampledImageCount { get; }

Property Value

int

Methods

AddSampledImage(ImageView)

public override uint AddSampledImage(ImageView view)

Parameters

view ImageView

Returns

uint

AddSampler(GpuSampler)

public override uint AddSampler(GpuSampler sampler)

Parameters

sampler GpuSampler

Returns

uint

AddStorageImage(ImageView)

public override uint AddStorageImage(ImageView view)

Parameters

view ImageView

Returns

uint

CountOf(string)

The number of 8-byte slots in a member's run.

public static uint CountOf(string member)

Parameters

member string

Returns

uint

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public override void Dispose()

OffsetOf(string)

Where a member's run starts in the argument buffer, in bytes.

public static ulong OffsetOf(string member)

Parameters

member string

Returns

ulong

RemoveSampledImage(uint)

public override void RemoveSampledImage(uint index)

Parameters

index uint

RemoveSampler(uint)

public override void RemoveSampler(uint index)

Parameters

index uint

RemoveStorageImage(uint)

public override void RemoveStorageImage(uint index)

Parameters

index uint