From 4e1557e50711f5cb33f0ba5644ac01c2d02de4e6 Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Thu, 6 Oct 2022 08:59:20 +0800 Subject: [PATCH] Update to latest wgpu 0.14 --- .../java/name/jinleili/wgpu/ToggleButton.kt | 3 --- .../name/jinleili/wgpu/WGPUSurfaceView.kt | 2 -- Cargo.lock | 25 +++++++++++-------- Cargo.toml | 3 ++- app-surface/Cargo.toml | 4 +-- app-surface/src/app_surface.rs | 2 -- src/main.rs | 2 +- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Android/app/src/main/java/name/jinleili/wgpu/ToggleButton.kt b/Android/app/src/main/java/name/jinleili/wgpu/ToggleButton.kt index 7c7c0e8..8830e42 100644 --- a/Android/app/src/main/java/name/jinleili/wgpu/ToggleButton.kt +++ b/Android/app/src/main/java/name/jinleili/wgpu/ToggleButton.kt @@ -1,8 +1,6 @@ package name.jinleili.wgpu -import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.background -import androidx.compose.foundation.border import androidx.compose.foundation.layout.* import androidx.compose.foundation.selection.toggleable import androidx.compose.foundation.shape.RoundedCornerShape @@ -11,7 +9,6 @@ import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp diff --git a/Android/app/src/main/java/name/jinleili/wgpu/WGPUSurfaceView.kt b/Android/app/src/main/java/name/jinleili/wgpu/WGPUSurfaceView.kt index 263f162..05d818e 100644 --- a/Android/app/src/main/java/name/jinleili/wgpu/WGPUSurfaceView.kt +++ b/Android/app/src/main/java/name/jinleili/wgpu/WGPUSurfaceView.kt @@ -15,10 +15,8 @@ class WGPUSurfaceView : SurfaceView, SurfaceHolder.Callback2 { constructor(context: Context) : super(context) { } - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { } - constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super( context, attrs, diff --git a/Cargo.lock b/Cargo.lock index ee87362..6493dcf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -977,8 +977,9 @@ dependencies = [ [[package]] name = "naga" -version = "0.9.0" -source = "git+https://github.com/gfx-rs/naga?rev=b209d911#b209d911681c4ef563f7d9048623667743e6248f" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "262d2840e72dbe250e8cf2f522d080988dfca624c4112c096238a4845f591707" dependencies = [ "bit-set", "bitflags", @@ -1819,8 +1820,9 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.13.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=c927e810#c927e810defc302d7b0cc21b069a0657df0771ff" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2272b17bffc8a0c7d53897435da7c1db587c87d3a14e8dae9cdb8d1d210fc0f" dependencies = [ "arrayvec 0.7.2", "js-sys", @@ -1840,8 +1842,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.13.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=c927e810#c927e810defc302d7b0cc21b069a0657df0771ff" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73d14cad393054caf992ee02b7da6a372245d39a484f7461c1f44f6f6359bd28" dependencies = [ "arrayvec 0.7.2", "bit-vec", @@ -1863,8 +1866,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.13.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=c927e810#c927e810defc302d7b0cc21b069a0657df0771ff" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdae6a80dbc725343f02f854b310b37190be946aeea65e9d83afaa7d840ebaac" dependencies = [ "android_system_properties", "arrayvec 0.7.2", @@ -1923,8 +1927,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.13.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=c927e810#c927e810defc302d7b0cc21b069a0657df0771ff" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28fb86c1909233c804aa79b7dd1ad06ebd979b2a465e3e980582db0ea9e69f3f" dependencies = [ "bitflags", ] diff --git a/Cargo.toml b/Cargo.toml index 9dbf89e..54aab6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,8 @@ log = "0.4" noise = { version = "0.7", default-features = false } pollster = "0.2" rand = { version = "0.7.2" } -wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "c927e810" } +wgpu = "0.14" +# wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "c927e810" } # wgpu = { git = "https://github.com/jinleili/wgpu", rev = "5ff54710" } # wgpu = { path = "../../forks/wgpu/wgpu" } diff --git a/app-surface/Cargo.toml b/app-surface/Cargo.toml index e784eba..361620d 100644 --- a/app-surface/Cargo.toml +++ b/app-surface/Cargo.toml @@ -8,7 +8,6 @@ version = "0.1.0" crate-type = ["rlib"] [profile.release] -# Rust 1.59+ strip = "all" [features] @@ -17,7 +16,8 @@ default = [] [dependencies] log = "0.4" pollster = "0.2" -wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "c927e810" } +wgpu = "0.14" +# wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "c927e810" } # wgpu = { git = "https://github.com/jinleili/wgpu", rev = "5ff54710" } # wgpu = { path = "../../../forks/wgpu/wgpu" } diff --git a/app-surface/src/app_surface.rs b/app-surface/src/app_surface.rs index 1d9bbdc..ef29924 100644 --- a/app-surface/src/app_surface.rs +++ b/app-surface/src/app_surface.rs @@ -5,7 +5,6 @@ pub struct AppSurface { pub scale_factor: f32, pub sdq: crate::SurfaceDeviceQueue, pub callback_to_app: Option, - pub temporary_directory: &'static str, pub library_directory: &'static str, } @@ -40,7 +39,6 @@ impl AppSurface { queue: Arc::new(queue), }, callback_to_app: None, - temporary_directory: "", library_directory: "", } } diff --git a/src/main.rs b/src/main.rs index a1132b9..329cd0a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,7 @@ fn main() { .with_title("wgpu on Desktop"); let window = builder.build(&events_loop).unwrap(); - let mut canvas = WgpuCanvas::new(AppSurface::new(window), 3); + let mut canvas = WgpuCanvas::new(AppSurface::new(window), 0); let mut last_update_inst = Instant::now(); let target_frametime = Duration::from_secs_f64(1.0 / 60.0);