Skip to content
Open
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
291 changes: 159 additions & 132 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 @@ -51,9 +51,9 @@ version = "0.1.0"
[workspace.dependencies]
tracing = "0.1.43"
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
naga = { version = "27.0.3", features = ["wgsl-out"] }
wgpu = "27.0.1"
egui = "0.33.3"
naga = { version = "28.0.0", features = ["wgsl-out"] }
wgpu = "28.0.0"
egui = { git = "https://github.com/emilk/egui.git", rev = "b077cf910297884a4f1b431e8da99806ae925168" }
clap = { version = "4.6.0", features = ["derive"] }
cpal = "0.16.0"
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 @@ -56,7 +56,7 @@ hashbrown = { workspace = true }
scopeguard = "1.2.0"
fluent-templates = { workspace = true }
egui = { workspace = true, optional = true }
egui_extras = { version = "0.33.3", default-features = false, optional = true }
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "b077cf910297884a4f1b431e8da99806ae925168", default-features = false, optional = true }
png = { version = "0.18.1", optional = true }
flv-rs = { path = "../flv" }
async-channel = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ unknown-git = "deny"
github = [
"ruffle-rs",
"kyren", # for `gc-arena`
"emilk", # for `egui`
]

[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.33.3", default-features = false, features = ["image"] }
egui-wgpu = { version = "0.33.3", features = ["winit"] }
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "b077cf910297884a4f1b431e8da99806ae925168", default-features = false, features = ["image"] }
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "b077cf910297884a4f1b431e8da99806ae925168", features = ["winit"] }
image = { workspace = true, features = ["png"] }
egui-winit = "0.33.3"
egui-winit = { git = "https://github.com/emilk/egui.git", rev = "b077cf910297884a4f1b431e8da99806ae925168" }
fontdb = "0.23"
ruffle_core = { path = "../core", features = ["audio", "clap", "mp3", "aac", "nellymoser", "default_compatibility_rules", "egui"] }
ruffle_render = { path = "../render", features = ["clap"] }
Expand Down
3 changes: 2 additions & 1 deletion desktop/src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl RuffleGui {
fn update(
&mut self,
egui_ctx: &egui::Context,
egui_ui: &mut egui::Ui,
show_menu: bool,
mut player: Option<&mut Player>,
menu_height_offset: f64,
Expand All @@ -94,7 +95,7 @@ impl RuffleGui {
.consume_shortcuts(egui_ctx, &mut self.dialogs, player.as_deref_mut());
if show_menu {
self.menu_bar
.show(&locale, egui_ctx, &mut self.dialogs, player.as_deref_mut());
.show(&locale, egui_ui, &mut self.dialogs, player.as_deref_mut());
}

self.dialogs.show(&locale, egui_ctx, player.as_deref_mut());
Expand Down
9 changes: 5 additions & 4 deletions desktop/src/gui/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,10 @@ impl GuiController {

let raw_input = self.egui_winit.take_egui_input(&self.window);
let show_menu = self.window.fullscreen().is_none() && !self.no_gui;
let mut full_output = self.egui_winit.egui_ctx().run(raw_input, |context| {
let mut full_output = self.egui_winit.egui_ctx().run_ui(raw_input, |ui| {
self.gui.update(
context,
self.egui_winit.egui_ctx(),
ui,
show_menu,
player.as_deref_mut(),
if show_menu {
Expand All @@ -357,7 +358,7 @@ impl GuiController {
.repaint_delay;

// If we're not in a UI, tell egui which cursor we prefer to use instead
if !self.egui_winit.egui_ctx().wants_pointer_input()
if !self.egui_winit.egui_ctx().egui_wants_pointer_input()
&& let Some(player) = player.as_deref()
{
full_output.platform_output.cursor_icon =
Expand Down Expand Up @@ -542,7 +543,7 @@ fn select_wgpu_backend(

fn try_wgpu_backend(backend: wgpu::Backends) -> Option<wgpu::Instance> {
let instance = create_wgpu_instance(backend, wgpu::BackendOptions::default());
if instance.enumerate_adapters(backend).is_empty() {
if futures::executor::block_on(instance.enumerate_adapters(backend)).is_empty() {
None
} else {
Some(instance)
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/gui/dialogs/bookmarks_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ impl BookmarksDialog {
.default_width(600.0)
.default_height(400.0)
.show(egui_ctx, |ui| {
egui::TopBottomPanel::top("bookmark-dialog-top-panel")
egui::Panel::top("bookmark-dialog-top-panel")
.resizable(true)
.min_height(100.0)
.min_size(100.0)
.show_inside(ui, |ui| {
if self.preferences.have_bookmarks() {
should_close = self.show_bookmark_table(locale, ui);
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/gui/dialogs/preferences_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ impl PreferencesDialog {
if ui.small_button(text(locale, "show-license")).clicked() {
self.openh264_license_visible = true;
};
let available_size = egui_ctx.available_rect().size();
let available_size = egui_ctx.content_rect().size();
egui::Window::new(text(locale, "openh264-license"))
.collapsible(false)
.resizable(false)
Expand Down Expand Up @@ -701,7 +701,7 @@ fn ime_enabled_name(locale: &LanguageIdentifier, ime_enabled: Option<bool>) -> C
}

fn backend_availability(instance: &wgpu::Instance, backend: wgpu::Backends) -> wgpu::Backends {
if instance.enumerate_adapters(backend).is_empty() {
if futures::executor::block_on(instance.enumerate_adapters(backend)).is_empty() {
wgpu::Backends::empty()
} else {
backend
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/gui/dialogs/select_path_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ impl SelectPathDialog {
pub fn render_window_contents(&mut self, locale: &LanguageIdentifier, ui: &mut Ui) -> bool {
let mut should_close = false;

egui::TopBottomPanel::top("top").show_inside(ui, |ui| {
egui::Panel::top("top").show_inside(ui, |ui| {
if let Some(ref message) = self.config.message {
ui.label(message.localize(locale));
}
});

egui::TopBottomPanel::bottom("bottom").show_inside(ui, |ui| {
egui::Panel::bottom("bottom").show_inside(ui, |ui| {
ui.horizontal(|ui| {
if self.config.extension.is_some() {
ui.checkbox(
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/gui/menu_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ impl MenuBar {
pub fn show(
&mut self,
locale: &LanguageIdentifier,
egui_ctx: &egui::Context,
egui_ui: &mut egui::Ui,
dialogs: &mut Dialogs,
mut player: Option<&mut Player>,
) {
egui::TopBottomPanel::top("menu_bar").show(egui_ctx, |ui| {
egui::Panel::top("menu_bar").show_inside(egui_ui, |ui| {
egui::MenuBar::new().ui(ui, |ui| {
self.file_menu(locale, ui, dialogs, player.is_some());
self.view_menu(locale, ui, &mut player);
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/gui/movie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl MovieViewRenderer {
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: None,
bind_group_layouts: &[&bind_group_layout],
push_constant_ranges: &[],
immediate_size: 0,
});
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
label: None,
Expand Down Expand Up @@ -119,7 +119,7 @@ impl MovieViewRenderer {
})],
compilation_options: Default::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
let vertices = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
Expand Down
5 changes: 5 additions & 0 deletions render/naga-agal/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ impl<'a> NagaBuilder<'a> {
interpolation: None,
sampling: None,
blend_src: None,
per_primitive: false,
}),
offset: 0,
}],
Expand All @@ -644,6 +645,7 @@ impl<'a> NagaBuilder<'a> {
interpolation: None,
sampling: None,
blend_src: None,
per_primitive: false,
}),
});
}
Expand Down Expand Up @@ -757,6 +759,7 @@ impl<'a> NagaBuilder<'a> {
interpolation: None,
sampling: None,
blend_src: None,
per_primitive: false,
}),
});

Expand Down Expand Up @@ -1789,6 +1792,8 @@ impl<'a> NagaBuilder<'a> {
workgroup_size: [0; 3],
workgroup_size_overrides: None,
function: self.func,
mesh_info: None,
task_payload: None,
};

self.module.entry_points.push(entry_point);
Expand Down
2 changes: 2 additions & 0 deletions render/naga-agal/src/varying.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl NagaBuilder<'_> {
interpolation: Some(naga::Interpolation::Perspective),
sampling: None,
blend_src: None,
per_primitive: false,
}),
offset: 0,
});
Expand All @@ -86,6 +87,7 @@ impl NagaBuilder<'_> {
interpolation: Some(Interpolation::Perspective),
sampling: None,
blend_src: None,
per_primitive: false,
}),
});
let arg_index = self.func.arguments.len() - 1;
Expand Down
4 changes: 4 additions & 0 deletions render/naga-pixelbender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ impl ShaderBuilder<'_> {
interpolation: Some(naga::Interpolation::Perspective),
sampling: Some(naga::Sampling::Center),
blend_src: None,
per_primitive: false,
}),
});

Expand All @@ -250,6 +251,7 @@ impl ShaderBuilder<'_> {
interpolation: None,
sampling: None,
blend_src: None,
per_primitive: false,
}),
});

Expand Down Expand Up @@ -441,6 +443,8 @@ impl ShaderBuilder<'_> {
workgroup_size: [0; 3],
workgroup_size_overrides: None,
function: builder.func,
mesh_info: None,
task_payload: None,
});

Ok(NagaModules {
Expand Down
2 changes: 1 addition & 1 deletion render/wgpu/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ impl ActiveFrame {
command_encoder: descriptors
.device
.create_command_encoder(&Default::default()),
staging_belt: wgpu::util::StagingBelt::new(65536),
staging_belt: wgpu::util::StagingBelt::new(descriptors.device.clone(), 65536),
draws_since_flush: 0,
}
}
Expand Down
6 changes: 5 additions & 1 deletion render/wgpu/src/bitmaps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ fn create_sampler(
address_mode_w: wgpu::AddressMode::Repeat,
mag_filter: filter,
min_filter: filter,
mipmap_filter: filter,
mipmap_filter: if filter == wgpu::FilterMode::Linear {
wgpu::MipmapFilterMode::Linear
} else {
wgpu::MipmapFilterMode::Nearest
},
lod_min_clamp: 0.0,
lod_max_clamp: 100.0,
compare: None,
Expand Down
10 changes: 2 additions & 8 deletions render/wgpu/src/buffer_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,12 @@ impl BufferBuilder {
pub fn copy_to(
self,
staging_belt: &mut wgpu::util::StagingBelt,
device: &wgpu::Device,
encoder: &mut wgpu::CommandEncoder,
buffer: &wgpu::Buffer,
) {
if let Some(length) = wgpu::BufferSize::new(self.inner.len() as u64) {
let mut view = staging_belt.write_buffer(
encoder,
buffer,
BufferAddress::default(),
length,
device,
);
let mut view =
staging_belt.write_buffer(encoder, buffer, BufferAddress::default(), length);
view.copy_from_slice(&self.inner);
}
}
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 @@ -403,7 +403,7 @@ impl CurrentPipeline {
.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: pipeline_layout_label.as_deref(),
bind_group_layouts: &[&compiled_shaders.bind_group_layout],
push_constant_ranges: &[],
immediate_size: 0,
});

let bind_group = descriptors
Expand Down Expand Up @@ -572,7 +572,7 @@ impl CurrentPipeline {
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview: Default::default(),
multiview_mask: None,
cache: None,
});
Some((compiled, bind_group))
Expand Down
5 changes: 1 addition & 4 deletions render/wgpu/src/context3d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl WgpuContext3D {
let front_buffer_raw_texture_handle = make_dummy_handle();

// FIXME - determine the best chunk size for this
let buffer_staging_belt = StagingBelt::new(1024);
let buffer_staging_belt = StagingBelt::new(descriptors.device.clone(), 1024);
let current_pipeline = CurrentPipeline::new(&descriptors);

let buffer_command_encoder =
Expand Down Expand Up @@ -708,7 +708,6 @@ impl Context3D for WgpuContext3D {
&buffer.buffer,
rounded_down_offset as u64,
NonZeroU64::new(rounded_up_length as u64).unwrap(),
&self.descriptors.device,
)
.copy_from_slice(
&buffer.data
Expand Down Expand Up @@ -737,7 +736,6 @@ impl Context3D for WgpuContext3D {
(start_vertex * (data32_per_vertex as usize) * std::mem::size_of::<f32>())
as u64,
NonZeroU64::new(data.len() as u64).unwrap(),
&self.descriptors.device,
)[..data.len()]
.copy_from_slice(data);
}
Expand Down Expand Up @@ -952,7 +950,6 @@ impl Context3D for WgpuContext3D {
(matrix_raw_data_column_major.len() * std::mem::size_of::<f32>()) as u64,
)
.unwrap(),
&self.descriptors.device,
);
// Despite what the docs claim, we copy in *column* major order, rather than *row* major order.
// See this code in OpenFL: https://github.com/openfl/openfl/blob/971a4c9e43b5472fd84d73920a2b7c1b3d8d9257/src/openfl/display3D/Context3D.hx#L1532-L1550
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 @@ -89,7 +89,7 @@
&self.bind_layouts.transforms,
&self.bind_layouts.bitmap,
],
push_constant_ranges: &[],
immediate_size: 0,
});
self.device
.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
Expand Down Expand Up @@ -128,7 +128,7 @@
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview: None,
multiview_mask: None,

Check warning on line 131 in render/wgpu/src/descriptors.rs

View workflow job for this annotation

GitHub Actions / Coverage Report

Coverage

Uncovered line (131)
cache: None,
})
})
Expand Down Expand Up @@ -157,7 +157,7 @@
&self.bind_layouts.transforms,
&self.bind_layouts.bitmap,
],
push_constant_ranges: &[],
immediate_size: 0,
});
self.device
.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
Expand Down Expand Up @@ -196,7 +196,7 @@
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview: None,
multiview_mask: None,
cache: None,
})
})
Expand Down
Loading
Loading