Skip to content

Commit c10e6e8

Browse files
committed
core(gpu): Fix Floyd-Steinberg dithering errors & performance issues (#61)
1 parent d98400d commit c10e6e8

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tabled = "0.19.0"
2424
[workspace.package]
2525
edition = "2021"
2626
license = "AGPL-3.0"
27-
version = "0.6.0"
27+
version = "0.6.1"
2828
description = "Tool for recoloring images and GIFs with any palette of your choice"
2929

3030
[profile.release]

core/src/gpu/compute.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -305,28 +305,12 @@ impl Processor {
305305
match config.mapping {
306306
Mapping::Palettized => {
307307
compute_pass.set_pipeline(&self.context.palettized_pipeline);
308+
compute_pass.set_bind_group(1, &self.context.blue_noise_bind_group, &[]);
308309
match config.dither_algorithm {
309310
Dithering::Fs => {
310311
compute_pass.dispatch_workgroups(1, 1, 1);
311312
}
312-
Dithering::Bn => {
313-
compute_pass.set_bind_group(
314-
1,
315-
&self.context.blue_noise_bind_group,
316-
&[],
317-
);
318-
let dispatch_x =
319-
gpu_chunk_config.image_width.div_ceil(WORKGROUP_SIZE_X);
320-
let dispatch_y =
321-
gpu_chunk_config.image_height.div_ceil(WORKGROUP_SIZE_Y);
322-
compute_pass.dispatch_workgroups(dispatch_x, dispatch_y, 1);
323-
}
324-
Dithering::None => {
325-
compute_pass.set_bind_group(
326-
1,
327-
&self.context.blue_noise_bind_group,
328-
&[],
329-
);
313+
Dithering::Bn | Dithering::None => {
330314
let dispatch_x =
331315
gpu_chunk_config.image_width.div_ceil(WORKGROUP_SIZE_X);
332316
let dispatch_y =

0 commit comments

Comments
 (0)