Give short example of WGSL push_constant syntax. (#5393)

This commit is contained in:
Bruce Mitchener 2024-03-16 08:20:21 +07:00 committed by GitHub
parent a63bec8cd6
commit fe91958010
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -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). - 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) - 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) - 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 ### New features

View File

@ -682,7 +682,14 @@ bitflags::bitflags! {
/// Allows the user to call [`RenderPass::set_push_constants`], provide a non-empty array /// 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`]. /// 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<push_constant>`:
///
/// ```rust,ignore
/// struct PushConstants { example: f32, }
/// var<push_constant> c: PushConstants;
/// ```
///
/// In GLSL, this corresponds to `layout(push_constant) uniform Name {..}`.
/// ///
/// Supported platforms: /// Supported platforms:
/// - DX12 /// - DX12