sectionVersion top-level constant

int const sectionVersion

The shape of the document this writer produces.

The reader is WebGpuLoadedShaderLibrary.sectionVersion, and the two are held equal by test/wgsl_section_test.dart — the constant cannot simply be imported from there for the reason this library's header gives.

Written out, although encodeWebGpuSection writes no version at all. That codec serves the engine's own table, which is generated beside the reader it feeds and can never be older than it. A bundle can: it is a file on disk that outlives the build that made it. A document that says nothing is read as whatever the reader's own version is, so the day the shape changes, a bundle packed today would be read as one packed tomorrow — the gate would pass and the reflection would be misread. Saying the number is what makes the refusal possible.

Implementation

const int sectionVersion = 1;