Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use async-fn-in-trait (RPIT) for various Asset traits. #11362

Closed
wants to merge 296 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
296 commits
Select commit Hold shift + click to select a range
9f2eabb
Deprecating hashbrown reexports (#11721)
andristarr Feb 6, 2024
cf15e6b
Implement `Meshable` for some 3D primitives (#11688)
Jondolf Feb 6, 2024
4c15dd0
Implement irradiance volumes. (#10268)
pcwalton Feb 6, 2024
75d383f
fix create_surfaces system ordering (#11747)
mockersf Feb 6, 2024
4c86ad6
Mesh insert indices (#11745)
lynn-lumen Feb 6, 2024
054134f
Add `ReflectKind` (#11664)
doonv Feb 7, 2024
f514d5c
Don't try to create a uniform buffer for light probes if there are no…
pcwalton Feb 7, 2024
c33b8b9
Properly check for result when getting pipeline in Msaa (#11758)
BorisBoutillier Feb 7, 2024
ff77adc
Typo in [`ScheduleLabel`] derive macro (#11764)
tjamaan Feb 7, 2024
ab16f5e
UI Texture 9 slice (#11600)
ManevilleF Feb 7, 2024
44c36ce
Mention Resource where missing from component/resource related type d…
SpecificProtagonist Feb 8, 2024
76b6666
wait for render app when main world is dropped (#11737)
hymm Feb 8, 2024
0166db3
Deprecate shapes in `bevy_render::mesh::shape` (#11773)
Jondolf Feb 8, 2024
f26b438
Cache the QueryState used to drop swapchain TextureViews (#11781)
james7132 Feb 9, 2024
5313730
Bump peter-evans/create-pull-request from 5 to 6 (#11712)
dependabot[bot] Feb 9, 2024
f4dab8a
Multithreaded render command encoding (#9172)
JMS55 Feb 9, 2024
0ebba27
Ignore screenshots generated by `screenshot` example (#11797)
doonv Feb 9, 2024
e0c296e
Optional ImageScaleMode (#11780)
ManevilleF Feb 9, 2024
f84672b
Fix `Quad` deprecation message mentioning a type that doesn't exist (…
doonv Feb 9, 2024
55ada61
Update ahash to 0.8.7 (#11785)
SpecificProtagonist Feb 10, 2024
3af8526
Stop extracting mesh entities to the render world. (#11803)
pcwalton Feb 10, 2024
0031391
Docs reflect that `RemovalDetection` also yields despawned entities (…
porkbrain Feb 10, 2024
3367611
doc(bevy_reflect): add note about trait bounds on `impl_type_path` (#…
tguichaoua Feb 10, 2024
2e2f898
Expose query accesses (#11700)
JoJoJet Feb 10, 2024
b6945e5
Stop copying the light probe array to the stack in the shader. (#11805)
pcwalton Feb 10, 2024
d939c44
Avoid unwraps in winit fullscreen handling code (#11735)
Friz64 Feb 10, 2024
61e01e4
Derive Ord for GamepadButtonType. (#11791)
shanecelis Feb 11, 2024
94ab84e
mipmap levels can be 0 and they should be interpreted as 1 (#11767)
anarelion Feb 11, 2024
c1a4e29
Replace pointer castings (`as`) by their API equivalent (#11818)
tguichaoua Feb 11, 2024
1c67e02
Move `EntityHash` related types into `bevy_ecs` (#11498)
doonv Feb 12, 2024
078dd06
bevy_dynamic_plugin: fix `unsafe_op_in_unsafe_fn` lint (#11622)
BD103 Feb 12, 2024
9c22573
Add a method for detecting changes within a certain scope (#11687)
JoJoJet Feb 12, 2024
9e30aa7
bevy_reflect_derive: Clean up attribute logic (#11777)
MrGVSV Feb 12, 2024
eee71bf
Put asset_events behind a run condition (#11800)
james7132 Feb 12, 2024
bd25135
Fix double indirection when applying command queues (#11822)
JoJoJet Feb 12, 2024
87add56
Immediately poll the executor once before spawning it as a task (#11801)
james7132 Feb 12, 2024
7b5a4ec
Use Asset Path Extension for `AssetLoader` Disambiguation (#11644)
bushrat011899 Feb 12, 2024
2bc4825
Add delta to CursorMoved event (#11710)
lynn-lumen Feb 12, 2024
b721aaa
Replace `crossbeam::scope` reference with `thread::scope` in docs (#1…
BD103 Feb 12, 2024
2d90b20
Fix global wireframe behavior not being applied on new meshes (#11792)
Kanabenki Feb 12, 2024
f1f83bf
Add `Mesh::merge` (#11456)
Jondolf Feb 12, 2024
aca71d0
Call a TextureAtlasLayout a layout and not an atlas (#11783)
NiklasEi Feb 13, 2024
77c26f6
Fix sysinfo CPU brand output (#11850)
Friz64 Feb 13, 2024
d3c9c61
Fix small docs misformat in `BundleInfo::new` (#11855)
Adamkob12 Feb 13, 2024
73bf730
fix shadow batching (#11645)
robtfm Feb 14, 2024
ebf81c6
Use `std::thread::sleep` instead of spin-waiting in the async_compute…
BD103 Feb 14, 2024
0354ce4
`FilteredEntityRef` conversions (#11838)
coreh Feb 14, 2024
8cf3447
Overwrite gizmo group in `insert_gizmo_group` (#11860)
Jondolf Feb 14, 2024
b446374
Dedicated primitive example (#11697)
RobWalt Feb 14, 2024
8018d62
Use question mark operator when possible (#11865)
BD103 Feb 14, 2024
bc98333
Fix a few Clippy lints (#11866)
BD103 Feb 14, 2024
dc9b486
Change light defaults & fix light examples (#11581)
doonv Feb 14, 2024
1d5388e
Un-hardcode positions and colors in `2d_shapes` example (#11867)
rparrett Feb 14, 2024
dd619a1
New Exposure and Lighting Defaults (and calibrate examples) (#11868)
cart Feb 15, 2024
4ebc560
Change MeshUniform::new() to be public. (#11880)
komadori Feb 15, 2024
f83de49
Rename Core Render Graph Labels (#11882)
cart Feb 15, 2024
fe777d5
Implement and register Reflect (value) for CameraRenderGraph and Came…
cart Feb 15, 2024
149d48f
Add type registrations for animation types (#11889)
ekropotin Feb 16, 2024
9505f6e
Support optional clear color in ColorAttachment. (#11884)
tychedelia Feb 16, 2024
9a2ce8e
irradiance: use textureSampleLevel for WebGPU support (#11893)
mockersf Feb 16, 2024
ebaa347
Add configuration for async pipeline creation on RenderPlugin (#11847)
rparrett Feb 16, 2024
16d710c
Fix asset loader registration warning (#11870)
thepackett Feb 16, 2024
80f2ee2
WebGPU: fix web-sys version (#11894)
mockersf Feb 16, 2024
f81aa64
Derive Reflect for Exposure (#11907)
IceSentry Feb 16, 2024
7883eea
Add `MeshPipelineKey::LIGHTMAPPED` as applicable during the shadow ma…
pcwalton Feb 17, 2024
8127d44
Irradiance volume example tweaks (#11911)
cart Feb 17, 2024
3058c17
Disable irradiance volumes on WebGL and WebGPU. (#11909)
pcwalton Feb 17, 2024
756535b
Remove `naga_oil` dependency from `bevy_pbr` (#11914)
rparrett Feb 17, 2024
1076bd4
Remove map_flatten from linting rules (#11913)
ekropotin Feb 17, 2024
e6e25de
Fix duplicate `encase_derive_impl` dependency (#11915)
rparrett Feb 17, 2024
4e20e4a
0.13 changelog (#11918)
cart Feb 17, 2024
abb8c35
Release 0.13.0 (#11920)
cart Feb 17, 2024
e0778bf
Add bevy_gizmos/macros to publish script (#11928)
cart Feb 17, 2024
412fd64
revert PointLightBundle to DirectionalLightBundle change made to asse…
awwsmm Feb 18, 2024
eef7dbe
Add single-f32 constructors for a few (very few) primitives (#11934)
Aztro-dev Feb 18, 2024
961d49f
scene example: remove unnecessary reflect(FromWorld) (#11938)
awwsmm Feb 18, 2024
efda05d
typo (#11955)
tomara-x Feb 18, 2024
cb5ff51
Qualify embedded_asset expansion with $crate:: (#11961)
coolreader18 Feb 18, 2024
6026c08
Update documentation for WorldQuery and filters (#11952)
kristoff3r Feb 18, 2024
c3db02e
Fix dds feature dependencies in bevy_core_pipeline (#11962)
TimJentzsch Feb 18, 2024
a1ef7be
Use `is` method instead of `downcast_ref::<T>().is_some()` in `App::i…
doonv Feb 18, 2024
2ae5087
Add the serde feature to bitflags for bevy_render. (#11966)
andriyDev Feb 19, 2024
24e8e67
text2d example: animate_scale no longer unnecessarily performs the sa…
awwsmm Feb 19, 2024
ac6a4ff
Update to toml_edit 0.22 (#11973)
james7132 Feb 19, 2024
f1fcf69
rename Camera3dBundle's 'dither' field to 'deband_dither' to align wi…
awwsmm Feb 19, 2024
5f1dd39
Rework animation to be done in two phases. (#11707)
pcwalton Feb 19, 2024
e34fb68
refactor: Extract parallel queue abstraction (#7348)
james7132 Feb 19, 2024
eb7f554
Implement Debug for SpriteBundle and SpriteSheetBundle (#10506)
NixyJuppie Feb 19, 2024
4134351
also look in just_pressed touches for position (#7743)
mockersf Feb 19, 2024
a475511
Add method for querying whether a given short type path is ambiguous …
coreh Feb 19, 2024
e50e848
Gltf loader now shows which file is missing pre baked tangents (#11854)
andristarr Feb 19, 2024
91b083b
Prevent panic when multiple Enter inputs received in `text_input` exa…
sam-kirby Feb 19, 2024
8de15ae
Use the scroll wheel to control the camera speed in examples (#11921)
Kanabenki Feb 19, 2024
0dccfb5
Stepping disabled performance fix (#11959)
dmlary Feb 19, 2024
f77618e
Add a `[lints]` entry for workspace members missing it (#11900)
Kanabenki Feb 19, 2024
bc82749
Remove APIs deprecated in 0.13 (#11974)
james7132 Feb 19, 2024
a7aee1d
Simplify and improve `overflow_debug` example (#11875)
rparrett Feb 19, 2024
dedf66f
Replace references to old book with quick start guide (#11983)
pkupper Feb 19, 2024
6d547d7
Allow Mesh-related queue phase systems to parallelize (#11804)
james7132 Feb 20, 2024
7e782f1
Fix example docs on embedded_asset macro (#12003)
nicopap Feb 20, 2024
1d0ea78
Save 16 bytes per MeshUniform in uniform/storage buffers (#11999)
superdump Feb 20, 2024
5a74ff6
Update `split_screen` example with 4 cameras (#12010)
djeedai Feb 20, 2024
dc25edd
Fix MSAA writeback when 3 or more cameras have the same target. (#11968)
komadori Feb 20, 2024
37e6321
Fix docs for quaternion interpolation (#12014)
msvbg Feb 20, 2024
8531033
Add support for KHR_texture_transform (#11904)
janhohenheim Feb 21, 2024
328008f
Move AlphaMode into bevy_render (#12012)
mweatherley Feb 21, 2024
464e287
Update async-channel to 2.2.0 (#12004)
mintlu8 Feb 21, 2024
d3e839a
Move gizmos examples in the separate folder (#11916)
ekropotin Feb 21, 2024
e7c3359
Bump Version after Release (#12020)
github-actions[bot] Feb 21, 2024
e64c8f8
Parse missing mime types (#12028)
Maximetinu Feb 21, 2024
11a3b77
Create imported_assets directory with full path (#12022)
infmagic2047 Feb 21, 2024
a513493
Make Globals visible in vertex shaders (#12032)
IceSentry Feb 21, 2024
a491bce
Fix `SystemTypeSet::system_type` being out of sync with `System::type…
jakobhellermann Feb 21, 2024
33c7a22
bevy_ecs address trivial cases of `unsafe_op_in_unsafe_fn` (#11861)
tguichaoua Feb 22, 2024
44a0e3f
Document all members of `bevy_dynamic_plugin` (#12029)
BD103 Feb 22, 2024
9dfef45
only update `Touches` resource when needed (#12048)
JeanMertz Feb 22, 2024
5d3f66f
Fix taplo CI - toml fmt (#12037)
ameknite Feb 22, 2024
9d67edc
fix some typos (#12038)
ameknite Feb 22, 2024
fa17406
Fixed Ui Image slicing (#12047)
ManevilleF Feb 23, 2024
caa7ec6
FIX: iOS Simulator not rendering due to missing CUBE_ARRAY_TEXTURES (…
sampettersson Feb 23, 2024
e79b9b6
Make more things pub in the renderer (#12053)
IceSentry Feb 23, 2024
c641882
set pipeline to queued when shader is not yet available (#12051)
mockersf Feb 23, 2024
54e2b2e
Improve file watcher error msg (#12060)
torsteingrindvik Feb 23, 2024
31d7fcd
Upstreaming bevy_color. (#12013)
viridia Feb 23, 2024
bc7ac78
Add a release step, add links to the github release note (#12041)
ameknite Feb 23, 2024
2701188
Remove unnecessary wildcards from `LogPlugin` and convert warnings to…
doonv Feb 23, 2024
7980fbf
fix typo: converstion -> conversion (#12074)
ameknite Feb 24, 2024
d31de3f
bevy_color: adding 'palettes' module. (#12067)
viridia Feb 24, 2024
a52b251
`bevy_color`: Created a private trait `StandardColor` (#12072)
bushrat011899 Feb 24, 2024
52f88e5
Loosen lifetime requirements for single-threaded `Scope::spawn` to ma…
chescock Feb 24, 2024
dc696c0
make reflection probe example frame rate independent (#12065)
mockersf Feb 24, 2024
9d420b4
Pad SkyUniforms to 16 bytes for WASM (#12078)
Waridley Feb 24, 2024
9d13ae3
Fix SimpleExecutor crash (#12076)
SpecificProtagonist Feb 24, 2024
42e6155
Immediately apply deferred system params in System::run (#11823)
james7132 Feb 24, 2024
65267dd
Fix missing renaming of Input -> ButtonInput (#12096)
ShadowMitia Feb 24, 2024
972ca62
`bevy_color`: Added `Xyza` Colour Space (#12079)
bushrat011899 Feb 24, 2024
e689d46
remove unnecessary mut in query in ui_texture_slice example (#12101)
rmsthebest Feb 24, 2024
10aef14
Adding "fluent" methods to modify color channels. (#12099)
viridia Feb 24, 2024
de004da
Rename `bevy_render::Color` to `LegacyColor` (#12069)
alice-i-cecile Feb 24, 2024
c0a52d9
Reflect `GizmoConfigStore` (#12104)
SludgePhD Feb 25, 2024
5f8f3b5
Check `cfg` during CI and fix feature typos (#12103)
eerii Feb 25, 2024
78b5e49
Add a way to get a strong handle from an AssetId (#12088)
nicopap Feb 25, 2024
bc2ddce
Simplified `bevy_color` `Srgba` hex string parsing (#12082)
afonsolage Feb 25, 2024
14042b1
Normalise root path in file_watcher (#12102)
theon Feb 25, 2024
a7be8a2
Prefer `UVec2` when working with texture dimensions (#11698)
CptPotato Feb 25, 2024
fd91c61
Cleanup: Use Parallel in extract_meshes (#12084)
james7132 Feb 25, 2024
ff29c43
Increase 3D Lighting example's light intensity (#11982)
BD103 Feb 25, 2024
5bcc100
Update docstrings for some Commands to use the correct type (#12111)
cBournhonesque Feb 25, 2024
bb00d9f
Added `add_group` to `PluginGroupBuilder` (#9530)
bushrat011899 Feb 25, 2024
e5994a4
Early-exit bloom node if `intensity == 0.0` (#12113)
SludgePhD Feb 25, 2024
5e63f68
Made `bevy_color` a dependency of `bevy_render` (#12105)
bushrat011899 Feb 25, 2024
ad5d790
Fix WebGL not rendering `StandardMaterial` (#12110)
janhohenheim Feb 25, 2024
3a1b9b9
Make Gilrs a normal resource on non-Wasm targets (#12092)
james7132 Feb 26, 2024
c4caebb
Run the multi-threaded executor at the end of each system task. (#11906)
chescock Feb 26, 2024
e0e9794
Add Archetype::component_count (#12119)
AxiomaticSemantics Feb 26, 2024
a463d0c
Fixed iOS documentation typo for xcrun command (#12112)
JoshuaSchlichting Feb 26, 2024
78b6fa1
sort alpha masked pipelines by pipeline & mesh instead of by distance…
Elabajaba Feb 26, 2024
43b859d
Implements conversion from `SystemId` to `Entity` (#11759)
porkbrain Feb 26, 2024
8ec6552
Port `bevy_core_pipeline` to `LinearRgba` (#12116)
alice-i-cecile Feb 26, 2024
f939c09
`bevy_color`: Added `Hsva` and `Hwba` Models (#12114)
bushrat011899 Feb 26, 2024
9bd6cc0
Add `Direction3dA` and move direction types out of `primitives` (#12018)
Jondolf Feb 26, 2024
1b1934f
Fix `CameraProjectionPlugin` not implementing `Plugin` in some cases …
doonv Feb 26, 2024
ebdda09
make gizmo groups ordering stable when rendering (#12034)
mockersf Feb 26, 2024
40bfce5
Add random shader utils, fix cluster_debug_visualization (#11956)
JMS55 Feb 26, 2024
fa179ba
Use `spawn_batch` in `many_lights` example (#11979)
BD103 Feb 26, 2024
5d941d5
Remove custom window size from `flex_layout` example (#11876)
rparrett Feb 26, 2024
51edf9c
Remove the UpdateAssets and AssetEvents schedules (#11986)
james7132 Feb 26, 2024
2b7a3b2
reflect: treat proxy types correctly when serializing (#12024)
soqb Feb 26, 2024
c97d010
Add `typos` - Source code spell checker (#12036)
ameknite Feb 26, 2024
1cded6a
Use immutable key for `HashMap` and `HashSet` (#12086)
tguichaoua Feb 26, 2024
f45450e
Added reflect support for std::HashSet, BTreeSet and BTreeMap. (#12124)
mintlu8 Feb 26, 2024
b96193e
Improve lighting in more examples (#12021)
BD103 Feb 26, 2024
1f2b5fc
Fix typos (#12131)
alice-i-cecile Feb 26, 2024
881f660
Make `TemporalJitter` and `MipBias` reflectable (#12132)
SludgePhD Feb 26, 2024
3bdeac6
Add to_bits and from_bits functions to `AssetIndex` (#12127)
TheRawMeatball Feb 26, 2024
4d325eb
`bevy_color`: Add `Laba` to support Lab Color Model (#12115)
bushrat011899 Feb 26, 2024
abc6f98
Impl ShaderType for LinearRgba (#12137)
IceSentry Feb 26, 2024
5860e01
Use LinearRgba in `bevy_gizmos` internals (#12128)
alice-i-cecile Feb 26, 2024
f7f7e32
Add methods to directly load assets from World (#12023)
nicopap Feb 27, 2024
fd0f1a3
Remove unnecessary `impl_reflect_for_btree_map` macro (#12146)
chompaa Feb 27, 2024
8020805
examples/ecs/iter_combinations: Initialize velocity using fixed times…
IWonderWhatThisAPIDoes Feb 27, 2024
00b6545
Update tracing-log requirement from 0.1.2 to 0.2.0 (#10404)
dependabot[bot] Feb 27, 2024
bbcdf68
`bevy_color`: Added Color Conversion Mermaid Diagram (#12147)
bushrat011899 Feb 27, 2024
ae9b4fc
Remove downcast-rs as a dependency from bevy_ecs (#12151)
james7132 Feb 27, 2024
08ce579
CI: run long tasks on new macOS runners (#12133)
mockersf Feb 27, 2024
d261a86
compute shader game of life example: use R32Float instead of Rgba8Uno…
mockersf Feb 27, 2024
309c387
Replace `FromWorld` requirement on `ReflectResource` and reflect `Res…
SkiFire13 Feb 27, 2024
2fbb4c6
Define a prelude for bevy_color, and add it to bevy_internal (#12158)
alice-i-cecile Feb 27, 2024
cbfeb94
include links in error messages (#12165)
tomara-x Feb 28, 2024
9ae5ba2
`bevy_color::Color` convenience methods (#12171)
alice-i-cecile Feb 28, 2024
35cec8b
Add Grid gizmos (#11988)
lynn-lumen Feb 28, 2024
6f849d3
add note about unloading assets from ram in wasm (#12166)
mockersf Feb 28, 2024
6774e04
`bevy_color`: Add Oklch Color Space (#12168)
bushrat011899 Feb 28, 2024
c2ae51d
Re-export `basic` color palette via `css` color palette (#12172)
alice-i-cecile Feb 28, 2024
ecdd284
Register `fxaa::Sensitivity` and derive `Debug` (#12167)
SludgePhD Feb 28, 2024
557e582
Add a colon to error message link (#12174)
BD103 Feb 28, 2024
f0c41b6
add cancel in progress support to automated CI checks (#11130)
lee-orr Feb 28, 2024
a543536
Cubic splines overhaul (#10701)
JohnTheCoolingFan Feb 28, 2024
315e637
Add tinting to the border in `ui_texture_slice` example (#11901)
rparrett Feb 28, 2024
c13de09
ui materials respect target camera (#12183)
robtfm Feb 28, 2024
7826313
Make sysinfo diagnostic plugin optional (#12164)
AxiomaticSemantics Feb 28, 2024
043041f
`bevy_color`: Add `sequence_dispersed` to `Hsla`, `Lcha`, `Oklcha` (#…
bushrat011899 Feb 28, 2024
f418de8
Rename `Direction2d/3d` to `Dir2/3` (#12189)
Jondolf Feb 28, 2024
21adeb6
Add an index argument to parallel iteration helpers in bevy_tasks (#1…
msvbg Feb 29, 2024
58ee3e8
Calculate AABBs to enable text2d culling (#11663)
Kanabenki Feb 29, 2024
b24ab2e
minor oklab/oklch doc nitpicks (#12196)
Gingeh Feb 29, 2024
599e5e4
Migrate from `LegacyColor` to `bevy_color::Color` (#12163)
alice-i-cecile Feb 29, 2024
080f280
Avoid panicking with non-UI nodes (#12213)
SludgePhD Feb 29, 2024
ccae470
configure_surface needs to be on the main thread on iOS (#12055)
mockersf Feb 29, 2024
f8f8bdd
Add coordinate axes gizmo (#12211)
mweatherley Feb 29, 2024
499c978
Update cargo deny (#12178)
ameknite Mar 1, 2024
4aca55d
bloom: use emissive instead of base_color for emissive (#12220)
mockersf Mar 1, 2024
bcdca06
Various improvements to the `contributors` example (#12217)
rparrett Mar 1, 2024
94ff123
Component Lifecycle Hooks and a Deferred World (#10756)
james-j-obrien Mar 1, 2024
6b212a8
Build dev docs like docs.rs (#12223)
mockersf Mar 1, 2024
fc0aa4f
Explicitly run `+nightly` for `-Zcheck-cfg` pass in ci. (#12230)
targrub Mar 1, 2024
f9cc91d
Intern mesh vertex buffer layouts so that we don't have to compare th…
pcwalton Mar 1, 2024
cc32610
Add `size` and `physical_size` to `window` (#12238)
hi-names-nat Mar 1, 2024
165c360
Update `wgpu` to v0.19.3 and unpin `web-sys`. (#12247)
xStrom Mar 2, 2024
bacd5e8
Replace init_component_info with register_component_hooks (#12244)
james-j-obrien Mar 2, 2024
8dd5692
Add nightly hint to config.toml (#12257)
janhohenheim Mar 2, 2024
45f7af6
Update engine_style_guide with guideline to link to the error code wh…
NoahShomette Mar 2, 2024
eb52a48
Batching: replace GpuArrayBufferIndex::index with a u32 (#12250)
james7132 Mar 2, 2024
0d172b2
Document instability of Entity's internal representation (#12249)
james7132 Mar 2, 2024
5619bd0
Replace bevy_log's tracing reexport with bevy_utils' (#12254)
james7132 Mar 2, 2024
04ec105
PBR: use attenuation instead of base_color for attenuation (#12266)
mockersf Mar 2, 2024
3b383ca
Use RPIT when viable for asset processing.
ArthurBrussee Jan 15, 2024
0554015
Add short doc comment on ErasedAssetReader / ErasedAssetWriter.
ArthurBrussee Jan 15, 2024
fc4dc2d
Typos (necesarry -> necessary, AssetReader -> AssetWriter)
ArthurBrussee Jan 15, 2024
fa955c1
Missed android impl -> async conversion.
ArthurBrussee Jan 17, 2024
67fb3b9
Add "FutureSend" to add platform conditional send bounds.
ArthurBrussee Jan 17, 2024
d928f76
Cargo fmt
ArthurBrussee Jan 17, 2024
3dfd72d
Compile for non-wasm platforms, oops.
ArthurBrussee Jan 17, 2024
fd76370
New impl after merge.
ArthurBrussee Jan 17, 2024
209d442
Update error golden (MSRV bump, guess 1.75 has a better error message)
ArthurBrussee Jan 17, 2024
9bb6b1a
Added imports for doc references.
ArthurBrussee Jan 17, 2024
78e3103
Revert "Update error golden (MSRV bump, guess 1.75 has a better error…
ArthurBrussee Jan 17, 2024
3785727
Simplify ErasedX a bit
ArthurBrussee Jan 18, 2024
678baa3
Remove comment about CompressorParams
ArthurBrussee Jan 22, 2024
0e0438c
FutureSend -> WasmNotSend
ArthurBrussee Jan 22, 2024
5c26deb
Relax some lifetimes now that future box doesn't need one.
ArthurBrussee Jan 22, 2024
954867e
Also do lifetimes for wasm
ArthurBrussee Jan 23, 2024
fca4175
And for android.
ArthurBrussee Jan 23, 2024
4ef022f
WasmNotSend -> ConditionalSend
ArthurBrussee Jan 23, 2024
8608765
More lifetimes for when using sync reader.
ArthurBrussee Jan 23, 2024
e988ef5
Update AssetTransformer
ArthurBrussee Feb 4, 2024
b2d703c
Pull BoxedFuture out of conditionally compiled mod
ArthurBrussee Feb 6, 2024
0c70da9
Derive BoxedFuture lifetime
ArthurBrussee Feb 6, 2024
fa194dc
Update to latest
ArthurBrussee Mar 2, 2024
a0d0cc3
Merge branch 'async-post-RPIT' of https://github.com/ArthurBrussee/be…
ArthurBrussee Mar 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 119 additions & 167 deletions crates/bevy_asset/src/io/file/file_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,223 +3,175 @@ use crate::io::{
Reader, Writer,
};
use async_fs::{read_dir, File};
use bevy_utils::BoxedFuture;
use futures_lite::StreamExt;

use std::path::Path;

use super::{FileAssetReader, FileAssetWriter};

impl AssetReader for FileAssetReader {
fn read<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<Box<Reader<'a>>, AssetReaderError>> {
Box::pin(async move {
let full_path = self.root_path.join(path);
match File::open(&full_path).await {
Ok(file) => {
let reader: Box<Reader> = Box::new(file);
Ok(reader)
}
Err(e) => {
if e.kind() == std::io::ErrorKind::NotFound {
Err(AssetReaderError::NotFound(full_path))
} else {
Err(e.into())
}
async fn read<'a>(&'a self, path: &'a Path) -> Result<Box<Reader<'a>>, AssetReaderError> {
let full_path = self.root_path.join(path);
match File::open(&full_path).await {
Ok(file) => {
let reader: Box<Reader> = Box::new(file);
Ok(reader)
}
Err(e) => {
if e.kind() == std::io::ErrorKind::NotFound {
Err(AssetReaderError::NotFound(full_path))
} else {
Err(e.into())
}
}
})
}
}

fn read_meta<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<Box<Reader<'a>>, AssetReaderError>> {
async fn read_meta<'a>(&'a self, path: &'a Path) -> Result<Box<Reader<'a>>, AssetReaderError> {
let meta_path = get_meta_path(path);
Box::pin(async move {
let full_path = self.root_path.join(meta_path);
match File::open(&full_path).await {
Ok(file) => {
let reader: Box<Reader> = Box::new(file);
Ok(reader)
}
Err(e) => {
if e.kind() == std::io::ErrorKind::NotFound {
Err(AssetReaderError::NotFound(full_path))
} else {
Err(e.into())
}
let full_path = self.root_path.join(meta_path);
match File::open(&full_path).await {
Ok(file) => {
let reader: Box<Reader> = Box::new(file);
Ok(reader)
}
Err(e) => {
if e.kind() == std::io::ErrorKind::NotFound {
Err(AssetReaderError::NotFound(full_path))
} else {
Err(e.into())
}
}
})
}
}

fn read_directory<'a>(
async fn read_directory<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<Box<PathStream>, AssetReaderError>> {
Box::pin(async move {
let full_path = self.root_path.join(path);
match read_dir(&full_path).await {
Ok(read_dir) => {
let root_path = self.root_path.clone();
let mapped_stream = read_dir.filter_map(move |f| {
f.ok().and_then(|dir_entry| {
let path = dir_entry.path();
// filter out meta files as they are not considered assets
if let Some(ext) = path.extension().and_then(|e| e.to_str()) {
if ext.eq_ignore_ascii_case("meta") {
return None;
}
) -> Result<Box<PathStream>, AssetReaderError> {
let full_path = self.root_path.join(path);
match read_dir(&full_path).await {
Ok(read_dir) => {
let root_path = self.root_path.clone();
let mapped_stream = read_dir.filter_map(move |f| {
f.ok().and_then(|dir_entry| {
let path = dir_entry.path();
// filter out meta files as they are not considered assets
if let Some(ext) = path.extension().and_then(|e| e.to_str()) {
if ext.eq_ignore_ascii_case("meta") {
return None;
}
let relative_path = path.strip_prefix(&root_path).unwrap();
Some(relative_path.to_owned())
})
});
let read_dir: Box<PathStream> = Box::new(mapped_stream);
Ok(read_dir)
}
Err(e) => {
if e.kind() == std::io::ErrorKind::NotFound {
Err(AssetReaderError::NotFound(full_path))
} else {
Err(e.into())
}
}
let relative_path = path.strip_prefix(&root_path).unwrap();
Some(relative_path.to_owned())
})
});
let read_dir: Box<PathStream> = Box::new(mapped_stream);
Ok(read_dir)
}
Err(e) => {
if e.kind() == std::io::ErrorKind::NotFound {
Err(AssetReaderError::NotFound(full_path))
} else {
Err(e.into())
}
}
})
}
}

fn is_directory<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<bool, AssetReaderError>> {
Box::pin(async move {
let full_path = self.root_path.join(path);
let metadata = full_path
.metadata()
.map_err(|_e| AssetReaderError::NotFound(path.to_owned()))?;
Ok(metadata.file_type().is_dir())
})
async fn is_directory<'a>(&'a self, path: &'a Path) -> Result<bool, AssetReaderError> {
let full_path = self.root_path.join(path);
let metadata = full_path
.metadata()
.map_err(|_e| AssetReaderError::NotFound(path.to_owned()))?;
Ok(metadata.file_type().is_dir())
}
}

impl AssetWriter for FileAssetWriter {
fn write<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<Box<Writer>, AssetWriterError>> {
Box::pin(async move {
let full_path = self.root_path.join(path);
if let Some(parent) = full_path.parent() {
async_fs::create_dir_all(parent).await?;
}
let file = File::create(&full_path).await?;
let writer: Box<Writer> = Box::new(file);
Ok(writer)
})
async fn write<'a>(&'a self, path: &'a Path) -> Result<Box<Writer>, AssetWriterError> {
let full_path = self.root_path.join(path);
if let Some(parent) = full_path.parent() {
async_fs::create_dir_all(parent).await?;
}
let file = File::create(&full_path).await?;
let writer: Box<Writer> = Box::new(file);
Ok(writer)
}

fn write_meta<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<Box<Writer>, AssetWriterError>> {
Box::pin(async move {
let meta_path = get_meta_path(path);
let full_path = self.root_path.join(meta_path);
if let Some(parent) = full_path.parent() {
async_fs::create_dir_all(parent).await?;
}
let file = File::create(&full_path).await?;
let writer: Box<Writer> = Box::new(file);
Ok(writer)
})
async fn write_meta<'a>(&'a self, path: &'a Path) -> Result<Box<Writer>, AssetWriterError> {
let meta_path = get_meta_path(path);
let full_path = self.root_path.join(meta_path);
if let Some(parent) = full_path.parent() {
async_fs::create_dir_all(parent).await?;
}
let file = File::create(&full_path).await?;
let writer: Box<Writer> = Box::new(file);
Ok(writer)
}

fn remove<'a>(&'a self, path: &'a Path) -> BoxedFuture<'a, Result<(), AssetWriterError>> {
Box::pin(async move {
let full_path = self.root_path.join(path);
async_fs::remove_file(full_path).await?;
Ok(())
})
async fn remove<'a>(&'a self, path: &'a Path) -> Result<(), AssetWriterError> {
let full_path = self.root_path.join(path);
async_fs::remove_file(full_path).await?;
Ok(())
}

fn remove_meta<'a>(&'a self, path: &'a Path) -> BoxedFuture<'a, Result<(), AssetWriterError>> {
Box::pin(async move {
let meta_path = get_meta_path(path);
let full_path = self.root_path.join(meta_path);
async_fs::remove_file(full_path).await?;
Ok(())
})
async fn remove_meta<'a>(&'a self, path: &'a Path) -> Result<(), AssetWriterError> {
let meta_path = get_meta_path(path);
let full_path = self.root_path.join(meta_path);
async_fs::remove_file(full_path).await?;
Ok(())
}

fn rename<'a>(
async fn rename<'a>(
&'a self,
old_path: &'a Path,
new_path: &'a Path,
) -> BoxedFuture<'a, Result<(), AssetWriterError>> {
Box::pin(async move {
let full_old_path = self.root_path.join(old_path);
let full_new_path = self.root_path.join(new_path);
if let Some(parent) = full_new_path.parent() {
async_fs::create_dir_all(parent).await?;
}
async_fs::rename(full_old_path, full_new_path).await?;
Ok(())
})
) -> Result<(), AssetWriterError> {
let full_old_path = self.root_path.join(old_path);
let full_new_path = self.root_path.join(new_path);
if let Some(parent) = full_new_path.parent() {
async_fs::create_dir_all(parent).await?;
}
async_fs::rename(full_old_path, full_new_path).await?;
Ok(())
}

fn rename_meta<'a>(
async fn rename_meta<'a>(
&'a self,
old_path: &'a Path,
new_path: &'a Path,
) -> BoxedFuture<'a, Result<(), AssetWriterError>> {
Box::pin(async move {
let old_meta_path = get_meta_path(old_path);
let new_meta_path = get_meta_path(new_path);
let full_old_path = self.root_path.join(old_meta_path);
let full_new_path = self.root_path.join(new_meta_path);
if let Some(parent) = full_new_path.parent() {
async_fs::create_dir_all(parent).await?;
}
async_fs::rename(full_old_path, full_new_path).await?;
Ok(())
})
) -> Result<(), AssetWriterError> {
let old_meta_path = get_meta_path(old_path);
let new_meta_path = get_meta_path(new_path);
let full_old_path = self.root_path.join(old_meta_path);
let full_new_path = self.root_path.join(new_meta_path);
if let Some(parent) = full_new_path.parent() {
async_fs::create_dir_all(parent).await?;
}
async_fs::rename(full_old_path, full_new_path).await?;
Ok(())
}

fn remove_directory<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<(), AssetWriterError>> {
Box::pin(async move {
let full_path = self.root_path.join(path);
async_fs::remove_dir_all(full_path).await?;
Ok(())
})
async fn remove_directory<'a>(&'a self, path: &'a Path) -> Result<(), AssetWriterError> {
let full_path = self.root_path.join(path);
async_fs::remove_dir_all(full_path).await?;
Ok(())
}

fn remove_empty_directory<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<(), AssetWriterError>> {
Box::pin(async move {
let full_path = self.root_path.join(path);
async_fs::remove_dir(full_path).await?;
Ok(())
})
async fn remove_empty_directory<'a>(&'a self, path: &'a Path) -> Result<(), AssetWriterError> {
let full_path = self.root_path.join(path);
async_fs::remove_dir(full_path).await?;
Ok(())
}

fn remove_assets_in_directory<'a>(
async fn remove_assets_in_directory<'a>(
&'a self,
path: &'a Path,
) -> BoxedFuture<'a, Result<(), AssetWriterError>> {
Box::pin(async move {
let full_path = self.root_path.join(path);
async_fs::remove_dir_all(&full_path).await?;
async_fs::create_dir_all(&full_path).await?;
Ok(())
})
) -> Result<(), AssetWriterError> {
let full_path = self.root_path.join(path);
async_fs::remove_dir_all(&full_path).await?;
async_fs::create_dir_all(&full_path).await?;
Ok(())
}
}
Loading
Loading