Updated wgpu to 0.9.0 and egui to 0.13.0

This commit is contained in:
Ben Wallis 2021-07-06 07:31:12 +01:00
parent a8447fd62d
commit 88bb160336
5 changed files with 115 additions and 70 deletions

144
Cargo.lock generated
View File

@ -443,9 +443,9 @@ checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631"
[[package]] [[package]]
name = "bytemuck" name = "bytemuck"
version = "1.5.1" version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bed57e2090563b83ba8f83366628ce535a7584c9afa4c9fc0612a03925c6df58" checksum = "9966d2ab714d0f785dbac0a0396251a35280aeb42413281617d0209ab4898435"
dependencies = [ dependencies = [
"bytemuck_derive", "bytemuck_derive",
] ]
@ -1444,18 +1444,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
[[package]] [[package]]
name = "egui" name = "drm-fourcc"
version = "0.12.0" version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "788148861d80b87d28d64440a3d31cae190e50ccc3ea585597466d38428365d7" checksum = "ebbf3a5ed4671aabffefce172ff43d69c1f27dd2c6aea28e5212a70f32ada0cf"
dependencies = [
"serde",
]
[[package]]
name = "egui"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77f9b394ccacc0cccb30f6de7371038a116931aa3186acd908b9ec61f405f15c"
dependencies = [ dependencies = [
"epaint", "epaint",
] ]
[[package]] [[package]]
name = "egui_wgpu_backend" name = "egui_wgpu_backend"
version = "0.8.0" version = "0.10.0"
source = "git+https://github.com/hasenbanck/egui_wgpu_backend.git?rev=63a002c6a9b6c016e45806dd065864431caab621#63a002c6a9b6c016e45806dd065864431caab621" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c405dd33ce1a2dc81e6cded24080157da7d95ae6231522c9cce2829cdc974346"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"epi", "epi",
@ -1464,9 +1474,9 @@ dependencies = [
[[package]] [[package]]
name = "egui_winit_platform" name = "egui_winit_platform"
version = "0.8.0" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd4cf17c0cd4dbcf2f8fef55a3592b9b7cfd970576c7302d8ba5c521b8560371" checksum = "783f6cf2246f553718a0bd28e8dfc3ae331085762020ac993ab2b68f7c2d81ae"
dependencies = [ dependencies = [
"egui", "egui",
"winit", "winit",
@ -1480,9 +1490,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]] [[package]]
name = "emath" name = "emath"
version = "0.12.0" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e73d6c8c70eadb71756fbbc3c303ab25e163b46b656886dd250de5636efea12" checksum = "80eea7508c08a7b4e2a041adcdca6f400d8606622c6bb980ecbbdc5f1aff9a4c"
[[package]] [[package]]
name = "encoding_rs" name = "encoding_rs"
@ -1542,22 +1552,22 @@ dependencies = [
[[package]] [[package]]
name = "epaint" name = "epaint"
version = "0.12.0" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80e2db640801230bdda80629bc3a063927a462f5eaf38a98da676954e78ccb99" checksum = "132e30d483d9fa252fe06aa112de777d068503c379fa51bc5834204ee3258fce"
dependencies = [ dependencies = [
"ab_glyph",
"ahash 0.7.4", "ahash 0.7.4",
"atomic_refcell", "atomic_refcell",
"emath", "emath",
"ordered-float 2.5.1", "ordered-float 2.5.1",
"rusttype 0.9.2",
] ]
[[package]] [[package]]
name = "epi" name = "epi"
version = "0.12.0" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59c4f6cbede1fc8f836384f85295a59199a4825940abcc3a8a29cfe2e3c37583" checksum = "4b04a4a240553fa9254d0569cf3aa22d9dbe77a66025e1f04b0785744629c9ec"
dependencies = [ dependencies = [
"egui", "egui",
] ]
@ -1596,6 +1606,16 @@ version = "2.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59"
[[package]]
name = "external-memory"
version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4dfe8d292b014422776a8c516862d2bff8a81b223a4461dfdc45f3862dc9d39"
dependencies = [
"bitflags",
"drm-fourcc",
]
[[package]] [[package]]
name = "fallible-iterator" name = "fallible-iterator"
version = "0.2.0" version = "0.2.0"
@ -1936,8 +1956,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-auxil" name = "gfx-auxil"
version = "0.9.0" version = "0.10.0"
source = "git+https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3796d33d23812f2bb8c7e3b5aea18b521" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1694991b11d642680e82075a75c7c2bd75556b805efa7660b705689f05b1ab1c"
dependencies = [ dependencies = [
"fxhash", "fxhash",
"gfx-hal", "gfx-hal",
@ -1946,13 +1967,15 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-dx11" name = "gfx-backend-dx11"
version = "0.8.0" version = "0.9.0"
source = "git+https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3796d33d23812f2bb8c7e3b5aea18b521" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f9e453baf3aaef2b0c354ce0b3d63d76402e406a59b64b7182d123cfa6635ae"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
"gfx-auxil", "gfx-auxil",
"gfx-hal", "gfx-hal",
"gfx-renderdoc",
"libloading 0.7.0", "libloading 0.7.0",
"log", "log",
"parking_lot 0.11.1", "parking_lot 0.11.1",
@ -1967,8 +1990,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-dx12" name = "gfx-backend-dx12"
version = "0.8.0" version = "0.9.1"
source = "git+https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3796d33d23812f2bb8c7e3b5aea18b521" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21506399f64a3c4d389182a89a30073856ae33eb712315456b4fd8f39ee7682a"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bit-set", "bit-set",
@ -1976,6 +2000,7 @@ dependencies = [
"d3d12", "d3d12",
"gfx-auxil", "gfx-auxil",
"gfx-hal", "gfx-hal",
"gfx-renderdoc",
"log", "log",
"parking_lot 0.11.1", "parking_lot 0.11.1",
"range-alloc", "range-alloc",
@ -1988,8 +2013,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-empty" name = "gfx-backend-empty"
version = "0.8.0" version = "0.9.0"
source = "git+https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3796d33d23812f2bb8c7e3b5aea18b521" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29c8f813c47791918aa00dc9c9ddf961d23fa8c2a5d869e6cb8ea84f944820f4"
dependencies = [ dependencies = [
"gfx-hal", "gfx-hal",
"log", "log",
@ -1998,8 +2024,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-gl" name = "gfx-backend-gl"
version = "0.8.1" version = "0.9.0"
source = "git+https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3796d33d23812f2bb8c7e3b5aea18b521" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bae057fc3a0ab23ecf97ae51d4017d27d5ddf0aab16ee6dcb58981af88c3152"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
@ -2021,14 +2048,16 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-metal" name = "gfx-backend-metal"
version = "0.8.1" version = "0.9.1"
source = "git+https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3796d33d23812f2bb8c7e3b5aea18b521" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0de85808e2a98994c6af925253f8a9593bc57180ef1ea137deab6d35cc949517"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
"block", "block",
"cocoa-foundation", "cocoa-foundation",
"copyless", "copyless",
"core-graphics-types",
"foreign-types", "foreign-types",
"fxhash", "fxhash",
"gfx-auxil", "gfx-auxil",
@ -2047,37 +2076,50 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-vulkan" name = "gfx-backend-vulkan"
version = "0.8.0" version = "0.9.0"
source = "git+https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3796d33d23812f2bb8c7e3b5aea18b521" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9861ec855acbbc65c0e4f966d761224886e811dc2c6d413a4776e9293d0e5c0"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"ash", "ash",
"byteorder", "byteorder",
"core-graphics-types", "core-graphics-types",
"gfx-hal", "gfx-hal",
"gfx-renderdoc",
"inplace_it", "inplace_it",
"libloading 0.7.0",
"log", "log",
"naga", "naga",
"objc", "objc",
"parking_lot 0.11.1", "parking_lot 0.11.1",
"raw-window-handle", "raw-window-handle",
"renderdoc-sys",
"smallvec", "smallvec",
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]] [[package]]
name = "gfx-hal" name = "gfx-hal"
version = "0.8.0" version = "0.9.0"
source = "git+https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3796d33d23812f2bb8c7e3b5aea18b521" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fbb575ea793dd0507b3082f4f2cde62dc9f3cebd98f5cd49ba2a4da97a976fd"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"external-memory",
"naga", "naga",
"raw-window-handle", "raw-window-handle",
"thiserror", "thiserror",
] ]
[[package]]
name = "gfx-renderdoc"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8027995e247e2426d3a00d13f5191dd56c314bff02dc4b54cbf727f1ba9c40a"
dependencies = [
"libloading 0.7.0",
"log",
"renderdoc-sys",
]
[[package]] [[package]]
name = "gilrs" name = "gilrs"
version = "0.8.1" version = "0.8.1"
@ -3008,13 +3050,13 @@ dependencies = [
[[package]] [[package]]
name = "metal" name = "metal"
version = "0.22.0" version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c12e48c737ee9a55e8bb2352bcde588f79ae308d3529ee888f7cc0f469b5777" checksum = "79d7d769f1c104b8388294d6594d491d2e21240636f5f94d37f8a0f3d7904450"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"block", "block",
"cocoa-foundation", "core-graphics-types",
"foreign-types", "foreign-types",
"log", "log",
"objc", "objc",
@ -3149,8 +3191,9 @@ checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238"
[[package]] [[package]]
name = "naga" name = "naga"
version = "0.4.0" version = "0.5.0"
source = "git+https://github.com/gfx-rs/naga?tag=gfx-25#057d03ad86f18e3bb3866b20901d8d4e892dd3d6" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef670817eef03d356d5a509ea275e7dd3a78ea9e24261ea3cb2dfed1abb08f64"
dependencies = [ dependencies = [
"bit-set", "bit-set",
"bitflags", "bitflags",
@ -4226,7 +4269,8 @@ dependencies = [
[[package]] [[package]]
name = "range-alloc" name = "range-alloc"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/gfx-rs/gfx?rev=27a1dae3796d33d23812f2bb8c7e3b5aea18b521#27a1dae3796d33d23812f2bb8c7e3b5aea18b521" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6"
[[package]] [[package]]
name = "raw-window-handle" name = "raw-window-handle"
@ -6812,8 +6856,9 @@ dependencies = [
[[package]] [[package]]
name = "wgpu" name = "wgpu"
version = "0.8.0" version = "0.9.0"
source = "git+https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549a8e2cb9dac781bafc5ed32828f3caf46" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd247f8b26fd3d42ef2f320d378025cd6e84d782ef749fab45cc3b981fbe3275"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"js-sys", "js-sys",
@ -6832,8 +6877,9 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-core" name = "wgpu-core"
version = "0.8.0" version = "0.9.0"
source = "git+https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549a8e2cb9dac781bafc5ed32828f3caf46" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2af5c8acd3ae5781a277cdf65a17f3a7135de5ae782775620e74ea16c9d47770"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
@ -6863,8 +6909,9 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-profiler" name = "wgpu-profiler"
version = "0.4.0" version = "0.5.0"
source = "git+https://github.com/Imberflur/wgpu-profiler?tag=wgpu-0.8#b156eb145bc223386ef344860d9b33b3c181650c" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab823972ed6859f12ea7a44d130d45a295caf0764668fffdc3934a7f5a66ec26"
dependencies = [ dependencies = [
"futures", "futures",
"wgpu", "wgpu",
@ -6872,8 +6919,9 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-types" name = "wgpu-types"
version = "0.8.0" version = "0.9.0"
source = "git+https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549a8e2cb9dac781bafc5ed32828f3caf46" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f5c9678cd533558e28b416d66947b099742df1939307478db54f867137f1b60"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"serde", "serde",

View File

@ -134,8 +134,6 @@ nativeBuildInputs = ["pkg-config"]
[patch.crates-io] [patch.crates-io]
vek = { git = "https://gitlab.com/veloren/vek.git", branch = "fix_intrinsics2" } vek = { git = "https://gitlab.com/veloren/vek.git", branch = "fix_intrinsics2" }
# patch wgpu so we can use wgpu-profiler crate
wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "a92b8549a8e2cb9dac781bafc5ed32828f3caf46" }
# # use the latest fixes in naga (remove when updates trickle down to wgpu-rs) # # use the latest fixes in naga (remove when updates trickle down to wgpu-rs)
# naga = { git = "https://github.com/gfx-rs/naga.git", rev = "3a0f0144112ff621dd7f731bf455adf6cab19164" } # naga = { git = "https://github.com/gfx-rs/naga.git", rev = "3a0f0144112ff621dd7f731bf455adf6cab19164" }

View File

@ -50,8 +50,8 @@ voxygen-egui = {package = "veloren-voxygen-egui", path = "egui", optional = true
# Graphics # Graphics
winit = {version = "0.25.0", features = ["serde"]} winit = {version = "0.25.0", features = ["serde"]}
wgpu = { version = "=0.8.0", features = ["trace", "cross"] } wgpu = { version = "0.9.0", features = ["trace", "cross"] }
wgpu-profiler = { git = "https://github.com/Imberflur/wgpu-profiler", tag = "wgpu-0.8" } wgpu-profiler = "0.5.0"
bytemuck = { version="1.4", features=["derive"] } bytemuck = { version="1.4", features=["derive"] }
shaderc = "0.6.2" shaderc = "0.6.2"
@ -66,9 +66,9 @@ glyph_brush = "0.7.0"
keyboard-keynames = { git = "https://gitlab.com/Frinksy/keyboard-keynames.git", rev = "9ae8f89014d0b0c5b61d0e821c5aeb6140c5c0dc" } keyboard-keynames = { git = "https://gitlab.com/Frinksy/keyboard-keynames.git", rev = "9ae8f89014d0b0c5b61d0e821c5aeb6140c5c0dc" }
# EGUI # EGUI
egui = {version = "0.12", optional = true } egui = {version = "0.13", optional = true }
egui_wgpu_backend = {git = "https://github.com/hasenbanck/egui_wgpu_backend.git", rev = "63a002c6a9b6c016e45806dd065864431caab621", optional = true } egui_wgpu_backend = { version = "0.10.0", optional = true }
egui_winit_platform = {version = "0.8", optional = true } egui_winit_platform = {version = "0.9", optional = true }
# ECS # ECS
specs = {git = "https://github.com/amethyst/specs.git", rev = "f985bec5d456f7b0dd8aae99848f9473c2cd9d46"} specs = {git = "https://github.com/amethyst/specs.git", rev = "f985bec5d456f7b0dd8aae99848f9473c2cd9d46"}

View File

@ -11,8 +11,8 @@ be-dyn-lib = []
[dependencies] [dependencies]
client = {package = "veloren-client", path = "../../client"} client = {package = "veloren-client", path = "../../client"}
common = {package = "veloren-common", path = "../../common"} common = {package = "veloren-common", path = "../../common"}
egui = "0.12" egui = "0.13"
egui_winit_platform = "0.8" egui_winit_platform = "0.9"
voxygen-dynlib = {package = "veloren-voxygen-dynlib", path = "../dynlib", optional = true} voxygen-dynlib = {package = "veloren-voxygen-dynlib", path = "../dynlib", optional = true}
# Hot Reloading # Hot Reloading

View File

@ -5,28 +5,20 @@ compile_error!("Can't use both \"be-dyn-lib\" and \"use-dyn-lib\" features at on
mod character_states; mod character_states;
use crate::character_states::draw_char_state_group;
use client::{Client, Join, World, WorldExt}; use client::{Client, Join, World, WorldExt};
use common::{ use common::{
comp, comp,
comp::{Poise, PoiseState}, comp::{aura::AuraKind::Buff, Body, Fluid, Poise, PoiseState},
}; };
use core::mem; use core::mem;
use egui::{ use egui::{
plot::{Plot, Value}, plot::{Line, Plot, Value, Values},
widgets::plot::Curve,
CollapsingHeader, Color32, Grid, Label, ScrollArea, Slider, Ui, Window, CollapsingHeader, Color32, Grid, Label, ScrollArea, Slider, Ui, Window,
}; };
fn two_col_row(ui: &mut Ui, label: impl Into<Label>, content: impl Into<Label>) {
ui.label(label);
ui.label(content);
ui.end_row();
}
use crate::character_states::draw_char_state_group;
use common::comp::{aura::AuraKind::Buff, Body, Fluid};
use egui_winit_platform::Platform; use egui_winit_platform::Platform;
use std::time::Duration; use std::time::Duration;
#[cfg(feature = "use-dyn-lib")] #[cfg(feature = "use-dyn-lib")]
use { use {
lazy_static::lazy_static, std::ffi::CStr, std::sync::Arc, std::sync::Mutex, lazy_static::lazy_static, std::ffi::CStr, std::sync::Arc, std::sync::Mutex,
@ -256,13 +248,14 @@ pub fn maintain_egui_inner(
.default_width(200.0) .default_width(200.0)
.default_height(200.0) .default_height(200.0)
.show(ctx, |ui| { .show(ctx, |ui| {
let plot = Plot::new("Frame Time").curve(Curve::from_values_iter( let line = Line::new(Values::from_values_iter(
egui_state egui_state
.frame_times .frame_times
.iter() .iter()
.enumerate() .enumerate()
.map(|(i, x)| Value::new(i as f64, *x)), .map(|(i, x)| Value::new(i as f64, *x)),
)); ));
let plot = Plot::new("Frame Time").line(line);
ui.add(plot); ui.add(plot);
}); });
@ -676,6 +669,12 @@ fn body_species(body: &Body) -> String {
} }
} }
fn two_col_row(ui: &mut Ui, label: impl Into<Label>, content: impl Into<Label>) {
ui.label(label);
ui.label(content);
ui.end_row();
}
fn poise_state_label(ui: &mut Ui, poise: &Poise) { fn poise_state_label(ui: &mut Ui, poise: &Poise) {
match poise.poise_state() { match poise.poise_state() {
PoiseState::Normal => { PoiseState::Normal => {