← Back to release summary

WebGPU: `buffer_view` feature

Category
Graphics
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

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.

Motivation

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.

Standards & signals

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

View on chromestatus.com