Skip to content

Commit

Permalink
Revert "Update wgpu to 23.0.0 (#846)" (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
noituri authored Nov 22, 2024
1 parent cc42a9f commit 9dfa17b
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 142 deletions.
222 changes: 123 additions & 99 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ socket2 = "0.5.5"
webrtc-util = "0.8.0"
opus = "0.3.0"
rubato = "0.15.0"
glyphon = { git = "https://github.com/grovesNL/glyphon", rev = "f1f50ab" }
glyphon = "0.6.0"
futures-util = "0.3.30"
tokio = { version = "1", features = ["full"] }
schemars = { git = "https://github.com/membraneframework-labs/schemars", rev = "a5ad1f9", features = [
"preserve_order",
] }
shared_memory = "0.12.4"
vk-video = { path = "vk-video" }
wgpu = { version = "23.0.0", default-features = false, features = [
wgpu = { version = "22.1.0", default-features = false, features = [
"wgsl",
"dx12",
"metal",
Expand Down
2 changes: 1 addition & 1 deletion compositor_render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ glyphon = { workspace = true }
crossbeam-channel = { workspace = true }
resvg = "0.35.0"
nalgebra-glm = { version = "0.18.0", features = ["convert-bytemuck"] }
naga = "23.0.0"
naga = "22.1.0"
rand = { workspace = true }
tracing = { workspace = true }
shared_memory = { workspace = true, optional = true }
Expand Down
4 changes: 2 additions & 2 deletions compositor_render/src/wgpu/common_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ pub fn create_render_pipeline(
vertex: wgpu::VertexState {
buffers: &[Vertex::LAYOUT],
module: shader_module,
entry_point: Some(crate::wgpu::common_pipeline::VERTEX_ENTRYPOINT_NAME),
entry_point: crate::wgpu::common_pipeline::VERTEX_ENTRYPOINT_NAME,
compilation_options: wgpu::PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: shader_module,
entry_point: Some(crate::wgpu::common_pipeline::FRAGMENT_ENTRYPOINT_NAME),
entry_point: crate::wgpu::common_pipeline::FRAGMENT_ENTRYPOINT_NAME,
targets: &[Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::Rgba8UnormSrgb,
write_mask: wgpu::ColorWrites::all(),
Expand Down
4 changes: 2 additions & 2 deletions compositor_render/src/wgpu/format/interleaved_yuv_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ impl InterleavedYuv422ToRgbaConverter {

vertex: wgpu::VertexState {
module: &shader_module,
entry_point: Some("vs_main"),
entry_point: "vs_main",
buffers: &[Vertex::LAYOUT],
compilation_options: wgpu::PipelineCompilationOptions::default(),
},

fragment: Some(wgpu::FragmentState {
module: &shader_module,
entry_point: Some("fs_main"),
entry_point: "fs_main",
targets: &[Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::Rgba8UnormSrgb,
write_mask: wgpu::ColorWrites::all(),
Expand Down
4 changes: 2 additions & 2 deletions compositor_render/src/wgpu/format/nv12_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ impl Nv12ToRgbaConverter {

vertex: wgpu::VertexState {
module: &shader_module,
entry_point: Some("vs_main"),
entry_point: "vs_main",
buffers: &[Vertex::LAYOUT],
compilation_options: wgpu::PipelineCompilationOptions::default(),
},

fragment: Some(wgpu::FragmentState {
module: &shader_module,
entry_point: Some("fs_main"),
entry_point: "fs_main",
targets: &[Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::Rgba8UnormSrgb,
write_mask: wgpu::ColorWrites::all(),
Expand Down
4 changes: 2 additions & 2 deletions compositor_render/src/wgpu/format/planar_yuv_to_rgba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ impl PlanarYuvToRgbaConverter {

vertex: wgpu::VertexState {
module: &shader_module,
entry_point: Some("vs_main"),
entry_point: "vs_main",
buffers: &[Vertex::LAYOUT],
compilation_options: wgpu::PipelineCompilationOptions::default(),
},

fragment: Some(wgpu::FragmentState {
module: &shader_module,
entry_point: Some("fs_main"),
entry_point: "fs_main",
targets: &[Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::Rgba8UnormSrgb,
write_mask: wgpu::ColorWrites::all(),
Expand Down
4 changes: 2 additions & 2 deletions compositor_render/src/wgpu/format/rgba_to_yuv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ impl RgbaToYuvConverter {

vertex: wgpu::VertexState {
module: &shader_module,
entry_point: Some("vs_main"),
entry_point: "vs_main",
buffers: &[Vertex::LAYOUT],
compilation_options: wgpu::PipelineCompilationOptions::default(),
},

fragment: Some(wgpu::FragmentState {
module: &shader_module,
entry_point: Some("fs_main"),
entry_point: "fs_main",
targets: &[Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::R8Unorm,
write_mask: wgpu::ColorWrites::all(),
Expand Down
4 changes: 2 additions & 2 deletions compositor_render/src/wgpu/utils/r8_fill_with_color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ impl R8FillWithValue {
primitive: PRIMITIVE_STATE,
vertex: wgpu::VertexState {
module: &shader_module,
entry_point: Some("vs_main"),
entry_point: "vs_main",
buffers: &[Vertex::LAYOUT],
compilation_options: wgpu::PipelineCompilationOptions::default(),
},
fragment: Some(wgpu::FragmentState {
module: &shader_module,
entry_point: Some("fs_main"),
entry_point: "fs_main",
targets: &[Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::R8Unorm,
write_mask: wgpu::ColorWrites::all(),
Expand Down
2 changes: 1 addition & 1 deletion compositor_web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tracing-subscriber = "0.2.19"
log = { workspace = true }
wasm-log = "0.3.1"
js-sys = "0.3.69"
wasm-bindgen = "0.2.95"
wasm-bindgen = "0.2.93"
wasm-bindgen-futures = "0.4.42"
web-sys = { version = "0.3.69", features = [
"Document",
Expand Down
2 changes: 1 addition & 1 deletion vk-video/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ h264-reader = { git = "https://github.com/membraneframework-labs/h264-reader.git
thiserror = "1.0.59"
tracing = "0.1.40"
vk-mem = "0.4.0"
wgpu = "23.0.0"
wgpu = "22.1.0"

[dev-dependencies]
tracing-subscriber = "0.3.18"
Expand Down
4 changes: 2 additions & 2 deletions vk-video/examples/player/player/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ impl<'a> Renderer<'a> {
module: &shader_module,
buffers: &[Vertex::LAYOUT],
compilation_options: Default::default(),
entry_point: None,
entry_point: "vs_main",
},
fragment: Some(wgpu::FragmentState {
module: &shader_module,
Expand All @@ -237,7 +237,7 @@ impl<'a> Renderer<'a> {
write_mask: wgpu::ColorWrites::ALL,
})],
compilation_options: Default::default(),
entry_point: None,
entry_point: "fs_main",
}),

primitive: wgpu::PrimitiveState {
Expand Down
9 changes: 1 addition & 8 deletions vk-video/src/vulkan_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ impl VulkanDecoder<'_> {
}
}

// this has to be done with Option and mut, because the closure we create has to be FnMut.
// this means we cannot consume its captures, so we have to take the option to be able to
// drop the resource.
let mut image_clone = Some(image.clone());

let hal_texture = unsafe {
wgpu::hal::vulkan::Device::texture_from_raw(
**image,
Expand All @@ -755,9 +750,7 @@ impl VulkanDecoder<'_> {
format: wgpu::TextureFormat::NV12,
mip_level_count: 1,
},
Some(Box::new(move || {
image_clone.take();
})),
Some(Box::new(image.clone())),
)
};

Expand Down
18 changes: 2 additions & 16 deletions vk-video/src/vulkan_decoder/vulkan_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ impl VulkanInstance {
None
};

// this has to be done with Option and mut, because the closure we create has to be FnMut.
// this means we cannot consume its captures, so we have to take the option to be able to
// drop the resource.
let mut instance_clone = Some(instance.clone());

let wgpu_instance = unsafe {
wgpu::hal::vulkan::Instance::from_raw(
(*entry).clone(),
Expand All @@ -142,9 +137,7 @@ impl VulkanInstance {
extensions,
wgpu::InstanceFlags::empty(),
false,
Some(Box::new(move || {
instance_clone.take();
})),
None,
)?
};

Expand Down Expand Up @@ -274,17 +267,10 @@ impl VulkanInstance {
},
};

// this has to be done with Option and mut, because the closure we create has to be FnMut.
// this means we cannot consume its captures, so we have to take the option to be able to
// drop the resource.
let mut device_clone = Some(device.clone());

let wgpu_device = unsafe {
wgpu_adapter.adapter.device_from_raw(
device.device.clone(),
Some(Box::new(move || {
device_clone.take();
})),
false,
&required_extensions,
wgpu_features,
&wgpu::MemoryHints::default(),
Expand Down

0 comments on commit 9dfa17b

Please sign in to comment.