Skip to content

Commit

Permalink
render: Update wgpu to 23.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
torokati44 committed Nov 11, 2024
1 parent 6d15138 commit 497613a
Show file tree
Hide file tree
Showing 17 changed files with 148 additions and 210 deletions.
268 changes: 110 additions & 158 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ version = "0.1.0"
[workspace.dependencies]
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
naga = { version = "22.1.0", features = ["wgsl-out"] }
wgpu = "22.1.0"
egui = "0.29.1"
naga = { version = "23.0.0", features = ["wgsl-out"] }
wgpu = "23.0.0"
egui = { git = "https://github.com/emilk/egui.git", branch = "master" }
clap = { version = "4.5.20", features = ["derive"] }
cpal = "0.15.3"
anyhow = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ hashbrown = { version = "0.14.5", features = ["raw"] }
scopeguard = "1.2.0"
fluent-templates = "0.11.0"
egui = { workspace = true, optional = true }
egui_extras = { version = "0.29.1", default-features = false, optional = true }
egui_extras = { git = "https://github.com/emilk/egui.git", branch = "master", default-features = false, optional = true }
png = { version = "0.17.14", optional = true }
flv-rs = { path = "../flv" }
async-channel = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ unknown-git = "deny"
# github.com organizations to allow git sources for
github = [
"ruffle-rs",
# TODO: Remove once a release with https://github.com/emilk/egui/pull/5330
# (the wgpu bump to 23.0.0) in it is out.
"emilk",
]

