bevy/crates/bevy_ui/src
Zhixing Zhang 16feb9acb7 Add push contant config to layout (#7681)
# Objective

Allow for creating pipelines that use push constants. To be able to use push constants. Fixes #4825

As of right now, trying to call `RenderPass::set_push_constants` will trigger the following error:

```
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(0, 59, Vulkan)>`
    In a set_push_constant command
    provided push constant is for stage(s) VERTEX | FRAGMENT | VERTEX_FRAGMENT, however the pipeline layout has no push constant range for the stage(s) VERTEX | FRAGMENT | VERTEX_FRAGMENT
```
## Solution

Add a field push_constant_ranges to` RenderPipelineDescriptor` and `ComputePipelineDescriptor`.

This PR supersedes #4908 which now contains merge conflicts due to significant changes to `bevy_render`.

Meanwhile, this PR also made the `layout` field of `RenderPipelineDescriptor` and `ComputePipelineDescriptor` non-optional. If the user do not need to specify the bind group layouts, they can simply supply an empty vector here. No need for it to be optional.

---

## Changelog
- Add a field push_constant_ranges to RenderPipelineDescriptor and ComputePipelineDescriptor
- Made the `layout` field of RenderPipelineDescriptor and ComputePipelineDescriptor non-optional.


## Migration Guide

- Add push_constant_ranges: Vec::new() to every `RenderPipelineDescriptor` and `ComputePipelineDescriptor`
- Unwrap the optional values on the `layout` field of `RenderPipelineDescriptor` and `ComputePipelineDescriptor`. If the descriptor has no layout, supply an empty vector.


Co-authored-by: Zhixing Zhang <me@neoto.xin>
2023-02-17 06:20:16 +00:00
..
flex The size field of CalculatedSize should not be a Size (#7641) 2023-02-13 18:20:29 +00:00
render Add push contant config to layout (#7681) 2023-02-17 06:20:16 +00:00
widget Changes in the size of a text node should trigger recomputation of its text (#7674) 2023-02-14 14:46:28 +00:00
camera_config.rs Extract component derive (#7399) 2023-01-30 18:12:16 +00:00
focus.rs expose cursor position with scale (#7297) 2023-01-20 14:25:24 +00:00
geometry.rs Add doc tests for the Size constructor functions (#7658) 2023-02-13 18:20:34 +00:00
lib.rs Fix Window feedback loop between the OS and Bevy (#7517) 2023-02-07 14:18:13 +00:00
node_bundles.rs Change default FocusPolicy to Pass (#7161) 2023-01-12 17:15:20 +00:00
stack.rs Rename schedule v3 to schedule (#7519) 2023-02-06 18:44:40 +00:00
ui_node.rs Improve the documentation for flex-basis (#7685) 2023-02-15 13:58:01 +00:00
update.rs Add z-index support with a predictable UI stack (#5877) 2022-11-02 22:06:04 +00:00