Skip to content

webgpu: 3d_scene example panics when pbr_pcss feature is enabled #16000

@rparrett

Description

@rparrett

Bevy version

main
bisected to #13497

Relevant system information

AdapterInfo { name: "", vendor: 0, device: 0, device_type: Other, driver: "", driver_info: "", backend: BrowserWebGpu }
Chrome Version 129.0.6668.101 (Official Build) (arm64)
(macos / m1 max)

This does not seem to be platform-specific. I also tested on:

win11 / nvidia 4080
Chrome 129

What you did

cargo run -p build-wasm-example -- --api webgpu 3d_scene --features=pbr_pcss
basic-http-server examples/wasm/

What went wrong

Compilation log for [Invalid ShaderModule (unlabeled)]:
1 error(s) generated while compiling the shader:
:704:25 error: no matching call to 'textureSampleLevel(texture_depth_2d_array, sampler, vec2<f32>, i32, f32)'

14 candidate functions:
 • 'textureSampleLevel(texture: texture_depth_2d_array  ✓ , sampler: sampler  ✓ , coords: vec2<f32>  ✓ , array_index: A  ✓ , level: L  ✗ ) -> f32' where:
      ✓  'A' is 'i32' or 'u32'
      ✗  'L' is 'i32' or 'u32'
 • 'textureSampleLevel(texture: texture_2d_array<f32>  ✗ , sampler: sampler  ✓ , coords: vec2<f32>  ✓ , array_index: A  ✓ , level: f32  ✓ ) -> vec4<f32>' where:
      ✓  'A' is 'i32' or 'u32'
 • 'textureSampleLevel(texture: texture_cube_array<f32>  ✗ , sampler: sampler  ✓ , coords: vec3<f32>  ✗ , array_index: A  ✓ , level: f32  ✓ ) -> vec4<f32>' where:
      ✓  'A' is 'i32' or 'u32'
 • 'textureSampleLevel(texture: texture_depth_2d  ✗ , sampler: sampler  ✓ , coords: vec2<f32>  ✓ , level: L  ✓ , offset: vec2<i32>  ✗ ) -> f32' where:
      ✓  'L' is 'i32' or 'u32'
 • 'textureSampleLevel(texture: texture_depth_2d_array  ✓ , sampler: sampler  ✓ , coords: vec2<f32>  ✓ , array_index: A  ✓ , level: L  ✗ , offset: vec2<i32>  ✗ ) -> f32' where:
      ✓  'A' is 'i32' or 'u32'
      ✗  'L' is 'i32' or 'u32'
 • 'textureSampleLevel(texture: texture_2d_array<f32>  ✗ , sampler: sampler  ✓ , coords: vec2<f32>  ✓ , array_index: A  ✓ , level: f32  ✓ , offset: vec2<i32>  ✗ ) -> vec4<f32>' where:
      ✓  'A' is 'i32' or 'u32'
 • 'textureSampleLevel(texture: texture_depth_2d  ✗ , sampler: sampler  ✓ , coords: vec2<f32>  ✓ , level: L  ✓ ) -> f32' where:
      ✓  'L' is 'i32' or 'u32'
 • 'textureSampleLevel(texture: texture_depth_cube_array  ✗ , sampler: sampler  ✓ , coords: vec3<f32>  ✗ , array_index: A  ✓ , level: L  ✗ ) -> f32' where:
      ✓  'A' is 'i32' or 'u32'
      ✗  'L' is 'i32' or 'u32'
 • 'textureSampleLevel(texture: texture_2d<f32>  ✗ , sampler: sampler  ✓ , coords: vec2<f32>  ✓ , level: f32  ✗ , offset: vec2<i32>  ✗ ) -> vec4<f32>'
 • 'textureSampleLevel(texture: texture_2d<f32>  ✗ , sampler: sampler  ✓ , coords: vec2<f32>  ✓ , level: f32  ✗ ) -> vec4<f32>'
 • 'textureSampleLevel(texture: texture_depth_cube  ✗ , sampler: sampler  ✓ , coords: vec3<f32>  ✗ , level: L  ✓ ) -> f32' where:
      ✓  'L' is 'i32' or 'u32'
 • 'textureSampleLevel(texture: texture_3d<f32>  ✗ , sampler: sampler  ✓ , coords: vec3<f32>  ✗ , level: f32  ✗ , offset: vec3<i32>  ✗ ) -> vec4<f32>'
 • 'textureSampleLevel(texture: texture_3d<f32>  ✗ , sampler: sampler  ✓ , coords: vec3<f32>  ✗ , level: f32  ✗ ) -> vec4<f32>'
 • 'textureSampleLevel(texture: texture_cube<f32>  ✗ , sampler: sampler  ✓ , coords: vec3<f32>  ✗ , level: f32  ✗ ) -> vec4<f32>'

    let sampled_depth = textureSampleLevel(directional_shadow_texturesX_naga_oil_mod_XMJSXM6K7OBRHEOR2NVSXG2C7OZUWK527MJUW4ZDJNZTXGX, directional_shadow_textures_linear_samplerX_naga_oil_mod_XMJSXM6K7OBRHEOR2NVSXG2C7OZUWK527MJUW4ZDJNZTXGX, light_local_3, array_index_3, 0f);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Understand this warning
127.0.0.1/:1 [Invalid ShaderModule (unlabeled)] is invalid.
 - While validating fragment stage ([Invalid ShaderModule (unlabeled)], entryPoint: fragment).
 - While validating fragment state.
 - While calling [Device].CreateRenderPipeline([RenderPipelineDescriptor "pbr_opaque_mesh_pipeline"]).
Understand this warning
225[Invalid RenderPipeline "pbr_opaque_mesh_pipeline"] is invalid.
 - While encoding [RenderPassEncoder "main_opaque_pass_3d"].SetPipeline([Invalid RenderPipeline "pbr_opaque_mesh_pipeline"]).
 - While finishing [CommandEncoder "main_opaque_pass_3d_command_encoder"].
Understand this warning
225[Invalid CommandBuffer "main_opaque_pass_3d_command_encoder" from CommandEncoder "main_opaque_pass_3d_command_encoder"] is invalid.
 - While calling [Queue].Submit([[CommandBuffer], [CommandBuffer "shadow_pass_command_encoder" from CommandEncoder "shadow_pass_command_encoder"], [CommandBuffer "shadow_pass_command_encoder" from CommandEncoder "shadow_pass_command_encoder"], [CommandBuffer "shadow_pass_command_encoder" from CommandEncoder "shadow_pass_command_encoder"], [CommandBuffer "shadow_pass_command_encoder" from CommandEncoder "shadow_pass_command_encoder"], [CommandBuffer "shadow_pass_command_encoder" from CommandEncoder "shadow_pass_command_encoder"], [CommandBuffer "shadow_pass_command_encoder" from CommandEncoder "shadow_pass_command_encoder"], [CommandBuffer], [Invalid CommandBuffer "main_opaque_pass_3d_command_encoder" from CommandEncoder "main_opaque_pass_3d_command_encoder"], [CommandBuffer]])

Additional information

Seems to be a separate issue from what's going on with webgl2, which is documented here: #15998

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorO-WebGPUSpecific to the WebGPU render APIP-CrashA sudden unexpected crashS-BlockedThis cannot move forward until something else changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions