Fix build errors for wgpu backend#9377
Conversation
|
Reference commit gfx-rs/wgpu-native@f16f716 Thank you! It baffles me that those library don't have version numbers that may be checked with compile-time |
|
How about the other things which diverged in the backend?
|
|
From my testing, with this PR I can build all of those examples without changing them, however, (and I don't know if im doing anything wrong) with both the v29 wgpu release and the latest commit from trunk, I cannot run any of these examples with wgpu. I got the following errors:
example_sdl3_wgpu stack tracePID: 184092 (example_sdl3_wg) UID: 1000 (lucas) GID: 1000 (lucas) Signal: 6 (ABRT) Timestamp: Thu 2026-04-23 19:04:18 WEST (5s ago) Command Line: ./build/example_sdl3_wgpu Executable: /home/lucas/Desktop/particle-simulation-2d/external/imgui/examples/example_sdl3_wgpu/build/example_sdl3_wgpu Control Group: /user.slice/user-1000.slice/session-2.scope Unit: session-2.scope Slice: user-1000.slice Session: 2 Owner UID: 1000 (lucas) Boot ID: 6c7e2af1b25b404cb94690293cf4058c Machine ID: 460c5ed5a3414ea28c71c7aa4671c4d1 Hostname: melhorpcnaoha Storage: /var/lib/systemd/coredump/core.example_sdl3_wg.1000.6c7e2af1b25b404cb94690293cf4058c.184092.1776967458000000.zst (present) Size on Disk: 2M Message: Process 184092 (example_sdl3_wg) of user 1000 dumped core.
example_glfw_wgpu stack straceCommand Line: ./build/example_glfw_wgpu
example_sdl2_wgpu stack stracePID: 188834 (example_sdl2_wg) UID: 1000 (lucas) GID: 1000 (lucas) Signal: 6 (ABRT) Timestamp: Thu 2026-04-23 19:10:08 WEST (2s ago) Command Line: ./build/example_sdl2_wgpu Executable: /home/lucas/Desktop/particle-simulation-2d/external/imgui/examples/example_sdl2_wgpu/build/example_sdl2_wgpu Control Group: /user.slice/user-1000.slice/session-2.scope Unit: session-2.scope Slice: user-1000.slice Session: 2 Owner UID: 1000 (lucas) Boot ID: 6c7e2af1b25b404cb94690293cf4058c Machine ID: 460c5ed5a3414ea28c71c7aa4671c4d1 Hostname: melhorpcnaoha Storage: /var/lib/systemd/coredump/core.example_sdl2_wg.1000.6c7e2af1b25b404cb94690293cf4058c.188834.1776967808000000.zst (present) Size on Disk: 2M Message: Process 188834 (example_sdl2_wg) of user 1000 dumped core.Running the sdl examples with dawn works just fine, but the example_glfw_wgpu with dawn has the following error: example_glfw_wgpu with dawn stack tracePID: 188088 (example_glfw_wg) UID: 1000 (lucas) GID: 1000 (lucas) Signal: 4 (ILL) Timestamp: Thu 2026-04-23 19:08:45 WEST (2s ago) Command Line: ./build/example_glfw_wgpu Executable: /home/lucas/Desktop/particle-simulation-2d/external/imgui/examples/example_glfw_wgpu/build/example_glfw_wgpu Control Group: /user.slice/user-1000.slice/session-2.scope Unit: session-2.scope Slice: user-1000.slice Session: 2 Owner UID: 1000 (lucas) Boot ID: 6c7e2af1b25b404cb94690293cf4058c Machine ID: 460c5ed5a3414ea28c71c7aa4671c4d1 Hostname: melhorpcnaoha Storage: /var/lib/systemd/coredump/core.example_glfw_wg.1000.6c7e2af1b25b404cb94690293cf4058c.188088.1776967725000000.zst (present) Size on Disk: 1.3M Message: Process 188088 (example_glfw_wg) of user 1000 dumped core. |



I didn't check, but I'm pretty sure wgpu-native updated their wgpu-headers so they now better match dawn and wgvk.
Some of the conditional compilation statements that are needed to support the multiple backends (wgpu, dawn and wgvk) are no longer needed for
WGPUProgrammableStageDescriptor, which becameWGPUComputeStateon all backends, same for the vertex input configuration andWGPUSurfaceGetCurrentTextureStatus_OutOfMemorywhich becameWGPUSurfaceGetCurrentTextureStatus_Error.Tested in my own small imgui, SDL3 and wgpu app, both dawn and wgpu-native.
This PR fixes the following compilation errors:
