Files
workinf_Blender_Wasm/docs/tasks/WBV2-P1424-001-compute-ssbo/CS08.md
mes123456 f3e21c6b98
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
chore: checkpoint web Blender migration source, tools and docs
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>
2026-11-10 11:18:01 +08:00

56 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CS08:storage texture/image 与跨后端同步
- queueTask: WBV2-P1424-001
- parentTask: WBV2-P1424-000
- packageStatus: planned
- dependsOn: CS02, CS03, CS07
- validation: NOT_RUN;acceptance: NOT_CLAIMED
## 业务与交付
原生 compute shader 采样/写图像 → native Texture → 后续 shader 或 framebuffer 消费
同一 compute broker 支持 native buffer 与 texture 资源,具备明确格式表、所有权和上传/回读路径。
## 最小输入与源码依据
- `blender-5.2.0/source/blender/gpu/webgl/webgl_texture.cc`
- `blender-5.2.0/source/blender/gpu/webgl/webgl_texture.hh`
- `blender-5.2.0/source/blender/gpu/webgl/webgl_shader.cc`
- `blender-5.2.0/source/blender/gpu/webgl/webgl_backend.cc`
- `web/protocol/gpu-compute.ts`
- `web/app/src/engine-client/gpu-compute-host.ts`
- `web/app/src/workers/gpu-compute.worker.ts`
- 当前 ComputeJob 只有 buffer 契约;webgl_shader.cc 显式拒绝 compute image/sampler。
- compositor result 的消费依赖 TEXTURE_UPDATE、TEXTURE_FETCH 和 SHADER_IMAGE_ACCESS barrier。
## 实现步骤
1. 扩展现有协议的 typed texture/sampler/view 资源,保留 buffer 兼容;映射原生 format、dimension、mip、layer、读写资格与 owner generation。
2. 建立源纹理内容到 WebGPU、image write 到原生/WebGL 纹理的真实传输;处理行距、紧凑行拷贝、整型/浮点格式、mip/layer/子区域及纹理视图。
3. 复用原生 shader declaration 生成 sampled texture/storage texture/sampler binding,按具体设备 format 能力选择合法访问;不把 image 原子伪装成 buffer 原子。
4. 落实 CS01 留下的 texture/image/framebuffer 屏障和反馈环边界,记录 CPU staging 为实际同步成本;失败前不替换原生目标。
5. 2D 首条业务落地后逐个接入真实 3D/array/mip caller;剩余维度/格式不能从完成范围中消失。
## 失败边界
不能声称 WebGLTexture 与 GPUTexture 可直接共享;每条资源转换必须有实际复制或合法共享机制。
发生阻塞时记录具体业务、原生函数/create-info、producer/consumer 和下一修复动作;保留既有产物,继续无此依赖的实现卡,不用缺失证据作为实现阻塞。
## 延后的用户场景(当前不执行)
- 非整行对齐尺寸、子区域/mip/layer
- 采样输入→storage image 输出→显示
- 整数/浮点格式与不支持格式
- device loss 无半成品纹理
没有在本次拆解中创建或运行测试 fixture。原生 shader、现有模板和真实业务数据是实现输入;需要新增用户使用 fixture 时在全项目实现完成后安排。
## 交接
每次报告填写:实际 workflow/route、源码函数与修改、仍未实现接口、产物元数据(仅生成时)、失败/no-mutation 策略、implementation 状态、validation=NOT_RUN、acceptance=NOT_CLAIMED、下一实现动作。记录 unitCount/verifiedUnits/unverifiedUnits/sourceTreeSha256 的来源;未绑定/未验证不增记覆盖。
执行约束:本卡属于 WBV2-P1424-001 / parent WBV2-P1424-000,nextTask=null 保持不变。全部功能实现前不执行测试、回归、冒烟、浏览器验收、类型/语法/上下文检查或证据审计。仅为产物生成进行必要增量编译。源码检索使用 tools/web/search-wbv2-batch-source.mjs 的精确 --source/--unit;GLSL fixture 只读取本卡列出的原文件。不加载完整专项规划、历史日志或源码 inventory。JS 仅承担浏览器 API/传输;几何算法仍使用 OCCT 出口,Three.js 仅显示。