A few minor lints and docs (#1436)

* A few minor lints and docs

* Added required packages to compile on Debian-style linux
* Inlined some format args, and removed some `&` in args (they cause about 6% slowdown that compiler cannot inline)
* a few spelling mistakes

* fix fmt
This commit is contained in:
Yuri Astrakhan 2023-10-19 02:33:10 -04:00 committed by GitHub
parent 67edac4aca
commit 3d4e3a74e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 140 additions and 158 deletions

View file

@ -206,11 +206,11 @@ impl gpu_executor::GpuExecutor for WgpuExecutor {
}
fn create_output_buffer(&self, len: usize, ty: Type, cpu_readable: bool) -> Result<WgpuShaderInput> {
log::debug!("Creating output buffer with len: {}", len);
log::debug!("Creating output buffer with len: {len}");
let create_buffer = |usage| {
Ok::<_, anyhow::Error>(self.context.device.create_buffer(&BufferDescriptor {
label: None,
size: len as u64 * ty.size().ok_or_else(|| anyhow::anyhow!("Cannot create buffer of type {:?}", ty))? as u64,
size: len as u64 * ty.size().ok_or_else(|| anyhow::anyhow!("Cannot create buffer of type {ty:?}"))? as u64,
usage,
mapped_at_creation: false,
}))
@ -290,7 +290,7 @@ impl gpu_executor::GpuExecutor for WgpuExecutor {
let surface = &canvas.as_ref().surface;
let surface_caps = surface.get_capabilities(&self.context.adapter);
println!("{:?}", surface_caps);
println!("{surface_caps:?}");
if surface_caps.formats.is_empty() {
log::warn!("No surface formats available");
//return Ok(());
@ -455,7 +455,7 @@ impl gpu_executor::GpuExecutor for WgpuExecutor {
let size = window.surface.inner_size();
let surface_caps = surface.get_capabilities(&self.context.adapter);
println!("{:?}", surface_caps);
println!("{surface_caps:?}");
let surface_format = wgpu::TextureFormat::Bgra8Unorm;
let config = wgpu::SurfaceConfiguration {
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,