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
{{ message }}
Repository navigation
Bevy 3d_scene not working in WebGL2 on windows #23627
3d rendering seems to work for me on MacOS and Linux in the browser (but not for @mockersf in CI).
Both firefox and chrome are affected.
Bisected the issue back to #23277 (wgpu update for v29)
ERROR /home/runner/.cargo/git/checkouts/bevy-50d7e162b728c6c6/d06aa47/crates/bevy_render/src/error_handler.rs:114
Caught rendering error: Validation ErrorCaused by: In a CommandEncoder
In a set_pipeline command
RenderPipeline with 'pbr_opaque_mesh_pipeline' label is invalid
I can reproduce on linux by setting WGPU_SETTINGS_PRIO=webgl2, even though everything works fine in an actual browser.
The issue seems related to hitting limits on the number of uniforms:
ERROR bevy_render::error_handler: Caught rendering error: Validation Error
Caused by:
In Device::create_pipeline_layout
Too many bindings of type UniformBuffers in Stage ShaderStages(FRAGMENT), limit is 11, count was 13. Check the limit `max_uniform_buffers_per_shader_stage` passed to `Adapter::request_device`
ERROR bevy_render::error_handler: Caught rendering error: Validation Error
Caused by:
In Device::create_render_pipeline, label = 'pbr_opaque_mesh_pipeline'
PipelineLayout with '' label is invalid
ERROR RenderContextState::apply{system=<Enable the debug feature to see the name>}: bevy_render::error_handler: Caught rendering error: Validation Error
Caused by:
In a CommandEncoder
In a set_pipeline command
RenderPipeline with 'pbr_opaque_mesh_pipeline' label is invalid
wgpu changed the way they calculate the number of bindings in wgu29 (in this PR), which I suspect is why we're only hitting this bug after the update.
I tried in CI and I have crashes on all os/browsers in webgl2:
ERROR crates/bevy_render/src/error_handler.rs:114 Caught rendering error: Validation Error
Caused by:
In Device::create_bind_group_layout, label = 'sparse buffer update bind group layout'
Too many bindings of type StorageBuffers in Stage ShaderStages(COMPUTE), limit is 0, count was 3. Check the limit `max_storage_buffers_per_shader_stage` passed to `Adapter::request_device`
or
%cERROR%c crates/bevy_render/src/error_handler.rs:114%c Caught rendering error: Validation Error
Caused by:
In Device::create_pipeline_layout
BindGroupLayout with 'sparse buffer update bind group layout' label is invalid
Just want to note that some of these validation errors were happening before the wgpu29 update.
These errors were happening before the wgpu29 update, and do not appear to break 3d_scene.
ERROR app: crates\bevy_render\src\error_handler.rs:114 Caught rendering error: Validation Error
Caused by:
In Device::create_bind_group_layout, label = 'sparse buffer update bind group layout'
Too many bindings of type StorageBuffers in Stage ShaderStages(COMPUTE), limit is 0, count was 3. Check the limit `max_storage_buffers_per_shader_stage` passed to `Adapter::request_device`
ERROR app: crates\bevy_render\src\error_handler.rs:114 Caught rendering error: Validation Error
Caused by:
In Device::create_pipeline_layout
BindGroupLayout with 'sparse buffer update bind group layout' label is invalid
ERROR app: crates\bevy_render\src\error_handler.rs:114 Caught rendering error: Validation Error
Caused by:
In Device::create_compute_pipeline, label = 'sparse buffer update pipeline'
PipelineLayout with '' label is invalid
These errors appear after the wgpu29 update, where 3d_scene is broken:
ERROR app: crates\bevy_render\src\error_handler.rs:114 Caught rendering error: Validation Error
Caused by:
In Device::create_pipeline_layout
Too many bindings of type UniformBuffers in Stage ShaderStages(FRAGMENT), limit is 12, count was 13. Check the limit `max_uniform_buffers_per_shader_stage` passed to `Adapter::request_device`
ERROR app: crates\bevy_render\src\error_handler.rs:114 Caught rendering error: Validation Error
Caused by:
In a CommandEncoder
In a set_pipeline command
RenderPipeline with 'pbr_opaque_mesh_pipeline' label is invalid
I did some investigation yesterday evening and here is what I came up with:
I’m able to reproduce this on DuckDuckGo on a Mac, which is when the max_uniform_buffers_per_shader_stage is 12. I cannot reproduce on Chrome because max_uniform_buffers_per_shader_stage is 16 there.
layout_entries in mesh_view_bindings.rs returns a Vec that has 12 Uniform buffers. OIT is not enabled when running the 3d_scene, but clustered_forward_buffer_binding_type and visibility_ranges_buffer_binding_type are both BufferBindingType::Uniform when running on the web. There are 7 calls to uniform_buffers in layout_entries, + 1 uniform buffer from environment_map_entries[3], and then there are 4 additional uniform buffers due to the *_buffer_binding_types being uniform.
The 13th Uniform buffer is added in SpecializeMeshPipeline::specialize via setup_morph_and_skinning_defs. The flags are all set to false, so it uses a model_only_layout. Because max_storage_buffers_per_shader_stage is 0, it ends up using another uniform buffer.
I’m unsure of what the fix actually should be here, but that at least accounts for all the uniform buffers that are actually being used.
Activity
dylansechet commentedon Apr 2, 2026
I can reproduce on linux by setting
WGPU_SETTINGS_PRIO=webgl2, even though everything works fine in an actual browser.The issue seems related to hitting limits on the number of uniforms:
wgpu changed the way they calculate the number of bindings in wgu29 (in this PR), which I suspect is why we're only hitting this bug after the update.
mockersf commentedon Apr 3, 2026
I tried in CI and I have crashes on all os/browsers in webgl2:
or
greeble-dev commentedon Apr 19, 2026
Just want to note that some of these validation errors were happening before the wgpu29 update.
These errors were happening before the wgpu29 update, and do not appear to break
3d_scene.These errors appear after the wgpu29 update, where
3d_sceneis broken:Tested on Win10/Chrome.
kfc35 commentedon Apr 23, 2026
I did some investigation yesterday evening and here is what I came up with:
max_uniform_buffers_per_shader_stageis 12. I cannot reproduce on Chrome becausemax_uniform_buffers_per_shader_stageis 16 there.layout_entriesinmesh_view_bindings.rsreturns a Vec that has 12 Uniform buffers. OIT is not enabled when running the 3d_scene, butclustered_forward_buffer_binding_typeandvisibility_ranges_buffer_binding_typeare bothBufferBindingType::Uniformwhen running on the web. There are 7 calls touniform_buffersinlayout_entries, + 1 uniform buffer fromenvironment_map_entries[3], and then there are 4 additional uniform buffers due to the *_buffer_binding_types being uniform.SpecializeMeshPipeline::specializeviasetup_morph_and_skinning_defs. The flags are all set to false, so it uses amodel_only_layout. Becausemax_storage_buffers_per_shader_stageis 0, it ends up using another uniform buffer.I’m unsure of what the fix actually should be here, but that at least accounts for all the uniform buffers that are actually being used.
Fix Motion Blur for WebGL2 (bevyengine#23953)
Fix Motion Blur for WebGL2 (bevyengine#23953)
Create mesh view bind group layout on demand to remove unused bindings (