You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempt to use the AssetCountDiagnosticsPlugin with a Texture or Mesh.
What you expected to happen
I expected this to work without error
use bevy::prelude::*;use bevy::asset::diagnostic::AssetCountDiagnosticsPlugin;fnmain(){App::build().add_plugins(DefaultPlugins).add_plugin(AssetCountDiagnosticsPlugin::<Texture>::default()).run()}
What actually happened
I receive this error in the console
May 13 11:31:16.496 WARN bevy_diagnostic::diagnostic: Diagnostic "asset_count bevy_render::texture::texture::Texture" has name longer than 32 characters, and so might overflow in the LogDiagnosticsPlugin Consider using a shorter name.
I may be wrong but since the 'name' it is complaining about is the full path of the object, can this 'name' be changed from outside bevy?
Additional Error
Another thing I've noticed is I'm unable to to create a AssetCountDiagnosticsPlugin for Mesh assets.
Since Mesh doesn't implement Default it fails to compile
Compiling asset-count v0.1.0 (/home/patrick/Projects/asset-count)
error[E0599]: the function or associated item `default` exists for struct `AssetCountDiagnosticsPlugin<bevy::prelude::Mesh>`, but its trait bounds were not satisfied
--> src/main.rs:7:58
|
7 | .add_plugin(AssetCountDiagnosticsPlugin::<Mesh>::default())
| ^^^^^^^ function or associated item cannot be called on `AssetCountDiagnosticsPlugin<bevy::prelude::Mesh>` due to unsatisfied trait bounds
|
::: /home/patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_asset-0.5.0/src/diagnostic/asset_count_diagnostics_plugin.rs:8:1
|
8 | pub struct AssetCountDiagnosticsPlugin<T: Asset> {
| ------------------------------------------------ doesn't satisfy `_: Default`
|
::: /home/patrick/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.5.0/src/mesh/mesh.rs:209:1
|
209 | pub struct Mesh {
| --------------- doesn't satisfy `bevy::prelude::Mesh: Default`
|
= note: the following trait bounds were not satisfied:
`bevy::prelude::Mesh: Default`
which is required by `AssetCountDiagnosticsPlugin<bevy::prelude::Mesh>: Default`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
error: could not compile `asset-count`
To learn more, run the command again with --verbose.
By looking at the source of AssetCountDiagnosticsPlugin it appears that the default method is only implemented where T: Default. But it should be implemented for any T I believe
The text was updated successfully, but these errors were encountered:
Bevy version
0.5.0
Operating system & version
Manjaro 21.04
What you did
Attempt to use the AssetCountDiagnosticsPlugin with a Texture or Mesh.
What you expected to happen
I expected this to work without error
What actually happened
I receive this error in the console
I may be wrong but since the 'name' it is complaining about is the full path of the object, can this 'name' be changed from outside bevy?
Additional Error
Another thing I've noticed is I'm unable to to create a AssetCountDiagnosticsPlugin for Mesh assets.
Since Mesh doesn't implement Default it fails to compile
By looking at the source of AssetCountDiagnosticsPlugin it appears that the default method is only implemented where T: Default. But it should be implemented for any T I believe
The text was updated successfully, but these errors were encountered: