Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
MslBindingMap.h File Reference

The deterministic Metal argument-table mapping shared by the MSL emitter and the Metal backend. More...

#include <cstdint>
Include dependency graph for MslBindingMap.h:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

constexpr uint32_t donner::gpu::shader::MslBufferIndex (uint32_t binding)
 Metal buffer argument-table index for an RHI buffer binding (uniform or storage). Invalid bindings return the reserved vertex index so callers reject them without overflow.
constexpr uint32_t donner::gpu::shader::MslTextureIndex (uint32_t binding)
 Metal texture argument-table index for an RHI texture binding.
constexpr uint32_t donner::gpu::shader::MslSamplerIndex (uint32_t binding)
 Metal sampler argument-table index for an RHI sampler binding.

Variables

constexpr uint32_t donner::gpu::shader::kMslBufferLengthsIndex = 0
 Reserved Metal buffer index for the fixed table of declared buffer lengths. Populated from every buffer binding in a group, uniform bindings included, and uploaded to each stage of the active encoder whenever the bound group changes. Raw MSL this backend accepts must leave this index free.
constexpr uint32_t donner::gpu::shader::kMslBufferBindingCount = 29
 Number of buffer bindings before the dedicated vertex slot.
constexpr uint32_t donner::gpu::shader::kMslTextureBindingCount = 128
 Number of texture argument slots per stage.
constexpr uint32_t donner::gpu::shader::kMslSamplerBindingCount = 16
 Number of sampler argument slots per stage.
constexpr uint32_t donner::gpu::shader::kMslVertexBufferIndex = 30
 Highest Metal buffer index, reserved for vertex slot zero. Additional vertex slots use lower indices not occupied by vertex-visible resource bindings in the active pipeline.

Detailed Description

The deterministic Metal argument-table mapping shared by the MSL emitter and the Metal backend.

Bind group 0 uses one flat argument table per stage. Slot 0 carries exact declared buffer lengths and buffer binding b uses slot 1 + b. Vertex slot zero uses index 30; additional active vertex slots use unoccupied vertex-stage indices chosen from the pipeline layout. Texture and sampler bindings use their binding numbers directly.

Function Documentation

◆ MslBufferIndex()

uint32_t donner::gpu::shader::MslBufferIndex ( uint32_t binding)
inlineconstexpr

Metal buffer argument-table index for an RHI buffer binding (uniform or storage). Invalid bindings return the reserved vertex index so callers reject them without overflow.

Parameters
bindingRHI binding index within group 0.

◆ MslSamplerIndex()

uint32_t donner::gpu::shader::MslSamplerIndex ( uint32_t binding)
inlineconstexpr

Metal sampler argument-table index for an RHI sampler binding.

Parameters
bindingRHI binding index within group 0.

◆ MslTextureIndex()

uint32_t donner::gpu::shader::MslTextureIndex ( uint32_t binding)
inlineconstexpr

Metal texture argument-table index for an RHI texture binding.

Parameters
bindingRHI binding index within group 0.