chore: checkpoint web Blender migration source, tools and docs
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer,
web workflow engine and protocol, tooling, docs and task records.
Large generated evidence, user-testing archives, build snapshots and
imported test assets remain untracked.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-10 11:18:01 +08:00
parent 122142c26c
commit f3e21c6b98
6887 changed files with 257154 additions and 12294 deletions

View File

@@ -0,0 +1,36 @@
"""Web Blender: native GPU compute with a read/write storage buffer.
Run from the Web Text Editor on a WebGPU-capable, isolated browser page.
The kernel executes on the GPU. This template is a usage example, not an
acceptance test and does not modify the current scene.
"""
import array
import gpu
# Group 0 binding indices match the order of `buffers`.
source = """
#version 450
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
layout(set = 0, binding = 0, std430) buffer Values {
float data[];
};
void main() {
uint index = gl_GlobalInvocationID.x;
if (index < uint(data.length())) {
data[index] = 2.0 * data[index] + 1.0;
}
}
"""
values = array.array("f", [0.0, 1.0, 2.0, 3.0])
outputs = gpu.compute.dispatch_glsl(
source,
buffers=[values],
workgroups=(1, 1, 1),
binding_types=["storage"],
timeout_ms=30000,
)
result = array.array("f")
result.frombytes(outputs[0])
print("GPU storage-buffer output:", result.tolist())