[advisories]
Expand Down
6 changes: 3 additions & 3 deletions desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ workspace = true
clap = { workspace = true }
cpal = { workspace = true }
egui = { workspace = true }
egui_extras = { version = "0.29.1", default-features = false, features = ["image"] }
egui-wgpu = { version = "0.29.1", features = ["winit"] }
egui_extras = { git = "https://github.com/emilk/egui.git", branch = "master", default-features = false, features = ["image"] }
egui-wgpu = { git = "https://github.com/emilk/egui.git", branch = "master", features = ["winit"] }
image = { workspace = true, features = ["png"] }
egui-winit = "0.29.1"
egui-winit = { git = "https://github.com/emilk/egui.git", branch = "master" }
fontdb = "0.23"
ruffle_core = { path = "../core", features = ["audio", "clap", "mp3", "nellymoser", "default_compatibility_rules", "egui"] }
ruffle_render = { path = "../render", features = ["clap"] }
Expand Down
2 changes: 1 addition & 1 deletion desktop/src/gui/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ fn load_system_fonts(
tracing::info!("loaded cjk fallback font \"{}\"", name);

let mut fd = egui::FontDefinitions::default();
fd.font_data.insert(name.clone(), fontdata);
fd.font_data.insert(name.clone(), fontdata.into());
fd.families
.get_mut(&egui::FontFamily::Proportional)
.expect("font family not found")
Expand Down
6 changes: 3 additions & 3 deletions desktop/src/gui/movie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl MovieViewRenderer {
label: None,
layout: Some(&pipeline_layout),
vertex: wgpu::VertexState {
entry_point: "vs_main",
entry_point: Some("vs_main"),
module: &module,
buffers: &[wgpu::VertexBufferLayout {
array_stride: 4 * 4,
Expand Down Expand Up @@ -107,11 +107,11 @@ impl MovieViewRenderer {

fragment: Some(wgpu::FragmentState {
module: &module,
entry_point: if surface_format.is_srgb() {
entry_point: Some(if surface_format.is_srgb() {
"fs_main_srgb_framebuffer"
} else {
"fs_main_linear_framebuffer"
},
}),
targets: &[Some(wgpu::ColorTargetState {
format: surface_format,
blend: Some(wgpu::BlendState::REPLACE),
Expand Down
25 changes: 4 additions & 21 deletions desktop/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,27 +254,10 @@ pub fn plot_stats_in_tracy(instance: &wgpu::Instance) {
.generate_report()
.expect("reports should be available on desktop");

#[allow(unused_mut)]
let mut backend = None;
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
{
backend = backend.or(report.vulkan).or(report.gl);
}
#[cfg(windows)]
{
backend = backend.or(report.dx12);
}
#[cfg(any(target_os = "macos", target_os = "ios"))]
{
backend = backend.or(report.metal);
}

if let Some(stats) = backend {
tracy.plot(BIND_GROUPS, stats.bind_groups.num_allocated as f64);
tracy.plot(BUFFERS, stats.buffers.num_allocated as f64);
tracy.plot(TEXTURES, stats.textures.num_allocated as f64);
tracy.plot(TEXTURE_VIEWS, stats.texture_views.num_allocated as f64);
}
tracy.plot(BIND_GROUPS, report.hub.bind_groups.num_allocated as f64);
tracy.plot(BUFFERS, report.hub.buffers.num_allocated as f64);
tracy.plot(TEXTURES, report.hub.textures.num_allocated as f64);
tracy.plot(TEXTURE_VIEWS, report.hub.texture_views.num_allocated as f64);

tracy.frame_mark();
}
Expand Down
4 changes: 2 additions & 2 deletions render/wgpu/src/context3d/current_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,13 @@ impl CurrentPipeline {
layout: Some(&pipeline_layout),
vertex: VertexState {
module: &compiled_shaders.vertex_module,
entry_point: naga_agal::SHADER_ENTRY_POINT,
entry_point: Some(naga_agal::SHADER_ENTRY_POINT),
buffers: &wgpu_vertex_buffers,
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &compiled_shaders.fragment_module,
entry_point: naga_agal::SHADER_ENTRY_POINT,
entry_point: Some(naga_agal::SHADER_ENTRY_POINT),
targets: &[Some(ColorTargetState {
format: self.target_format,
blend: Some(wgpu::BlendState {
Expand Down
8 changes: 4 additions & 4 deletions render/wgpu/src/descriptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ impl Descriptors {
layout: Some(copy_texture_pipeline_layout),
vertex: wgpu::VertexState {
module: &self.shaders.copy_srgb_shader,
entry_point: "main_vertex",
entry_point: Some("main_vertex"),
buffers: &VERTEX_BUFFERS_DESCRIPTION_POS,
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &self.shaders.copy_srgb_shader,
entry_point: "main_fragment",
entry_point: Some("main_fragment"),
targets: &[Some(wgpu::ColorTargetState {
format,
// All of our blending has been done by now, so we want
Expand Down Expand Up @@ -168,13 +168,13 @@ impl Descriptors {
layout: Some(copy_texture_pipeline_layout),
vertex: wgpu::VertexState {
module: &self.shaders.copy_shader,
entry_point: "main_vertex",
entry_point: Some("main_vertex"),
buffers: &VERTEX_BUFFERS_DESCRIPTION_POS,
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &self.shaders.copy_shader,
entry_point: "main_fragment",
entry_point: Some("main_fragment"),
targets: &[Some(wgpu::ColorTargetState {
format,
// All of our blending has been done by now, so we want
Expand Down
4 changes: 2 additions & 2 deletions render/wgpu/src/filters/bevel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl BevelFilter {
layout: Some(&self.pipeline_layout),
vertex: wgpu::VertexState {
module: &descriptors.shaders.bevel_filter,
entry_point: "main_vertex",
entry_point: Some("main_vertex"),
buffers: &VERTEX_BUFFERS_DESCRIPTION_FILTERS_WITH_DOUBLE_BLUR,
compilation_options: Default::default(),
},
Expand All @@ -141,7 +141,7 @@ impl BevelFilter {
},
fragment: Some(wgpu::FragmentState {
module: &descriptors.shaders.bevel_filter,
entry_point: "main_fragment",
entry_point: Some("main_fragment"),
targets: &[Some(wgpu::TextureFormat::Rgba8Unorm.into())],
compilation_options: Default::default(),
}),
Expand Down
4 changes: 2 additions & 2 deletions render/wgpu/src/filters/blur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl BlurFilter {
layout: Some(&self.pipeline_layout),
vertex: wgpu::VertexState {
module: &descriptors.shaders.blur_filter,
entry_point: "main_vertex",
entry_point: Some("main_vertex"),
buffers: &VERTEX_BUFFERS_DESCRIPTION_FILTERS,
compilation_options: Default::default(),
},
Expand All @@ -136,7 +136,7 @@ impl BlurFilter {
},
fragment: Some(wgpu::FragmentState {
module: &descriptors.shaders.blur_filter,
entry_point: "main_fragment",
entry_point: Some("main_fragment"),
targets: &[Some(wgpu::TextureFormat::Rgba8Unorm.into())],
compilation_options: Default::default(),
}),
Expand Down
4 changes: 2 additions & 2 deletions render/wgpu/src/filters/color_matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl ColorMatrixFilter {
layout: Some(&self.pipeline_layout),
vertex: wgpu::VertexState {
module: &descriptors.shaders.color_matrix_filter,
entry_point: "main_vertex",
entry_point: Some("main_vertex"),
buffers: &VERTEX_BUFFERS_DESCRIPTION_FILTERS,
compilation_options: Default::default(),
},
Expand All @@ -117,7 +117,7 @@ impl ColorMatrixFilter {
},
fragment: Some(wgpu::FragmentState {
module: &descriptors.shaders.color_matrix_filter,
entry_point: "main_fragment",
entry_point: Some("main_fragment"),
targets: &[Some(wgpu::TextureFormat::Rgba8Unorm.into())],
compilation_options: Default::default(),
}),
Expand Down
4 changes: 2 additions & 2 deletions render/wgpu/src/filters/displacement_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl DisplacementMapFilter {
layout: Some(&self.pipeline_layout),
vertex: wgpu::VertexState {
module: &descriptors.shaders.displacement_map_filter,
entry_point: "main_vertex",
entry_point: Some("main_vertex"),
buffers: &VERTEX_BUFFERS_DESCRIPTION_FILTERS,
compilation_options: Default::default(),
},
Expand All @@ -154,7 +154,7 @@ impl DisplacementMapFilter {
},
fragment: Some(wgpu::FragmentState {
module: &descriptors.shaders.displacement_map_filter,
entry_point: "main_fragment",
entry_point: Some("main_fragment"),
targets: &[Some(wgpu::TextureFormat::Rgba8Unorm.into())],
compilation_options: Default::default(),
}),
Expand Down
4 changes: 2 additions & 2 deletions render/wgpu/src/filters/glow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl GlowFilter {
layout: Some(&self.pipeline_layout),
vertex: wgpu::VertexState {
module: &descriptors.shaders.glow_filter,
entry_point: "main_vertex",
entry_point: Some("main_vertex"),
buffers: &VERTEX_BUFFERS_DESCRIPTION_FILTERS_WITH_BLUR,
compilation_options: Default::default(),
},
Expand All @@ -140,7 +140,7 @@ impl GlowFilter {
},
fragment: Some(wgpu::FragmentState {
module: &descriptors.shaders.glow_filter,
entry_point: "main_fragment",
entry_point: Some("main_fragment"),
targets: &[Some(wgpu::TextureFormat::Rgba8Unorm.into())],
compilation_options: Default::default(),
}),
Expand Down
4 changes: 2 additions & 2 deletions render/wgpu/src/pipelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,13 @@ fn create_pipeline_descriptor<'a>(
layout: Some(pipeline_layout),
vertex: wgpu::VertexState {
module: vertex_shader,
entry_point: "main_vertex",
entry_point: Some("main_vertex"),
buffers: vertex_buffer_layout,
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: fragment_shader,
entry_point: "main_fragment",
entry_point: Some("main_fragment"),
targets: color_target_state,
compilation_options: wgpu::PipelineCompilationOptions {
constants: fragment_constants,
Expand Down
4 changes: 2 additions & 2 deletions render/wgpu/src/pixel_bender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ impl PixelBenderWgpuShader {
layout: Some(&self.pipeline_layout),
vertex: VertexState {
module: &self.vertex_shader,
entry_point: naga_pixelbender::VERTEX_SHADER_ENTRYPOINT,
entry_point: Some(naga_pixelbender::VERTEX_SHADER_ENTRYPOINT),
buffers: &VERTEX_BUFFERS_DESCRIPTION_FILTERS,
compilation_options: Default::default(),
},
fragment: Some(wgpu::FragmentState {
module: &self.fragment_shader,
entry_point: naga_pixelbender::FRAGMENT_SHADER_ENTRYPOINT,
entry_point: Some(naga_pixelbender::FRAGMENT_SHADER_ENTRYPOINT),
targets: &[Some(ColorTargetState {
format,
// FIXME - what should this be?
Expand Down

0 comments on commit 497613a

Please sign in to comment.