bevy/crates/bevy_render/src
James Liu a4ed1b88b8
Relax BufferVec's type constraints (#12866)
# 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.
2024-04-05 02:11:41 +00:00
..
batching Improve performance by binning together opaque items instead of sorting them. (#12453) 2024-03-30 02:55:02 +00:00
camera Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
diagnostic Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
mesh Micro-optimize queue_material_meshes, primarily to remove bit manipulation. (#12791) 2024-04-01 21:58:53 +00:00
primitives Reflect default in some types on bevy_render (#12580) 2024-03-19 22:50:17 +00:00
render_graph Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
render_phase Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
render_resource Relax BufferVec's type constraints (#12866) 2024-04-05 02:11:41 +00:00
renderer Disable RAY_QUERY and RAY_TRACING_ACCELERATION_STRUCTURE by default (#12862) 2024-04-04 19:20:19 +00:00
texture Remove redundant imports (#12817) 2024-04-01 19:59:08 +00:00
view Normalize warning messages with Nvidia drivers (#12833) 2024-04-01 19:56:56 +00:00
alpha.rs Move AlphaMode into bevy_render (#12012) 2024-02-21 19:34:10 +00:00
extract_component.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
extract_instances.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
extract_param.rs Enable the unsafe_op_in_unsafe_fn lint (#11591) 2024-01-28 23:18:11 +00:00
extract_resource.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
globals.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
lib.rs remove DeterministicRenderingConfig (#12811) 2024-04-01 09:32:47 +00:00
maths.wgsl Add support for KHR_texture_transform (#11904) 2024-02-21 01:11:28 +00:00
pipelined_rendering.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
render_asset.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
settings.rs Update to wgpu 0.19 and raw-window-handle 0.6 (#11280) 2024-01-26 18:14:21 +00:00
spatial_bundle.rs Implement Clone for VisibilityBundle and SpatialBundle (#10394) 2023-11-07 21:25:00 +00:00