msl

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: GPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package msl emits Metal Shading Language source from the compute IR. It is a printer: every name is synthesized from an IR index, every operator expression is parenthesized, and no Go is interpreted. The Metal runtime compiler compiles the output.

Index

Constants

View Source
const GroupWorkgroup = 128

GroupWorkgroup is a group entry's threadgroup width, the unit the Metal backend widens a group row in (GroupThreads).

Variables

This section is empty.

Functions

This section is empty.

Types

type EntryPoint

type EntryPoint struct {
	Name            string
	Buffers         []compile.BufferBinding
	ParamsBinding   int
	DispatchBinding int
	Workgroup       [2]int
	BufferLengths   bool // extra binding after Dispatch, word counts by buffer index
}

EntryPoint describes one emitted entry point: its function name in the source, the buffer bindings in order, the binding of the params struct (-1 when the entry takes none) and of the dispatch record, and the workgroup size the host dispatches with.

type Output

type Output struct {
	Source  string
	Entries []EntryPoint
}

Output is the emitted source and its entry points.

func Emit

func Emit(m *compile.Module) (*Output, error)

Emit prints the module as one MSL source file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL