Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ windows = { version = "0.62", default-features = false }
# wasm32 dependencies
console_error_panic_hook = "0.1.5"
console_log = "1"
js-sys = { version = "0.3.85", default-features = false }
wasm-bindgen = { version = "0.2.108", default-features = false }
wasm-bindgen-futures = { version = "0.4.58", default-features = false }
js-sys = { version = "0.3.92", default-features = false }
wasm-bindgen = { version = "0.2.115", default-features = false }
wasm-bindgen-futures = { version = "0.4.65", default-features = false }
wasm-bindgen-test = "0.3"
web-sys = { version = "0.3.85", default-features = false }
web-sys = { version = "0.3.92", default-features = false }
web-time = "1.1.0"

# deno dependencies
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ web-sys = { workspace = true, optional = true, features = [
"HtmlCanvasElement",
"WebGl2RenderingContext",
"OffscreenCanvas",
"VideoFrame",
] }
js-sys = { workspace = true, optional = true, default-features = true }

Expand Down
8 changes: 8 additions & 0 deletions wgpu-hal/src/gles/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ impl super::Queue {
v,
);
},
#[cfg(not(web_sys_unstable_apis))]
wgt::ExternalImageSource::VideoFrame(_) => {
unimplemented!("web_sys_unstable_apis is needed for glow")
}
#[cfg(web_sys_unstable_apis)]
wgt::ExternalImageSource::VideoFrame(ref v) => unsafe {
gl.tex_sub_image_3d_with_video_frame(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost ready, but for some reason this method doesn't exist. @cwfitzgerald any ideas?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the problem is that it too is behind a cfg(web_sys_unstable_apis) so this would need a PR to glow to remove it https://docs.rs/crate/glow/latest/source/src/web_sys.rs#1402-1437.

Up to you the order which this happens.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened a PR grovesNL/glow#361, but glow seems to be released quite seldom.

Expand Down Expand Up @@ -627,6 +631,10 @@ impl super::Queue {
v,
)
},
#[cfg(not(web_sys_unstable_apis))]
wgt::ExternalImageSource::VideoFrame(_) => {
unimplemented!("web_sys_unstable_apis is needed for glow")
}
#[cfg(web_sys_unstable_apis)]
wgt::ExternalImageSource::VideoFrame(ref v) => unsafe {
gl.tex_sub_image_2d_with_video_frame_and_width_and_height(
Expand Down
4 changes: 0 additions & 4 deletions wgpu-types/src/texture/external_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ pub enum ExternalImageSource {
/// Requires [`DownlevelFlags::UNRESTRICTED_EXTERNAL_TEXTURE_COPIES`]
OffscreenCanvas(web_sys::OffscreenCanvas),
/// Copy from a video frame.
#[cfg(web_sys_unstable_apis)]
VideoFrame(web_sys::VideoFrame),
}

Expand All @@ -61,7 +60,6 @@ impl ExternalImageSource {
ExternalImageSource::ImageData(i) => i.width(),
ExternalImageSource::HTMLCanvasElement(c) => c.width(),
ExternalImageSource::OffscreenCanvas(c) => c.width(),
#[cfg(web_sys_unstable_apis)]
ExternalImageSource::VideoFrame(v) => v.display_width(),
}
}
Expand All @@ -75,7 +73,6 @@ impl ExternalImageSource {
ExternalImageSource::ImageData(i) => i.height(),
ExternalImageSource::HTMLCanvasElement(c) => c.height(),
ExternalImageSource::OffscreenCanvas(c) => c.height(),
#[cfg(web_sys_unstable_apis)]
ExternalImageSource::VideoFrame(v) => v.display_height(),
}
}
Expand All @@ -93,7 +90,6 @@ impl core::ops::Deref for ExternalImageSource {
Self::ImageData(i) => i,
Self::HTMLCanvasElement(c) => c,
Self::OffscreenCanvas(c) => c,
#[cfg(web_sys_unstable_apis)]
Self::VideoFrame(v) => v,
}
}
Expand Down
Loading
Loading