diff --git a/CHANGELOG.md b/CHANGELOG.md index c5c606f47..44c229868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ By @cwfitzgerald in [#5325](https://github.com/gfx-rs/wgpu/pull/5325). - Document Wayland specific behavior related to `SurfaceTexture::present`. By @i509VCB in [#5092](https://github.com/gfx-rs/wgpu/pull/5092). - Add mention of primitive restart in the description of `PrimitiveState::strip_index_format`. By @cpsdqs in [#5350](https://github.com/gfx-rs/wgpu/pull/5350) - Document precise behaviour of `SourceLocation`. By @stefnotch in [#5386](https://github.com/gfx-rs/wgpu/pull/5386) +- Give short example of WGSL `push_constant` syntax. By @waywardmonkeys in [#5393](https://github.com/gfx-rs/wgpu/pull/5393) ### New features diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 347aad76f..79320932e 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -682,7 +682,14 @@ bitflags::bitflags! { /// Allows the user to call [`RenderPass::set_push_constants`], provide a non-empty array /// to [`PipelineLayoutDescriptor`], and provide a non-zero limit to [`Limits::max_push_constant_size`]. /// - /// A block of push constants can be declared with `layout(push_constant) uniform Name {..}` in shaders. + /// A block of push constants can be declared in WGSL with `var`: + /// + /// ```rust,ignore + /// struct PushConstants { example: f32, } + /// var c: PushConstants; + /// ``` + /// + /// In GLSL, this corresponds to `layout(push_constant) uniform Name {..}`. /// /// Supported platforms: /// - DX12