Skip to content

Unable to handle shader compilation errors #2130

@Herschel

Description

@Herschel

wgpu currently has no API to inspect errors when compiling a shader module. On desktop, Device::create_shader_module will panic on error. On web, the different browsers will print out error info to the console, but execution continues, and errors will usually occur later during pipeline creation with the errored ShaderModule objects.

The WebGPU spec requires a GPUShaderModule.compilationInfo() method that should return any errors generated during compilation.

Ideally, either:

  • change Device::create_shader_module to idiomatically return a Result,
  • or match the spec and add a ShaderModule::compilation_info method. The user can then inspect this info and return an error as appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions