Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deps: Update wgpu from 0.19.2 to 22.1.0. #501

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 252 additions & 34 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ arbitrary = { version = "1.3.2", features = ["derive"] }
arrayvec = { version = "0.7.4", default-features = false }
async_fn_traits = "0.1.1"
base64 = { version = "0.22.1", default-features = false }
bitflags = { version = "2.4", default-features = false }
bitflags = { version = "2.6.0", default-features = false }
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
# Note that this excludes the "derive" feature but some crates need it.
bytemuck = { version = "1.13.1", default-features = false }
Expand Down Expand Up @@ -129,17 +129,17 @@ snapbox = "0.6.10" # keep in sync with `trycmd`
strum = { version = "0.26.1", default-features = false, features = ["derive"] }
sync_wrapper = { version = "1.0.0", default-features = false }
tempfile = "3.3.0"
thiserror = "1.0.56"
thiserror = "1.0.62"
time = { version = "0.3.36", default-features = false }
# Tokio is used for async test-running and for certain binaries.
# The library crates do not require Tokio.
tokio = { version = "1.28.0", default-features = false }
trycmd = "0.15.4" # keep in sync with `snapbox`
unicode-segmentation = { version = "1.10.1", default-features = false }
unicode-width = { version = "0.1.9", default-features = false }
wasm-bindgen-futures = "0.4.40"
wasm-bindgen-futures = "0.4.42"
web-time = "1.0.0"
wgpu = { version = "0.19.3", default-features = false, features = ["wgsl"] }
wgpu = { version = "22.1.0", default-features = false, features = ["wgsl"] }
yield-progress = { version = "0.1.6", default-features = false }

# Note: Lints are also necessarily redefined in the workspaces other than this one.
Expand Down
2 changes: 1 addition & 1 deletion all-is-cubes-gpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ resource = "0.5.0"
send_wrapper = { workspace = true }
wasm-bindgen-futures = { workspace = true }
# For initializing tests on web. (This is not a dev-dependency because some of said tests are not in this package.)
web-sys = { version = "0.3.67", features = ["OffscreenCanvas"] }
web-sys = { version = "0.3.69", features = ["OffscreenCanvas"] }
web-time = { workspace = true }
wgpu = { workspace = true, optional = true }

Expand Down
3 changes: 2 additions & 1 deletion all-is-cubes-gpu/src/in_wgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,13 @@ impl<I: time::Instant> EverythingRenderer<I> {
/// A device descriptor suitable for the expectations of [`EverythingRenderer`].
pub fn device_descriptor(available_limits: wgpu::Limits) -> wgpu::DeviceDescriptor<'static> {
wgpu::DeviceDescriptor {
label: None,
required_features: wgpu::Features::empty(),
required_limits: wgpu::Limits {
max_inter_stage_shader_components: 32, // number used by blocks-and-lines shader
..wgpu::Limits::downlevel_webgl2_defaults().using_resolution(available_limits)
},
label: None,
memory_hints: wgpu::MemoryHints::default(), // TODO: consider setting
}
}

Expand Down
6 changes: 6 additions & 0 deletions all-is-cubes-gpu/src/in_wgpu/bloom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ impl BloomPipelines {
vertex: wgpu::VertexState {
module: shaders.bloom.get(),
entry_point: "bloom_vertex",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: shaders.bloom.get(),
entry_point: "bloom_downsample_fragment",
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: linear_scene_texture_format,
blend: None,
Expand All @@ -79,18 +81,21 @@ impl BloomPipelines {
// default = off. No need for multisampling since we are not drawing triangles here.
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache: None,
});
let upsample_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
label: Some("BloomPipelines::upsample_pipeline"),
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
module: shaders.bloom.get(),
entry_point: "bloom_vertex",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: shaders.bloom.get(),
entry_point: "bloom_upsample_fragment",
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: linear_scene_texture_format,
blend: None,
Expand All @@ -102,6 +107,7 @@ impl BloomPipelines {
// default = off. No need for multisampling since we are not drawing triangles here.
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache: None,
});

#[cfg_attr(target_family = "wasm", allow(clippy::arc_with_non_send_sync))]
Expand Down
15 changes: 9 additions & 6 deletions all-is-cubes-gpu/src/in_wgpu/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ pub async fn create_instance_for_test_or_exit() -> wgpu::Instance {
});

