Skip to content

Commit 159f322

Browse files
Fix up CI
1 parent 1a86d23 commit 159f322

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

src/renderer/app_state.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,11 @@ impl<'a> AppState<'a> {
382382
#[cfg(target_os = "macos")]
383383
if self.modifiers.state().super_key() {
384384
let circle = self.mouse_state.selected_shape().map(|i| {
385-
self.editor_state
385+
*self
386+
.editor_state
386387
.get_element_by_id(i)
387388
.expect("selected id must be valid")
388389
.inner()
389-
.clone()
390390
});
391391

392392
self.mouse_state.set_clipboard_shape(circle);
@@ -486,8 +486,8 @@ impl<'a> AppState<'a> {
486486
pub(crate) fn render(&self) -> Result<(), wgpu::SurfaceError> {
487487
let (output, view, mut encoder) = self.gpu_allocator.begin_frame()?;
488488

489-
let workgroup_count_x = (self.size.width + 15) / 16;
490-
let workgroup_count_y = (self.size.height + 15) / 16;
489+
let workgroup_count_x = self.size.width.div_ceil(16);
490+
let workgroup_count_y = self.size.height.div_ceil(16);
491491

492492
// Execute effect pipeline - automatically chains all effects with CPU-level conditionals!
493493
self.effect_pipeline.execute(

src/renderer/compute_effect.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct ComputeEffect {
1010
}
1111

1212
impl ComputeEffect {
13-
pub fn builder<'a>(label: &'a str) -> ComputeEffectBuilder<'a> {
13+
pub const fn builder<'a>(label: &'a str) -> ComputeEffectBuilder<'a> {
1414
ComputeEffectBuilder {
1515
label,
1616
shader_source: None,
@@ -50,12 +50,12 @@ pub struct ComputeEffectBuilder<'a> {
5050
}
5151

5252
impl<'a> ComputeEffectBuilder<'a> {
53-
pub fn with_shader(mut self, source: &'a str) -> Self {
53+
pub const fn with_shader(mut self, source: &'a str) -> Self {
5454
self.shader_source = Some(source);
5555
self
5656
}
5757

58-
pub fn _with_entry_point(mut self, entry_point: &'a str) -> Self {
58+
pub const fn _with_entry_point(mut self, entry_point: &'a str) -> Self {
5959
self.entry_point = entry_point;
6060
self
6161
}

src/renderer/effect_pipeline.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ use anyhow::Result;
33

44
use crate::renderer::feature_uniform::FeatureUniform;
55

6+
pub type DispatchConditionalFn = Box<dyn Fn(&FeatureUniform) -> bool>;
7+
68
pub struct EffectPipeline {
7-
effects: Vec<(ComputeEffect, Box<dyn Fn(&FeatureUniform) -> bool>)>,
9+
effects: Vec<(ComputeEffect, DispatchConditionalFn)>,
810

911
texture_a: Texture,
1012
texture_b: Texture,
@@ -30,7 +32,7 @@ impl EffectPipeline {
3032
EffectPipelineBuilder::new(gpu_allocator, input_texture, width, height)
3133
}
3234

33-
pub fn texture_a(&self) -> &Texture {
35+
pub const fn texture_a(&self) -> &Texture {
3436
&self.texture_a
3537
}
3638

@@ -65,7 +67,7 @@ pub struct EffectPipelineBuilder<'a, 'b> {
6567
input_texture: &'a wgpu::TextureView,
6668
texture_a: Texture,
6769
texture_b: Texture,
68-
effects: Vec<(ComputeEffect, Box<dyn Fn(&FeatureUniform) -> bool>)>,
70+
effects: Vec<(ComputeEffect, DispatchConditionalFn)>,
6971
}
7072

7173
impl<'a, 'b> EffectPipelineBuilder<'a, 'b> {

src/renderer/feature_uniform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl FeatureUniform {
176176
}
177177

178178
impl FeatureUniform {
179-
pub fn gamma(&self) -> u32 {
179+
pub const fn gamma(&self) -> u32 {
180180
self.gamma
181181
}
182182
}

src/renderer/mouse_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ impl MouseState {
6363
self.drag_offset = offset;
6464
}
6565

66-
pub(crate) fn clipboard_shape(&self) -> Option<Circle> {
67-
self.clipboard_shape.clone()
66+
pub(crate) const fn clipboard_shape(&self) -> Option<Circle> {
67+
self.clipboard_shape
6868
}
6969

7070
pub(crate) const fn set_clipboard_shape(&mut self, element_id: Option<Circle>) {

0 commit comments

Comments
 (0)