mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
a4ed1b88b8
# Objective Since BufferVec was first introduced, `bytemuck` has added additional traits with fewer restrictions than `Pod`. Within BufferVec, we only rely on the constraints of `bytemuck::cast_slice` to a `u8` slice, which now only requires `T: NoUninit` which is a strict superset of `Pod` types. ## Solution Change out the `Pod` generic type constraint with `NoUninit`. Also taking the opportunity to substitute `cast_slice` with `must_cast_slice`, which avoids a runtime panic in place of a compile time failure if `T` cannot be used. --- ## Changelog Changed: `BufferVec` now supports working with types containing `NoUninit` but not `Pod` members. Changed: `BufferVec` will now fail to compile if used with a type that cannot be safely read from. Most notably, this includes ZSTs, which would previously always panic at runtime. |
||
---|---|---|
.. | ||
batching | ||
camera | ||
diagnostic | ||
mesh | ||
primitives | ||
render_graph | ||
render_phase | ||
render_resource | ||
renderer | ||
texture | ||
view | ||
alpha.rs | ||
extract_component.rs | ||
extract_instances.rs | ||
extract_param.rs | ||
extract_resource.rs | ||
globals.rs | ||
globals.wgsl | ||
gpu_component_array_buffer.rs | ||
lib.rs | ||
maths.wgsl | ||
pipelined_rendering.rs | ||
render_asset.rs | ||
settings.rs | ||
spatial_bundle.rs |