-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
WebGL: INVALID_OPERATION drawArrays
with repo
#5732
Comments
I've met this issue as well, here is some more detail: The rendering completely stops (canvas turns fully transparent in firefox, and freezes in chromium) Here is the updated minimal example for latest bevy 0.9 use std::time::Duration;
use bevy::{prelude::*, sprite::MaterialMesh2dBundle};
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_startup_system(setup)
.add_system(update_ticker)
.run();
}
#[derive(Component)]
struct Ticker {
timer: Timer,
}
fn setup(
mut cmd: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<ColorMaterial>>,
) {
// This is needed otherwise the invalid operation will not fire.
cmd.spawn(Camera2dBundle {
..Default::default()
});
cmd.spawn((
Ticker {
timer: Timer::new(Duration::from_secs(5), TimerMode::Repeating),
},
MaterialMesh2dBundle {
mesh: meshes.add(shape::Quad::default().into()).into(),
material: materials.add(ColorMaterial::from(Color::WHITE)),
transform: Transform::from_translation(Vec3::new(0.0, 0.0, 1.0)),
..Default::default()
},
));
}
// delete the entity after 5 seconds.
fn update_ticker(mut cmd: Commands, time: Res<Time>, mut q: Query<(Entity, &mut Ticker)>) {
for (e, mut t) in q.iter_mut() {
t.timer.tick(time.delta());
if t.timer.just_finished() {
cmd.entity(e).despawn();
}
}
} System info: |
This is still an issue in 0.10 and I just ran into a case where setting |
This issue should be fixed as of #8446 🙂 |
That's great news! I have 3-4 projects plagued by this bug so I'll give that a try and report back soon! |
Can confirm this is fixed |
Bevy version
0.8.0
Relevant system information
What you did
Creating a color material and/or mesh then removing the entity that is rendering it triggers an error in the console.
The minimal repo case is located here for easy cloning + running via trunk: https://github.com/AlexOkafor/bevy_webgl_invalid_op_repo
Relevant code below:
What went wrong
when the same code is run natively, there doesn't seem to be any errors coming to the console.
Additional information
logs: 127.0.0.1-1660842111571.log
discord discussion: https://discord.com/channels/691052431525675048/1008708052519755916
The text was updated successfully, but these errors were encountered: