# Objective
- Test is failing on nightly after the merge of https://github.com/rust-lang/rust/pull/90247
- It was relying on the precision of the duration of `1.0 / 3.0`
## Solution
- Fix the test to be less reliant on float precision to have the same result
# Objective
- Support overriding wgpu features and limits that were calculated from default values or queried from the adapter/backend.
- Fixes#3686
## Solution
- Add `disabled_features: Option<wgpu::Features>` to `WgpuOptions`
- Add `constrained_limits: Option<wgpu::Limits>` to `WgpuOptions`
- After maybe obtaining updated features and limits from the adapter/backend in the case of `WgpuOptionsPriority::Functionality`, enable the `WgpuOptions` `features`, disable the `disabled_features`, and constrain the `limits` by `constrained_limits`.
- Note that constraining the limits means for `wgpu::Limits` members named `max_.*` we take the minimum of that which was configured/queried for the backend/adapter and the specified constrained limit value. This means the configured/queried value is used if the constrained limit is larger as that is as much as the device/API supports, or the constrained limit value is used if it is smaller as we are imposing an artificial constraint. For members named `min_.*` we take the maximum instead. For example, a minimum stride might be 256 but we set constrained limit value of 1024, then 1024 is the more conservative value. If the constrained limit value were 16, then 256 would be the more conservative.
On platforms like wasm (on mobile) the cursor can disappear suddenly (ex: the user releases their finger from the screen). This causes the undesirable behavior in #3752. These changes make the UI handler properly handle this case.
Fixes#3752
Alternative to #3599
# Objective
- While it is not safe to enable mappable primary buffers for all GPUs, it should be preferred for integrated GPUs where an integrated GPU is one that is sharing system memory.
## Solution
- Auto-disable mappable primary buffers only for discrete GPUs. If the GPU is integrated and mappable primary buffers are supported, use them.
# Objective
- Do not panic when mroe than 256 point lights are added the scene
- Fixes https://github.com/bevyengine/bevy/issues/3682
## Solution
- Only iterate the first `MAX_POINT_LIGHTS` lights instead of as many as there are
## Open questions
- Should we warn that there are more than the maximum allowed number of point lights in the scene?
# Objective
- When using `WgpuOptionsPriority::Functionality`, which is the default, wgpu::Features::MAPPABLE_PRIMARY_BUFFERS would be automatically enabled. This feature can and does have a significant negative impact on performance for discrete GPUs where resizable bar is not supported, which is a common case. As such, this feature should not be automatically enabled.
- Fixes the performance regression part of https://github.com/bevyengine/bevy/issues/3686 and at least some, if not all cases of https://github.com/bevyengine/bevy/issues/3687
## Solution
- When using `WgpuOptionsPriority::Functionality`, use the adapter-supported features, enable `TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES` and disable `MAPPABLE_PRIMARY_BUFFERS`
# Objective
- On Safari mobile, calling `winit_window.set_cursor_grab(true)` fails as the API is not implemented (as there is no cursor on Safari mobile, the api doesn't make sense there). I don't know about other mobile browsers
```
[Error] Unhandled Promise Rejection: TypeError: getObject(arg0).exitPointerLock is not a function. (In 'getObject(arg0).exitPointerLock()', 'getObject(arg0).exitPointerLock' is undefined)
(anonymous function) (rect.js:1089)
wasm-stub
<?>.wasm-function[web_sys::features::gen_Document::Document::exit_pointer_lock::h20ffc49be163fc45]
<?>.wasm-function[winit::platform_impl::platform::backend::canvas::Canvas::set_cursor_grab::h6a9472cf55263e98]
<?>.wasm-function[bevy_winit::winit_windows::WinitWindows::create_window::h9db5b3cbb24347c5]
<?>.wasm-function[<bevy_winit::WinitPlugin as bevy_app::plugin::Plugin>::build::ha4a7c046b80c4280]
<?>.wasm-function[bevy_app::plugin_group::PluginGroupBuilder::finish::h0e5bc78f71c37b2f]
<?>.wasm-function[rect::main::h899852fd17f2d489]
<?>.wasm-function[std::sys_common::backtrace::__rust_begin_short_backtrace::hfe38f282e8dda96b]
<?>.wasm-function[std::rt::lang_start::{{closure}}::hc2f3b555ffc58618]
<?>.wasm-function[std::rt::lang_start_internal::ha901ae30d88554f2]
<?>.wasm-function[main]
<?>.wasm-function[]
wasm-stub
21261
(anonymous function) (rect.js:1664)
asyncFunctionResume
(anonymous function)
promiseReactionJobWithoutPromise
promiseReactionJob
```
## Solution
- Do not call the api to release cursor grab on window creation, as the cursor is not grabbed anyway at this point
# Objective
- Fix incorrect iterator usage in WriteStd430 impl for [T]
- The first item was being written twice. This is correct in the WriteStd140 impl for [T].
## Solution
- See the code.
# Objective
In this PR I added the ability to opt-out graphical backends. Closes#3155.
## Solution
I turned backends into `Option` ~~and removed panicking sub app API to force users handle the error (was suggested by `@cart`)~~.
# Objective
The current 2d rendering is specialized to render sprites, we need a generic way to render 2d items, using meshes and materials like we have for 3d.
## Solution
I cloned a good part of `bevy_pbr` into `bevy_sprite/src/mesh2d`, removed lighting and pbr itself, adapted it to 2d rendering, added a `ColorMaterial`, and modified the sprite rendering to break batches around 2d meshes.
~~The PR is a bit crude; I tried to change as little as I could in both the parts copied from 3d and the current sprite rendering to make reviewing easier. In the future, I expect we could make the sprite rendering a normal 2d material, cleanly integrated with the rest.~~ _edit: see <https://github.com/bevyengine/bevy/pull/3460#issuecomment-1003605194>_
## Remaining work
- ~~don't require mesh normals~~ _out of scope_
- ~~add an example~~ _done_
- support 2d meshes & materials in the UI?
- bikeshed names (I didn't think hard about naming, please check if it's fine)
## Remaining questions
- ~~should we add a depth buffer to 2d now that there are 2d meshes?~~ _let's revisit that when we have an opaque render phase_
- ~~should we add MSAA support to the sprites, or remove it from the 2d meshes?~~ _I added MSAA to sprites since it's really needed for 2d meshes_
- ~~how to customize vertex attributes?~~ _#3120_
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
# Objective
Updated the docs for bevy_ui as requested by #3492
## Solution
I have documented the parts I understand. anchors.rs is not in use and should be removed, thus I haven't documented that, and some of the more renderer-heavy code is beyond me and needs input from either cart or someone familiar with bevy rendering
Co-authored-by: Troels Jessen <kairyuka@gmail.com>
# Objective
- Using plain exponential depth slicing for perspective projection cameras results in unnecessarily many slices very close together close to the camera. If the camera is then moved close to a collection of point lights, they will likely exhaust the available uniform buffer space for the lists of which lights affect which clusters.
## Solution
- A simple solution to this is to use a different near plane value for the depth slicing and set it to where the first slice's far plane should be. The default value is 5 and works well. This results in the configured number of depth slices, maintains the exponential slicing beyond the initial slice, and no slices are too small such that they cause problems that are sensitive to the view position.
# Objective
- Fix the case mentioned in https://github.com/bevyengine/bevy/pull/2725#issuecomment-1007014024.
- On a machine with 4 cores, so 1 thread for assets, loading a gltf with only one textures hangs all asset loading
## Solution
- Do not use the task pool when there is only one texture to load
Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
#3457 adds the `doc_markdown` clippy lint, which checks doc comments to make sure code identifiers are escaped with backticks. This causes a lot of lint errors, so this is one of a number of PR's that will fix those lint errors one crate at a time.
This PR fixes lints in the `bevy_ecs` crate.
# Objective
Part of #3492
- Complete inline documentation of `bevy_audio`
## Solution
- Added inline documentation to all public parts of `bevy_audio`
- Added a few inline examples at important places
- Some renaming for clarity (e.g. `AudioLoader` and generics)
- added `#![warn(missing_docs)]` and `#![forbid(unsafe_code)]` to `bevy_audio`
I also tried adding support for the other vorbis file endings `.oga` and `.spx` to the `AudioLoader` (see `file endings` at https://tools.ietf.org/html/rfc5334#section-10.3), but the `rodio` decoder does not seem to support those.
#3457 adds the `doc_markdown` clippy lint, which checks doc comments to make sure code identifiers are escaped with backticks. This causes a lot of lint errors, so this is one of a number of PR's that will fix those lint errors one crate at a time.
This PR fixes lints in the `bevy_ui` crate.
#3457 adds the `doc_markdown` clippy lint, which checks doc comments to make sure code identifiers are escaped with backticks. This causes a lot of lint errors, so this is one of a number of PR's that will fix those lint errors one crate at a time.
This PR fixes lints in the `bevy_text` crate.
# Objective
- Fixes#1920.
- Users often want to know how to get the values of removed components (#1655).
- Stand-alone `bevy_ecs` behavior is very unintuitive, as `World::clear_trackers()` must be manually called.
- Fixes#2999 by extending the existing test (thanks @hymm for pointing me to it) to be clearer and check for component removal as well.
## Solution
- Better docs!
- Better tests!
# Objective
- Load names of lights from gltf
## Solution
- Load names of lights from gltf
Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
# Objective
- Allow the user to specify the priority when configuring wgpu features/limits and by default use the maximum capabilities of the chosen adapter.
## Solution
- Add a `WgpuOptionsPriority` enum with `Compatibility`, `Functionality` and `WebGL2` options.
- Add a `priority: WgpuOptionsPriority` member to `WgpuOptions`.
- When initialising the renderer, if `WgpuOptions::priority == WgpuOptionsPriority::Functionality`, query the adapter for the available features and limits, use them when creating a device, and update `WgpuOptions` with those values. If `Compatibility` use the behaviour as before this PR. If `WebGL2` then use the WebGL2 downlevel limits as used when when building for wasm, for convenience of testing WebGL2 limits without having to build for wasm.
- Add an environment variable `WGPU_OPTIONS_PRIO` that takes `compatibility`, `functionality`, `webgl2`.
- Default to `WgpuOptionsPriority::Functionality`.
- Insert updated `WgpuOptions` into render app world as well. This is useful for applying the limits when rendering, such as limiting the directional light shadow map texture to 2048x2048 when using WebGL2 downlevel limits but not on wasm.
- Reduced `draw_state` logs from `debug` to `trace` and added `debug` level logs for the wgpu features and limits. Use `RUST_LOG=bevy_render=debug` to see the output.
Modifies the code emitted by `derive_label` to use fully-qualified type
names (e.g. `std::boxed::Box` instead of `Box`).
# Objective
- Using unqualified types here causes errors when the proc macro is used in contexts that locally define types with conflicting names (e.g. a local definition of `Box`).
## Solution
- Fully qualify standard types emitted by the proc macro code.
Updates the requirements on [nalgebra](https://github.com/dimforge/nalgebra) to permit the latest version.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/dimforge/nalgebra/blob/dev/CHANGELOG.md">nalgebra's changelog</a>.</em></p>
<blockquote>
<h2>[0.30.0] (02 Jan. 2022)</h2>
<h3>Breaking changes</h3>
<ul>
<li>The <code>Dim</code> trait is now marked as unsafe.</li>
<li>The <code>Matrix::pow</code> and <code>Matrix::pow_mut</code> methods only allow positive integer exponents now. To compute negative
exponents, the user is free to invert the matrix before calling <code>pow</code> with the exponent’s absolute value.</li>
</ul>
<h3>Modified</h3>
<ul>
<li>Use more concise debug impls for matrices and geometric transformation types.</li>
<li>The singular values computed by the SVD are now sorted in increasing order by default. Use <code>SVD::new_unordered</code>
instead to reproduce the older behavior without the sorting overhead.</li>
<li>The <code>UnitDualQuaternion::sclerp</code> method will no longer panic when given two equal rotations.</li>
<li>The <code>Matrix::select_rows</code> and <code>Matrix::select_columns</code> methods no longer require the matrix components to implement
the trait <code>Zero</code>.</li>
<li>The <code>Matrix::pow</code> and <code>Matrix::pow_mut</code> methods will now also work with integer matrices.</li>
</ul>
<h3>Added</h3>
<ul>
<li>Added the conversion trait <code>From<Vec<T>></code> and method <code>from_vec_storage</code> for <code>RowDVector</code>.</li>
<li>Added implementation of <code>From</code> and <code>Into</code> for converting between <code>nalgebra</code> types and types from
<code>glam 0.18</code>. These can be enabled by enabling the <code>convert-glam018</code> cargo features.</li>
<li>Added the methods <code>Matrix::product</code>, <code>::row_product</code>, <code>::row_product_tr</code>, and <code>::column_product</code> to compute the
product of the components, rows, or columns, of a single matrix or vector.</li>
<li>The <code>Default</code> trait is now implemented for most geometric types: <code>Point</code>, <code>Isometry</code>, <code>Rotation</code>, <code>Similarity</code>,
<code>Transform</code>, <code>UnitComplex</code>, and <code>UnitQuaternion</code>.</li>
<li>Added the <code>Scale</code> geometric type for representing non-uniform scaling.</li>
<li>Added <code>Cholesky::new_with_substitute</code> that will replace diagonal elements by a given constant whenever <code>Cholesky</code>
meets a non-definite-positiveness.</li>
<li>Re-added the conversion from a vector/matrix slice to a static array.</li>
<li>Added the <code>cuda</code> feature that enables the support of <a href="https://github.com/Rust-GPU/Rust-CUDA">rust-cuda</a> for using
<code>nalgebra</code> features with CUDA kernels written in Rust.</li>
<li>Added special-cases implementations for the 2x2 and 3x3 SVDs for better accuracy and performances.</li>
<li>Added the methods <code>Matrix::polar</code>, <code>Matrix::try_polar</code>, and <code>SVD::to_polar</code> to compute the polar decomposition of
a matrix, based on its SVD.</li>
<li><code>nalgebra-sparse</code>: provide constructors for unsorted but otherwise valid data using the CSR format.</li>
<li><code>nalgebra-sparse</code>: added reading MatrixMarked data files to a sparse <code>CooMatrix</code>.</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Fixed a potential unsoundness with <code>matrix.get(i)</code> and <code>matrix.get_mut(i)</code> where <code>i</code> is an <code>usize</code>, and <code>matrix</code>
is a matrix slice with non-default strides.</li>
<li>Fixed potential unsoundness with <code>vector.perp</code> where <code>vector</code> isn’t actually a 2D vector as expected.</li>
<li>Fixed linkage issue with <code>nalgebra-lapack</code>: the user of <code>nalgebra-lapack</code> no longer have to add
<code>extern crate lapack-src</code> to their <code>main.rs</code>.</li>
<li>Fixed the <code>no-std</code> build of <code>nalgebra-glm</code>.</li>
<li>Fix the <code>pow</code> and <code>pow_mut</code> functions (the result was incorrect for some exponent values).</li>
</ul>
<h2>[0.29.0]</h2>
<h3>Breaking changes</h3>
<ul>
<li>We updated to the version 0.6 of <code>simba</code>. This means that the trait bounds <code>T: na::RealField</code>, <code>na::ComplexField</code>,
<code>na::SimdRealField</code>, <code>na:SimdComplexField</code> no imply that <code>T: Copy</code> (they only imply that <code>T: Clone</code>). This may affect</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="e8b9c40123"><code>e8b9c40</code></a> Release v0.30.0</li>
<li><a href="c0f8530d5e"><code>c0f8530</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/dimforge/nalgebra/issues/1055">#1055</a> from dimforge/fix-pow</li>
<li><a href="99ac8c4032"><code>99ac8c4</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/dimforge/nalgebra/issues/1050">#1050</a> from metric-space/polar-decomposition-take-2</li>
<li><a href="498d7e3d4c"><code>498d7e3</code></a> Semi-unitary test checks for if rows or cols are orthonomal</li>
<li><a href="ae6fda7dc7"><code>ae6fda7</code></a> Change svd to svd_unordered for the method output to be equal</li>
<li><a href="d806669cc7"><code>d806669</code></a> Fix Matrix::pow and make it work only with positive exponents</li>
<li><a href="fdaf8c0fbe"><code>fdaf8c0</code></a> Add tests for Matrix::pow</li>
<li><a href="67a82c2c88"><code>67a82c2</code></a> Test: minor style fix</li>
<li><a href="8e0ca439c2"><code>8e0ca43</code></a> Use proptest for testing the polar decomposition</li>
<li><a href="cc10b67dd1"><code>cc10b67</code></a> Add Matrix::try_polar that returns Option and make Matrix::polar not return O...</li>
<li>Additional commits viewable in <a href="https://github.com/dimforge/nalgebra/compare/v0.29.0...v0.30.0">compare view</a></li>
</ul>
</details>
<br />
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
# Objective
- Add support for loading lights from glTF 2.0 files
## Solution
- This adds support for the KHR_punctual_lights extension which supports point, directional, and spot lights, though we don't yet support spot lights.
- Inserting light bundles when creating scenes required registering some more light bundle component types.
This PR is part of the issue #3492.
# Objective
- Clean up dead code in `bevy_core`.
- Add and update the `bevy_core` documentation to achieve a 100% documentation coverage.
- Add the #![warn(missing_docs)] lint to keep the documentation coverage for the future.
# Solution
- Remove unused `Bytes`, `FromBytes`, `Labels`, and `EntityLabels` types and associated systems.
- Made several types private that really only have use as internal types, mostly pertaining to fixed timestep execution.
- Add and update the bevy_core documentation.
- Add the #![warn(missing_docs)] lint.
# Open Questions
Should more of the internal states of `FixedTimestep` be public? Seems mostly to be an implementation detail unless someone really needs that fixed timestep state.
# Objective
- Nightly checks where disabled because of a bug in Rust
- Dependency checks are failing because of a new duplicate
## Solution
- Now that https://github.com/rust-lang/rust/pull/92175 has been merged, re-enable nightly checks
- Add the new duplicate dependency to the known list
- Removed `Inflector` dependency as it's not used anymore
Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
# Objective
Docs updates.
## Solution
- Detail what `OrthographicCameraBundle::new_2d()` creates.
- Fix a few renamed parameters in comments of `TrackedRenderPass`.
- Add missing comments for viewport and debug markers.
Co-authored-by: Jerome Humbert <djeedai@gmail.com>
This PR is part of the issue #3492.
# Objective
- Add and update the bevy_dylib documentation to achieve a 100% documentation coverage.
- Add the #![warn(missing_docs)] lint to keep the documentation coverage for the future.
# Solution
- Add and update the bevy_dylib documentation.
- Add the #![warn(missing_docs)] lint.
# Objective
This contributes documentation that should cover the entirety of bevy_internal as requested in #3492
## Solution
warn(missing_docs) has been activated and documentation has been added to missing parts so that no warnings appear from this setting
# Objective
- After updating #2988, all the examples started crashing with
```
thread 'main' panicked at 'Plugin "bevy_render::render_component::ExtractComponentPlugin<bevy_asset::handle::Handle<bevy_pbr::pbr_material::StandardMaterial>>" was already added', crates/bevy_app/src/app.rs:831:33
```
## Solution
Plugin was added twice:
directly:
1d0d8a3397/crates/bevy_pbr/src/lib.rs (L73)
and through `MaterialPlugin`:
1d0d8a3397/crates/bevy_pbr/src/lib.rs (L72)1d0d8a3397/crates/bevy_pbr/src/material.rs (L183)
I removed the extra plugin
Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
# Objective
Remove the `StorageType` parameter from `ComponentDescriptor::new_resource` as discussed in #3361.
- fixes#3361
## Solution
- Parameter removed.
- Basic docs added.
## Note
Left a [comment](https://github.com/bevyengine/bevy/issues/3361#issuecomment-996433346) about `SparseStorage` being the more reasonable choice.
Co-authored-by: r4gus <david@thesugar.de>
#3457 adds the `doc_markdown` clippy lint, which checks doc comments to make sure code identifiers are escaped with backticks. This causes a lot of lint errors, so this is one of a number of PR's that will fix those lint errors one crate at a time.
This PR fixes lints in the `bevy_utils` crate.
#3457 adds the `doc_markdown` clippy lint, which checks doc comments to make sure code identifiers are escaped with backticks. This causes a lot of lint errors, so this is one of a number of PR's that will fix those lint errors one crate at a time.
This PR fixes lints in the `bevy_transform` crate.
#3457 adds the `doc_markdown` clippy lint, which checks doc comments to make sure code identifiers are escaped with backticks. This causes a lot of lint errors, so this is one of a number of PR's that will fix those lint errors one crate at a time.
This PR fixes lints in the `bevy_app` crate.