gfx-rs / wgpu-native

Native WebGPU implementation based on wgpu-core
Apache License 2.0
865 stars 103 forks source link

Identifier refers to disabled backend feature "empty" #380

Closed davnotdev closed 6 months ago

davnotdev commented 6 months ago

Hi. While trying to call wgpuBufferUnmap, the function panics with "Identifier refers to disabled backend feature 'empty'" using the binaries in the latest Github release. Investigating the error, I find that the error is triggered in the wgpu-core:

define_backend_caller! { gfx_if_empty, gfx_if_empty_hidden, "empty" if all(
    not(any(feature = "metal", feature = "vulkan", feature = "gles")),
    any(target_os = "macos", target_os = "ios"),
) }

This should now happen however because I am not an the empty backend. Using wgpuGenerateReport, I can confirm that I am running using the vulkan backend. Same result when I use the opengl backend. I tried building this repo from the trunk branch. The same libwgpu_native.a that can run the triangle example fails with the same issue. For additional context, I am running Linux on X11.

rajveermalviya commented 6 months ago

I can't repro this with the capture example which uses wgpuBufferUnmap, does that fail for you? make run-example-capture

davnotdev commented 6 months ago

I found the issue. Should have gotten more sleep because it was a classic case of casting a pointer to the wrong type :-) wgpuBufferUnmap works perfectly once fixed. Thanks for your help.