mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-30 10:03:56 +01:00
Merge pull request #192 from JonRC/fix/headless-render-without-compute
Headless render on adapters without compute shaders, and the wgpu env vars
This commit is contained in:
9 files changed
+235
-22
No files matched your search
@@ -48,7 +48,7 @@ pub(crate) enum Command {
|
||||
///
|
||||
/// --camera looks through a camera saved in the project (camera.add); --samples path traces it
|
||||
/// instead (Rendering mode), on the GPU when it has compute shaders, else (or with --cpu) on
|
||||
/// the CPU.
|
||||
/// the CPU (no GPU needed).
|
||||
#[command(after_help = INPUTS)]
|
||||
Render(RenderArgs),
|
||||
/// A new project from a mesh or a built-in mesh
|
||||
|
||||
@@ -184,6 +184,34 @@ fn render_writes_a_png() {
|
||||
let _ = std::fs::remove_dir_all(&d);
|
||||
}
|
||||
|
||||
/// Without a GPU, the viewport render's error says what still works, and that does work. A backend
|
||||
/// this platform lacks stands in for a machine without a GPU: the CLI's wgpu instance reads
|
||||
/// `WGPU_BACKEND`.
|
||||
#[test]
|
||||
fn render_without_a_gpu_points_to_path_tracing() {
|
||||
let d = tmp("no-gpu");
|
||||
let out = d.join("cube.png");
|
||||
let absent = if cfg!(target_os = "macos") { "dx12" } else { "metal" };
|
||||
let render = |extra: &[&str]| {
|
||||
Command::new(cli_binary())
|
||||
.env("WGPU_BACKEND", absent)
|
||||
.env_remove("WGPU_ADAPTER_NAME")
|
||||
.env_remove("WGPU_POWER_PREF")
|
||||
.args(["render", "builtin:cube", p(&out), "--size", "64x64"])
|
||||
.args(extra)
|
||||
.output()
|
||||
.unwrap()
|
||||
};
|
||||
let o = render(&[]);
|
||||
let err = String::from_utf8_lossy(&o.stderr);
|
||||
assert_eq!(o.status.code(), Some(1), "{err}");
|
||||
assert!(err.contains("cannot render") && err.contains("path tracing (`samples`) needs no GPU"), "{err}");
|
||||
let o = render(&["--samples", "2"]);
|
||||
assert!(o.status.success(), "{}", String::from_utf8_lossy(&o.stderr));
|
||||
assert_eq!(image::open(&out).unwrap().width(), 64);
|
||||
let _ = std::fs::remove_dir_all(&d);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn path_traced_render_needs_no_gpu() {
|
||||
let d = tmp("trace");
|
||||
|
||||
@@ -401,7 +401,7 @@ impl Headless {
|
||||
|
||||
let gpu = match self.gpu.get_or_insert_with(Gpu::new) {
|
||||
Ok(g) => g,
|
||||
Err(e) => return Err(AutomationError::Other(format!("cannot render: {e}"))),
|
||||
Err(e) => return Err(AutomationError::Other(format!("cannot render: {e}; path tracing (`samples`) needs no GPU"))),
|
||||
};
|
||||
|
||||
// Last-resort guard: wgpu panics on device errors; drop the device and report instead
|
||||
|
||||
@@ -31,3 +31,7 @@ wasm-bindgen-futures = "0.4"
|
||||
[dev-dependencies]
|
||||
image = { workspace = true }
|
||||
texturecraft-formats = { workspace = true }
|
||||
|
||||
# The noop backend stands in for an adapter without compute shaders in the headless tests.
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
||||
wgpu = { workspace = true, features = ["noop"] }
|
||||
@@ -121,9 +121,7 @@ pub fn raytracing_available() -> bool {
|
||||
}
|
||||
|
||||
fn bake_adapter() -> Result<(wgpu::Adapter, String, wgpu::Limits), String> {
|
||||
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor::new_without_display_handle_from_env());
|
||||
let options = wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::HighPerformance, ..Default::default() };
|
||||
let adapter = pollster::block_on(instance.request_adapter(&options)).map_err(|e| format!("no GPU adapter: {e}"))?;
|
||||
let adapter = crate::headless::adapter()?;
|
||||
let info = adapter.get_info();
|
||||
let limits = adapter.limits();
|
||||
let flags = adapter.get_downlevel_capabilities().flags;
|
||||
@@ -134,7 +132,7 @@ fn bake_adapter() -> Result<(wgpu::Adapter, String, wgpu::Limits), String> {
|
||||
Ok((adapter, info.name, limits))
|
||||
}
|
||||
|
||||
fn unsupported_adapter(device_type: wgpu::DeviceType, flags: wgpu::DownlevelFlags, limits: &wgpu::Limits) -> Option<&'static str> {
|
||||
pub(crate) fn unsupported_adapter(device_type: wgpu::DeviceType, flags: wgpu::DownlevelFlags, limits: &wgpu::Limits) -> Option<&'static str> {
|
||||
if device_type == wgpu::DeviceType::Cpu {
|
||||
return Some("is a software renderer");
|
||||
}
|
||||
|
||||
@@ -834,7 +834,17 @@ mod tests {
|
||||
}
|
||||
|
||||
fn gpu() -> Option<(Headless, GpuTracer)> {
|
||||
let Ok(h) = Headless::new() else {
|
||||
gpu_on(Headless::new())
|
||||
}
|
||||
|
||||
/// A tracer on a device whose buffers hold at most 256 MiB, as wgpu's default limits do: a GPU's
|
||||
/// own limits (several GiB on a desktop card) would let an 8192² render succeed.
|
||||
fn small_buffer_gpu() -> Option<(Headless, GpuTracer)> {
|
||||
gpu_on(Headless::with_buffer_cap(256 << 20))
|
||||
}
|
||||
|
||||
fn gpu_on(headless: Result<Headless, String>) -> Option<(Headless, GpuTracer)> {
|
||||
let Ok(h) = headless else {
|
||||
eprintln!("skipping: no GPU adapter");
|
||||
return None;
|
||||
};
|
||||
@@ -908,7 +918,7 @@ mod tests {
|
||||
/// Rejecting an oversized render preserves the image and lets tracing continue.
|
||||
#[test]
|
||||
fn failed_reset_retains_the_active_render() {
|
||||
let Some((mut headless, mut tracer)) = gpu() else { return };
|
||||
let Some((mut headless, mut tracer)) = small_buffer_gpu() else { return };
|
||||
let scene = sphere_scene(&mut headless, crate::ibl::environment("Studio Soft", 32), &WHITE);
|
||||
let camera = camera();
|
||||
let settings = TraceSettings::default();
|
||||
|
||||
@@ -9,15 +9,89 @@ pub struct Headless {
|
||||
pub adapter_name: String,
|
||||
}
|
||||
|
||||
/// The adapter for work without a window (renders, path tracing, GPU baking). Like the desktop app,
|
||||
/// it honours `WGPU_ADAPTER_NAME` (part of the adapter's name or backend, any case) and `WGPU_POWER_PREF`
|
||||
/// (`high`, the default, `low` or `none`); the instance reads wgpu's other variables
|
||||
/// (`WGPU_BACKEND`, `WGPU_ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER`, ...).
|
||||
pub fn adapter() -> Result<wgpu::Adapter, String> {
|
||||
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor::new_without_display_handle_from_env());
|
||||
let power = wgpu::PowerPreference::from_env().unwrap_or(wgpu::PowerPreference::HighPerformance);
|
||||
if let Ok(name) = std::env::var("WGPU_ADAPTER_NAME") {
|
||||
let adapters = pollster::block_on(instance.enumerate_adapters(wgpu::Backends::all()));
|
||||
let infos: Vec<wgpu::AdapterInfo> = adapters.iter().map(wgpu::Adapter::get_info).collect();
|
||||
if let Some(a) = pick_adapter(&infos, &name, power).and_then(|i| adapters.into_iter().nth(i)) {
|
||||
return Ok(a);
|
||||
}
|
||||
log::warn!("no GPU adapter matches WGPU_ADAPTER_NAME `{name}`; choosing by power preference");
|
||||
}
|
||||
pollster::block_on(instance.request_adapter(&wgpu::RequestAdapterOptions { power_preference: power, ..Default::default() }))
|
||||
.map_err(|e| format!("no GPU adapter: {e}"))
|
||||
}
|
||||
|
||||
/// Which of `infos` `WGPU_ADAPTER_NAME=name` picks. Several adapters may match (the same GPU on two
|
||||
/// backends, two GPUs of one vendor): rank them as the desktop app's selector does, hardware before
|
||||
/// software, then `power`, then native backends before OpenGL, then the listing order.
|
||||
fn pick_adapter(infos: &[wgpu::AdapterInfo], name: &str, power: wgpu::PowerPreference) -> Option<usize> {
|
||||
use wgpu::{Backend, DeviceType, PowerPreference};
|
||||
let wanted = name.to_lowercase();
|
||||
infos
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, info)| info.name.to_lowercase().contains(&wanted) || format!("{:?}", info.backend).to_lowercase().contains(&wanted))
|
||||
.min_by_key(|(index, info)| {
|
||||
let lower = info.name.to_lowercase();
|
||||
let software = info.device_type == DeviceType::Cpu || ["llvmpipe", "lavapipe", "warp"].iter().any(|s| lower.contains(s));
|
||||
let power_rank = match (power, info.device_type) {
|
||||
(PowerPreference::None, DeviceType::Cpu) => 1,
|
||||
(PowerPreference::None, _) => 0,
|
||||
(PowerPreference::LowPower, DeviceType::IntegratedGpu) | (PowerPreference::HighPerformance, DeviceType::DiscreteGpu) => 0,
|
||||
(PowerPreference::LowPower, DeviceType::DiscreteGpu) | (PowerPreference::HighPerformance, DeviceType::IntegratedGpu) => 1,
|
||||
(_, DeviceType::Other) => 2,
|
||||
(_, DeviceType::VirtualGpu) => 3,
|
||||
(_, DeviceType::Cpu) => 4,
|
||||
};
|
||||
let backend_rank = match (power, info.backend) {
|
||||
(PowerPreference::None, _) | (_, Backend::Vulkan | Backend::Metal | Backend::Dx12) => 0,
|
||||
(_, Backend::Gl) => 1,
|
||||
_ => 2,
|
||||
};
|
||||
(software, power_rank, backend_rank, *index)
|
||||
})
|
||||
.map(|(index, _)| index)
|
||||
}
|
||||
|
||||
/// A device on `adapter` with all its limits. The viewport draws with fragment passes only, so an
|
||||
/// adapter without compute shaders (WebGL2-class, or the GL driver WSL2 offers on an integrated GPU)
|
||||
/// still renders it; the GPU path tracer checks the device's limits itself.
|
||||
fn device(adapter: &wgpu::Adapter) -> Result<(wgpu::Device, wgpu::Queue), String> {
|
||||
device_with_limits(adapter, adapter.limits())
|
||||
}
|
||||
|
||||
fn device_with_limits(adapter: &wgpu::Adapter, limits: wgpu::Limits) -> Result<(wgpu::Device, wgpu::Queue), String> {
|
||||
let desc = wgpu::DeviceDescriptor { label: Some("tc_headless"), required_limits: limits, ..Default::default() };
|
||||
pollster::block_on(adapter.request_device(&desc)).map_err(|e| format!("no GPU device on {}: {e}", adapter.get_info().name))
|
||||
}
|
||||
|
||||
impl Headless {
|
||||
/// Create a device on the default adapter. Errors when no GPU (or software) adapter exists.
|
||||
/// Create a device on [`adapter`]. Errors when no GPU (or software) adapter exists.
|
||||
pub fn new() -> Result<Headless, String> {
|
||||
let instance = wgpu::Instance::default();
|
||||
let adapter = pollster::block_on(instance.request_adapter(&wgpu::RequestAdapterOptions::default())).map_err(|e| format!("no GPU adapter: {e}"))?;
|
||||
let adapter_name = adapter.get_info().name;
|
||||
let (device, queue) = pollster::block_on(adapter.request_device(&wgpu::DeviceDescriptor::default())).map_err(|e| format!("no GPU device: {e}"))?;
|
||||
let adapter = adapter()?;
|
||||
let (device, queue) = device(&adapter)?;
|
||||
let renderer = Renderer::new(&device, &queue, wgpu::TextureFormat::Rgba8Unorm);
|
||||
Ok(Headless { device, queue, renderer, adapter_name })
|
||||
Ok(Headless { device, queue, renderer, adapter_name: adapter.get_info().name })
|
||||
}
|
||||
|
||||
/// A device whose buffers are capped at `bytes` (or the adapter's own limit when that is lower),
|
||||
/// so tests of "too big for this GPU" paths do not depend on how large the machine's limits are.
|
||||
#[cfg(test)]
|
||||
pub(crate) fn with_buffer_cap(bytes: u64) -> Result<Headless, String> {
|
||||
let adapter = adapter()?;
|
||||
let mut limits = adapter.limits();
|
||||
limits.max_buffer_size = limits.max_buffer_size.min(bytes);
|
||||
limits.max_storage_buffer_binding_size = limits.max_storage_buffer_binding_size.min(bytes);
|
||||
let (device, queue) = device_with_limits(&adapter, limits)?;
|
||||
let renderer = Renderer::new(&device, &queue, wgpu::TextureFormat::Rgba8Unorm);
|
||||
Ok(Headless { device, queue, renderer, adapter_name: adapter.get_info().name })
|
||||
}
|
||||
|
||||
/// Render a frame and read it back as RGBA8 (sRGB-encoded).
|
||||
@@ -28,3 +102,72 @@ impl Headless {
|
||||
self.renderer.read_view(&self.device, &self.queue, frame.view_id)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// An adapter without compute shaders still gets a device for the viewport. wgpu's noop backend
|
||||
/// stands in for one (WSL2's GL driver on an Intel GPU, a WebGL2-class GPU): asking it for
|
||||
/// `Limits::default()` failed with "Limit 'max_compute_workgroups_per_dimension' value 65535 is
|
||||
/// better than allowed 0".
|
||||
#[test]
|
||||
fn an_adapter_without_compute_shaders_gets_a_device() {
|
||||
let noop = wgpu::NoopBackendOptions { enable: true, limits: Some(wgpu::Limits::downlevel_webgl2_defaults()), ..Default::default() };
|
||||
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
||||
backends: wgpu::Backends::NOOP,
|
||||
backend_options: wgpu::BackendOptions { noop, ..Default::default() },
|
||||
..wgpu::InstanceDescriptor::new_without_display_handle()
|
||||
});
|
||||
let adapter = pollster::block_on(instance.request_adapter(&wgpu::RequestAdapterOptions::default())).unwrap();
|
||||
assert_eq!(adapter.limits().max_compute_workgroups_per_dimension, 0);
|
||||
device(&adapter).unwrap();
|
||||
}
|
||||
|
||||
fn info(name: &str, device_type: wgpu::DeviceType, backend: wgpu::Backend) -> wgpu::AdapterInfo {
|
||||
wgpu::AdapterInfo { name: name.into(), ..wgpu::AdapterInfo::new(device_type, backend) }
|
||||
}
|
||||
|
||||
/// A `WGPU_ADAPTER_NAME` that several adapters match still follows `WGPU_POWER_PREF`, and an
|
||||
/// empty one matches them all.
|
||||
#[test]
|
||||
fn a_name_several_adapters_match_follows_the_power_preference() {
|
||||
use wgpu::{Backend::*, DeviceType::*, PowerPreference as P};
|
||||
let gpus = [
|
||||
info("Intel(R) Iris(R) Xe Graphics", IntegratedGpu, Vulkan),
|
||||
info("Intel(R) Arc(TM) A770", DiscreteGpu, Vulkan),
|
||||
info("llvmpipe (LLVM 15)", Cpu, Gl),
|
||||
];
|
||||
assert_eq!(pick_adapter(&gpus, "intel", P::HighPerformance), Some(1));
|
||||
assert_eq!(pick_adapter(&gpus, "intel", P::LowPower), Some(0));
|
||||
assert_eq!(pick_adapter(&gpus, "INTEL", P::None), Some(0));
|
||||
assert_eq!(pick_adapter(&gpus, "", P::HighPerformance), Some(1));
|
||||
assert_eq!(pick_adapter(&gpus, "llvm", P::HighPerformance), Some(2));
|
||||
assert_eq!(pick_adapter(&gpus, "gl", P::HighPerformance), Some(2));
|
||||
assert_eq!(pick_adapter(&gpus, "nvidia", P::HighPerformance), None);
|
||||
// One GPU on two backends: the native one before OpenGL.
|
||||
let twice = [info("D3D12 (NVIDIA GeForce RTX 4050)", DiscreteGpu, Gl), info("Microsoft Direct3D12 (NVIDIA GeForce RTX 4050)", DiscreteGpu, Vulkan)];
|
||||
assert_eq!(pick_adapter(&twice, "rtx 4050", P::HighPerformance), Some(1));
|
||||
}
|
||||
|
||||
/// On an adapter with WebGL2-class limits (no compute shaders) the viewport renderer still builds,
|
||||
/// the GPU path tracer and the GPU baker each refuse with a message instead of panicking.
|
||||
#[test]
|
||||
fn an_adapter_without_compute_shaders_gets_an_error_not_a_panic() {
|
||||
let noop = wgpu::NoopBackendOptions { enable: true, limits: Some(wgpu::Limits::downlevel_webgl2_defaults()), ..Default::default() };
|
||||
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
||||
backends: wgpu::Backends::NOOP,
|
||||
backend_options: wgpu::BackendOptions { noop, ..Default::default() },
|
||||
..wgpu::InstanceDescriptor::new_without_display_handle()
|
||||
});
|
||||
let adapter = pollster::block_on(instance.request_adapter(&wgpu::RequestAdapterOptions::default())).unwrap();
|
||||
let (device, queue) = device(&adapter).unwrap();
|
||||
let _renderer = Renderer::new(&device, &queue, wgpu::TextureFormat::Rgba8Unorm);
|
||||
assert!(!crate::gpu_trace::GpuTracer::supported(&device));
|
||||
let err = crate::gpu_trace::GpuTracer::new(&device).err().expect("the tracer needs compute shaders");
|
||||
assert!(err.contains("compute shaders"), "{err}");
|
||||
let flags = adapter.get_downlevel_capabilities().flags;
|
||||
let reason = crate::gpu_bake::unsupported_adapter(wgpu::DeviceType::IntegratedGpu, flags, &adapter.limits());
|
||||
assert!(reason.is_some_and(|r| r.contains("compute")), "{reason:?}");
|
||||
}
|
||||
}
|
||||
@@ -398,6 +398,20 @@ pub fn aux_size(size: (u32, u32)) -> u32 {
|
||||
|
||||
impl Tex {
|
||||
fn new(device: &wgpu::Device, label: &str, w: u32, h: u32, format: wgpu::TextureFormat, mips: u32) -> Tex {
|
||||
// COPY_SRC: the GPU path tracer copies the display textures into its arrays.
|
||||
let usage =
|
||||
wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST | wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::COPY_SRC;
|
||||
Self::with_usage(device, label, w, h, format, mips, usage)
|
||||
}
|
||||
|
||||
/// The environment map, uploaded from the CPU and sampled, never drawn into. As a render target
|
||||
/// it would need float color buffers, which GLES and WebGL2 may lack (see [`hdr_renderable`]).
|
||||
fn environment(device: &wgpu::Device, w: u32, h: u32) -> Tex {
|
||||
let usage = wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST;
|
||||
Self::with_usage(device, "tc_env", w, h, wgpu::TextureFormat::Rgba16Float, ENV_LEVELS, usage)
|
||||
}
|
||||
|
||||
fn with_usage(device: &wgpu::Device, label: &str, w: u32, h: u32, format: wgpu::TextureFormat, mips: u32, usage: wgpu::TextureUsages) -> Tex {
|
||||
let texture = device.create_texture(&wgpu::TextureDescriptor {
|
||||
label: Some(label),
|
||||
size: wgpu::Extent3d { width: w, height: h, depth_or_array_layers: 1 },
|
||||
@@ -405,11 +419,7 @@ impl Tex {
|
||||
sample_count: 1,
|
||||
dimension: wgpu::TextureDimension::D2,
|
||||
format,
|
||||
// COPY_SRC: the GPU path tracer copies the display textures into its arrays.
|
||||
usage: wgpu::TextureUsages::TEXTURE_BINDING
|
||||
| wgpu::TextureUsages::COPY_DST
|
||||
| wgpu::TextureUsages::RENDER_ATTACHMENT
|
||||
| wgpu::TextureUsages::COPY_SRC,
|
||||
usage,
|
||||
view_formats: &[],
|
||||
});
|
||||
let view = texture.create_view(&wgpu::TextureViewDescriptor::default());
|
||||
@@ -1245,7 +1255,7 @@ impl Renderer {
|
||||
layout: &refraction_bind_group_layout,
|
||||
entries: &[wgpu::BindGroupEntry { binding: 0, resource: wgpu::BindingResource::TextureView(&black) }],
|
||||
});
|
||||
let env = Tex::new(device, "tc_env", PLACEHOLDER_ENV_SIZE[0], PLACEHOLDER_ENV_SIZE[1], wgpu::TextureFormat::Rgba16Float, ENV_LEVELS);
|
||||
let env = Tex::environment(device, PLACEHOLDER_ENV_SIZE[0], PLACEHOLDER_ENV_SIZE[1]);
|
||||
|
||||
let mut renderer = Renderer {
|
||||
target_format,
|
||||
@@ -1336,7 +1346,7 @@ impl Renderer {
|
||||
|
||||
let levels = ibl::prefilter(&img, ENV_LEVELS);
|
||||
if self.env.texture.width() != img.width || self.env.texture.height() != img.height {
|
||||
self.env = Tex::new(device, "tc_env", img.width, img.height, wgpu::TextureFormat::Rgba16Float, ENV_LEVELS);
|
||||
self.env = Tex::environment(device, img.width, img.height);
|
||||
}
|
||||
for (l, lv) in levels.iter().enumerate() {
|
||||
let bytes: Vec<u8> = lv.data.iter().flat_map(|c| [c[0], c[1], c[2], 1.0]).flat_map(|v| half::f16::from_f32(v).to_le_bytes()).collect();
|
||||
@@ -2640,6 +2650,23 @@ mod tests {
|
||||
h.renderer.display_textures()[0][0].width()
|
||||
}
|
||||
|
||||
/// The environment map is only uploaded and sampled. A render target usage would ask for float
|
||||
/// color buffers, which GLES and WebGL2 adapters may not have.
|
||||
#[test]
|
||||
fn the_environment_map_is_not_a_render_target() {
|
||||
let Ok(mut h) = Headless::new() else {
|
||||
eprintln!("skipping: no GPU adapter");
|
||||
return;
|
||||
};
|
||||
let usage = wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST;
|
||||
assert_eq!(h.renderer.env.texture.usage(), usage, "the built-in environment");
|
||||
// An imported image of another size makes a new texture.
|
||||
let image = ImageRes::new(256, 128, vec![[0.5, 0.5, 0.5, 1.0]; 256 * 128], false);
|
||||
h.renderer.set_environment(&h.device, &h.queue, "resource:grey", Some(&image));
|
||||
assert_eq!(h.renderer.env.texture.width(), 256);
|
||||
assert_eq!(h.renderer.env.texture.usage(), usage, "an imported environment");
|
||||
}
|
||||
|
||||
fn prepare(h: &mut Headless) {
|
||||
let mut enc = h.device.create_command_encoder(&Default::default());
|
||||
h.renderer.resolve_pending(&h.device);
|
||||
|
||||
@@ -860,7 +860,10 @@ steps or an object with an optional input and output (paths relative to the curr
|
||||
}
|
||||
```
|
||||
|
||||
The CLI is a console program and never opens a window; `render` needs a GPU or software adapter.
|
||||
The CLI is a console program and never opens a window; `render` needs a GPU or software adapter, unless it path
|
||||
traces (`--samples`). Like the desktop app, it takes the high-performance GPU; `WGPU_ADAPTER_NAME`
|
||||
(part of the adapter's name or backend) or `WGPU_POWER_PREF` (`high`, `low` or `none`) picks another.
|
||||
`WGPU_BACKEND` narrows the list first, so a name on a backend it leaves out matches nothing.
|
||||
|
||||
`texturecraft-cli` follows [RFC-0018](https://github.com/storytold/craft-contrib/blob/main/rfcs/0018-cli-conventions.md)
|
||||
(command-line conventions); `texturecraft-cli --help` and `<subcommand> --help` are the reference for every flag.
|
||||
|
||||
Reference in new issue
Block a user