Skip to content

Commit

Permalink
Disable drm on wasm targets
Browse files Browse the repository at this point in the history
  • Loading branch information
morr0ne committed Feb 28, 2025
1 parent 1898f06 commit 5880de9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions wgpu-core/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl Instance {
///
/// This function is only available on Unix-like platforms (Linux, FreeBSD) and
/// currently only works with the Vulkan backend.
#[cfg(all(unix, not(target_vendor = "apple")))]
#[cfg(all(unix, not(target_vendor = "apple"), not(target_family = "wasm")))]
#[cfg_attr(not(vulkan), allow(unused_variables))]
pub unsafe fn create_surface_from_drm(
&self,
Expand Down Expand Up @@ -848,7 +848,7 @@ impl Global {
///
/// This function is only available on Unix-like platforms (Linux, FreeBSD) and
/// currently only works with the Vulkan backend.
#[cfg(all(unix, not(target_vendor = "apple")))]
#[cfg(all(unix, not(target_vendor = "apple"), not(target_family = "wasm")))]
pub unsafe fn instance_create_surface_from_drm(
&self,
fd: i32,
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/src/vulkan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod device;
mod instance;
mod sampler;

#[cfg(all(unix, not(target_vendor = "apple")))]
#[cfg(all(unix, not(target_vendor = "apple"), not(target_family = "wasm")))]
mod drm;

use std::{
Expand Down
2 changes: 1 addition & 1 deletion wgpu/src/api/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ pub enum SurfaceTargetUnsafe {
///
/// - All parameters must point to valid DRM values and remain valid for as long as the resulting [`Surface`] exists.
/// - The file descriptor (`fd`), plane, connector, and mode configuration must be valid and compatible.
#[cfg(all(unix, not(target_vendor = "apple")))]
#[cfg(all(unix, not(target_vendor = "apple"), not(target_family = "wasm")))]
Drm {
/// The file descriptor of the DRM device.
fd: i32,
Expand Down
2 changes: 1 addition & 1 deletion wgpu/src/backend/wgpu_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ impl dispatch::InstanceInterface for ContextWgpuCore {
.instance_create_surface(raw_display_handle, raw_window_handle, None)
},

#[cfg(all(unix, not(target_vendor = "apple")))]
#[cfg(all(unix, not(target_vendor = "apple"), not(target_family = "wasm")))]
SurfaceTargetUnsafe::Drm {
fd,
plane,
Expand Down

0 comments on commit 5880de9

Please sign in to comment.