Skip to content

Commit fcd3d4f

Browse files
committed
Remove emscripten support
1 parent b25909d commit fcd3d4f

File tree

11 files changed

+15
-15
lines changed

11 files changed

+15
-15
lines changed

wgpu-core/src/conv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn is_valid_copy_dst_texture_format(
3333
}
3434
}
3535

36-
#[cfg_attr(not(target_arch = "wasm32"), allow(unused))]
36+
#[cfg_attr(any(not(target_arch = "wasm32"), feature = "emscripten"), allow(unused))]
3737
pub fn is_valid_external_image_copy_dst_texture_format(format: wgt::TextureFormat) -> bool {
3838
use wgt::TextureFormat as Tf;
3939
match format {

wgpu-core/src/device/queue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
805805
Ok(())
806806
}
807807

808-
#[cfg(target_arch = "wasm32")]
808+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
809809
pub fn queue_copy_external_image_to_texture<A: HalApi>(
810810
&self,
811811
queue_id: id::QueueId,

wgpu-hal/src/empty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl crate::CommandEncoder<Api> for Encoder {
264264

265265
unsafe fn copy_buffer_to_buffer<T>(&mut self, src: &Resource, dst: &Resource, regions: T) {}
266266

267-
#[cfg(target_arch = "wasm32")]
267+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
268268
unsafe fn copy_external_image_to_texture<T>(
269269
&mut self,
270270
src: &wgt::ExternalImageSource,

wgpu-hal/src/gles/command.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
309309
}
310310
}
311311

312-
#[cfg(target_arch = "wasm32")]
312+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
313313
unsafe fn copy_external_image_to_texture<T>(
314314
&mut self,
315315
src: &wgt::ExternalImageSource,

wgpu-hal/src/gles/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ enum Command {
661661
dst_target: BindTarget,
662662
copy: crate::BufferCopy,
663663
},
664-
#[cfg(target_arch = "wasm32")]
664+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
665665
CopyExternalImageToTexture {
666666
src: wgt::ExternalImageSource,
667667
dst: glow::Texture,

wgpu-hal/src/gles/queue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl super::Queue {
375375
unsafe { gl.bind_buffer(copy_dst_target, None) };
376376
}
377377
}
378-
#[cfg(target_arch = "wasm32")]
378+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
379379
C::CopyExternalImageToTexture {
380380
ref src,
381381
dst,

wgpu-hal/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ pub trait CommandEncoder<A: Api>: Send + Sync + fmt::Debug {
402402
/// Works with a single array layer.
403403
/// Note: `dst` current usage has to be `TextureUses::COPY_DST`.
404404
/// Note: the copy extent is in physical size (rounded to the block size)
405-
#[cfg(target_arch = "wasm32")]
405+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
406406
unsafe fn copy_external_image_to_texture<T>(
407407
&mut self,
408408
src: &wgt::ExternalImageSource,

wgpu/src/backend/direct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ impl crate::Context for Context {
21962196
}
21972197
}
21982198

2199-
#[cfg(target_arch = "wasm32")]
2199+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
22002200
fn queue_copy_external_image_to_texture(
22012201
&self,
22022202
queue: &Self::QueueId,

wgpu/src/backend/web.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2357,7 +2357,7 @@ impl crate::context::Context for Context {
23572357
);
23582358
}
23592359

2360-
#[cfg(target_arch = "wasm32")]
2360+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
23612361
fn queue_copy_external_image_to_texture(
23622362
&self,
23632363
queue: &Self::QueueId,

wgpu/src/context.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ pub trait Context: Debug + Send + Sized + Sync {
561561
data_layout: ImageDataLayout,
562562
size: Extent3d,
563563
);
564-
#[cfg(target_arch = "wasm32")]
564+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
565565
fn queue_copy_external_image_to_texture(
566566
&self,
567567
queue: &Self::QueueId,
@@ -1488,7 +1488,7 @@ pub(crate) trait DynContext: Debug + Send + Sync {
14881488
data_layout: ImageDataLayout,
14891489
size: Extent3d,
14901490
);
1491-
#[cfg(target_arch = "wasm32")]
1491+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
14921492
fn queue_copy_external_image_to_texture(
14931493
&self,
14941494
queue: &ObjectId,
@@ -2884,7 +2884,7 @@ where
28842884
Context::queue_write_texture(self, &queue, queue_data, texture, data, data_layout, size)
28852885
}
28862886

2887-
#[cfg(target_arch = "wasm32")]
2887+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
28882888
fn queue_copy_external_image_to_texture(
28892889
&self,
28902890
queue: &ObjectId,

wgpu/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ pub use wgt::{
4949

5050
// wasm-only types, we try to keep as many types non-platform
5151
// specific, but these need to depend on web-sys.
52-
#[cfg(target_arch = "wasm32")]
52+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
5353
pub use wgt::{ExternalImageSource, ImageCopyExternalImage};
54-
#[cfg(target_arch = "wasm32")]
54+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
5555
static_assertions::assert_impl_all!(ExternalImageSource: Send, Sync);
5656

5757
/// Filter for error scopes.
@@ -3921,7 +3921,7 @@ impl Queue {
39213921
}
39223922

39233923
/// Schedule a copy of data from `image` into `texture`.
3924-
#[cfg(target_arch = "wasm32")]
3924+
#[cfg(all(target_arch = "wasm32", not(feature = "emscripten")))]
39253925
pub fn copy_external_image_to_texture(
39263926
&self,
39273927
source: &wgt::ImageCopyExternalImage,

0 commit comments

Comments
 (0)