Skip to content

Commit

Permalink
document push constant stages
Browse files Browse the repository at this point in the history
  • Loading branch information
ScanMountGoat committed Dec 8, 2024
1 parent b9e74c9 commit d0531df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## unreleased
### Added
* Added option to write options for performing naga shader validation.
* Added `emit_to_stderr` and `emit_to_stderr_with_path` methods to `CreateModuleError` for printing colored and formatted shader errors.
* Added `emit_to_stderr` and `emit_to_stderr_with_path` methods to `CreateModuleError` for printing colored and formatted shader errors.
* Added PUSH_CONSTANT_STAGES constant to generated code.

### Changed
* Changed `create_shader_module` and `create_shader_module_embedded` to return naga parse errors instead of panic.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ WGPU will still validate the size of the buffer binding at runtime.
- Vertex attributes using floating point types in WGSL like `vec2<f32>` are assumed to use float inputs instead of normalized attributes like unorm or snorm integers.
- All textures are assumed to be filterable and all samplers are assumed to be filtering. This may lead to compatibility issues. This can usually be resolved by requesting the native only feature TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES.
- It's possible to achieve slightly better performance than the generated code in some cases like avoiding redundant bind group bindings. This should be addressed by using some handwritten code where appropriate.
- Pipelines only define a single push constant range shared by all stages for simplicity. Set the data using a single call with offset 0 and the appropriate used stages like `wgpu::ShaderStages::VERTEX_FRAGMENT`.
- Pipelines only define a single push constant range for simplicity. Set the data using a single call with offset 0 and the accessed stages in the generated `PUSH_CONSTANT_STAGES` constant.

## Publishing Crates
Rust expects build scripts to not modify files outside of OUT_DIR. The provided example project outputs the generated bindings to the `src/` directory for documentation purposes.
Expand Down

0 comments on commit d0531df

Please sign in to comment.