CF_ShaderWgslSplit¶
Category: graphics
GitHub: cute_shader_bytecode.h
A storage image a shader both loads and stores, split in two for WebGPU.
| Struct Members | Description |
|---|---|
const char* name |
The image's name as declared. |
int set |
The CF descriptor set, equal to the WGSL group. |
int store_binding |
The WGSL binding of the write-only storage texture. |
int load_binding |
The WGSL binding of the texture_2d load side. |
Remarks¶
WebGPU only allows read-write storage access for r32 formats, and forbids binding one texture as both a
writable storage texture and a sampled texture in one dispatch. A shader that loads and stores an image of
any other format stores through a write-only storage texture at store_binding, and loads through a
texture_2d at load_binding. Bind a copy of the image, taken before the dispatch, as the load side.