opencode/packages/widget/test/fixtures/gpu/raw-bytes-not-an-array-buffer.json
OpenCode Agent 6fefac75b2 test(core): GPU fixtures for the batch's shape and the canvases it stops
raw-bytes-not-an-array-buffer posts valid ops into scene with a Uint8Array for bytes (stops
["scene"]); raw-ops-not-a-list posts a string for ops (stops all). Raw fixtures of the wrong shape
keep their batches, with bytes null when they aren't an ArrayBuffer and ops as posted.
2026-11-23 01:48:42 +00:00

41 lines
1.4 KiB
JSON

{
"name": "raw-bytes-not-an-array-buffer",
"source": "async function main() {\n widget.render(ui.canvas({ key: \"scene\", gpu: true, height: 100 }))\n __host.post({ type: \"gpu\", ops: [[\"context\", 1, \"scene\", \"rgba8unorm\", \"opaque\"], [\"view\", 2, 1, { dimension: \"2d\", baseMipLevel: 0, mipLevelCount: 1, baseArrayLayer: 0, arrayLayerCount: 1 }], [\"pass\", { colorAttachments: [{ view: 2, resolveTarget: null, clearValue: [0, 0, 0, 1], loadOp: \"clear\", storeOp: \"store\" }], depthStencilAttachment: null }], [\"end\"]], bytes: new Uint8Array(8) })\n await widget.frame()\n}",
"canvases": [
{
"key": "scene",
"width": 100,
"height": 100
}
],
"gpu": {
"available": true,
"format": "rgba8unorm"
},
"errors": [
{
"message": "a batch's bytes must be an ArrayBuffer",
"canvases": [
"scene"
]
}
],
"end": "return",
"batches": [
{
"frame": false,
"bytes": null,
"ops": [
["context",1,"scene","rgba8unorm","opaque"],
["view",2,1,{"dimension":"2d","baseMipLevel":0,"mipLevelCount":1,"baseArrayLayer":0,"arrayLayerCount":1}],
["pass",{"colorAttachments":[{"view":2,"resolveTarget":null,"clearValue":[0,0,0,1],"loadOp":"clear","storeOp":"store"}],"depthStencilAttachment":null}],
["end"]
]
},
{
"frame": true,
"bytes": "",
"ops": []
}
]
}