2024-02-03 21:40:55 +00:00
|
|
|
// FIXME(3492): remove once docs are ready
|
|
|
|
#![allow(missing_docs)]
|
2024-03-27 03:30:08 +00:00
|
|
|
#![forbid(unsafe_code)]
|
2024-03-23 02:22:52 +00:00
|
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
2024-03-25 18:52:50 +00:00
|
|
|
#![doc(
|
|
|
|
html_logo_url = "https://bevyengine.org/assets/icon.png",
|
|
|
|
html_favicon_url = "https://bevyengine.org/assets/icon.png"
|
|
|
|
)]
|
2024-02-03 21:40:55 +00:00
|
|
|
|
Migrate to encase from crevice (#4339)
# Objective
- Unify buffer APIs
- Also see #4272
## Solution
- Replace vendored `crevice` with `encase`
---
## Changelog
Changed `StorageBuffer`
Added `DynamicStorageBuffer`
Replaced `UniformVec` with `UniformBuffer`
Replaced `DynamicUniformVec` with `DynamicUniformBuffer`
## Migration Guide
### `StorageBuffer`
removed `set_body()`, `values()`, `values_mut()`, `clear()`, `push()`, `append()`
added `set()`, `get()`, `get_mut()`
### `UniformVec` -> `UniformBuffer`
renamed `uniform_buffer()` to `buffer()`
removed `len()`, `is_empty()`, `capacity()`, `push()`, `reserve()`, `clear()`, `values()`
added `set()`, `get()`
### `DynamicUniformVec` -> `DynamicUniformBuffer`
renamed `uniform_buffer()` to `buffer()`
removed `capacity()`, `reserve()`
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-05-18 21:09:21 +00:00
|
|
|
use bevy_macro_utils::BevyManifest;
|
|
|
|
use encase_derive_impl::{implement, syn};
|
|
|
|
|
|
|
|
const ENCASE: &str = "encase";
|
|
|
|
|
|
|
|
fn bevy_encase_path() -> syn::Path {
|
|
|
|
let bevy_manifest = BevyManifest::default();
|
|
|
|
bevy_manifest
|
2023-01-11 21:12:02 +00:00
|
|
|
.get_subcrate("render")
|
Migrate to encase from crevice (#4339)
# Objective
- Unify buffer APIs
- Also see #4272
## Solution
- Replace vendored `crevice` with `encase`
---
## Changelog
Changed `StorageBuffer`
Added `DynamicStorageBuffer`
Replaced `UniformVec` with `UniformBuffer`
Replaced `DynamicUniformVec` with `DynamicUniformBuffer`
## Migration Guide
### `StorageBuffer`
removed `set_body()`, `values()`, `values_mut()`, `clear()`, `push()`, `append()`
added `set()`, `get()`, `get_mut()`
### `UniformVec` -> `UniformBuffer`
renamed `uniform_buffer()` to `buffer()`
removed `len()`, `is_empty()`, `capacity()`, `push()`, `reserve()`, `clear()`, `values()`
added `set()`, `get()`
### `DynamicUniformVec` -> `DynamicUniformBuffer`
renamed `uniform_buffer()` to `buffer()`
removed `capacity()`, `reserve()`
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-05-18 21:09:21 +00:00
|
|
|
.map(|bevy_render_path| {
|
|
|
|
let mut segments = bevy_render_path.segments;
|
|
|
|
segments.push(BevyManifest::parse_str("render_resource"));
|
|
|
|
syn::Path {
|
|
|
|
leading_colon: None,
|
|
|
|
segments,
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.map(|path| {
|
|
|
|
let mut segments = path.segments;
|
|
|
|
segments.push(BevyManifest::parse_str(ENCASE));
|
|
|
|
syn::Path {
|
|
|
|
leading_colon: None,
|
|
|
|
segments,
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.unwrap_or_else(|| bevy_manifest.get_path(ENCASE))
|
|
|
|
}
|
|
|
|
|
|
|
|
implement!(bevy_encase_path());
|