compute.buffer · function ·
CreateComputeBufferResource
Create compute buffer resource from the supplied values.
Describe compute buffer layouts, ownership, transfers, and validation.
external CreateComputeBufferResource(text id, text deviceId, text memoryClass, int byteSize, int alignmentBytes, bool isMutable, int generation, text externalIdentity) returns computeBufferResourceStatus: source-declared
Parameters
text id- Supply id as text.
text deviceId- Supply device id as text.
text memoryClass- Supply memory class as text.
int byteSize- Supply byte size as int.
int alignmentBytes- Supply alignment bytes as int.
bool isMutable- Supply is mutable as bool.
int generation- Supply generation as int.
text externalIdentity- Supply external identity as text.
Use CreateComputeBufferResource
A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.
cpu · source-example · type checked
using compute.buffer
// Describe compute buffer layouts, ownership, transfers, and validation.
text id = "id"
text deviceId = "device Id"
text memoryClass = "memory Class"
int byteSize = 4
int alignmentBytes = 4
bool isMutable = true
int generation = 1
text externalIdentity = "external Identity"
computeBufferResource result = CreateComputeBufferResource(id, deviceId, memoryClass, byteSize, alignmentBytes, isMutable, generation, externalIdentity)
Console.Log("Inspect result in your debugger")
project.mech
manifestVersion = "2"
package = "api.example.compute_buffer__createcomputebufferresource"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
[app]
kind = "headless"
[[dependencies]]
package = "compute.buffer"
version = "0.1.0"
path = "../../../yeho/packages/compute/buffer"
Notes and source
Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.
yeho/packages/compute/buffer/contracts.yh:217