This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Description
When I run a program that renders with wgpu using my intel chipset with mesa driver, on an optimus laptop, I'm getting a crash at the shader compilation stage for a shader that uses the fwidth built-in function.
[2023-10-01T15:17:12Z ERROR wgpu_hal::gles::egl] GLES: [ShaderCompiler/Error] ID 1 : 0:38(20): error: no function with name 'fwidth'
[2023-10-01T15:17:12Z INFO wgpu_hal::gles::device] Compiled shader NativeShader(11)
[2023-10-01T15:17:12Z ERROR wgpu::backend::direct] Shader translation error for stage ShaderStages(NONE | VERTEX): 0:38(20): error: no function with name 'fwidth'
[2023-10-01T15:17:12Z ERROR wgpu::backend::direct] Please report it to https://github.com/gfx-rs/naga
[2023-10-01T15:17:12Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
According to the wgpu_hal logs, this is using OpenGL ES 3.2 with Mesa 23.1.8, and the shader language version is OpenGL ES GLSL ES 3.20.
The version of naga used is 0.12.2, pulled from wgpu 0.16.1
According to the GLSL ES 3.20 spec, the fwidth function should be provided as a built-in function.
I'm not sure if this is an issue on naga's side or in mesa.