diff --git a/Cargo.lock b/Cargo.lock index a77b9614e988..9369fc3f2573 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,11 +206,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" dependencies = [ "clipboard-win", + "core-graphics", + "image", "log", "objc2", "objc2-app-kit", "objc2-foundation", "parking_lot", + "windows-sys 0.48.0", "x11rb", ] @@ -417,6 +420,9 @@ name = "bitflags" version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +dependencies = [ + "serde", +] [[package]] name = "bitstream-io" @@ -626,12 +632,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "cfg_aliases" version = "0.2.1" @@ -1297,8 +1297,7 @@ checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" [[package]] name = "ecolor" version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d72e9c39f6e11a2e922d04a34ec5e7ef522ea3f5a1acfca7a19d16ad5fe50f5" +source = "git+https://github.com/emilk/egui.git?branch=master#a5d7cf5bd76b54531fc3a97a2ce7f37d16ae0069" dependencies = [ "bytemuck", "emath", @@ -1307,10 +1306,10 @@ dependencies = [ [[package]] name = "egui" version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252d52224d35be1535d7fd1d6139ce071fb42c9097773e79f7665604f5596b5e" +source = "git+https://github.com/emilk/egui.git?branch=master#a5d7cf5bd76b54531fc3a97a2ce7f37d16ae0069" dependencies = [ "ahash", + "bitflags 2.7.0", "emath", "epaint", "log", @@ -1321,8 +1320,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c1e821d2d8921ef6ce98b258c7e24d9d6aab2ca1f9cdf374eca997e7f67f59" +source = "git+https://github.com/emilk/egui.git?branch=master#a5d7cf5bd76b54531fc3a97a2ce7f37d16ae0069" dependencies = [ "ahash", "bytemuck", @@ -1341,11 +1339,11 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e84c2919cd9f3a38a91e8f84ac6a245c19251fd95226ed9fae61d5ea564fce3" +source = "git+https://github.com/emilk/egui.git?branch=master#a5d7cf5bd76b54531fc3a97a2ce7f37d16ae0069" dependencies = [ "ahash", "arboard", + "bytemuck", "egui", "log", "profiling", @@ -1359,8 +1357,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7a8198c088b1007108cb2d403bc99a5e370999b200db4f14559610d7330126" +source = "git+https://github.com/emilk/egui.git?branch=master#a5d7cf5bd76b54531fc3a97a2ce7f37d16ae0069" dependencies = [ "ahash", "egui", @@ -1379,8 +1376,7 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "emath" version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4fe73c1207b864ee40aa0b0c038d6092af1030744678c60188a05c28553515d" +source = "git+https://github.com/emilk/egui.git?branch=master#a5d7cf5bd76b54531fc3a97a2ce7f37d16ae0069" dependencies = [ "bytemuck", ] @@ -1509,8 +1505,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5666f8d25236293c966fbb3635eac18b04ad1914e3bab55bc7d44b9980cafcac" +source = "git+https://github.com/emilk/egui.git?branch=master#a5d7cf5bd76b54531fc3a97a2ce7f37d16ae0069" dependencies = [ "ab_glyph", "ahash", @@ -1527,8 +1522,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66f6ddac3e6ac6fd4c3d48bb8b1943472f8da0f43a4303bcd8a18aa594401c80" +source = "git+https://github.com/emilk/egui.git?branch=master#a5d7cf5bd76b54531fc3a97a2ce7f37d16ae0069" [[package]] name = "equivalent" @@ -2102,9 +2096,9 @@ dependencies = [ [[package]] name = "glow" -version = "0.14.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51fa363f025f5c111e03f13eda21162faeacb6911fe8caa0c0349f9cf0c4483" +checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08" dependencies = [ "js-sys", "slotmap", @@ -2923,9 +2917,9 @@ dependencies = [ [[package]] name = "metal" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" +checksum = "f569fb946490b5743ad69813cb19629130ce9374034abe31614a36402d18f99e" dependencies = [ "bitflags 2.7.0", "block", @@ -2982,22 +2976,23 @@ dependencies = [ [[package]] name = "naga" -version = "23.1.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "364f94bc34f61332abebe8cad6f6cd82a5b65cff22c828d05d0968911462ca4f" +checksum = "e380993072e52eef724eddfcde0ed013b0c023c3f0417336ed041aa9f076994e" dependencies = [ "arrayvec", "bit-set", "bitflags 2.7.0", - "cfg_aliases 0.1.1", + "cfg_aliases", "codespan-reporting", "hexf-parse", "indexmap", "log", "rustc-hash 1.1.0", "spirv", + "strum", "termcolor", - "thiserror 1.0.69", + "thiserror 2.0.11", "unicode-xid", ] @@ -3114,7 +3109,7 @@ checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags 2.7.0", "cfg-if", - "cfg_aliases 0.2.1", + "cfg_aliases", "libc", "memoffset", ] @@ -3501,6 +3496,15 @@ dependencies = [ "libredox", ] +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "num-traits", +] + [[package]] name = "ordered-stream" version = "0.2.0" @@ -3824,7 +3828,7 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" dependencies = [ - "cfg_aliases 0.2.1", + "cfg_aliases", "libc", "once_cell", "socket2", @@ -4954,6 +4958,28 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + [[package]] name = "stub-report" version = "0.1.0" @@ -6079,12 +6105,13 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "wgpu" -version = "23.0.1" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f70000db37c469ea9d67defdc13024ddf9a5f1b89cb2941b812ad7cde1735a" +checksum = "e41253fc7b660735e2a2d9a58c563f2a047d3cc3445293d8f4095538c9e8afbe" dependencies = [ "arrayvec", - "cfg_aliases 0.1.1", + "bitflags 2.7.0", + "cfg_aliases", "document-features", "js-sys", "log", @@ -6104,14 +6131,14 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "23.0.1" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d63c3c478de8e7e01786479919c8769f62a22eec16788d8c2ac77ce2c132778a" +checksum = "82a39b8842dc9ffcbe34346e3ab6d496b32a47f6497e119d762c97fcaae3cb37" dependencies = [ "arrayvec", "bit-vec", "bitflags 2.7.0", - "cfg_aliases 0.1.1", + "cfg_aliases", "document-features", "indexmap", "log", @@ -6122,16 +6149,16 @@ dependencies = [ "raw-window-handle", "rustc-hash 1.1.0", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.11", "wgpu-hal", "wgpu-types", ] [[package]] name = "wgpu-hal" -version = "23.0.1" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89364b8a0b211adc7b16aeaf1bd5ad4a919c1154b44c9ce27838213ba05fd821" +checksum = "5a782e5056b060b0b4010881d1decddd059e44f2ecd01e2db2971b48ad3627e5" dependencies = [ "android_system_properties", "arrayvec", @@ -6140,7 +6167,7 @@ dependencies = [ "bitflags 2.7.0", "block", "bytemuck", - "cfg_aliases 0.1.1", + "cfg_aliases", "core-graphics-types", "glow", "glutin_wgl_sys", @@ -6157,6 +6184,7 @@ dependencies = [ "ndk-sys 0.5.0+25.2.9519653", "objc", "once_cell", + "ordered-float", "parking_lot", "profiling", "range-alloc", @@ -6164,7 +6192,7 @@ dependencies = [ "renderdoc-sys", "rustc-hash 1.1.0", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.11", "wasm-bindgen", "web-sys", "wgpu-types", @@ -6174,12 +6202,13 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "610f6ff27778148c31093f3b03abc4840f9636d58d597ca2f5977433acfe0068" +checksum = "50ac044c0e76c03a0378e7786ac505d010a873665e2d51383dcff8dd227dc69c" dependencies = [ "bitflags 2.7.0", "js-sys", + "log", "web-sys", ] @@ -6564,7 +6593,7 @@ dependencies = [ "block2", "bytemuck", "calloop", - "cfg_aliases 0.2.1", + "cfg_aliases", "concurrent-queue", "core-foundation 0.9.4", "core-graphics", diff --git a/Cargo.toml b/Cargo.toml index c740b54d7129..a9a21db391ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,9 +48,9 @@ version = "0.1.0" [workspace.dependencies] tracing = "0.1.41" tracing-subscriber = { version = "0.3.19", features = ["env-filter"] } -naga = { version = "23.1.0", features = ["wgsl-out"] } -wgpu = "23.0.1" -egui = "0.30.0" +naga = { version = "24.0.0", features = ["wgsl-out"] } +wgpu = "24.0.0" +egui = { git = "https://github.com/emilk/egui.git", branch = "master" } clap = { version = "4.5.26", features = ["derive"] } cpal = "0.15.3" anyhow = "1.0" diff --git a/core/Cargo.toml b/core/Cargo.toml index 4285e5023e80..e73ccc495df1 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -55,7 +55,7 @@ hashbrown = { version = "0.14.5", features = ["raw"] } scopeguard = "1.2.0" fluent-templates = "0.13.0" egui = { workspace = true, optional = true } -egui_extras = { version = "0.30.0", default-features = false, optional = true } +egui_extras = { git = "https://github.com/emilk/egui.git", branch = "master", default-features = false, optional = true } png = { version = "0.17.16", optional = true } flv-rs = { path = "../flv" } async-channel = { workspace = true } diff --git a/deny.toml b/deny.toml index 7a918670aa5b..19a39b0a1f4c 100644 --- a/deny.toml +++ b/deny.toml @@ -84,6 +84,9 @@ unknown-git = "deny" # github.com organizations to allow git sources for github = [ "ruffle-rs", + # TODO: Remove once a release with https://github.com/emilk/egui/pull/5610 + # (the wgpu bump to 24.0.0) in it is out. + "emilk", ] [advisories] diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index e24bcbd5d006..c5ddbb97b632 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -14,10 +14,10 @@ workspace = true clap = { workspace = true } cpal = { workspace = true } egui = { workspace = true } -egui_extras = { version = "0.30.0", default-features = false, features = ["image"] } -egui-wgpu = { version = "0.30.0", features = ["winit"] } +egui_extras = { git = "https://github.com/emilk/egui.git", branch = "master", default-features = false, features = ["image"] } +egui-wgpu = { git = "https://github.com/emilk/egui.git", branch = "master", features = ["winit"] } image = { workspace = true, features = ["png"] } -egui-winit = "0.30.0" +egui-winit = { git = "https://github.com/emilk/egui.git", branch = "master" } fontdb = "0.23" ruffle_core = { path = "../core", features = ["audio", "clap", "mp3", "aac", "nellymoser", "default_compatibility_rules", "egui"] } ruffle_render = { path = "../render", features = ["clap"] } diff --git a/desktop/src/backends/ui.rs b/desktop/src/backends/ui.rs index c32ffdf779e1..b565045336ae 100644 --- a/desktop/src/backends/ui.rs +++ b/desktop/src/backends/ui.rs @@ -215,7 +215,7 @@ impl UiBackend for DesktopUiBackend { } fn set_clipboard_content(&mut self, content: String) { - self.clipboard.set(content); + self.clipboard.set_text(content); } fn set_fullscreen(&mut self, is_full: bool) -> Result<(), FullscreenError> { diff --git a/desktop/src/gui/controller.rs b/desktop/src/gui/controller.rs index 4fd270ebcbef..e259202f22b8 100644 --- a/desktop/src/gui/controller.rs +++ b/desktop/src/gui/controller.rs @@ -282,6 +282,10 @@ impl GuiController { // Cannot help with that :( panic!("wgpu: Out of memory: no more memory left to allocate a new frame"); } + Err(SurfaceError::Other) => { + // Generic error, not much we can do. + panic!("wgpu: Acquiring a texture failed with a generic error"); + } }; let raw_input = self.egui_winit.take_egui_input(&self.window); @@ -456,7 +460,7 @@ fn create_wgpu_instance( } fn try_wgpu_backend(backend: wgpu::Backends) -> Option { - let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { backends: backend, flags: wgpu::InstanceFlags::default().with_env(), ..Default::default() diff --git a/desktop/src/gui/dialogs/preferences_dialog.rs b/desktop/src/gui/dialogs/preferences_dialog.rs index 33a333c3a1d2..61790637a7a1 100644 --- a/desktop/src/gui/dialogs/preferences_dialog.rs +++ b/desktop/src/gui/dialogs/preferences_dialog.rs @@ -666,7 +666,7 @@ fn find_available_graphics_backends() -> wgpu::Backends { // We have to make a new instance here, as the one created for the entire application may not have // all backends enabled - let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { backends: wgpu::Backends::all(), flags: wgpu::InstanceFlags::default().with_env(), ..Default::default() diff --git a/exporter/src/main.rs b/exporter/src/main.rs index d10bdfaae6f7..dd92d7ace02c 100644 --- a/exporter/src/main.rs +++ b/exporter/src/main.rs @@ -383,7 +383,7 @@ fn trace_path(_opt: &Opt) -> Option<&Path> { fn main() -> Result<()> { let opt: Opt = Opt::parse(); - let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { backends: opt.graphics.into(), ..Default::default() }); diff --git a/render/naga-agal/src/builder.rs b/render/naga-agal/src/builder.rs index e3ea97dca253..1a437afa0d49 100644 --- a/render/naga-agal/src/builder.rs +++ b/render/naga-agal/src/builder.rs @@ -1675,6 +1675,7 @@ impl<'a> NagaBuilder<'a> { }, early_depth_test: None, workgroup_size: [0; 3], + workgroup_size_overrides: None, function: self.func, }; diff --git a/render/naga-pixelbender/src/lib.rs b/render/naga-pixelbender/src/lib.rs index ca2ddd462de8..41930ba004d8 100644 --- a/render/naga-pixelbender/src/lib.rs +++ b/render/naga-pixelbender/src/lib.rs @@ -433,6 +433,7 @@ impl ShaderBuilder<'_> { stage: ShaderStage::Fragment, early_depth_test: None, workgroup_size: [0; 3], + workgroup_size_overrides: None, function: builder.func, }); diff --git a/render/wgpu/src/backend.rs b/render/wgpu/src/backend.rs index 88d31c123b35..fece6a75ce07 100644 --- a/render/wgpu/src/backend.rs +++ b/render/wgpu/src/backend.rs @@ -66,7 +66,7 @@ impl WgpuRenderBackend { } else { wgpu::Backends::GL }; - let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { backends, ..Default::default() }); @@ -101,7 +101,7 @@ impl WgpuRenderBackend { format_list(&get_backend_names(backend), "and") ); } - let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { backends: backend, ..Default::default() }); @@ -148,7 +148,7 @@ impl WgpuRenderBackend { format_list(&get_backend_names(backend), "and") ); } - let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { backends: backend, ..Default::default() }); @@ -640,14 +640,14 @@ impl RenderBackend for WgpuRenderBackend { }); self.descriptors.queue.write_texture( - wgpu::ImageCopyTexture { + wgpu::TexelCopyTextureInfo { texture: &texture, mip_level: 0, origin: Default::default(), aspect: wgpu::TextureAspect::All, }, bitmap.data(), - wgpu::ImageDataLayout { + wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(4 * extent.width), rows_per_image: None, @@ -689,7 +689,7 @@ impl RenderBackend for WgpuRenderBackend { self.active_frame.submit_direct(&self.descriptors); self.descriptors.queue.write_texture( - wgpu::ImageCopyTexture { + wgpu::TexelCopyTextureInfo { texture: &texture.texture, mip_level: 0, origin: wgpu::Origin3d { @@ -701,7 +701,7 @@ impl RenderBackend for WgpuRenderBackend { }, &bitmap.data()[(region.y_min * texture.texture.width() * 4) as usize ..(region.y_max * texture.texture.width() * 4) as usize], - wgpu::ImageDataLayout { + wgpu::TexelCopyBufferLayout { offset: (region.x_min * 4) as wgpu::BufferAddress, bytes_per_row: Some(4 * texture.texture.width()), rows_per_image: None, @@ -821,13 +821,13 @@ impl RenderBackend for WgpuRenderBackend { filter, ); self.active_frame.command_encoder.copy_texture_to_texture( - wgpu::ImageCopyTexture { + wgpu::TexelCopyTextureInfo { texture: applied_filter.color_texture(), mip_level: 0, origin: wgpu::Origin3d { x: 0, y: 0, z: 0 }, aspect: Default::default(), }, - wgpu::ImageCopyTexture { + wgpu::TexelCopyTextureInfo { texture: &dest_texture.texture, mip_level: 0, origin: wgpu::Origin3d { diff --git a/render/wgpu/src/context3d/mod.rs b/render/wgpu/src/context3d/mod.rs index 4449e4d7e326..f872a2131d54 100644 --- a/render/wgpu/src/context3d/mod.rs +++ b/render/wgpu/src/context3d/mod.rs @@ -1060,16 +1060,16 @@ impl Context3D for WgpuContext3D { texture_buffer.unmap(); self.buffer_command_encoder.copy_buffer_to_texture( - wgpu::ImageCopyBuffer { + wgpu::TexelCopyBufferInfo { buffer: &texture_buffer, // The copy source uses the padded image data, with larger rows - layout: wgpu::ImageDataLayout { + layout: wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(bytes_per_row), rows_per_image: Some(rows_per_image), }, }, - wgpu::ImageCopyTexture { + wgpu::TexelCopyTextureInfo { texture: &dest.texture, mip_level: 0, origin: wgpu::Origin3d { diff --git a/render/wgpu/src/lib.rs b/render/wgpu/src/lib.rs index c2f61e89a75e..7eddde8a6d1c 100644 --- a/render/wgpu/src/lib.rs +++ b/render/wgpu/src/lib.rs @@ -200,7 +200,7 @@ impl QueueSyncHandle { let buffer = pool.take(&descriptors, buffer_dimensions.clone()); frame.command_encoder.copy_texture_to_buffer( - wgpu::ImageCopyTexture { + wgpu::TexelCopyTextureInfo { texture: &texture.texture, mip_level: 0, origin: wgpu::Origin3d { @@ -210,9 +210,9 @@ impl QueueSyncHandle { }, aspect: wgpu::TextureAspect::All, }, - wgpu::ImageCopyBuffer { + wgpu::TexelCopyBufferInfo { buffer: &buffer, - layout: wgpu::ImageDataLayout { + layout: wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(buffer_dimensions.padded_bytes_per_row), rows_per_image: None, diff --git a/render/wgpu/src/pixel_bender.rs b/render/wgpu/src/pixel_bender.rs index ae744d7f507b..2941c5524c5b 100644 --- a/render/wgpu/src/pixel_bender.rs +++ b/render/wgpu/src/pixel_bender.rs @@ -16,8 +16,8 @@ use ruffle_render::{ use wgpu::util::{DeviceExt, StagingBelt}; use wgpu::{ BindGroupEntry, BindingResource, BlendComponent, BufferDescriptor, BufferUsages, - ColorTargetState, ColorWrites, CommandEncoder, ImageCopyTexture, PipelineLayout, - RenderPipeline, RenderPipelineDescriptor, SamplerBindingType, ShaderModuleDescriptor, + ColorTargetState, ColorWrites, CommandEncoder, PipelineLayout, RenderPipeline, + RenderPipelineDescriptor, SamplerBindingType, ShaderModuleDescriptor, TexelCopyTextureInfo, TextureDescriptor, TextureFormat, TextureView, VertexState, }; @@ -345,14 +345,14 @@ fn image_input_as_texture<'a>( view_formats: &[texture_format], }); descriptors.queue.write_texture( - wgpu::ImageCopyTexture { + wgpu::TexelCopyTextureInfo { texture: &fresh_texture, mip_level: 0, origin: wgpu::Origin3d::ZERO, aspect: wgpu::TextureAspect::All, }, &padded_bytes, - wgpu::ImageDataLayout { + wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(padded_bytes.len() as u32 / height), rows_per_image: None, @@ -498,13 +498,13 @@ pub(super) fn run_pixelbender_shader_impl( view_formats: &[wgpu::TextureFormat::Rgba8Unorm], }); render_command_encoder.copy_texture_to_texture( - ImageCopyTexture { + TexelCopyTextureInfo { texture: target, mip_level: 0, origin: Default::default(), aspect: Default::default(), }, - ImageCopyTexture { + TexelCopyTextureInfo { texture: &fresh_texture, mip_level: 0, origin: Default::default(), diff --git a/render/wgpu/src/surface/target.rs b/render/wgpu/src/surface/target.rs index 2902217ac2f6..cb52e13cc54e 100644 --- a/render/wgpu/src/surface/target.rs +++ b/render/wgpu/src/surface/target.rs @@ -419,7 +419,7 @@ impl CommandTarget { }); self.ensure_cleared(encoder); encoder.copy_texture_to_texture( - wgpu::ImageCopyTextureBase { + wgpu::TexelCopyTextureInfo { texture: self .resolve_buffer .as_ref() @@ -429,7 +429,7 @@ impl CommandTarget { origin: Default::default(), aspect: Default::default(), }, - wgpu::ImageCopyTextureBase { + wgpu::TexelCopyTextureInfo { texture: blend_buffer.texture(), mip_level: 0, origin: Default::default(), diff --git a/render/wgpu/src/target.rs b/render/wgpu/src/target.rs index 08b83508dec2..e71173b16525 100644 --- a/render/wgpu/src/target.rs +++ b/render/wgpu/src/target.rs @@ -287,7 +287,7 @@ impl RenderTarget for TextureTarget { }); let (buffer, dimensions) = buffer.inner(); encoder.copy_texture_to_buffer( - wgpu::ImageCopyTexture { + wgpu::TexelCopyTextureInfo { texture: &self.texture, mip_level: 0, origin: wgpu::Origin3d { @@ -297,9 +297,9 @@ impl RenderTarget for TextureTarget { }, aspect: wgpu::TextureAspect::All, }, - wgpu::ImageCopyBuffer { + wgpu::TexelCopyBufferInfo { buffer, - layout: wgpu::ImageDataLayout { + layout: wgpu::TexelCopyBufferLayout { offset: 0, bytes_per_row: Some(dimensions.padded_bytes_per_row), rows_per_image: None,