Skip to content

Unsupported GL_EXT_texture_shadow_lod causes panic in PBR pipeline #14045

Open
@ByteNybbler

Description

@ByteNybbler

Bevy version

So far this panic has been reproduced on the following versions of Bevy:

  • v0.13.2
  • v0.14.0-rc.3
  • v0.15.3
  • v0.16.0

Relevant system information

  • SystemInfo { os: "Windows 10 Home", kernel: "19045", cpu: "Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz", core_count: "4", memory: "15.9 GiB" }
  • AdapterInfo { name: "Intel(R) HD Graphics 4600", vendor: 32902, device: 0, device_type: IntegratedGpu, driver: "OpenGL", driver_info: "4.3.0 - Build 20.19.15.4531", backend: Gl }
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)

What you did

WGPU_BACKEND=gl cargo run --example pbr

I've also noticed this same error on the 3d_shapes and load_gltf examples. Maybe any PBR scene will cause this issue?

What went wrong

Bevy does not seem to gracefully handle GL_EXT_texture_shadow_lod not being supported by the render device, and this causes shader compilation failures. This essentially makes many 3D Bevy games unplayable on older graphics hardware when using OpenGL.

2024-06-27T04:56:36.395669Z ERROR log: GLES: [ShaderCompiler/Error] ID 0 : SHADER_ID_COMPILE error has been generated. GLSL compile failed for shader 21, "": ERROR: 0:4: '#extension' :  'GL_EXT_texture_shadow_lod' is not supported
ERROR: 0:585: 'textureLod' : no matching overloaded function found (using implicit conversion)
ERROR: 0:660: 'textureLod' : no matching overloaded function found (using implicit conversion)


2024-06-27T04:56:36.395730Z ERROR log:  Shader compilation failed: ERROR: 0:4: '#extension' :  'GL_EXT_texture_shadow_lod' is not supported
ERROR: 0:585: 'textureLod' : no matching overloaded function found (using implicit conversion)
ERROR: 0:660: 'textureLod' : no matching overloaded function found (using implicit conversion)


2024-06-27T04:56:36.396042Z ERROR log: Device::create_render_pipeline error: Internal error in ShaderStages(FRAGMENT) shader: ERROR: 0:4: '#extension' :  'GL_EXT_texture_shadow_lod' is not supported
ERROR: 0:585: 'textureLod' : no matching overloaded function found (using implicit conversion)
ERROR: 0:660: 'textureLod' : no matching overloaded function found (using implicit conversion)


2024-06-27T04:56:36.396070Z ERROR log: Shader translation error for stage ShaderStages(FRAGMENT): ERROR: 0:4: '#extension' :  'GL_EXT_texture_shadow_lod' is not supported
ERROR: 0:585: 'textureLod' : no matching overloaded function found (using implicit conversion)
ERROR: 0:660: 'textureLod' : no matching overloaded function found (using implicit conversion)


2024-06-27T04:56:36.396082Z ERROR log: Please report it to https://github.com/gfx-rs/wgpu
2024-06-27T04:56:36.396123Z ERROR log: Handling wgpu errors as fatal by default 
thread 'Async Compute Task Pool (1)' panicked at C:\Users\bytenybbler\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.20.1\src\backend\wgpu_core.rs:2996:5:
wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `pbr_opaque_mesh_pipeline`
    Internal error in ShaderStages(FRAGMENT) shader: ERROR: 0:4: '#extension' :  'GL_EXT_texture_shadow_lod' is not supported
ERROR: 0:585: 'textureLod' : no matching overloaded function found (using implicit conversion)
ERROR: 0:660: 'textureLod' : no matching overloaded function found (using implicit conversion)

Encountered a panic in system `bevy_render::render_resource::pipeline_cache::PipelineCache::process_pipeline_queue_system`!

Additional information

wgpu devs say that it is downstream's responsibility to handle missing GL_EXT_texture_shadow_lod gracefully, perhaps by using a downlevel flag: gfx-rs/wgpu#5344 (comment)

gfx-rs/wgpu#5171 introduced a new dependency on the GL_EXT_texture_shadow_lod feature, but upon testing older Bevy versions, it appears to be unrelated to this issue.

I found this bug while I was trying to test #8789.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenA-glTFRelated to the glTF 3D scene/model formatC-BugAn unexpected or incorrect behaviorO-OpenGLSpecific to the OpenGL render APIP-CrashA sudden unexpected crash

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions