WGSL language feature for reinterpreting data in variables. The feature allows developers to divide a single uniform, storage, or workgroup variable into multiple logical variables. It also allows the type of the data in the variable to be interpreted as multiple types within the program.
This features adds a new opaque type for use with storage and uniform buffers and workgroup variables. It allows the data in those variables to be reinterpreted as other types. This is useful for both type-punning data and logically sub-dividing a variable into multiple parts. For ease-of-use and safety, the opaque type can only be operated on by new built-in functions. The reinterpretation can only occur on the opaque type. This maintains flexibility, but reduces implementation complexity.
Samples: https://github.com/webgpu/webgpu-samples/pull/568
Explainers: https://github.com/gpuweb/gpuweb/blob/main/proposals/buffer-view.md https://github.com/webgpu/webgpu-samples/pull/568