// Report adapters that we *could* pick
_ = writeln!(
stderr,
"Available adapters (backend filter = {backends:?}):"
);
for adapter in instance.enumerate_adapters(wgpu::Backends::all()) {
_ = writeln!(stderr, " {}", shortened_adapter_info(&adapter.get_info()));
#[cfg(not(target_family = "wasm"))]
{
_ = writeln!(
stderr,
"Available adapters (backend filter = {backends:?}):"
);
for adapter in instance.enumerate_adapters(wgpu::Backends::all()) {
_ = writeln!(stderr, " {}", shortened_adapter_info(&adapter.get_info()));
}
}

let adapter = try_create_adapter_for_test(&instance, |m| _ = writeln!(stderr, "{m}")).await;
Expand Down
21 changes: 21 additions & 0 deletions all-is-cubes-gpu/src/in_wgpu/pipelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ impl Pipelines {
// place to ensure that no skew occurs.
let current_graphics_options = graphics_options.get();

// Not using pipeline cache (but maybe we should set up hooks for that in the future).
let cache: Option<&wgpu::PipelineCache> = None;

let block_texture_entry = |binding| wgpu::BindGroupLayoutEntry {
binding,
visibility: wgpu::ShaderStages::FRAGMENT,
Expand Down Expand Up @@ -184,11 +187,13 @@ impl Pipelines {
vertex: wgpu::VertexState {
module: shaders.blocks_and_lines.get(),
entry_point: "block_vertex_main",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: vertex_buffers,
},
fragment: Some(wgpu::FragmentState {
module: shaders.blocks_and_lines.get(),
entry_point: "block_fragment_opaque",
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: fb.linear_scene_texture_format(),
blend: None,
Expand All @@ -205,6 +210,7 @@ impl Pipelines {
}),
multisample,
multiview: None,
cache,
});

let transparent_render_pipeline =
Expand All @@ -214,6 +220,7 @@ impl Pipelines {
vertex: wgpu::VertexState {
module: shaders.blocks_and_lines.get(),
entry_point: "block_vertex_main",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: vertex_buffers,
},
fragment: Some(wgpu::FragmentState {
Expand All @@ -225,6 +232,7 @@ impl Pipelines {
}
ref t => panic!("unimplemented transparency option {t:?}"),
},
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: fb.linear_scene_texture_format(),
// Note that this blending configuration is for premultiplied alpha.
Expand Down Expand Up @@ -255,6 +263,7 @@ impl Pipelines {
}),
multisample,
multiview: None,
cache,
});

let skybox_render_pipeline =
Expand All @@ -266,11 +275,13 @@ impl Pipelines {
vertex: wgpu::VertexState {
module: shaders.blocks_and_lines.get(),
entry_point: "skybox_vertex",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: shaders.blocks_and_lines.get(),
entry_point: "skybox_fragment",
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: fb.linear_scene_texture_format(),
blend: None,
Expand All @@ -288,6 +299,7 @@ impl Pipelines {
}),
multisample,
multiview: None,
cache,
});

let lines_render_pipeline_layout =
Expand All @@ -304,11 +316,13 @@ impl Pipelines {
vertex: wgpu::VertexState {
module: shaders.blocks_and_lines.get(),
entry_point: "lines_vertex",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[WgpuLinesVertex::desc()],
},
fragment: Some(wgpu::FragmentState {
module: shaders.blocks_and_lines.get(),
entry_point: "lines_fragment",
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: fb.linear_scene_texture_format(),
blend: None,
Expand All @@ -328,6 +342,7 @@ impl Pipelines {
}),
multisample,
multiview: None,
cache,
});

let frame_copy_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
Expand Down Expand Up @@ -364,11 +379,13 @@ impl Pipelines {
vertex: wgpu::VertexState {
module: shaders.frame_copy.get(),
entry_point: "frame_copy_vertex",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: shaders.frame_copy.get(),
entry_point: "frame_copy_fragment",
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::Rgba16Float,
blend: None,
Expand All @@ -382,6 +399,7 @@ impl Pipelines {
depth_stencil: None,
multisample,
multiview: None,
cache,
});

#[cfg(feature = "rerun")]
Expand Down Expand Up @@ -442,11 +460,13 @@ impl Pipelines {
vertex: wgpu::VertexState {
module: shaders.rerun_copy.get(),
entry_point: "rerun_frame_copy_vertex",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: shaders.rerun_copy.get(),
entry_point: "rerun_frame_copy_fragment",
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[
Some(wgpu::ColorTargetState {
format: wgpu::TextureFormat::Rgba8UnormSrgb,
Expand All @@ -468,6 +488,7 @@ impl Pipelines {
// we're writing *to* a non-multisampled texture
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache,
});

let linear_sampler = device.create_sampler(&wgpu::SamplerDescriptor {
Expand Down
3 changes: 3 additions & 0 deletions all-is-cubes-gpu/src/in_wgpu/postprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ pub(crate) fn create_postprocess_pipeline(
vertex: wgpu::VertexState {
module: shaders.postprocess.get(),
entry_point: "postprocess_vertex",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[],
},
fragment: Some(wgpu::FragmentState {
module: shaders.postprocess.get(),
entry_point: "postprocess_fragment",
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: super::surface_view_format(surface_format),
blend: Some(wgpu::BlendState::PREMULTIPLIED_ALPHA_BLENDING),
Expand All @@ -115,6 +117,7 @@ pub(crate) fn create_postprocess_pipeline(
// default = off. No need for multisampling since we are not drawing triangles here.
multisample: wgpu::MultisampleState::default(),
multiview: None,
cache: None,
})
}

Expand Down
3 changes: 3 additions & 0 deletions all-is-cubes-gpu/src/in_wgpu/shader_testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ where
vertex: wgpu::VertexState {
module: &shader,
entry_point: "block_vertex_main",
compilation_options: wgpu::PipelineCompilationOptions::default(),
buffers: &[WgpuBlockVertex::desc(), WgpuInstanceData::desc()],
},
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "test_entry_point",
compilation_options: wgpu::PipelineCompilationOptions::default(),
targets: &[Some(wgpu::ColorTargetState {
format: fbt.linear_scene_texture_format(),
blend: None,
Expand All @@ -122,6 +124,7 @@ where
}),
multisample: wgpu::MultisampleState::default(), // default = off
multiview: None,
cache: None,
});

// Placeholder space data for the bind group
Expand Down
Loading