{"id":"compute.buffer--CreateComputeBufferResource","name":"CreateComputeBufferResource","owner":"yeho","package":"compute.buffer","kind":"function","signature":"external CreateComputeBufferResource(text id, text deviceId, text memoryClass, int byteSize, int alignmentBytes, bool isMutable, int generation, text externalIdentity) returns computeBufferResource","description":"Create compute buffer resource from the supplied values.","context":"Describe compute buffer layouts, ownership, transfers, and validation.","parameters":[{"name":"id","type":"text","description":"Supply id as text."},{"name":"deviceId","type":"text","description":"Supply device id as text."},{"name":"memoryClass","type":"text","description":"Supply memory class as text."},{"name":"byteSize","type":"int","description":"Supply byte size as int."},{"name":"alignmentBytes","type":"int","description":"Supply alignment bytes as int."},{"name":"isMutable","type":"bool","description":"Supply is mutable as bool."},{"name":"generation","type":"int","description":"Supply generation as int."},{"name":"externalIdentity","type":"text","description":"Supply external identity as text."}],"returns":"computeBufferResource","members":[],"tags":["buffer","compute","compute.buffer","cpu","function","source-example","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"packages/compute/buffer/contracts.yh","line":217,"sha256":"4a526796fb83ba031f9fdebfef36dbadc5df2e95f59824d7acec3563ce79c47b"},"status":"source-declared","notes":["Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup."],"examples":[{"id":"usage","title":"Use CreateComputeBufferResource","description":"A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.","code":"using compute.buffer\n\n// Describe compute buffer layouts, ownership, transfers, and validation.\ntext id = \"id\"\ntext deviceId = \"device Id\"\ntext memoryClass = \"memory Class\"\nint byteSize = 4\nint alignmentBytes = 4\nbool isMutable = true\nint generation = 1\ntext externalIdentity = \"external Identity\"\ncomputeBufferResource result = CreateComputeBufferResource(id, deviceId, memoryClass, byteSize, alignmentBytes, isMutable, generation, externalIdentity)\nConsole.Log(\"Inspect result in your debugger\")\n","manifest":"manifestVersion = \"2\"\npackage = \"api.example.compute_buffer__createcomputebufferresource\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n\n[[dependencies]]\npackage = \"compute.buffer\"\nversion = \"0.1.0\"\npath = \"../../../yeho/packages/compute/buffer\"\n","tags":["cpu","source-example"],"verification":"type checked","run":"cpu-oracle","sha256":"ceb4f4cf31fb9e5c346e3434c32b92a298c759ca1b5731c6f2393820f96b2915","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=compute.buffer--CreateComputeBufferResource","json":"https://demonhunterlabs.com/reference/items/compute.buffer--CreateComputeBufferResource.json","markdown":"https://demonhunterlabs.com/reference/text/compute.buffer--CreateComputeBufferResource.md"}
