mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Voxygen list backends subcommand
This commit is contained in:
parent
d11c58b75b
commit
b523423404
@ -7,7 +7,7 @@
|
|||||||
//!
|
//!
|
||||||
//! Airshipper should only use arguments listed above! Since we will not try to
|
//! Airshipper should only use arguments listed above! Since we will not try to
|
||||||
//! be careful about their stability otherwise.
|
//! be careful about their stability otherwise.
|
||||||
use clap::Parser;
|
use clap::{Parser, Subcommand};
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
@ -16,4 +16,13 @@ pub struct Args {
|
|||||||
/// This allows passing in server selection performed in airshipper.
|
/// This allows passing in server selection performed in airshipper.
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
pub server: Option<String>,
|
pub server: Option<String>,
|
||||||
|
|
||||||
|
#[clap(subcommand)]
|
||||||
|
pub command: Option<Commands>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Commands {
|
||||||
|
/// List available wgpu backends.
|
||||||
|
ListBackends,
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,28 @@ use tracing::{info, warn};
|
|||||||
use veloren_voxygen::ui::egui::EguiState;
|
use veloren_voxygen::ui::egui::EguiState;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// Process CLI arguments
|
||||||
|
use clap::Parser;
|
||||||
|
let args = cli::Args::parse();
|
||||||
|
|
||||||
|
if let Some(command) = args.command {
|
||||||
|
match command {
|
||||||
|
cli::Commands::ListBackends => {
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
let backends = &["dx11", "dx12", "vulkan"];
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
let backends = &["vulkan"];
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
let backends = &["metal"];
|
||||||
|
|
||||||
|
for backend in backends {
|
||||||
|
println!("{backend}");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "tracy")]
|
#[cfg(feature = "tracy")]
|
||||||
common_base::tracy_client::Client::start();
|
common_base::tracy_client::Client::start();
|
||||||
|
|
||||||
@ -93,10 +115,6 @@ fn main() {
|
|||||||
|
|
||||||
panic_handler::set_panic_hook(log_filename, logs_dir);
|
panic_handler::set_panic_hook(log_filename, logs_dir);
|
||||||
|
|
||||||
// Process CLI arguments
|
|
||||||
use clap::Parser;
|
|
||||||
let args = cli::Args::parse();
|
|
||||||
|
|
||||||
// Setup tokio runtime
|
// Setup tokio runtime
|
||||||
use common::consts::MIN_RECOMMENDED_TOKIO_THREADS;
|
use common::consts::MIN_RECOMMENDED_TOKIO_THREADS;
|
||||||
use std::sync::{
|
use std::sync::{
|
||||||
|
Loading…
Reference in New Issue
Block a user